));
          if (_completer.isCompleted) return;

          try {
            logger.info("Scraping abstract/graphical abstract from $loadedUrl");

            final rawResult = await controller.evaluateJavascript(source: """
(() => {
  function extractFullText(element) {
    if (!element) return null;
    return element.innerText.trim();
  }

  let output = { abstract: null, graphicalAbstract: null };

  // ====== ABSTRACT ======
  if (${textAbstract ? "true" : "false"}) {
    let springerHeader = document.querySelector('h2.c-article-section__title');
    if (springerHeader && /abstract/i.test(springerHeader.innerText)) {
      let springerAbstract = springerHeader.nextElementSibling;
      if (springerAbstract && springerAbstract.classList.contains('c-article-section__content')) {
        output.abstract = extractFullText(springerAbstract);
      }
    }

    let elsevierAbstract = document.querySelector('.abstract.author');
    if (elsevierAbstract) {
      output.abstract = extractFullText(elsevierAbstract);
    }

    let imsHeader = document.querySelector('h2.main-title');
    if (imsHeader && /abstract/i.test(imsHeader.innerText)) {
      let parent = imsHeader.parentElement;
      if (parent) {
        let imsAbstractDiv = parent.querySelector('div');
        if (imsAbstractDiv) {
          output.abstract = Array.from(imsAbstractDiv.querySelectorAll('p'))
            .map(p => p.innerText.trim())
            .filter(t => t.length > 0)
            .join("\\n\\n");
        }
      }
    }

    let abstractDiv = [...document.querySelectorAll('div, section')]
      .find(el => /abstract/i.test(el.className) || /abstract/i.test(el.id));
    if (abstractDiv && !output.abstract) {
      output.abstract = extractFullText(abstractDiv);
    }

    if (!output.abstract) {
      let metaDesc = document.querySelector('meta[name="description"]');
      if (metaDesc) output.abstract = metaDesc.content.trim();
    }
  }

  // ====== GRAPHICAL ABSTRACT ======
  if (${graphicalAbstract ? "true" : "false"}) {
    function isGraphicalAbstract(el) {
      if (!el) return false;
      if (/(graphical\\s*abstract|ga)/i.test(el.alt || el.title || el.dataset.caption || '')) return true;
      if (/(graphical\\s*abstract|ga|graphic|figure|f[0-9]|abspara)/i.test(el.parentElement?.className || el.parentElement?.id || '')) return true;
      return false;
    }

    let elsevierLrgLink = document.querySelector('a.download-link[href*="_lrg.jpg"], a.download-link[href*="_lrg.png"]');
    if (elsevierLrgLink?.href) output.graphicalAbstract = elsevierLrgLink.href;

    if (!output.graphicalAbstract) {
      let cellPressLink = document.querySelector('a.icon-full-screen[href*="_lrg.jpg"], a.icon-full-screen[href*="_lrg.png"]');
      if (cellPressLink?.href && isGraphicalAbstract(cellPressLink.parentElement)) output.graphicalAbstract = cellPressLink.href;
    }

    if (!output.graphicalAbstract) {
      let copernicusImg = document.querySelector('img[data-web][src*="thumb"]');
      if (copernicusImg?.getAttribute('data-web')?.includes('avatar')) output.graphicalAbstract = copernicusImg.getAttribute('data-web');
    }

    if (!output.graphicalAbstract) {
      let wileyGA = document.querySelector('#abstract-graphical-en img.figure__image');
      if (wileyGA?.getAttribute('data-lg-src')) output


fectPuff,
            StarEffectBound,

            /* Deluxe */

            MahoLarpaMasterCrown1,
            MahoLiepaMasterCrown1,
            MahoLupaMasterCrown1,
            MahoLeaperMasterCrown1,
            PoppyBroJrBombShot,
            GrandDeathLowperBulletShot,
            GrandDeathLowperBulletBomb,
            GrandDeathLowperBulletRainBomb,
            GrandDeathLowperBulletDivideBomb,
            GrandDeathLowperBulletHoming,
            GrandDeathLowperBulletShot3D,
            GrandDeathLowperDeathLowperMove1,
            GrandDeathLowperDeathLowperMove2,
            GrandDeathLowperEnergyShotFirst,
            GrandDeathLowperEnergyShotSecond,
            GrandDeathLowperWaterBall,
            SparkDoubterMahoLarpa,
            SparkDoubterMahoLiepa,
            SparkDoubterSnakeWalk,
            SparkDoubterBallFall,
            FireFattyBufferJrBound,
            FireFattyBufferWaterMain,
            WaterGoliathWaterBall,
            WaterGoliathTornadoWater,
            WaterGoliathRainfall
        }

        public enum BinItemKind : uint
        {
            PointStar,
            OneUp,
            MTomato,
            Food,
            EnergySphere,
            InvincibleCandy,
            PointStarMiddle,
            PointStarLarge,
            AbilitySeat,
            ScoreCoin,
            MTomatoRelief,

            /* Deluxe insertion start */

            MagicalPower,
            ExMagic,

            /* Deluxe insertion end */

            ShipParts,
            SuperAbilityStar,
            EnergySphereUsed,
            EnergySphereEmpty,

            /* Deluxe */

            GemFragment,
            StampTicket,
            AbilitySource,
            EnergyDrinkForKiss
        }

        public enum SFXKind : uint
        {
            None,
            Darkness,
            Monotone
        }

        public enum MapType : uint
        {
            Normal,
            /// <summary>
            /// Disallows Mid-bosses from locking the camera and spawning health bars
            /// </summary>
            MidbossRush,
            Shooting,
            /// <summary>
            /// The most complicated map type<br/>
            /// <list type="bullet">
            ///     <item>Doubles the amount of memory a Boss's Heap uses (0x20000 -> 0x40000 bytes)</item>
            ///     <item>Limits the amount of loaded Bosses from 4 to 1</item>
            ///     <item>Increases the amount of memory a Weapon's Heap uses (0x4000 -> 0x4C00 bytes)</item>
            ///     <item>Limits the amount of loaded Weapons from 96 to 80</item>
            ///     <item>Enables the swirling ground particle effects from the final battle</item>
            /// </list>
            /// </summary>
            FinalBattle,
            LevelMap
        }
    }
}


/*
    Copyright (C) 2011-2015 de4dot@gmail.com

    This file is part of de4dot.

    de4dot 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.

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

using System;
using System.Runtime.Remoting;
using System.Runtime.Serialization;
using System.Threading;
using AssemblyData;

#if !NETFRAMEWORK
namespace System.Runtime.Remoting {
	class RemotingException : SystemException {
	}
}
#endif

namespace de4dot.code.AssemblyClient {
	public sealed class AssemblyClient : IAssemblyClient {
		const int WAIT_TIME_BEFORE_CONNECTING = 1000;
		const int MAX_CONNECT_WAIT_TIME_MS = 2000;
		IAssemblyServerLoader loader;
		IAssemblyService service;
		DateTime serverLoadedTime;

		public IAssemblyService Service => service;
		public IStringDecrypterService StringDecrypterService => (IStringDecrypterService)service;
		public IMethodDecrypterService MethodDecrypterService => (IMethodDecrypterService)service;
		pu


0f0;
    font-family: Cormorant Unicase, Helvetica, Arial, Verdana, Tahoma, sans-serif;
    font-size: 16px;
        text-shadow:
        1px 1px 3px #040d94,
        1px 1px 9px #3363ff,
        1px 1px 14px #2c29d6,
        1px 1px 14px #292cd6;
}
.game-details__container{
  backdrop-filter: blur(2px);
}
.gallery-slider__preview-image,
.gallery-slider__preview-button--active,
.gallery-slider__preview-button,
.gallery-slider__media,
.gallery-slider__animation-container{
    border-radius: 20px;
}
.content-sidebar {
  background: transparent;
  backdrop-filter: blur(2px);
  background-color: #3363ff0e;
}
.sidebar-section__button{
    background-color: #3363ff0e;
    text-transform: uppercase;
    color: #ffffff;
    font-family: Cormorant Unicase, Helvetica, Arial, Verdana, Tahoma, sans-serif;
    font-size: 16px;
        text-shadow:
        1px 1px 3px #040d94,
        1px 1px 10px #3363ff,
        1px 1px 15px #2c29d6,
        1px 1px 15px #292cd6;
}
.sidebar-section__button:hover{
    background-color: #3363ff0e;
}
.sidebar-section__content{
    background-color: #3363ff0e;
}
.subscription-required-button{
    text-transform: uppercase;
    color: #ffffff;
    font-family: Cormorant Unicase, Helvetica, Arial, Verdana, Tahoma, sans-serif;
    font-size: 13px;
        text-shadow:
        1px 1px 3px #040d94,
        1px 1px 10px #3363ff,
        1px 1px 15px #2c29d6,
        1px 1px 15px #292cd6;
}
.hero-panel__content p{
    text-transform: uppercase;
    color: #ffffff;
    font-family: Cormorant Unicase, Helvetica, Arial, Verdana, Tahoma, sans-serif;
    font-size: 16px;
        text-shadow:
        1px 1px 3px #040d94,
        1px 1px 10px #3363ff,
        1px 1px 15px #2c29d6,
        1px 1px 15px #292cd6;
}
.list__item p{
    font-family: Cormorant Unicase, Helvetica, Arial, Verdana, Tahoma, sans-serif;
    font-size: 16px;
}
.link{
    font-family: Cormorant Unicase, Helvetica, Arial, Verdana, Tahoma, sans-serif;
    font-size: 20px;
}

/* DOWNLOADS */
.download-group__item{
    margin-left: 2px;
    background-color: rgba(8, 27, 197, 0.1);
    box-shadow:
        1px 1px 3px #040d94,
        1px 1px 10px #3363ff,
        1px 1px 15px #2c29d6,
        1px 1px 15px #292cd6;
    transition: all ease 0.3s;
    width: 100%;
    gap: 1px;
    justify-content: flex-start;
    border-radius: 55px;
    color: #ffffff;
    text-transform: uppercase;
    font-family: Cormorant Unicase, Helvetica, Arial, Verdana, Tahoma, sans-serif;
    font-size: 14px;


 => {
                        self.results = new_results;
                        self.results.values.pop()
                    }
                    _ => None,
                }
            } else {
                None
            }
        })
    }
}
pub mod client;
pub mod command_parser;
pub mod nsm_test;
pub mod protocol_helpers;
pub mod server;
pub mod socket;
pub mod utils;
pub mod writer;

use crate::client::{send_data, vsock_connect};
use crate::server::server_with_action;
use crate::writer::LogWriter;
use command_parser::{ClientArgs, ServerArgs};
use simplelog::*;
use std::fs::File;
use std::os::unix::io::AsRawFd;
use std::time::Duration;

#[macro_use]
extern crate log;

/// Send 'Hello, world!' to the server
pub fn client(args: ClientArgs) -> Result<(), String> {
    CombinedLogger::init(vec![
        TermLogger::new(LevelFilter::Info, Config::default(), TerminalMode::Mixed),
        WriteLogger::new(
            LevelFilter::Info,
            Config::default(),
            File::create("my_rust_binary.log").unwrap(),
        ),
    ])
    .map_err(|e| format!("{:?}", e))?;

    let log_port = args.log_port;
    std::thread::spawn(move || {
        match server_with_action(log_port, move |buf| {
            println!(
                "log from server: {}",
                String::from_utf8(buf)
                    .map_err(|err| format!("The received bytes are not UTF-8: {:?}", err))?
            );
            Ok(())
        }) {
            Err(e) => println!("client server got error: {}", e),
            _ => {}
        }
    });

    let vsocket = vsock_connect(args.cid, args.port)?;
    send_data(vsocket.as_raw_fd(), "init".as_bytes())?;

    let vsocket = vsock_connect(args.cid, args.port)?;
    send_data(vsocket.as_raw_fd(), "echo".as_bytes())?;

    // TODO: Replace this with your client code
    let vsocket = vsock_connect(args.cid, args.port)?;
    let data = "Hello, from client!".to_string();
    send_data(vsocket.as_raw_fd(), data.as_bytes())?;

    std::thread::sleep(Duration::from_secs(3));
    println!("timeout, close socket now...");
    Ok(())
}

/// Accept connections on a certain port and print
/// the received data
pub fn server(args: ServerArgs) -> Result<(), String> {
    let log_port = args.log_port;
    let mut init = false;
    server_with_action(args.port, |buf| {
        let buf = String::from_utf8(buf)
            .map_err(|err| format!("The received bytes are not UTF-8: {:?}", err))?;

        if !init {
            init = true;

            CombinedLogger::init(vec![WriteLogger::new(
                LevelFilter::Info,
                Config::default(),
                LogWriter::new(log_port),
            )])
            .map_err(|e| format!("{:?}", e))?;
            println!("log init successfully");
            info!("log init successfully");
            return Ok(());
        }

        println!("server got message: {}", &buf);
        match buf.as_str() {
            "echo" => info!("{}", &buf),
            _ => debug!("{}", &buf),
        }

        Ok(())
    })
}
use super::{type_canonicalizer, TypeError};
use crate::types::Type;
use std::collections::BTreeMap;

pub fn check(one: &


        255, 255, 255, 255, 255, 255, 255, 255,
        255, 255, 255, 255, 255, 255, 255, 255,
        255, 255, 255, 62,  255, 255, 255, 63,
        52,  53,  54,  55,  56,  57,  58,  59,
        60,  61,  255, 255, 255, 255, 255, 255,
        255, 0,   1,   2,   3,   4,   5,   6,
        7,   8,   9,   10,  11,  12,  13,  14,
        15,  16,  17,  18,  19,  20,  21,  22,
        23,  24,  25,  255, 255, 255, 255, 255,
        255, 26,  27,  28,  29,  30,  31,  32,
        33,  34,  35,  36,  37,  38,  39,  40,
        41,  42,  43,  44,  45,  46,  47,  48,
        49,  50,  51,  255, 255, 255, 255, 255
    };

    template<typename ResultType, typename InputType>
    ResultType encodeDetail(const InputType& input) {
        ResultType result;
        size_t i = 0;
        for (; i < (input.size()/3)*3; i += 3) {
            unsigned int c = input[i+2] | (input[i+1]<<8) | (input[i]<<16);
            result.push_back(encodeMap[(c&0xFC0000)>>18]);
            result.push_back(encodeMap[(c&0x3F000)>>12]);
            result.push_back(encodeMap[(c&0xFC0)>>6]);
            result.push_back(encodeMap[c&0x3F]);
        }
        if (input.size() % 3 == 2) {
            unsigned int c = (input[i+1]<<8) | (input[i]<<16);
            result.push_back(encodeMap[(c&0xFC0000)>>18]);
            result.push_back(encodeMap[(c&0x3F000)>>12]);
            result.push_back(encodeMap[(c&0xFC0)>>6]);
            result.push_back('=');
        }
        else if (input.size() % 3 == 1) {
            unsigned int c = input[i]<<16;
            result.push_back(encodeMap[(c&0xFC0000)>>18]);
            result.push_back(encodeMap[(c&0x3F000)>>12]);
            result.push_back('=');
            result.push_back('=');
        }
        return result;
    }
}

std::string Base64::encode(const ByteArray& s) {
    return encodeDetail<std::string>(s);
}

SafeByteArray Base64::encode(const SafeByteArray& s) {
    return encodeDetail<SafeByteArray>(s);
}

ByteArray Base64::decode(const std::string& input) {
    ByteArray result;

    if (input.size() % 4) {
        return ByteArray();
    }
    for (size_t i = 0; i < input.size(); i += 4) {
        unsigned char c1 = input[i+0];
        unsigned char c2 = input[i+1];
        unsigned char c3 = input[i+2];
        unsigned char c4 = input[i+3];
        if (c3 == '=') {
            unsigned int c = (((decodeMap[c1]<<6)|decodeMap[c2])&0xFF0)>>4;
            result.push_back(c);
        }
        else if (c4 == '=') {
            unsigned int c = (((decodeMap[c1]<<12)|(decodeMap[c2]<<6)|decodeMap[c3])&0x3FFFC)>>2;
            result.push_back((c&0xFF00) >> 8);
            result.push_back(c&0xFF);
        }
        else {
            unsigned int c = (decodeMap[c1]<<18) | (decodeMap[c2]<<12) | (decodeMap[c3]<<6) | decodeMap[c4];
            result.push_back((c&0xFF000


equals(other) && this.modifier == (other as? NumericType)?.modifier

    override fun hashCode() = Objects.hash(super.hashCode(), generics, modifier, isPrimitive)
}
/*
 * Copyright (c) 2023, Fraunhofer AISEC. All rights reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * 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 de.fraunhofer.aisec.cpg.graph.types

import de.fraunhofer.aisec.cpg.frontends.Language

/** Represents a [Map] type with key-value pairs. */
class MapType(typeName: CharSequence, override var elementType: Type, language: Language<*>) :
    ObjectType(typeName, listOf(elementType), false, language), SecondOrderType
/*
 * Copyright (c) 2023, Fraunhofer AISEC. All rights reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * 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 de.fraunhofer.aisec.cpg.graph.types

import de.fraunhofer.aisec.cpg.frontends.Language

class StringType(
    typeName: CharSequence = "",
    language: Language<*>,
    generics: List<Type> = listOf(),
    primitive: Boolean = false,
    mutable: Boolean = false,
) :
    ObjectType(
        typeName = typeName,
        generics = generics,
        primitive = primitive,
        mutable = mutable,
        language = language,
    ) {

    init {
        // Built-in types are always resolved
        this.typeOrigin = Origin.RESOLVED
    }
}
/*
 * Copyright (c) 2023, Fraunhofer AISEC. All rights reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law


lds[0] > this.AQIThresholds[0] && this.AQIThresholds[1] === newThresholds[1]) {
        // if the new lower bound is higher than the old lower bound, change the lower bound
      } else if(newThresholds[1] < this.AQIThresholds[1] && this.AQIThresholds[0] === newThresholds[0]) {
        // if the new upper bound is lower than the old upper bound, change the upper bound
      } else {
        console.log(this.name, "not changing thresholds", { AQI, provisional: newThresholds, current: this.AQIThresholds })
        return
      }
    }

    return newThresholds;
  }

  private calculateAQINotifyBracket(AQI : number): notifyBracket {
    if(!this.AQIThresholds || this.AQIThresholds.length < 2) {
      console.log("no thresholds to notify for", this.name);
      return notifyBracket.none;
    }

    if(AQI < this.AQIThresholds[0]) {
      return notifyBracket.low
    }
    if(AQI > this.AQIThresholds[1]) {
      return notifyBracket.high
    }
    return notifyBracket.none;
  }
}

export enum TripActionType {
  POST_TRIP_ATTEMPT = 'post_trip_attempt',
  POST_TRIP_SUCCESS = 'post_trip_success',
  POST_TRIP_ERROR = 'post_trip_error',
  FETCH_TRIPS_ATTEMPT = 'fetch_trips_attempt',
  FETCH_TRIPS_SUCCESS = 'fetch_trips_success',
  FETCH_TRIPS_ERROR = 'fetch_trips_error',
  TRIPS_RESET = 'trips_reset',
}

export type SingleLandTrip = {
  amount: number;
  created_at: string;
  updated_at: string;
  distance: number;
  id: number;
  user_id: number;
  round_trip: boolean;
  vehicle_type: string;
};

export type SingleAirTrip = {
  amount: number;
  created_at: string;
  updated_at: string;
  distance: number;
  id: number;
  user_id: number;
  round_trip: boolean;
  departure: string;
  arrival: string;
  arrival_latitude: number;
  arrival_longitude: number;
  departure_latitude: number;
  departure_longitude: number;
};

export interface TripType {
  land_trips: SingleLandTrip[];
  air_trips: SingleAirTrip[];
}
import { Directive, ElementRef, HostBinding, HostListener, Renderer2 } from "@angular/core";

@Directive({
    selector:'[appDropdown]'
})
export class DropdownDirective{

    // @HostBinding('class.open')toggle:boolean=false;
    // @HostListener('click')onToggle(){
    //     this.toggle=!this.toggle;
    // }

    // ******** USING ONLY A HOST LISTENER ********
    toggle:boolean=false;
    @HostListener('click')onClick(){
        if(!this.toggle){
            this.renderer.addClass(
            this.elRef.nativeElement,
            'open')
            this.toggle=!this.toggle;
        }else{
            this.renderer.removeClass(
            this.elRef.nativeElement,
            'open');
             this.toggle=!this.toggle;
        }

    }
    constructor(private elRef:ElementRef,private renderer:Renderer2){}

}import { LightExercise, FullExercise } from './exercise.model';

type Exercise = LightExercise | FullExercise;

export interface WithExerciseId {
  exercise: number;
}

export interface WithExercise<T extends Exercise = FullExercise> {
  exercise: T;
}

export interface With


ts while meeting performance needs.
  - **Context**: A DevSecOps practice for advanced environments (e.g., Kubernetes since 2014), it uses tools like Karpenter for auto-scaling (AWS Well-Architected: “Optimize over time”).
  - **Importance**: Saves 20-50% on containerized apps (e.g., $10K → $5K), scales to microservices, and balances cost/performance (e.g., Netflix’s EKS).
  - **Tools**: Karpenter, Cluster Autoscaler, AWS Graviton instances.
- **Practical Use Cases**:
  - **Netflix’s Karpenter**: Netflix uses Karpenter to right-size EKS nodes, saving $500K+ yearly for 247M users’ microservices.
    - **Example**: Karpenter swaps `m5.large` for `t3.medium` → $200K saved.
  - **Amazon’s Graviton**: Amazon shifts EKS to Graviton2 instances, cutting 20% ($1M+) for 1M+ customers’ workloads.

---

#### 7. Billing APIs
- **Theoretical Keyword Explanation**:
  - **Definition**: Billing APIs (e.g., AWS Cost and Usage Reports - CUR) provide programmatic access to detailed billing data for custom analysis and dashboards.
  - **Context**: A DevSecOps automation enabler (CUR since 2017), it supports enterprise reporting (AWS Well-Architected: “Analyze programmatically”).
  - **Importance**: Scales to billions in spend (e.g., $1B+ budgets), enables custom tools (e.g., Slack bots), and meets audit needs (e.g., SOC 2).
  - **Features**: Hourly granularity, tag-level data, S3 export.
- **Practical Use Cases**:
  - **Google’s Custom Dashboards**: Google (AWS user) builds CUR-based dashboards, tracking $5M+ spend for 1B+ users, saving $1M by identifying waste.
    - **Example**: CUR → Athena query → “$2M EC2 waste” → Optimize.
  - **Walmart’s Billing Bot**: Walmart uses CUR with Lambda to report daily spend to Slack, saving $500K+ for 240M customers by catching anomalies.

---

#### 8. Real-World Use Case: Automating Cost Shutdowns and Forecasting for a Fortune 100 Retail App
- **Theoretical Keyword Explanation**:
  - **Definition**: A scenario applying Day 4 topics to automate cost management and forecast spend for a retail app with seasonal traffic (e.g., holiday peaks).
  - **Context**: Fortune 100 retailers like Walmart face cost volatility, requiring DevSecOps automation and foresight (e.g., 2018 Uber overspend lessons).
  - **Importance**: Integrates advanced tools for scalable savings, preparing learners for enterprise cost challenges.
- **Practical Use Case**:
  - **Walmart’s Seasonal App**: A DevSecOps team optimizes a retail app:
    - **Anomaly Detection**: Flags $10K EC2 spike → Shut down dev instances.
    - **Lambda**: Stops idle EC2 nightly → $5K/month saved.
    - **CloudHealth**: Tracks $2M AWS spend → $500K optimized.
    - **Spot Instances**: Runs batch jobs → $200K saved.
    - **Forecasting**: Predicts $3M peak → RIs save $1M.
    - **EKS Optimization**: Karpenter saves $300K.
    - **CUR**: Daily Slack report → $100K early savings.
    - **Scale**: Supports 150M weekly shoppers, saving $2M+.

---

## Learning Schedule (7-8 Hours)
- **Morning (4 hours)**:
  - **Theoretical Deep Dive (2 hours)**: AWS Cost Anomaly Detection, Cost Automation with Lambda, CloudHealth/CloudCheckr, Spot Instances (slides, AWS docs, Gartner trends).
    - Discuss ML detection, Lambda triggers, third-party benefits, Spot mechanics.
  - **Practical Exploration (2 hours)**: Review anomaly alerts, Lambda code examples, CloudHealth dashboards, Netflix/Walmart use cases.
- **Afternoon (3-4 hours)**:
  - **Theoretical Deep Dive (1.5 hours)**: Cost Forecasting, Infrastructure Cost Optimization, Billing APIs, Retail Use Case (forecasting models, EKS scaling, CUR queries).


from torchverif.net_interval.v2 import *
from torchverif.net_interval.v1 import evaluate_fcnn_samples, evaluate_fcnn_interval, verify_bound_disjunction
import matplotlib.pyplot as plt
import torch

def test_attack_nn():
    # Input regions
    f1 = [38, 46]  # MEAN VALUE DISTANCE EGO-LEAD
    f2 = [1, 3]  # STD DISTANCE EGO-LEAD
    f3 = [7, 13]  # MEAN VALUE RELATIVE SPEED EGO-LEAD
    f4 = [3, 6]  # STD RELATIVE SPEED EGO-LEAD
    f5 = [19, 21]  # MEAN VALUE EGO-SPEED
    f6 = [0.4, 0.7]  # STD VALUE EGO-SPEED

    arr_f = [f5, f6, f1, f2, f3, f4]

    net = torch.load("../../models/attack_nn_4layers_6feat.pth", map_location=torch.device('cpu'))
    net = torch.nn.Sequential(*(list(net.children())[:-1]))

    intervals, bounds = evaluate_fcnn_interval(net, arr_f)
    print(bounds)
    o_sam = evaluate_fcnn_samples(net, arr_f, cartesian=False, samples=10000)
    interval_plot_scores_helper([], bounds, threshold=0,
                                class_labels=["no attack", "attack"],
                                xlabel="Prediction score",
                                ylabel="Class label", legend=1)
    print(verify_bound_disjunction(intervals, 1))
    plt.show()

def test_multiple_attack_nn():
    # Input regions
    f1 = [38, 46]  # MEAN VALUE DISTANCE EGO-LEAD
    f2 = [1, 3]  # STD DISTANCE EGO-LEAD
    f3 = [7, 13]  # MEAN VALUE RELATIVE SPEED EGO-LEAD
    f4 = [3, 6]  # STD RELATIVE SPEED EGO-LEAD
    f5 = [19, 21]  # MEAN VALUE EGO-SPEED
    f6 = [0.4, 0.7]  # STD VALUE EGO-SPEED

    bound_list = []
    ticks = []
    for i in range(1, 15, 1):
        f = [i, i + 3]
        ticks.append("[" + str(f[0]) + "," + str(f[1]) + "]")
        arr_f = [f5, f6, f1, f2, f, f4]

        net = torch.load("../../models/attack_nn_4layers_6feat.pth", map_location=torch.device('cpu'))
        net = torch.nn.Sequential(*(list(net.children())[:-1]))

        intervals, bounds = evaluate_fcnn_interval(net, arr_f)
        bound_list.append(bounds)

    interval_time_plot_helper(bound_list, neuron=None,
                              class_labels=["no attack", "attack"],
                              xticks=ticks,
                              xlabel="Ego-car mean absolute speed uncertainty",
                              ylabel="Prediction score")
    plt.show()

if __name__ == '__main__':
    test_attack_nn()
    test_multiple_attack_nn()


from django.conf.urls.static import static
from django.contrib import admin
from django.urls import path, include, re_path
from rest_framework import views
from rest_framework.authtoken.views import obtain_auth_token
from rest_framework.routers import SimpleRouter

from django.conf import settings

urlpatterns = [
    path('admin/', admin.site.urls),
    path('', include('articles.urls')),
    path('users/', include('users.urls')),
    path('captcha/', include('captcha.urls')),
    path('KamranVideo/', include('KamranVideo.urls')),
    path('KamranGram/', include('KamranGram.urls')),
    path('comments/', include('comments.urls')),
    path('__debug__/', include('debug_toolbar.urls')),
    path('social-auth/', include('social_django.urls', namespace='social')),
    # API
    path('api/v1/kamran-project/', include('api.urls', namespace='api')),
    path('api/v1/session_auth/', include('rest_framework.urls')),
    path('api/v1/djoser_auth/', include('djoser.urls')),
    re_path('^djoser_auth/', include('djoser.urls.authtoken')),

]

if settings.DEBUG:
    urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
    urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)


        [Tooltip("The minimum volume level needed to be heard to start collecting data from the audio source.")]
        [SerializeField] public float soundWakeThreshold = .0005f;

        [Tooltip("The length of the individual samples read from the audio source")]
        [Range(10, 500)] [SerializeField] public int sampleLengthInMs = 10;

        [Tooltip("The total audio data that should be buffered for lookback purposes on sound based activations.")]
        [SerializeField] public float micBufferLengthInSeconds = 1;

        [Tooltip("The maximum amount of concurrent requests that can occur")]
        [Range(1, 10)] [SerializeField] public int maxConcurrentRequests = 5;

        [Header("Custom Transcription")]
        [Tooltip(
            "If true, the audio recorded in the activation will be sent to Wit.ai for processing. If a custom transcription provider is set and this is false, only the transcription will be sent to Wit.ai for processing")]
        [SerializeField]
        public bool sendAudioToWit = true;

        [Tooltip("A custom provider that returns text to be used for nlu processing on activation instead of sending audio.")]
        [SerializeField] public CustomTranscriptionProvider customTranscriptionProvider;

        [Tooltip("If always record is set the mic will fill the mic data buffer as long as the component is enabled in the scene.")]
        public bool alwaysRecord;

        [Tooltip("The preferred number of seconds to offset from the time the activation happens. A negative value here could help to catch any words that may have been cut off at the beginning of an activation (assuming input is already being read into the buffer)")]
        public float preferredActivationOffset = -.5f;
    }
}


.WriteLine($"{allocator.Key}   ALLOCATION COUNT: {allocator.Value.Count}");
                    }
#endif
                    Debug.Assert(pool.outstandingIds.Count == 0);
                }
            }
#endif
        }

        /// <summary>
        /// Returns all allocations in the pool to sources. Any outstanding buffers will be invalidated silently.
        /// The pool will remain in a usable state after clearing.
        /// </summary>
        public void Clear()
        {
            for (int i = 0; i < pools.Length; ++i)
            {
                pools[i].Clear();
            }
        }

        /// <summary>
        /// Returns all allocations in the pool to sources. Any outstanding buffers will be invalidated silently.
        /// Equivalent to <see cref="Clear"/> for <see cref="BufferPool"/>.
        /// </summary>
        void IDisposable.Dispose()
        {
            Clear();
        }

        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        public static int GetCapacityForCount<T>(int count)
        {
            if (count == 0)
                count = 1;
            Debug.Assert(BitOperations.RoundUpToPowerOf2((ulong)(count * Unsafe.SizeOf<T>())) < int.MaxValue, "This function assumes that counts aren't going to overflow a signed 32 bit integer.");
            return ((int)BitOperations.RoundUpToPowerOf2((uint)(count * Unsafe.SizeOf<T>()))) / Unsafe.SizeOf<T>();
        }

        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        int IUnmanagedMemoryPool.GetCapacityForCount<T>(int count)
        {
            return GetCapacityForCount<T>(count);
        }

#if DEBUG
        ~BufferPool()
        {
            var totalBlockCount = 0;
            for (int i = 0; i < pools.Length; ++i)
            {
                totalBlockCount += pools[i].BlockCount;
            }
            //If block count is zero, pinned just returns true since that's the default. If there's a nonzero number of blocks, then they have to be explicitly unpinned
            //in order for a finalizer to be valid.
            Debug.Assert(totalBlockCount == 0, "Memory leak warning! Don't let a buffer pool die without clearing it!");
        }
#endif

    }
}


090AC AFA3002C */  sw      $v1, 0x002C($sp)
/* 05370 808090B0 8FA3002C */  lw      $v1, 0x002C($sp)
/* 05374 808090B4 3C010002 */  lui     $at, 0x0002                ## $at = 00020000
/* 05378 808090B8 00300821 */  addu    $at, $at, $s0
/* 0537C 808090BC 84794ACE */  lh      $t9, 0x4ACE($v1)           ## 00004ACE
/* 05380 808090C0 240C000C */  addiu   $t4, $zero, 0x000C         ## $t4 = 0000000C
/* 05384 808090C4 2728FFFF */  addiu   $t0, $t9, 0xFFFF           ## $t0 = FFFFFFFF
/* 05388 808090C8 A428CACE */  sh      $t0, -0x3532($at)          ## 0001CACE
/* 0538C 808090CC 84694AD0 */  lh      $t1, 0x4AD0($v1)           ## 00004AD0
/* 05390 808090D0 3C010002 */  lui     $at, 0x0002                ## $at = 00020000
/* 05394 808090D4 00300821 */  addu    $at, $at, $s0
/* 05398 808090D8 252AFFFF */  addiu   $t2, $t1, 0xFFFF           ## $t2 = FFFFFFFF
/* 0539C 808090DC A42ACAD0 */  sh      $t2, -0x3530($at)          ## 0001CAD0
/* 053A0 808090E0 846B4AD0 */  lh      $t3, 0x4AD0($v1)           ## 00004AD0
/* 053A4 808090E4 3C010002 */  lui     $at, 0x0002                ## $at = 00020000
/* 053A8 808090E8 00300821 */  addu    $at, $at, $s0
/* 053AC 808090EC 05630070 */  bgezl   $t3, .L808092B0
/* 053B0 808090F0 84624ABC */  lh      $v0, 0x4ABC($v1)           ## 00004ABC
/* 053B4 808090F4 A42CCAD0 */  sh      $t4, -0x3530($at)          ## 0001CAD0
/* 053B8 808090F8 846D4AD2 */  lh      $t5, 0x4AD2($v1)           ## 00004AD2
/* 053BC 808090FC 846F4AD0 */  lh      $t7, 0x4AD0($v1)           ## 00004AD0
/* 053C0 80809100 3C010002 */  lui     $at, 0x0002                ## $at = 00020000
/* 053C4 80809104 000D7080 */  sll     $t6, $t5,  2
/* 053C8 80809108 01CD7023 */  subu    $t6, $t6, $t5
/* 053CC 8080910C 000E7080 */  sll     $t6, $t6,  2
/* 053D0 80809110 01CD7021 */  addu    $t6, $t6, $t5
/* 053D4 80809114 00300821 */  addu    $at, $at, $s0
/* 053D8 80809118 01CFC021 */  addu    $t8, $t6, $t7
/* 053DC 8080911C 10000063 */  beq     $zero, $zero, .L808092AC
/* 053E0 80809120 A438CACE */  sh      $t8, -0x3532($at)          ## 0001CACE
.L80809124:
/* 053E4 80809124 2841001F */  slti    $at, $v


lydata.elements[0].properties if p.name.startswith("scale_")]
    scale_names = sorted(scale_names, key = lambda x: int(x.split('_')[-1]))
    scales = np.zeros((xyz.shape[0], len(scale_names)))
    for idx, attr_name in enumerate(scale_names):
        scales[:, idx] = np.asarray(plydata.elements[0][attr_name])

    rot_names = [p.name for p in plydata.elements[0].properties if p.name.startswith("rot")]
    rot_names = sorted(rot_names, key = lambda x: int(x.split('_')[-1]))
    rots = np.zeros((xyz.shape[0], len(rot_names)))
    for idx, attr_name in enumerate(rot_names):
        rots[:, idx] = np.asarray(plydata.elements[0][attr_name])
    # xyz features_dc features_extra opacities scales rots
    return xyz, features_dc, features_extra, opacities, scales, rots
def mkdir_p(folder_path):
    # Creates a directory. equivalent to using mkdir -p on the command line
    try:
        makedirs(folder_path)
    except OSError as exc:
        if exc.errno == EEXIST and path.isdir(folder_path):
            pass
        else:
            raise
def convert_np_tensor(xyz, features_dc, features_rest, opacity, scaling, rotation):
    xyz = torch.tensor(xyz, dtype=torch.float, device="cuda")
    features_dc = torch.tensor(features_dc, dtype=torch.float, device="cuda").transpose(1, 2).contiguous()
    features_rest = torch.tensor(features_rest, dtype=torch.float, device="cuda").transpose(1, 2).contiguous()
    opacity = torch.tensor(opacity, dtype=torch.float, device="cuda")
    scaling = torch.tensor(scaling, dtype=torch.float, device="cuda")
    rotation = torch.tensor(rotation, dtype=torch.float, device="cuda")
    return xyz, features_dc, features_rest, opacity, scaling, rotation
def construct_list_of_attributes(features_dc, features_rest, scaling, rotation):
        l = ['x', 'y', 'z', 'nx', 'ny', 'nz']
        # All channels except the 3 DC
        for i in range(features_dc.shape[1]*features_dc.shape[2]):
            l.append('f_dc_{}'.format(i))
        for i in range(features_rest.shape[1]*features_rest.shape[2]):
            l.append('f_rest_{}'.format(i))
        l.append('opacity')
        for i in range(scaling.shape[1]):
            l.append('scale_{}'.format(i))
        for i in range(rotation.shape[1]):
            l.append('rot_{}'.format(i))
        return l

def similar_points_tree(point_cloud_A, point_cloud_B, threshold): # 使用KD树找到在阈值内相似的点

    tree = KDTree(point_cloud_B)

    distances, indices = tree.query(point_cloud_A, k=1)

    similar_indices = np.where(distances < threshold)[0]

    return similar_indices
def composition(xyz_rgb, features_dc_rgb, features_extra_rgb, opacities_rgb, scales_rgb, rots_rgb,path_2): # 合并两个点云的属性
    xyz_binary, features_dc_binary, features_extra_binary, opacities_binary, scales_binary, rots_binary = load_ply(path_2)
    print(xyz_binary.shape)
    xyz = np.concatenate((xyz_rgb, xyz_binary), axis=0)
    features_dc = np.concatenate((features_dc_rgb,features_dc_binary),axis=0)
    features_rest = np.concatenate((features_extra_rgb,features_extra_binary),axis=0)
    opacity = np.concatenate((opacities_rgb, opacities_binary),axis=0)
    scaling = np.concatenate((scales_rgb, scales_binary),axis=0)
    rotation = np.concatenate((rots_rgb , rots_binary),axis=0)
    return xyz, features_dc, features_rest, opacity, scaling, rotation
def save_ply(xyz, features_dc, features_rest, opacity, scaling, rotation, path_save):
        mkdir_p(os.path.dirname(path_save))

        xyz = xyz.detach().cpu().numpy()
        normals = np.zeros_like(xyz)
        f_dc = features_dc.detach().transpose(1, 2).flatten(start_dim=1).contiguous().cpu().numpy()
        f_rest = features_rest.detach().transpose(1, 2).flatten(start_dim=1).contiguous().cpu().numpy()
        opacities = opacity.detach().cpu().numpy()
        scale = scaling.detach().cpu().numpy()
        rotation = rotation.detach().cpu().numpy()

        dtype_full = [(attribute, 'f4') for attribute in construct_list_of_attributes(features_dc, features_rest, scaling, rotation)]

        elements = np.empty(xyz.shape[0], dtype=dtype_full)
        attributes = np.concatenate((xyz, normals, f_dc, f_rest, opacities, scale, rotation), axis=1)
        elements[:] = list(map(tuple, attributes))
        el = PlyElement.describe(elements, 'vertex')
        PlyData([el]).write(path_save)
# Main Procedure
if __name__ == "__main__":
    parser = argparse.ArgumentParser(description='Process Gaussians.')
    parser.add_argument('--original_ply', type=str, requi


d UNK_021CA8C0

	arm_func_start sub_020AA824
sub_020AA824: ; 0x020AA824
	stmdb sp!, {r4-r10,lr}
	movs r5, r2
	mov r7, r0
	movne r0, #0x0
	strne r0, [r5, #0x0]
	ldr r0, _020AA958 ; =UNK_021CA8D4
	mov r6, r1
	ldr r0, [r0, #0x0]
	mov r4, #0x0
	cmp r6, r0
	bne _020AA920
	ldr r8, _020AA95C ; =sNumStream
	ldr r0, [r8, #0x0]
	cmp r0, #0x0
	beq _020AA920
	mov r9, r4
	cmp r0, #0x0
	bls _020AA89C
_020AA86C:
	mov r0, r7
	mov r1, r6
	mov r2, r9
	mov r3, r5
	bl sub_020AA968
	cmp r0, #0x1
	moveq r4, #0x1
	beq _020AA89C
	ldr r0, [r8, #0x0]
	add r9, r9, #0x1
	cmp r9, r0
	blo _020AA86C
_020AA89C:
	cmp r4, #0x0
	beq _020AA90C
	ldr r8, _020AA95C ; =sNumStream
	add r10, r9, #0x1
	ldr r0, [r8, #0x0]
	cmp r10, r0
	moveq r4, #0x1
	beq _020AA934
	cmp r10, r0
	bhs _020AA934
	ldr sb, _020AA960 ; =UNK_021CAAA4
_020AA8C8:
	mov r0, r9
	mov r1, r6
	mov r2, r10
	mov r3, r5
	bl sub_020AA968
	cmp r0, #0x1
	bne _020AA8F8
	mov r0, r7
	mov r1, r9
	mov r2, r7
	mov r3, r6
	bl vct_mix_audio
_020AA8F8:
	ldr r0, [r8, #0x0]
	add r10, r10, #0x1
	cmp r10, r0
	blo _020AA8C8
	b _020AA934
_020AA90C:
	mov r1, r7
	mov r2, r6
	mov r0, #0x0
	bl MIi_CpuClearFast
	b _020AA934
_020AA920:
	mov r1, r7
	mov r2, r6
	mov r0, #0x0
	bl MIi_CpuClearFast
	mov r4, #0x0
_020AA934:
	ldr r0, _020AA964 ; =UNK_021CA8C8
	ldr r0, [r0, #0x0]
	cmp r0, #0x0
	beq _020AA950
	mov r0, r7
	mov r1, r6
	bl sub_020AD45C
_020AA950:
	mov r0, r4
	ldmia sp!, {r4-r10,pc}
	.balign 4
_020AA958: .word UNK_021CA8D4
_020AA95C: .word sNumStream
_020AA960: .word UNK_021CAAA4
_020AA964: .word UNK_021CA8C8

	arm_func_start sub_020AA968
sub_020AA968: ; 0x020AA968
	stmdb sp!, {r4-r11,lr}
	sub sp, sp, #0xc
	ldr r4, _020AABD4 ; =


e.m(0, 0)
    game.m(1, 2)
    game.m(1, 0)
    game.m(2, 0)
    game.m(0, 2)
    game.m(0, 1)
    game.m(2, 1)
    game.m(2, 2)
    println(game.getCurrentFieldAsAString())
    println("game.isGameFinished() = " + game.isGameFinished())
    println("game.isGameWon() = " + game.isGameWon())
    println("game.getWinner() = " + game.getWinner())
    println("game.getLeader() = " + game.getLeader())
}

fun play3x3gameWhichIsWon() {
    println("=========================")
    println("game #2 is about to start")
    val game = Game.create()
    game.m(1, 1) // X
    game.m(2, 1) // O
    game.m(2, 0) // X
    game.m(0, 2) // O
    game.m(1, 2) // X
    game.m(2, 2) // O
    println(game.getCurrentFieldAsAString())
    println("game.isGameFinished() = " + game.isGameFinished())
    game.m(1, 0) // X - this one was problematic
    println(game.getCurrentFieldAsAString())
    println("game.isGameFinished() = " + game.isGameFinished())
    println("game.isGameWon() = " + game.isGameWon())
    println("game.getWinner() = " + game.getWinner())
}

fun play3x3x3gameWhichIsWon() {
    println("=========================")
    println("game #3 is about to start")
    val game = Game.create(true)
    game.m(1, 1, 0) // X
    game.m(2, 1, 0) // O
    game.m(2, 0, 0) // X
    game.m(0, 2, 0) // O
    game.m(1, 1, 1) // X
    game.m(2, 2, 0) // O
    game.m(1, 1, 2) // X - this one was problematic but in version 0.3.0 this bug was fixed
    /*
        . . x
        . X o <- x x x - on Z axis
        o . o
     */
    println(game.getCurrentFieldAsAString())
    println("game.isGameFinished() = " + game.isGameFinished())
    println("game.isGameWon() = " + game.isGameWon())
    println("game.getWinner() = " + game.getWinner())
}

fun play4x4gameWhichIsWon() {
    println("=========================")
    println("game #4 is about to start")
    val game = Game.create(4)
    game.m(0, 0) // X
    game.m(1, 0) // O
    game.m(0, 1) // X -> now A has a line of 2 marks and becomes a leader
    game.m(1, 1) // O -> now B also has a line of 2 marks
    game.m(2, 0) // X -> now A still has a line of 2 marks
    game.m(1, 2) // O -> now B has a line of 3 marks and becomes a new leader
    /*
        X O X .
        X O . .
        . O . .
        . . . .
     */
    println(game.getCurrentFieldAsAString())
    println("game.isGameFinished() = " + game.isGameFinished())
    println("game.isGameWon() = " + game.isGameWon())
    println("game.getWinner() = " + game.getWinner())
}

fun play4x4x4gameWhichIsWon() {
    println("=========================")
    println("game #5 is about to start")
    val game = Game.create(true, 4)
    game.m(0, 0, 0) // X
    game.m(1, 0, 0) // O
    game.m(0, 1, 0) // X -> now A has a line of 2 marks and becomes a leader
    game.m(1, 0, 1) // O -> now B also has a line of 2 marks
    game.m(2, 0, 0) // X -> now A still has a line


_temp;
|	CMDREG1B[fsave_frame] =  cmdreg1b_temp;
|	DTAG[fsave_frame]     =  dtag_temp;
|	ETE15[fsave_frame]    =  ete15_temp;
|
|	/* Make sure that the cmdreg3b dest reg is not going to
|	 * be destroyed by a FMOVEM at the end of all this code.
|	 * If it is, you should move the current value of the reg
|	 * onto the stack so that the reg will loaded with that value.
|	 */
|
|	/* All done.  Proceed with the code below */
|    }
|
|    etemp  = FP_reg_[cmdreg1b[12:10]];
|    ete15  = ~ete14;
|    cmdreg1b[15:10] = 010010;
|    clear(bug_flag_procIDxxxx);
|    FRESTORE and return;
|
|
|    FIX_OPCLASS2:
|    if ((cmdreg1b[9:7] == cmdreg2b[9:7]) &&
|	(cmdreg1b[9:7] != cmdreg3b[9:7]))  {  /* xu conflict only */
|	/* We execute the following code if there is an
|	   xu conflict and NOT an nu conflict */
|
|	/* first save some values on the fsave frame */
|	stag_temp     = STAG[fsave_frame];
|	cmdreg1b_temp = CMDREG1B[fsave_frame];
|	dtag_temp     = DTAG[fsave_frame];
|	ete15_temp    = ETE15[fsave_frame];
|	etemp_temp    = ETEMP[fsave_frame];
|
|	CUPC[fsave_frame] = 0000000;
|	FRESTORE
|	FSAVE
|
|
|	/* If the xu instruction is exceptional, we punt.
|	 * Otherwise, we would have to include OVFL/UNFL handler
|	 * code here to get the correct answer.
|	 */
|	if (fsave_frame_format == $4060) {goto KILL_PROCESS}
|
|	fsave_frame = /* build a long frame of all zeros */
|	fsave_frame_format = $4060;  /* label it as long frame */
|
|	/* load it with the temps we saved */
|	STAG[fsave_frame]     =  stag_temp;
|	CMDREG1B[fsave_frame] =  cmdreg1b_temp;
|	DTAG[fsave_frame]     =  dtag_temp;
|	ETE15[fsave_frame]    =  ete15_temp;
|	ETEMP[fsave_frame]    =  etemp_temp;
|
|	/* Make sure that the cmdreg3b dest reg is not going to
|	 * be destroyed by a FMOVEM at the end of all this code.
|	 * If it is, you should move the current value of the reg
|	 * onto the stack so that the reg will loaded with that value.
|	 */
|
|	/* All done.  Proceed with the code below */
|    }
|
|    if (etemp_exponent == min_sgl)   etemp_exponent = min_dbl;
|    if (etemp_exponent == max_sgl)   etemp_exponent = max_dbl;
|    cmdreg1b[15:10] = 010101;
|    clear(bug_flag_procIDxxxx);
|    FRESTORE and return;
|
|
|    NOFIX:
|    clear(bug_flag_procIDxxxx);
|    FRESTORE and return;
|

|		Copyright (C) Motorola, Inc. 1990
|			All Rights Reserved
|
|       For details on the license for this file, please see the
|       file, README, in this same directory.

|BUGFIX    idnt    2,1 | Motorola 040 Floating


  {
    DAEDITOR3.conError("FATAL: %s,%d:\n    %s", file, line, msg);
    EDITORCORE->getConsole().showConsole();
  }
  return false;
}

class DaEditor3Engine : public IDaEditor3Engine, public NullMsgPipe, public ITextureNameResolver
{
public:
  DaEditor3Engine() : m_FilterTypeId(-1)
  {
    daEditor3InterfaceVer = DAEDITOR3_VERSION;
    assetDlg = 0;
  }
  ~DaEditor3Engine() { resetInterface(); }

  Tab<String> objFilterList;

  const char *getBuildString() override { return "1.0"; }
  bool registerService(IEditorService *srv) override
  {
    if (srv->getServiceFriendlyName())
    {
      debug("register service: %s", srv->getServiceName());
      srvPlugins.push_back(new GenServicePlugin(srv));
      if (!DAGORED2->registerPlugin(srvPlugins.back()))
      {
        delete srvPlugins.back();
        srvPlugins.pop_back();
        delete srv;
        debug("-- register service failed");
        return false;
      }
    }
    else
    {
      debug("register hidden service: %s", srv->getServiceName());
      services.push_back(srv);
    }

    IObjEntityMgr *oemgr = srv->queryInterface<IObjEntityMgr>();
    if (oemgr)
      registerEntityMgr(oemgr);

    return true;
  }
  bool unregisterService(IEditorService *srv) override
  {
    debug("unregister service: %s", srv->getServiceName());
    for (int i = srvPlugins.size() - 1; i >= 0; i--)
      if (srvPlugins[i]->srv == srv)
      {
        IObjEntityMgr *oemgr = srv->queryInterface<IObjEntityMgr>();
        if (oemgr)
          unregisterEntityMgr(oemgr);

        erase_items(srvPlugins, i, 1);
        return true;
      }
    for (int i = services.size() - 1; i >= 0; i--)
      if (services[i] == srv)
      {
        erase_items(services, i, 1);
        return true;
      }
    return false;
  }

  IEditorService *findService(const char *internalName) const override
  {
    for (int i = 0; i < srvPlugins.size(); i++)
      if (strcmp(srvPlugins[i]->getInternalName(), internalName) == 0)
        return srvPlugins[i]->srv;
    return nullptr;
  }

  bool registerEntityMgr(IObjEntityMgr *oemgr) override
  {
    for (int i = entityMgrs.size() - 1; i >= 0; i--)
      if (entityMgrs[i] == oemgr)
        return false;

    entityMgrs.push_back(oemgr);
    if (!invEntMgr && oemgr->canSupportEntityClass(-1))
      invEntMgr = oemgr;
    return true;
  }
  bool unregisterEntityMgr(IObjEntityMgr *oemgr) override
  {
    for (int i = entityMgrs.size() - 1; i >= 0; i--)
      if (entityMgrs[i] == oemgr)
      {
        for (int j = entityClsMap.size() - 1; j >= 0; j--)
          if (entityClsMap[j] == oemgr)
            entityClsMap[j] = NULL;
        erase_items(entityMgrs, i, 1);
        if (invEntMgr == oemgr)
          invEntMgr = NULL;
        return true;
      }
    return false;
  }

  int getAssetTypeId(const char *entity_name) const override { return assetMgr.getAssetTypeId(entity_name); }
  const char *getAssetTypeName(int cls) const override { return assetMgr.getAssetTypeName(cls); }
  IObjEntity *createEntity(const DagorAsset &asset, bool virtual_ent) override { return IObj


 pool === 'staging' || pool === 'dbAndStaging';

    const dbPool: Array<Peer> = useDB
      ? Array.from(this.db.entries()).map(([addr, data]) => [
          addr,
          {pool: 'db', ...data},
        ])
      : [];
    const stagingPool: Array<Peer> = useStaging
      ? Array.from(this.staging.entries()).map(([addr, data]) => [
          addr,
          {pool: 'staging', ...data},
        ])
      : [];

    return ([] as Array<[string, any]>)
      .concat(dbPool)
      .concat(stagingPool)
      .filter(([address]) => {
        const state = this.hub.getState(address);
        return state !== 'connected' && state !== 'connecting';
      });
  }

  //#endregion

  //#region QUERIES

  /**
   * Answers whether a peer has passed an 'exponential backoff' check, relative
   * to a given timestamp (or `Date.now()` if no timestamp is provided). The
   * exponential backoff is a certain time gap counting from the latest
   * stateChange timestamp, and this gap grows with the number of connection
   * failures that have occurred for this peer.
   *
   * @param step A temporal parameter (measured in milliseconds) for how much
   * the exponential backoff grows for each connection failure.
   * @param max (optional, default is `Infinity`) The maximum time gap (in
   * milliseconds) for the exponential backoff.
   * @param timestamp (optional, default is `Date.now()`) The timestamp to
   * compare the exponential backoff with. If the time gap between the latest
   * stateChange and the exponential backoff is less than this timestamp, this
   * check passes.
   */
  static passesExpBackoff = Time.passesExpBackoff;

  /**
   * Answers whether a group of peers (as an array) has had enough time gap
   * since the last stateChange for any peer. This is known as a "debounce". The
   * time gap is determined by the 'groupMin' argument, the first argument.
   * @param groupMin A temporal parameter (measured in milliseconds) for how
   * long the time gap should last.
   * @param timestamp (optional, default is Date.now()) The timestamp to compare
   * the time gap with. If the time gap between the latest stateChange (for any
   * peer) is less than this timestapm, this check passes.
   */
  static passesGroupDebounce = Time.passesGroupDebounce;

  /**
   * Answers whether a peer has not had a connection attempt yet.
   */
  static hasNoAttempts = Health.hasNoAttempts;

  /**
   * Answers whether a peer has never been successfully connected to yet, but
   * has been tried.
   */
  static hasOnlyFailedAttempts = Health.hasOnlyFailedAttempts;

  /**
   * Answers whether a peer has had some successful connection in the past.
   */
  static hasSuccessfulAttempts = Health.hasSuccessfulAttempts;

  /**
   * Answers whether a peer has successfully pinged us in the past.
   */
  static hasPinged = Health.hasPinged;

  /**
   * Sorts an array of peers from oldest 'stateChange' timestamp to newest.
   */
  static sortByStateChange = Sorting.sortByStateChange;

  //#endregion
}

export = ConnQuery;
export function getContext(canvas: HTMLCanvasElement): WebGLRenderingContext {
  let ctx;
  try {
    ctx = canvas.getContext('webgl') || canvas.getContext('experimental-webgl');
    return (ctx as WebGLRenderingContext);
  } catch (e) {
    throw new Error(e.message);
  }
}

export function initialCanvasElement(): HTMLCanvasElement {
  const canvas = document.createElement('canvas');
  document.body.appendChild(canvas);
  return canvas;
}

export function resize(canvas: HTMLCanvasElement) {
  const


3]);
        t = state[9] ^ d[4];
        bc[1] = std::rotl(t, ROT[9]);

        state[5] = bc[0] ^ (bc[2] & ~bc[1]);
        state[6] = bc[1] ^ (bc[3] & ~bc[2]);
        state[7] = bc[2] ^ (bc[4] & ~bc[3]);
        state[8] = bc[3] ^ (bc[0] & ~bc[4]);
        state[9] = bc[4] ^ (bc[1] & ~bc[0]);

        t = state[10] ^ d[0];
        bc[4] = std::rotl(t, ROT[20]);
        t = state[11] ^ d[1];
        bc[0] = std::rotl(t, ROT[1]);
        t = state[12] ^ d[2];
        bc[1] = std::rotl(t, ROT[7]);
        t = state[13] ^ d[3];
        bc[2] = std::rotl(t, ROT[13]);
        t = state[14] ^ d[4];
        bc[3] = std::rotl(t, ROT[19]);

        state[10] = bc[0] ^ (bc[2] & ~bc[1]);
        state[11] = bc[1] ^ (bc[3] & ~bc[2]);
        state[12] = bc[2] ^ (bc[4] & ~bc[3]);
        state[13] = bc[3] ^ (bc[0] & ~bc[4]);
        state[14] = bc[4] ^ (bc[1] & ~bc[0]);

        t = state[15] ^ d[0];
        bc[1] = std::rotl(t, ROT[5]);
        t = state[16] ^ d[1];
        bc[2] = std::rotl(t, ROT[11]);
        t = state[17] ^ d[2];
        bc[3] = std::rotl(t, ROT[17]);
        t = state[18] ^ d[3];
        bc[4] = std::rotl(t, ROT[23]);
        t = state[19] ^ d[4];
        bc[0] = std::rotl(t, ROT[4]);

        state[15] = bc[0] ^ (bc[2] & ~bc[1]);
        state[16] = bc[1] ^ (bc[3] & ~bc[2]);
        state[17] = bc[2] ^ (bc[4] & ~bc[3]);
        state[18] = bc[3] ^ (bc[0] & ~bc[4]);
        state[19] = bc[4] ^ (bc[1] & ~bc[0]);

        t = state[20] ^ d[0];
        bc[3] = std::rotl(t, ROT[15]);
        t = state[21] ^ d[1];
        bc[4] = std::rotl(t, ROT[21]);
        t = state[22] ^ d[2];
        bc[0] = std::rotl(t, ROT[2]);
        t = state[23] ^ d[3];
        bc[1] = std::rotl(t, ROT[8]);
        t = state[24] ^ d[4];
        bc[2] = std::rotl(t, ROT[14]);

        state[20] = bc[0] ^ (bc[2] & ~bc[1]);
        state[21] = bc[1] ^ (bc[3] & ~bc[2]);
        state[22] = bc[2] ^ (bc[4] & ~bc[3]);
        state[23] = bc[3] ^ (bc[0] & ~bc[4]);
        state[24] = bc[4] ^ (bc[1] & ~bc[0]);
    }

    // Keccak-p[1600, 24] permutation, applying 24 rounds of permutation on state of dimension 5 x 5 x 64 ( = 1600 ) -bits,
    // using algorithm 7 defined in section 3.3 of SHA3 specification https://dx.doi.org/10.6028/NIST.FIPS.202
    forceinline constexpr void
        permute(uint64_t state[LANE_CNT])
    {
        constexpr auto STEP_BY = 4;
        static_assert(ROUNDS % STEP_BY == 0);

        for (size_t i = 0; i < ROUNDS; i += STEP_BY) {
            roundx4(state, i);
        }
    }

}


 i < 18; i++) {
    this.P[i] ^= stream2word(key, keybytes);
  }
  BLF_J = 0;

  for (i = 0; i < 18; i += 2) {
    this.encipher(d, d8);
    this.P[i]   = d[0];
    this.P[i+1] = d[1];
  }

  for (i = 0; i < 4; i++) {
    for (k = 0; k < 256; k += 2) {
      this.encipher(d, d8);
      this.S[i][k]   = d[0];
      this.S[i][k+1] = d[1];
    }
  }
};

Blowfish.prototype.expandstate = function(data, databytes, key, keybytes) {
  var d = new Uint32Array(2), i, k;

  for (i = 0, BLF_J = 0; i < 18; i++) {
    this.P[i] ^= stream2word(key, keybytes);
  }

  for (i = 0, BLF_J = 0; i < 18; i += 2) {
    d[0] ^= stream2word(data, databytes);
    d[1] ^= stream2word(data, databytes);
    this.encipher(d);
    this.P[i]   = d[0];
    this.P[i+1] = d[1];
  }

  for (i = 0; i < 4; i++) {
    for (k = 0; k < 256; k += 2) {
      d[0] ^= stream2word(data, databytes);
      d[1] ^= stream2word(data, databytes);
      this.encipher(d);
      this.S[i][k]   = d[0];
      this.S[i][k+1] = d[1];
    }
  }
  BLF_J = 0;
};

Blowfish.prototype.enc = function(data, blocks) {
  for (var i = 0; i < blocks; i++) {
    this.encipher(data.subarray(i*2));
  }
};

Blowfish.prototype.dec = function(data, blocks) {
  for (var i = 0; i < blocks; i++) {
    this.decipher(data.subarray(i*2));
  }
};

var BCRYPT_BLOCKS = 8,
    BCRYPT_HASHSIZE = 32;

function bcrypt_hash(sha2pass, sha2salt, out) {
  var state = new Blowfish(),
      cdata = new Uint32Array(BCRYPT_BLOCKS), i,
      ciphertext = new Uint8Array([79,120,121,99,104,114,111,109,97,116,105,
            99,66,108,111,119,102,105,115,104,83,119,97,116,68,121,110,97,109,
            105,116,101]); //"OxychromaticBlowfishSwatDynamite"

  state.expandstate(sha2salt, 64, sha2pass, 64);
  for (i = 0; i < 64; i++) {
    state.expand0state(sha2salt, 64);
    state.expand0state(sha2pass, 64);
  }

  for (i = 0; i < BCRYPT_BLOCKS; i++)
    cdata[i] = stream2word(ciphertext, ciphertext.byteLength);
  for (i = 0; i < 64; i++)
    state.enc(cdata, cdata.byteLength / 8);

  for (i = 0; i < BCRYPT_BLOCKS; i++) {
    out[4*i+3] = cdata[i] >>> 24;
    out[4*i+2] = cdata[i] >>> 16;
    out[4*i+1] = cdata[i] >>> 8;
    out[4*i+0] = cdata[i];
  }
};

function bcrypt_pbkdf(pass, passlen, salt, saltlen, key, keylen, rounds) {
  var sha2pass = new Uint8Array(64),
      sha2salt = new Uint8Array(64),
      out = new Uint8Array(BCRYPT_HASHSIZE),
      tmpout = new Uint8Array(BCRYPT_HASHSIZE),
      countsalt = new U


Me2b_38","ev_VMe2b_39","ev_VMe2b_40","ev_VMe2b_41","ev_VMe2b_42","ev_VMe2b_43","ev_VMe2b_44","ev_VMe2b_45","ev_VMe2b_46","ev_VMe2b_47","ev_VMe2b_48","ev_cBHTT_195","ev_cBHTT_196","ev_cBHTT_197","ev_cBHTT_198","ev_cBHTT_199","ev_cBHTT_200","ev_cBHTT_201","ev_VMe2b_53","ev_VMe2b_54"],"images":[],"videoComments":[]},{"displayCommentEvent":{"id":"ev_cBHTT_212","timestamp":1518145437089,"type":"Insert","character":"y","previousNeighborId":"ev_cBHTT_211","createdByDevGroupId":"devGroupId-cBHTT_1","lineNumber":9,"column":21,"fileId":"fileId-e9XQd_0","pastedEventId":null,"relevant":true},"developerGroupId":"devGroupId-EvOeX_1","timestamp":1518146636910,"commentText":"These are the conflict markers identifying what comes from branch 1 and branch 2.","selectedCodeIds":["ev_VMe2b_0","ev_VMe2b_1","ev_VMe2b_2","ev_VMe2b_3","ev_VMe2b_4","ev_VMe2b_5","ev_VMe2b_6","ev_VMe2b_7","ev_VMe2b_8","ev_VMe2b_10","ev_VMe2b_11","ev_VMe2b_12","ev_VMe2b_13","ev_VMe2b_14","ev_VMe2b_15","ev_VMe2b_16","ev_VMe2b_17","ev_VMe2b_18","ev_VMe2b_56","ev_VMe2b_57","ev_VMe2b_58","ev_VMe2b_59","ev_VMe2b_60","ev_VMe2b_61","ev_VMe2b_62"],"images":[],"videoComments":[]},{"displayCommentEvent":{"id":"ev_cBHTT_212","timestamp":1518145437089,"type":"Insert","character":"y","previousNeighborId":"ev_cBHTT_211","createdByDevGroupId":"devGroupId-cBHTT_1","lineNumber":9,"column":21,"fileId":"fileId-e9XQd_0","pastedEventId":null,"relevant":true},"developerGroupId":"devGroupId-EvOeX_1","timestamp":1518146732575,"commentText":"There were some changes made by both developers that were not in conflict.

These can be added without conflict markers.
","selectedCodeIds":["ev_EvOeX_196","ev_EvOeX_197","ev_EvOeX_198","ev_EvOeX_199","ev_cBHTT_207","ev_cBHTT_208","ev_cBHTT_209","ev_cBHTT_210","ev_cBHTT_211","ev_cBHTT_212"],"images":[],"videoComments":[]}],"ev_PfCOJ_276":[{"displayCommentEvent":{"id":"ev_PfCOJ_276","timestamp":1518146836139,"type":"Delete","character":"\n","previousNeighborId":"ev_VMe2b_63","createdByDevGroupId":"devGroupId-e9XQd_0","lineNumber":3,"column":1,"fileId":"fileId-e9XQd_0","relevant":true},"developerGroupId":"devGroupId-e9XQd_0","timestamp":1518147181430,"commentText":"
After the merge the playback had the changes with the conflict markers.

I downloaded that playback and opened it up in my editor.

Then I had to resolve the conflicts. This often involves working with the developers who made the changes and figuring out what it the right combination of changes.

Now that I cleaned up the changes I can build off of this version.
","selectedCodeIds":[],"images":[],"videoComments":[]}]};
            playbackData.playbackDescription = {"title":"Playback","description":""};
            playbackData.branchId = "PfCOJ";

            //setup a new playback with the current data
            getPlaybackWindowsReadyForAnimation(true);

            //if this is a playback for a comment
            if(false) {

                //step forward as far as possible
                step("forward", Number.MAX_SAFE_INTEGER);
            }
        }

            function makeAnAlert(msg, alertType, idOfAlertArea) {

                //make the alert div
                var alertElement = document.createElement("div");
                alertElement.classList.add("alert");
                alertElement.classList.add(alertType);
                alertElement.classList.add("alert-dismissible");

                //add a button
                var dismissButton = document.createElement("button");
                dismissButton.classList.add("close");
                dismi


1.986l1.486-4.092 1.92-1.169 5.76-5.76h-2.88l-5.76 5.76-2.88 9.6 9.6-2.88 5.76-5.76v-2.88l-5.76 5.76-1.169 1.92z"></path></svg>',
        move: '<svg width="24" height="24"><path d="M19.68 4.32h-6.24l2.4 2.4-2.88 2.88 1.44 1.44 2.88-2.88 2.4 2.4z"></path> <path d="M19.68 19.68v-6.24l-2.4 2.4-2.88-2.88-1.44 1.44 2.88 2.88-2.4 2.4z"></path> <path d="M4.32 19.68h6.24l-2.4-2.4 2.88-2.88-1.44-1.44-2.88 2.88-2.4-2.4z"></path> <path d="M4.32 4.32v6.24l2.4-2.4 2.88 2.88 1.44-1.44-2.88-2.88 2.4-2.4z"></path></svg>',
        plus: '<svg width="24" height="24"><path d="M18.429 10.286h-4.714v-4.714c0-0.237-0.192-0.429-0.429-0.429h-2.571c-0.237 0-0.429 0.192-0.429 0.429v4.714h-4.714c-0.237 0-0.429 0.192-0.429 0.429v2.571c0 0.237 0.192 0.429 0.429 0.429h4.714v4.714c0 0.237 0.192 0.429 0.429 0.429h2.571c0.237 0 0.429-0.192 0.429-0.429v-4.714h4.714c0.237 0 0.429-0.192 0.429-0.429v-2.571c0-0.237-0.192-0.429-0.429-0.429z"></path></svg>',
        snippet: '<svg width="24" height="24"><path d="M20.6 10l-6-.8L12 3.8 9.4 9.2l-6 .9 4.3 4.2-1 5.9 5.3-2.8 5.3 2.8-1-6 4.3-4.1z"/></svg>',
        tab: '<svg width="24" height="24"><path d="M18.72 4.32h0.96v7.68h-0.96v-7.68z"></path> <path d="M4.32 12h0.96v7.68h-0.96v-7.68z"></path> <path d="M9.12 14.88h10.56v1.92h-10.56v2.4l-3.36-3.36 3.36-3.36v2.4z"></path> <path d="M14.88 9.12h-10.56v-1.92h10.56v-2.4l3.36 3.36-3.36 3.36z"></path></svg>',
        tabvertical: '<svg width="24" height="24"><path d="M19.7,18.7v1H12v-1H19.7z"/> <path d="M12,4.3v1H4.3v-1H12z"/> <path d="M9.1,9.1v10.6H7.2V9.1H4.8l3.4-3.4l3.4,3.4C11.5,9.1,9.1,9.1,9.1,9.1z"/> <path d="M14.9,14.9V4.3h1.9v10.6h2.4l-3.4,3.4l-3.4-3.4H14.9z"/></svg>',
        table: '<svg width="24" height="24"><path d="M3.4 3.4h17.2v4.3H3.4V3.4zm0 7.5h17.2V12H3.4v-1zm0 4.3h17.2v1H3.4v-1zm0 4.3h17.2v1H3.4v-1zm0-16h1.1v17h-1v-17zm16.1 0h1v17h-1v-17zm-5.4 0h1.1v17h-1v-17zm-5.3 0h1v17h-1v-17z"/></svg>',
        tablethorizontal: '<svg width="24" height="24"><path d="M19.9 17.4v-10c0-.8-.7-1.5-1.5-1.5H5.6C4.8 6 4 6


_FAM_PPP 6
     * }
     */
    public static int APPLE_IF_FAM_PPP() {
        return APPLE_IF_FAM_PPP;
    }

    private static final int APPLE_IF_FAM_PVC = (int) 7L;
    /**
     * {@snippet lang=c :
     * #define APPLE_IF_FAM_PVC 7
     * }
     */
    public static int APPLE_IF_FAM_PVC() {
        return APPLE_IF_FAM_PVC;
    }

    private static final int APPLE_IF_FAM_DISC = (int) 8L;
    /**
     * {@snippet lang=c :
     * #define APPLE_IF_FAM_DISC 8
     * }
     */
    public static int APPLE_IF_FAM_DISC() {
        return APPLE_IF_FAM_DISC;
    }

    private static final int APPLE_IF_FAM_MDECAP = (int) 9L;
    /**
     * {@snippet lang=c :
     * #define APPLE_IF_FAM_MDECAP 9
     * }
     */
    public static int APPLE_IF_FAM_MDECAP() {
        return APPLE_IF_FAM_MDECAP;
    }

    private static final int APPLE_IF_FAM_GIF = (int) 10L;
    /**
     * {@snippet lang=c :
     * #define APPLE_IF_FAM_GIF 10
     * }
     */
    public static int APPLE_IF_FAM_GIF() {
        return APPLE_IF_FAM_GIF;
    }

    private static final int APPLE_IF_FAM_FAITH = (int) 11L;
    /**
     * {@snippet lang=c :
     * #define APPLE_IF_FAM_FAITH 11
     * }
     */
    public static int APPLE_IF_FAM_FAITH() {
        return APPLE_IF_FAM_FAITH;
    }

    private static final int APPLE_IF_FAM_STF = (int) 12L;
    /**
     * {@snippet lang=c :
     * #define APPLE_IF_FAM_STF 12
     * }
     */
    public static int APPLE_IF_FAM_STF() {
        return APPLE_IF_FAM_STF;
    }

    private static final int APPLE_IF_FAM_FIREWIRE = (int) 13L;
    /**
     * {@snippet lang=c :
     * #define APPLE_IF_FAM_FIREWIRE 13
     * }
     */
    public static int APPLE_IF_FAM_FIREWIRE() {
        return APPLE_IF_FAM_FIREWIRE;
    }

    private static final int APPLE_IF_FAM_BOND = (int) 14L;
    /**
     * {@snippet lang=c :
     * #define APPLE_IF_FAM_BOND 14
     * }
     */
    public static int APPLE_IF_FAM_BOND() {
        return APPLE_IF_FAM_BOND;
    }

    private static final int APPLE_IF_FAM_CELLULAR = (int) 15L;
    /**
     * {@snippet lang=c :
     * #define APPLE_IF_FAM_CELLULAR 15
     * }
     */
    public static int APPLE_IF_FAM_CELLULAR() {
        return APPLE_IF_FAM_CELLULAR;
    }

    private static final int APPLE_IF_FAM_UNUSED_16 = (int) 16L;
    /**
     * {@snippet lang=c :
     * #define APPLE_IF_FAM_UNUSED_16 16
     * }
     */
    public static int APPLE_IF_FAM_UNUSED_16() {
        return APPLE_IF_FAM_UNUSED_16;
    }

    private static final int APPLE_IF_FAM_UTUN = (int) 17L;
    /**
     * {@snippet lang=c


#!/bin/sh
_=[[
	. "${0%/*}/regress.sh"
	exec runlua -r5.2 "$0" "$@"
]]

local unix = require"unix"
local regress = require"regress".export".*"

local args = { "./getopt", "-ax", "-a", "x", "-b", "-bb", "--", "-a" }
local a = 0;
local b = 0;

for optc, optarg in unix.getopt(args, "a:b") do
	info("got option %s with argument %s", check(optc, "optc was nil"), optarg or "nil")

	if optc == "a" then
		check(optarg == "x", "expected optarg of 'x' with -a, got '%s'", tostring(optarg))
		a = a + 1
	elseif optc == "b" then
		check(optarg == nil, "expected nil optarg with -b")
		b = b + 1
	else
		panic("unexpected option: %s", optc)
	end
end

check(a == 2, "expected 2 -a, got %d", a)
check(b == 3, "expected 3 -b, got %d", b)
check(unix.optind == 8, "expected optind of 8, got %d", unix.optind)

local args = {


trás de las criptomonedas, los sitios web de videojuegos y apuestas ocuparon el segundo lugar, cuyo porcentaje de ataque aumentó un 19 % respecto al trimestre anterior. Los sitios web de marketing y publicidad les siguieron de cerca en tercer lugar, si bien apenas hubo cambios en su porcentaje de ataques.

Principales sectores objetivo de ataques DDoS HTTP (porcentaje de ataques de tráfico sobre el tráfico total de todos los sectores)

Sin embargo, si nos fijamos en la cantidad de ataques de tráfico en relación con todo el tráfico de un sector determinado, las cifras muestran un panorama diferente. El trimestre pasado, las organizaciones sin ánimo de lucro fueron las más afectadas. Los ataques DDoS HTTP representaron el 12 % del tráfico dirigido a estas organizaciones. Cloudflare protege a más de 2271 organizaciones sin ánimo de lucro en 111 países como parte del proyecto Galileo, que celebró su noveno aniversario este año . En los últimos meses, una media de 67,7 millones de ciberataques se dirigieron diariamente a este tipo de organizaciones.

En general, la cantidad de ataques DDoS contra organizaciones sin ánimo de lucro se alzó un 46 %, con lo que el porcentaje de ataques de tráfico alcanzó el 17,6 %. Sin embargo, a pesar de este crecimiento, el sector de la consultoría de gestión saltó al primer puesto teniendo en cuenta que los ataques DDoS representaron un 18,4 % de su tráfico.

Principales sectores objetivo de ataques DDoS HTTP (porcentaje de ataque de tráfico sobre el tráfico total por sector)

Cuando descendemos por las capas del modelo OSI, observamos que las redes de Internet más afectadas pertenecían a los sectores de las tecnologías de la información y los servicios. Casi uno de cada tres bytes dirigidos a estos sectores formaban parte de ataques DDoS a las capas 3 y 4.

Sorprendentemente, las empresas del sector de la música fueron el segundo mayor blanco de ataques, seguidas por el sector de medios audiovisuales, y la industria aeronáutica y aeroespacial.

		<figcaption


AsLongAsYouWant => 'Pas besoin de vous presser, il n\'y a pas de limite de temps!';

  @override
  String get coordinatesShowCoordinates => 'Afficher les coordonnées';

  @override
  String get coordinatesShowCoordsOnAllSquares => 'Coordonnées sur chaque case';

  @override
  String get coordinatesShowPieces => 'Afficher les pièces';

  @override
  String get coordinatesStartTraining => 'Démarrer l\'entrainement';

  @override
  String get coordinatesFindSquare => 'Trouver la case';

  @override
  String get coordinatesNameSquare => 'Nommer la case';

  @override
  String get coordinatesPracticeOnlySomeFilesAndRanks => 'Entraînement rangées/colonnes';

  @override
  String get patronDonate => 'Faire un don';

  @override
  String get patronLichessPatron => 'Mécène Lichess';

  @override
  String get patronBecomePatron => 'Devenir un mécène de Lichess';

  @override
  String perfStatPerfStats(String param) {
    return 'Statistiques en $param';
  }

  @override
  String get perfStatViewTheGames => 'Voir les parties';

  @override
  String get perfStatProvisional => 'provisoire';

  @override
  String get perfStatNotEnoughRatedGames => 'Il n\'y a pas assez de parties classées pour établir un classement fiable.';

  @override
  String perfStatProgressOverLastXGames(String param) {
    return 'Changement après les $param dernières parties :';
  }

  @override
  String perfStatRatingDeviation(String param) {
    return 'Écart-type du classement : $param.';
  }

  @override
  String perfStatRatingDeviationTooltip(String param1, String param2, String param3) {
    return 'Une valeur plus faible indique un classement plus fiable. Au-delà de $param1, le classement est considéré comme provisoire. Pour être inclus dans les classements, cette valeur doit être inférieure à $param2 (échecs standards) ou $param3 (variantes).';
  }

  @override
  String get perfStatTotalGames => 'Nombre total de parties';

  @override
  String get perfStatRatedGames => 'Parties classées';

  @override
  String get perfStatTournamentGames => 'Parties de tournoi';

  @override
  String get perfStatBerserkedGames => 'Parties berserkées';

  @override
  String get perfStatTimeSpentPlaying => 'Temps passé à jouer';

  @override
  String get perfStatAverageOpponent => 'Classement moyen des adversaires';

  @override
  String get perfStatVictories => 'Victoires';

  @override
  String get perfStatDefeats => 'Défaites';

  @override
  String get perfStatDisconnections => 'Déconnexions';

  @override
  String get perfStatNotEnoughGames => 'Pas assez de parties jouées';

  @override
  String perfStatHighestRating(String param) {
    return 'Meilleur classement atteint : $param';
  }

  @override
  String perfStatLowestRating(String param) {
    return 'Plus bas classement atteint : $param';
  }

  @override
  String perfStatFromXToY(String param1, String param2) {
    return 'de $param1 à $param2';
  }

  @override
  String get perfStatWinningStreak => 'Victoires consécutives';

  @override
  String get perfStatLosingStreak => 'Défaites consécutives';

  @override
  String perfStatLongestStreak(String param) {
    return 'Série la plus longue : $param';
  }

  @override
  String perfStatCurrentStreak(String param) {
    return 'Série actuelle : $param';
  }

  @override
  String get perfStatBestRated => 'Meilleures victoires classées';

  @override
  String g


a1b.w	;Mode Delai,50 Pre_division

	rte

timerb_init	move.w	#$2100,sr
	sf	$fffffa1b.w
	stop	#$2100		;2 Raster_lignes
	movem.l	d0-a6,-(sp)
	stop	#$2100		;Pour la Syncro

	move.w	#$2700,sr		;On Coupe Tout

	movem.l	noir,d0-d7
	movem.l	d0-d7,$ffff8240.w	;40

	moveq	#8,d2
.att1	dbra	d2,.att1
	moveq	#10,d2

	move.b	#0,$ffff820a.w	;60Hz
.att2	dbra	d2,.att2	;Tempo
	move.b	#2,$ffff820a.w	;50Hz

	moveq	#15,d2
.att	dbra	d2,.att

	tst.b	$ffff8209.w
	bne.s	.h2
	addq.b	#1,mm1+3
	movem.l	(sp)+,d0-a6
	bclr	#0,$fffffa0f.w
	rte

.h2	move.w	#1,trouve
	movem.l	(sp)+,d0-a6
	bclr	#0,$fffffa0f.w
	rte

hbl_init	rte

full	move.w	#$2100,sr
	sf	$fffffa1b.w
	stop	#$2100		;2 Raster_lignes
	movem.l	d0-a6,-(sp)
	stop	#$2100		;Pour la Syncro

	move.w	#$2700,sr		;On Coupe Tout

	movem.l	noir,d0-d5/a0-a1
	movem.l	d0-d5/a0-a1,$ffff8240.w	;40

	moveq	#8,d2
.att1	dbra	d2,.att1
	moveq	#10,d2

	move.b	#0,$ffff820a.w	;60Hz
.att2	dbra	d2,.att2	;Tempo
	move.b	#2,$ffff820a.w	;50Hz

.syncro	move.b	$ffff8209.w,d2
	beq.s	.syncro
	neg	d2
	lsr	d2,d2

	lea	ligne_230,a0
	move.l	add_table,a1	;8

	rept	73-8-2-6
	nop
	endr

	move.w	(a1)+,d0		;2
	jsr	(a0,d0.w)		;6	;rts 4

	move.w	(a1)+,d0		;2
	jsr	(a0,d0.w)		;6	;rts 4

	move.w	(a1)+,d0		;2
	jsr	(a0,d0.w)		;6	;rts 4

	move.w	(a1)+,d0		;2
	jsr	(a0,d0.w)		;6	;rts 4

	move.w	(a1)+,d0		;2
	jsr	(a0,d0.w)		;6	;rts 4

	move.w	(a1)+,d0		;2
	jsr	(a0,d0.w)		;6	;rts 4

	move.w	(a1)+,d0		;2
	jsr	(a0,d0.w)		;6	;rts 4

	rept	8-4
	nop
	endr

	move.w	a5,(a5)	; haute resolution
	nop
	move.b	d7,(a5)	; basse resolution

	movem.l	b_col,d0-d5/a0-a1
	movem.l	d0-d5/a0-a1,$ffff8240.w	;40

auto_col	move.w	#couleur_te


) > 0 {
		for iNdEx := len(m.Verbs) - 1; iNdEx >= 0; iNdEx-- {
			i -= len(m.Verbs[iNdEx])
			copy(dAtA[i:], m.Verbs[iNdEx])
			i = encodeVarintGenerated(dAtA, i, uint64(len(m.Verbs[iNdEx])))
			i--
			dAtA[i] = 0xa
		}
	}
	return len(dAtA) - i, nil
}

func (m *ResourceAttributes) Marshal() (dAtA []byte, err error) {
	size := m.Size()
	dAtA = make([]byte, size)
	n, err := m.MarshalToSizedBuffer(dAtA[:size])
	if err != nil {
		return nil, err
	}
	return dAtA[:n], nil
}

func (m *ResourceAttributes) MarshalTo(dAtA []byte) (int, error) {
	size := m.Size()
	return m.MarshalToSizedBuffer(dAtA[:size])
}

func (m *ResourceAttributes) MarshalToSizedBuffer(dAtA []byte) (int, error) {
	i := len(dAtA)
	_ = i
	var l int
	_ = l
	i -= len(m.Tenant)
	copy(dAtA[i:], m.Tenant)
	i = encodeVarintGenerated(dAtA, i, uint64(len(m.Tenant)))
	i--
	dAtA[i] = 0x42
	i -= len(m.Name)
	copy(dAtA[i:], m.Name)
	i = encodeVarintGenerated(dAtA, i, uint64(len(m.Name)))
	i--
	dAtA[i] = 0x3a
	i -= len(m.Subresource)
	copy(dAtA[i:], m.Subresource)
	i = encodeVarintGenerated(dAtA, i, uint64(len(m.Subresource)))
	i--
	dAtA[i] = 0x32
	i -= len(m.Resource)
	copy(dAtA[i:], m.Resource)
	i = encodeVarintGenerated(dAtA, i, uint64(len(m.Resource)))
	i--
	dAtA[i] = 0x2a
	i -= len(m.Version)
	copy(dAtA[i:], m.Version)
	i = encodeVarintGenerated(dAtA, i, uint64(len(m.Version)))
	i--
	dAtA[i] = 0x22
	i -= len(m.Group)
	copy(dAtA[i:], m.Group)
	i = encodeVarintGenerated(dAtA, i, uint64(len(m.Group)))
	i--
	dAtA[i] = 0x1a
	i -= len(m.Verb)
	copy(dAtA[i:], m.Verb)
	i = encodeVarintGenerated(dAtA, i, uint64(len(m.Verb)))
	i--
	dAtA[i] = 0x12
	i -= len(m.Namespace)
	copy(dAtA[i:], m.Namespace)
	i = encodeVarintGenerated(dAtA, i, uint64(len(m.Namespace)))
	i--
	dAtA[i] = 0xa
	return len(dAtA) - i, nil
}

func (m *ResourceRule) Marshal() (dAtA []byte, err error) {
	size := m.Size()
	dAtA = make([]byte, size)
	n, err := m.MarshalToSizedBuffer(dAtA[:size])
	if err != nil {
		return nil, err
	}
	return dAtA[:n], nil
}

func (m *ResourceRule) MarshalTo(dAtA []byte) (int, error) {
	size := m.Size()
	return m.MarshalToSizedBuffer(dAtA[:size])
}

func (m *ResourceRule) MarshalToSizedBuffer(dAtA []byte) (int, error) {
	i := len(dAtA)
	_ = i
	var l int
	_ = l
	if len(m.ResourceNames) > 0 {
		for iNdEx := len(m.ResourceNames) - 1; iNdEx >= 0; iNdEx-- {
			i -= len(m.ResourceNames[iNdEx])


47-3.86L1.05 3.996l5 5 5-5%22 fill=%22%23222%22/%3E %3C/svg%3E");background-position:100% 50%;background-repeat:no-repeat;opacity:0.85}.vectorMenu h3:hover span,.vectorMenu h3:focus span{color:#222222}.vectorMenu h3:hover span:after,.vectorMenu h3:focus span:after{opacity:1}.vectorMenu .menu{list-style:none none;background-color:#ffffff;clear:both;min-width:100%;position:absolute;top:2.5em;left:-1px;margin:0;border:1px solid #a2a9b1;border-top-width:0;padding:0;box-shadow:0 1px 1px 0 rgba(0,0,0,0.1);text-align:left;display:none;z-index:2}.vectorMenu:hover .menu{display:block}.vectorMenu .vectorMenuCheckbox:checked ~ .menu{display:block}.vectorMenu ul{list-style:none none;padding:0;margin:0;text-align:left}.vectorMenu li{padding:0;margin:0;text-align:left;line-height:1em}.vectorMenu li a{display:block;padding:0.625em;white-space:nowrap;color:#0645ad;cursor:pointer;font-size:0.8125em}.vectorMenu li.selected a,.vectorMenu li.selected a:visited{color:#222;text-decoration:none}#mw-head .vectorMenu h3{float:left;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAuCAIAAABmjeQ9AAAAQ0lEQVR4AWVOhQEAIAzC/X+xAXbXeoDFGA3A9yk1n4juBROcUegfarWjP3ojZvEzxs6j+nygmo+zzsk79nY+tOxdEhlf3UHVgUFrVwAAAABJRU5ErkJggg==);background-image:url("en.wikipedia.org/w/skins/Vector/images/tab-break.png")!ie;background-repeat:no-repeat;background-position:bottom right;font-size:1em;height:2.5em;padding:0 0.5em 0 0;margin:0 -1px 0 0}.vectorMenuCheckbox{cursor:pointer;position:absolute;top:0;left:0;z-index:1;opacity:0;width:100%;height:100%;margin:0;padding:0;display:none}:not(:checked) > .vectorMenuCheckbox{display:block}.vectorMenuCheckbox:checked + h3 span:after{transform:scaleY(-1)}.vectorMenuCheckbox:focus + h3{outline:dotted 1px;outline:auto -webkit-focus-ring-color}@-webkit-keyframes rotate{from{-webkit-transform:rotate(0deg);-moz-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(360deg);-moz-transform:rotate(360deg);transform:rotate(360deg)}}@-moz-keyframes rotate{from{-webkit-transform:rotate(0deg);-moz-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(360deg);-moz-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes rotate{from{-webkit-transform:rotate(0deg);-moz-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(360deg);-moz-transform:rotate(360deg);transform:rotate(360deg)}}.vectorTabs #ca-unwatch.icon a,.vectorTabs #ca-watch.ico


alRule("INTEGER", "0b[01]+|0[0-7]+|[1-9][0-9]*|0x[0-9a-fA-F]+", false,
            ConstantAsmType.instance()),
        terminalRuleTypeString("COLON", ":", false),
        terminalRuleTypeString("PLUS", "+", true),
        terminalRuleTypeString("MINUS", "-", false),
        terminalRuleTypeString("TILDE", "~", false),
        terminalRuleTypeString("SLASH", "/", false),
        terminalRuleTypeString("BACKSLASH", "\\\\", false),
        terminalRuleTypeString("LPAREN", "(", true),
        terminalRuleTypeString("RPAREN", ")", true),
        terminalRuleTypeString("LBRAC", "[", true),
        terminalRuleTypeString("RBRAC", "]", true),
        terminalRuleTypeString("LCURLY", "{", true),
        terminalRuleTypeString("RCURLY", "}", true),
        terminalRuleTypeString("STAR", "*", true),
        terminalRuleTypeString("DOT", ".", true),
        terminalRuleTypeString("COMMA", ",", false),
        terminalRuleTypeString("DOLLAR", "$", true),
        terminalRuleTypeString("EQUAL", "=", false),
        terminalRuleTypeString("EQUALEQUAL", "==", false),
        terminalRuleTypeString("PIPE", "|", true),
        terminalRuleTypeString("PIPEPIPE", "||", true),
        terminalRuleTypeString("CARET", "^", true),
        terminalRuleTypeString("AMP", "&", false),
        terminalRuleTypeString("AMPAMP", "&&", false),
        terminalRuleTypeString("EXCLAIM", "!", false),
        terminalRuleTypeString("EXCLAIMEQUAL", "!=", false),
        terminalRuleTypeString("PERCENT", "%", false),
        terminalRuleTypeString("HASH", "#", false),
        terminalRuleTypeString("LESS", "<", false),
        terminalRuleTypeString("LESSEQUAL", "<=", false),
        terminalRuleTypeString("LESSLESS", "<<", false),
        terminalRuleTypeString("LESSGREATER", "<>", false),
        terminalRuleTypeString("GREATER", ">", false),
        terminalRuleTypeString("GREATEREQUAL", ">=", false),
        terminalRuleTypeString("GREATERGREATER", ">>", false),
        terminalRuleTypeString("AT", "@", false),
        terminalRuleTypeString("MINUSGREATER", "->", false),
        terminalRule("EOL", "\\r\\n?|\\n", true, VoidAsmType.instance()),
        nonTerminalRule("Statement", InstructionAsmType.instance(), false, instructionRule(),
            ruleReference("EOL", VoidAsmType.instance())),
        nonTerminalRule("Register", RegisterAsmType.instance(),
            false, ruleReference("IDENTIFIER", StringAsmType.instance())),
        nonTerminalRule("ImmediateOperand", OperandAsmType.instance(), false,
            ruleReference("Expression")),
        nonTerminalRule("Identifier", null, false, ruleReference("IDENTIFIER")),
        nonTerminalRule("Expression", ExpressionAsmType.instance(), true,
            ruleReference("Expression")),
        nonTerminalRule("Instruction", InstructionAsmType.instance(), true,
            ruleReference("Instruction")),
        integerRule(),
        nonTerminalRule("Natural", ConstantAsmType.instance(), false,
            ruleReference("INTEGER", ConstantAsmType.instance())),
        nonTerminalRule("Label", SymbolAsmType.instance(), false,
            ruleReference("Identifier", StringAsmType.instance()))
    ));
  }

  /**
   * Defines a function that negates a 64-bit integer.
   * This function is used in the default grammar rules to be able to parse negative constants.
   *
   * @return a function definition that negates a 64-bit integer
   */
  public static FunctionDefinition asmNegFunctionDefinition() {
    return new FunctionDefinition(
        new Identifier(


edEncoding").handler { ctx ->
                ctx.put(HttpHeader.CONTENT_LENGTH, "32").end("test no chunked encoding success")
            }
            .router().get("/testCompressedContent").handler { ctx ->
                ctx.put(HttpHeader.CONTENT_ENCODING, ContentEncoding.GZIP.value)
                    .write("测试压缩内容：")
                    .write(
                        mutableListOf(
                            BufferUtils.toBuffer("跳过", StandardCharsets.UTF_8),
                            BufferUtils.toBuffer("跳过", StandardCharsets.UTF_8),
                            BufferUtils.toBuffer("今天，", StandardCharsets.UTF_8),
                            BufferUtils.toBuffer("非常愉快的", StandardCharsets.UTF_8),
                            BufferUtils.toBuffer("搞定了这个功能。", StandardCharsets.UTF_8)
                        ), 2, 3
                    )
                    .end()
            }
            .router().get("/echo0").handler { it.end("ok") }
            .timeout(120 * 1000L)
            .listen(address)
    }

    @AfterEach
    fun destroy() {
        val time = measureTimeMillis {
            httpServer.stop()
        }
        println("shutdown time: $time ms")
    }

    @Test
    @DisplayName("should send the HTTP request no content successfully")
    fun testNoContent() = runBlocking {
        val httpClient = HttpClientFactory.create()
        val count = 100

        val time = measureTimeMillis {
            val futures =
                (1..count).map { httpClient.get("http://${address.hostName}:${address.port}/testHttpClient").submit() }
            CompletableFuture.allOf(*futures.toTypedArray()).await()
            val allDone = futures.all { it.isDone }
            assertTrue(allDone)

            val response = futures[0].await()

            assertEquals(HttpStatus.OK_200, response.status)
            assertEquals(14L, response.contentLength)
            assertEquals("test client ok", response.stringBody)

            assertEquals(2, response.cookies.size)
            assertEquals("value1", response.cookies.filter { it.name == "cookie1" }.map { it.value }[0])
            assertEquals("value2", response.cookies.filter { it.name == "cookie2" }.map { it.value }[0])

        }

        val throughput = count / (time / 1000.00)
        println("success. $time ms, ${throughput.roundToLong()} qps")
        httpClient.stop()
    }

    @Test
    @DisplayName("should send the HTTP request with content using chucked encoding successfully")
    fun testContentWithChunkedEncoding() = runBlocking {
        val httpClient = HttpClientFactory.create()

        val data = ByteBuffer.wrap(content.toByteArray(StandardCharsets.UTF_8))
        println("data length: ${data.remaining()}")
        val response = httpClient
            .post("http://${address.hostName}:${address.port}/testChunkedEncoding")
            .contentProvider(MockChunkByteBufferContentProvider(data)).submit().await()

        assertEquals(HttpStatus.OK_200, response.status)
        assertEquals("test chunked encoding success", response.stringBody)

        httpClient.stop()
    }

    @Test
    @DisplayName("should send the HTTP request with content and content length successfully")
    fun testContentWithoutChunkedEncoding() = runBlocking {
        val httpClient = HttpClientFactory.create()

        (1..10).map {
            val data = ByteBuffer.wrap(content.toByteArray(StandardCharsets.UTF_8))
            val length = data.remaining()
            println("data length: $length")
            httpClient.post("http://${address.hostName}:${address.port}/testNoChunkedEncoding")
                .contentProvider(ByteBufferContentProvider(data))
                .submit()
        }.forEach {
            val response = it.await()
            asse


).\n")
    else
        request_mode(MODE.M, "M")
        old_value = camera.aperture.raw
        printf("Setting aperture to random values...\n")
        for k = 1,100 do
            local method = math.random(1,3)
            local d = nil
            local extra_tol = 0
            if method == 1 then
                local av = math.random(round(camera.aperture.min.value*10), round(camera.aperture.max.value*10)) / 10
                if math.random(1,2) == 1 then
                    camera.aperture.value = av
                else
                    camera.aperture = av
                end
                d = math.abs(math.log(camera.aperture.value,2) - math.log(av,2)) * 2
                -- when checking the result, allow a larger difference (0.1 units) - see note below
                extra_tol = math.abs(math.log(av,2) - math.log(av-0.1,2)) * 2
            elseif method == 2 then
                local apex = math.random(round(camera.aperture.min.apex*100), round(camera.aperture.max.apex*100)) / 100
                camera.aperture.apex = apex
                d = math.abs(camera.aperture.apex - apex)
            elseif method == 3 then
                local raw = math.random(camera.aperture.min.raw, camera.aperture.max.raw)
                camera.aperture.raw = raw
                d = math.abs(camera.aperture.raw - raw) / 8
            end

            -- difference between requested and actual aperture should be max 1.5/8 EV
            -- note: when using F-numbers, the difference may be larger, because of the rounding done
            -- to match Canon values (e.g. raw 48 would be f/5.66 (f/5.7), instead of Canon's f/5.6)
            if (d > 1.5/8 + extra_tol) then
                printf("Error: aperture delta %s EV (expected < %s, %s, method=%d)\n", d, 1.5/8 + extra_tol, camera.aperture, method)
            end

            -- aperture and Av (APEX) should be consistent
            local expected_apex = math.log(camera.aperture.value, 2) * 2
            if math.abs(expected_apex - camera.aperture.apex) > 0.2 then
                printf("Error: aperture %s != Av%s, expected %s\n", camera.aperture.value, camera.aperture.apex, expected_apex)
            end

            -- setting aperture to the same value, using any method (value,apex,raw)
            -- should not change anything
            for i,field in pairs{"value","apex","raw"} do
                local current = {}
                current.apex  = camera.aperture.apex
                current.value = camera.aperture.value
                current.raw   = camera.aperture.raw

                camera.aperture[field] = current[field]

                if camera.aperture.value ~= current.value then
                    printf("Error: aperture set to %s=%s, got %s, expected %s\n", field, current[field], camera.aperture.value, current.value)
                end
                if camera.aperture.apex ~= current.apex then
                    printf("Error: aperture set to %s=%s, got Sv%s, expected Sv%s\n", field, current[field], camera.aperture.apex, current.apex)
                end
                if camera.aperture.raw ~= current.raw then
                    printf("Error: aperture set to %s=%s, got %s, expected %s (raw)\n", field, current[field], camera.aperture.raw, current.raw)
                end
            end
        end
        camera.aperture.raw = old_value
    end

    request_mode(MODE.AV,


}

  passStructInlineArray100Bytes_a0 = a0;

  final result = passStructInlineArray100BytesCalculateResult();

  print("result = $result");

  return result;
}

void passStructInlineArray100BytesAfterCallback() {
  final result = passStructInlineArray100BytesCalculateResult();

  print("after callback result = $result");

  Expect.equals(5050, result);
}

typedef PassStructStruct16BytesHomogeneousFloat2x5Type =
    Float Function(
      StructStruct16BytesHomogeneousFloat2,
      StructStruct16BytesHomogeneousFloat2,
      StructStruct16BytesHomogeneousFloat2,
      StructStruct16BytesHomogeneousFloat2,
      StructStruct16BytesHomogeneousFloat2,
    );

// Global variables to be able to test inputs after callback returned.
StructStruct16BytesHomogeneousFloat2
passStructStruct16BytesHomogeneousFloat2x5_a0 =
    Pointer<StructStruct16BytesHomogeneousFloat2>.fromAddress(0).ref;
StructStruct16BytesHomogeneousFloat2
passStructStruct16BytesHomogeneousFloat2x5_a1 =
    Pointer<StructStruct16BytesHomogeneousFloat2>.fromAddress(0).ref;
StructStruct16BytesHomogeneousFloat2
passStructStruct16BytesHomogeneousFloat2x5_a2 =
    Pointer<StructStruct16BytesHomogeneousFloat2>.fromAddress(0).ref;
StructStruct16BytesHomogeneousFloat2
passStructStruct16BytesHomogeneousFloat2x5_a3 =
    Pointer<StructStruct16BytesHomogeneousFloat2>.fromAddress(0).ref;
StructStruct16BytesHomogeneousFloat2
passStructStruct16BytesHomogeneousFloat2x5_a4 =
    Pointer<StructStruct16BytesHomogeneousFloat2>.fromAddress(0).ref;

// Result variable also global, so we can delete it after the callback.
double passStructStruct16BytesHomogeneousFloat2x5Result = 0.0;

double passStructStruct16BytesHomogeneousFloat2x5CalculateResult() {
  double result = 0;

  result += passStructStruct16BytesHomogeneousFloat2x5_a0.a0.a0;
  result += passStructStruct16BytesHomogeneousFloat2x5_a0.a1[0].a0;
  result += passStructStruct16BytesHomogeneousFloat2x5_a0.a1[1].a0;
  result += passStructStruct16BytesHomogeneousFloat2x5_a0.a2;
  result += passStructStruct16BytesHomogeneousFloat2x5_a1.a0.a0;
  result += passStructStruct16BytesHomogeneousFloat2x5_a1.a1[0].a0;
  result += passStructStruct16BytesHomogeneousFloat2x5_a1.a1[1].a0;
  result += passStructStruct16BytesHomogeneousFloat2x5_a1.a2;
  result += passStructStruct16BytesHomogeneousFloat2x5_a2.a0.a0;
  result += passStructStruct16BytesHomogeneousFloat2x5_a2.a1[0].a0;
  result += passStructStruct16BytesHomogeneousFloat2x5_a2.a1[1].a0;
  result += passStructStruct16BytesHomogeneousFloat2x5_a2.a2;
  result += passStructStruct16BytesHomogeneousFloat2x5_a3.a0.a0;
  result += passStructStruct16BytesHomogeneousFloat2x5_a3.a1[0].a0;
  result += passStructStruct16BytesHomogeneousFloat2x5_a3.a1[1].a0;
  result += passStructStruct16BytesHomogeneousFloat2x5_a3.a2;
  result += passStructStruct16BytesHomogeneousFloat2x5_a4.a0.a0;
  result += passStructStruct16BytesHomogeneousFloat2


String, MutableList<StyleRule>>()
  private val htmlParserThreadLocal = ThreadLocal<HtmlParser>()

  init {
    rule(StyleRule.tagRule("p"))
    rule(StyleRule.tagRule("div"))
    rule(StyleRule.tagRule("br").just("\n"))

    rule(StyleRule.tagRule("s").link(PostLinkable.Type.SPOILER))
    rule(StyleRule.tagRule("b").bold())
    rule(StyleRule.tagRule("i").italic())
    rule(StyleRule.tagRule("em").italic())

    rule(StyleRule.tagRule("pre")
      .withCssClass("prettyprint")
      .monospace()
      .size(sp(12f))
      .backgroundColorId(ChanThemeColorId.BackColorSecondary)
      .foregroundColorId(ChanThemeColorId.TextColorPrimary)
    )

    rule(StyleRule.tagRule("span")
      .withCssClass("spoiler")
      .link(PostLinkable.Type.SPOILER)
    )

    rule(StyleRule.tagRule("span").withCssClass("abbr").nullify())
    rule(StyleRule.tagRule("span").foregroundColorId(ChanThemeColorId.PostInlineQuoteColor).linkify())

    rule(StyleRule.tagRule("strong").bold())
    rule(StyleRule.tagRule("strong-red;").bold().foregroundColorId(ChanThemeColorId.AccentColor))
  }

  open fun parseComment(
    commentRaw: String
  ): Spanned? {
    val total = SpannableStringBuilder()

    try {
      val htmlParser = htmlParserThreadLocal.getOrSet { HtmlParser() }

      val document = htmlParser.parse(commentRaw.replace("<wbr>", ""))
      val nodes = document.nodes

      nodes.forEach { node ->
        total.append(parseNode(node))
      }

    } catch (e: Throwable) {
      Logger.e(TAG, "Error parsing comment html", e)
      return null
    }

    return total
  }

  private fun parseNode(
    node: HtmlNode
  ): Spanned {
    if (node is HtmlNode.Text) {
       return SpannableString(node.text)
    }

    if (node is HtmlNode.Tag) {
      val htmlTag = node.htmlTag
      var nodeName = htmlTag.tagName
      val styleAttr = htmlTag.attrOrNull("style")

      if (styleAttr != null && styleAttr.isNotEmpty() && nodeName != "span") {
        nodeName = nodeName + '-' + styleAttr.split(":".toRegex()).toTypedArray()[1].trim()
      }

      val innerNodes = htmlTag.children
      val texts: MutableList<CharSequence> = ArrayList(innerNodes.size + 1)

      innerNodes.mapNotNullTo(texts) { parseNode(it) }

      val allInnerText = TextUtils.concat(*texts.toTypedArray())

      val result: CharSequence? = handleTag(
        nodeName,
        allInnerText,
        htmlTag
      )

      return SpannedString.valueOf(result ?: allInnerText)
    }

    Logger.e(TAG, "Unknown node instance: " + node.javaClass.name)
    return SpannedString.valueOf("")
  }

  private fun handleTag(
    tag: String,
    text: CharSequence,
    htmlTag: HtmlTag
  ): CharSequence? {
    val rules = rules[tag]
      ?: return text
    val forceHttpsScheme = ChanSettings.forceHttpsUrlScheme.get()

    for (i in 0..1) {
      val highPriority = i == 0

      for (rule in rules) {
        if (rule.highPriority() == highPriority && rule.applies(htmlTag)) {
          val params = StyleRulesParamsBuilder()
            .withText(text)
            .withHtmlTag(htmlTag)
            .forceHttpsScheme(forceHttpsScheme)
            .build()

          return rule.apply(params)
        }
      }
    }

    // Unknown tag, return the text;
    return text
  }


1588"]
L69_1 = "__super__"
L69_1 = _ENV["CD196F6E832051588"]["prototype"]
L70_1 = {}
L71_1 = "__index"


# Dependencies
```
pip install -r requirements.txt
```

# Dataset Download

Download training and testing images from [[here](https://drive.google.com/drive/folders/1o_M3p8OLURm4wo8pcD0EQclH6feyXlcm?usp=drive_link)]

# Dataset Explanations
Suppose we are translating clear images to rainy images, then we should put images under /path_to_your_dataset/ like this.

```
A: source images (e.g., clear images)
B: target images (e.g., rainy images)
S: sem. seg. maps of A
T: sem. seg. maps of B
```

# Dataset Folder Structure
```
/path_to_your_dataset/
    ├── trainA
    ├── trainB
    ├── trainS
    ├── trainT
    ├── testA
    ├── testB
    ├── testS
    ├── testT
```

## NOTE1: Avoiding Empty Test Folders
testS and testT is not used for training or testing. However, make sure to include images in the testS and testT folders to prevent them from being empty, as an empty folder cause error during training and testing.

In convenience, we suggest that you use the following command to avoid empty folder.
```
cp -r testA testS
cp -r testB testT
```

## NOTE2: Obtaining Semantic Segmentation Maps
As ground truth semantic segmentation maps are not available for BDD100K, we estimate these maps using the [[ConvNeXt-XL](https://github.com/open-mmlab/mmsegmentation/tree/main/configs/convnext)] model from the [[MMSegmentation](https://github.com/open-mmlab/mmsegmentation/)] toolbox. If you are working with a dataset like [[Cityscapes](https://www.cityscapes-dataset.com/)] which already includes ground truth semantic segmentation maps, the semantic guidance can be expected to be more effective.

# Training from scratch
Run in terminal.
```
bash train.sh
```

# Testing with pretrained model
1. Download the checkpoints from [[here](https://drive.google.com/drive/folders/1CsQ1yssNl_WULkwkT8_zz6-j4D56Gfv8?usp=drive_link)]

2. Unzip the checkpoints.

3. Create folder `bdd100k_1_20`, `INIT`, and `boreas_snowy` under `./checkpoints` like below.

```
/TPSeNCE/
    ├── checkpoints
    │   ├── bdd100k_1_20                       (clear2rainy)
    │   ├── INIT                               (clear2rainy)
    |   ├── boreas_snowy                       (clearsnowy)
    |   ├── bdd100k_7_19_night_tri_sem         (day2night)
    |   ├── bdd100k_7_20_snowy_tri_sem         (clear2snowy)
```

4. Run in terminal
```
bash test.sh
```

# Deraining Experiments

1. Choose one of the deraining methods below:
（1）[EffDerain](https://github.com/tsingqguo/efficientderain)
（2）[VRGNet](https://github.com/hongwang01/VRGNet)
（3）[PreNet](https://github.com/csdwren/PReNet)
（4）[SAPNet](https://github.com/ShenZheng2000/SAPNet-for-image-deraining)

2. Use TPSeNCE with checkpoint `bdd100k_1_20