 = SetsCC(x->opcode());
  }
}

 void CodeGen::LenIntrinsic(Expr* var) {
  // The caller emits the operand push.
  // Ugly: build an argument list from the array
  List<Expr*> *args = List<Expr*>::New(proc_);
  args->Append(var);
  Intrinsic* fun = SymbolTable::universe()->LookupOrDie("len")->AsIntrinsic();
  Intrinsic::CFunction target = Intrinsics::TargetFor(proc_, fun, args);
  emit_op(fun->can_fail() ? callc : callcnf);
  emit_ptr((const void*)target);
}

void CodeGen::DoCall(Call* x) {
  Trace t(&tlevel_, "(Call");
  const List<Expr*>* args = x->args();
  if (x->fun()->AsIntrinsic() != NULL) {
    Intrinsic* fun = x->fun()->AsIntrinsic();

    // handle some special intrinsics
    // (typically require special argument handling)
    if (fun->kind() == Intrinsic::DEBUG) {
      // DEBUG() is very special.
      // we know we have at least one argument and that it is a string literal
      string cmd = args->at(0)->as_string()->cpp_str(proc_);
      if (cmd == "print") {
        // for debugging: print values
        if (args->length() > 1  && args->at(1)->type()->is_string()) {
          // push args in reverse order, leaving format string at TOS
          { StackMark sm(this);  // fd_print consumes the arguments
            for (int i = args->length(); --i >= 1; )
              Load(args->at(i), false);
            // push file descriptor
            PushInt(1);
          }
          emit_op(fd_print);
          return;
        }
      }
      if (cmd == "ref") {
        // for debugging: print ref count of a value
        Load(args->at(1), false);
        emit_op(debug_ref);
        return;
      }
      Unimplemented();
      return;
    }

    if (fun->kind() == Intrinsic::DEF) {
      { TrapHandler handler(this, ftarget(), NULL, true, args->at(0));
        // evaluate expr & throw away result
        Load(args->at(0), false);
        Pop(args->at(0)->type());
      }
      // if we reach this point, the expression was defined
      PushBool(true);
      return;
    }

    if (fun->kind() == Intrinsic::INPROTO ||
        fun->kind() == Intrinsic::CLEARPROTO) {
      // because the argument is a selector, the
      // selector's variable type (t) must be a tuple
      Selector* s = args->at(0)->AsSelector();
      TupleType* t = s->var()->type()->as_tuple();
      assert(t != NULL);
      // compute the bit offset i for the inproto bit
      // in the tuple's bit vector (following the fields)
      int i = t->inproto_index(s->field());
      // customize based on intrinsic
      bool is_inproto = (fun->kind() == Intrinsic::INPROTO);
      bool make_unique = !is_inproto;
      Opcode op = is_inproto ? ftestB : fclearB;
      // emit code
      Load(s->var(), make_unique);
      emit_op(op);
      emit_int32(i);
      return;
    }

    if (fun->kind() == Intrinsic::UNDEFINE) {
      Variable* v = args->at(0)->AsVariable();
      assert(v != NULL);
      SetBP(v->level());
      emit_op(undefine);
      emit_int16(var_index(v->offset()));
      return;
    }

    if (fun->kind() == Intrinsic::SORT ||
        fun->kind() == Intrinsic::SORTX) {
      // TODO: we could put this in TargetFor and have two
      // non-variadic C functions.


[r5, #1764]
	bl	printk
	mov	r3, #1
	str	r3, [r5, #-3612]
.L2593:
	mov	r0, #0
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L2592:
	ldrh	r2, [r8, #8]
	cmp	r2, r3
	bne	.L2594
	ldrh	r2, [r8]
	ldrh	r3, [r4, #4]
	cmp	r2, r3
	bne	.L2594
	ldr	r2, [r5, #1768]
	mov	r1, r7
	mov	r0, r4
	bl	FtlMapWritePage
.L2591:
	add	r6, r6, #1
	b	.L2590
.L2601:
	.align	2
.L2600:
	.word	.LANCHOR0
	.word	.LANCHOR2
	.word	.LANCHOR2+1760
	.word	.LC133
	.fnend
	.size	ftl_map_blk_gc, .-ftl_map_blk_gc
	.align	2
	.global	Ftl_write_map_blk_to_last_page
	.syntax unified
	.arm
	.fpu softvfp
	.type	Ftl_write_map_blk_to_last_page, %function
Ftl_write_map_blk_to_last_page:
	.fnstart
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	.save {r4, r5, r6, r7, r8, r9, r10, lr}
	ldr	r5, .L2613
	ldr	r6, [r5, #-3612]
	cmp	r6, #0
	bne	.L2603
	ldrh	r3, [r0]
	movw	r2, #65535
	mov	r4, r0
	ldr	r7, [r0, #12]
	cmp	r3, r2
	bne	.L2604
	ldrh	r3, [r0, #8]
	add	r3, r3, #1
	strh	r3, [r0, #8]	@ movhi
	bl	FtlFreeSysBlkQueueOut
	strh	r0, [r7]	@ movhi
	ldr	r3, [r4, #28]
	strh	r6, [r4, #2]	@ movhi
	strh	r6, [r4]	@ movhi
	add	r3, r3, #1
	str	r3, [r4, #28]
.L2603:
	mov	r0, #0
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L2604:
	lsl	r3, r3, #1
	ldr	r8, [r0, #24]
	ldr	r10, .L2613+4
	mov	r1, #255
	ldrh	r9, [r7, r3]
	ldrh	r3, [r0, #2]
	ldr	r7, [r5, #-500]
	orr	r3, r3, r9, lsl #10
	str	r7, [r5, #1772]
	str	r3, [r5, #1764]
	ldr	r3, [r5, #-524]
	str	r3, [r5, #17


value: param
              });
          }
          return new CoderNumber(coerceFunc, size / 8, (match[1] === 'int'), param.name);
      }
      var match = param.type.match(paramTypeBytes);
      if (match) {
          var size = parseInt(match[1]);
          if (size === 0 || size > 32) {
              errors.throwError('invalid bytes length', errors.INVALID_ARGUMENT, {
                  arg: 'param',
                  value: param
              });
          }
          return new CoderFixedBytes(coerceFunc, size, param.name);
      }
      var match = param.type.match(paramTypeArray);
      if (match) {
          var size = parseInt(match[2] || "-1");
          param = properties_1.jsonCopy(param);
          param.type = match[1];
          return new CoderArray(coerceFunc, getParamCoder(coerceFunc, param), size, param.name);
      }
      if (param.type.substring(0, 5) === 'tuple') {
          return getTupleParamCoder(coerceFunc, param.components, param.name);
      }
      if (param.type === '') {
          return new CoderNull(coerceFunc, param.name);
      }
      errors.throwError('invalid type', errors.INVALID_ARGUMENT, {
          arg: 'type',
          value: param.type
      });
      return null;
  }
  var AbiCoder = /** @class */ (function () {
      function AbiCoder(coerceFunc) {
          errors.checkNew(this, AbiCoder);
          if (!coerceFunc) {
              coerceFunc = exports.defaultCoerceFunc;
          }
          properties_1.defineReadOnly(this, 'coerceFunc', coerceFunc);
      }
      AbiCoder.prototype.encode = function (types, values) {
          if (types.length !== values.length) {
              errors.throwError('types/values length mismatch', errors.INVALID_ARGUMENT, {
                  count: { types: types.length, values: values.length },
                  value: { types: types, values: values }
              });
          }
          var coders = [];
          types.forEach(function (type) {
              // Convert types to type objects
              //   - "uint foo" => { type: "uint", name: "foo" }
              //   - "tuple(uint, uint)" => { type: "tuple", components: [ { type: "uint" }, { type: "uint" }, ] }
              var typeObject = null;
              if (typeof (type) === 'string') {
                  typeObject = parseParam(type);
              }
              else {
                  typeObject = type;
              }
              coders.push(getParamCoder(this.coerceFunc, typeObject));
          }, this);
          return bytes_1.hexlify(new CoderTuple(this.coerceFunc, coders, '_').encode(values));
      };
      AbiCoder.prototype.decode = function (types, data) {
          var coders = [];
          types.forEach(function (type) {
              // See encode for details
              var typeObject = null;
              if (typeof (type) === 'string') {
                  typeObject = parseParam(type);
              }
              else {
                  typeObject = properties_1.jsonCopy(type);
              }
              coders.push(getParamCoder(this.coerceFunc, typeObject));
          }, this);
          return new CoderTuple(this.coerceFunc, coders, '_').decode(bytes_1.arrayify(data), 0).value;
      };
      return AbiCoder;
  }());
  exports.AbiCoder = AbiCoder;
  exports.defaultAbiCoder = new AbiCoder();

  },{"./address":144,"./bignumber":145,"./bytes":146,"./errors":147,"./properties":149,"./utf8":152}],144:[function(require,module,exports){
  'use strict';
  var __importDefault = (this && this.__importDefault) || function (mod)


accent-teal .custom-select:focus,.accent-teal .form-control:focus:not(.is-invalid):not(.is-warning):not(.is-valid){border-color:#7eeaca}.accent-teal .page-item .page-link{color:#20c997}.accent-teal .page-item.active .page-link,.accent-teal .page-item.active a{background-color:#20c997;border-color:#20c997;color:#fff}.accent-teal .page-item.disabled .page-link,.accent-teal .page-item.disabled a{background-color:#fff;border-color:#dee2e6;color:#6c757d}.accent-teal [class*=sidebar-dark-] .sidebar a:not(.dropdown-item):not(.btn-app):not(.nav-link):not(.brand-link){color:#c2c7d0}.accent-teal [class*=sidebar-dark-] .sidebar a:not(.dropdown-item):not(.btn-app):not(.nav-link):not(.brand-link):hover{color:#fff}.accent-teal [class*=sidebar-light-] .sidebar a:not(.dropdown-item):not(.btn-app):not(.nav-link):not(.brand-link){color:#15181a}.accent-teal [class*=sidebar-light-] .sidebar a:not(.dropdown-item):not(.btn-app):not(.nav-link):not(.brand-link):hover{color:#212529}.dark-mode.accent-teal .page-item .page-link:focus,.dark-mode.accent-teal .page-item .page-link:hover{color:#26dca6}.accent-cyan .btn-link,.accent-cyan .nav-tabs .nav-link,.accent-cyan a:not(.dropdown-item):not(.btn-app):not(.nav-link):not(.brand-link):not(.page-link):not(.badge):not(.btn){color:#17a2b8}.accent-cyan .btn-link:hover,.accent-cyan .nav-tabs .nav-link:hover,.accent-cyan a:not(.dropdown-item):not(.btn-app):not(.nav-link):not(.brand-link):not(.page-link):not(.badge):not(.btn):hover{color:#0f6674}.accent-cyan .dropdown-item.active,.accent-cyan .dropdown-item:active{background-color:#17a2b8;color:#fff}.accent-cyan .custom-control-input:checked~.custom-control-label::before{background-color:#17a2b8;border-color:#0c525d}.accent-cyan .custom-control-input:checked~.custom-control-label::after{background-image:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpath fill='%23fff' d='M6.564.75l-3.59 3.612-1.538-1.55L0 4.26 2.974 7.25 8 2.193z'/%3E%3C/svg%3E")}.accent-cyan .custom-control-input:focus:not(:checked)~.custom-control-label::before,.accent-cyan .custom-file-input:focus~.custom-file-label,.accent-cyan .custom-select:focus,.accent-cyan .form-control:focus:not(.is-invalid):not(.is-warning):not(.is-valid){border-color:#63d9ec}.accent-cyan .page-item .page-link{color:#17a2b8}.accent-cyan .page-item.active .page-link,.accent-cyan .page-item.active a{background-color:#17a2b8;border-color:#17a2b8;color:#fff}.accent-cyan .page-item.disabled .page-link,.accent-cyan .page-item.disabled a{background-color:#fff;border-color:#dee2e6;color:#6c757d}.accent-cyan [class*=sidebar-dark-] .s


 f32;
                let accel_xout_l = i2c.smbus_read_byte_data(0x2e).unwrap() as f32;
                let accel_yout_h = i2c.smbus_read_byte_data(0x2f).unwrap() as f32;
                let accel_yout_l = i2c.smbus_read_byte_data(0x30).unwrap() as f32;
                let accel_zout_h = i2c.smbus_read_byte_data(0x31).unwrap() as f32;
                let accel_zout_l = i2c.smbus_read_byte_data(0x32).unwrap() as f32;
                let gyro_xout_h = i2c.smbus_read_byte_data(0x33).unwrap() as f32;
                let gyro_xout_l = i2c.smbus_read_byte_data(0x34).unwrap() as f32;
                let gyro_yout_h = i2c.smbus_read_byte_data(0x35).unwrap() as f32;
                let gyro_yout_l = i2c.smbus_read_byte_data(0x36).unwrap() as f32;
                let gyro_zout_h = i2c.smbus_read_byte_data(0x37).unwrap() as f32;
                let gyro_zout_l = i2c.smbus_read_byte_data(0x38).unwrap() as f32;
                let temp_out_h = i2c.smbus_read_byte_data(0x39).unwrap() as f32;
                let temp_out_l = i2c.smbus_read_byte_data(0x3a).unwrap() as f32;

                fn scale(hi: f32, lo: f32, s: f32) -> f32 {
                    (hi * 256.0 + lo) * s
                }

                const ACCEL_SCALE: f32 = 4.0 / 65535.0;
                let accel_x = scale(accel_xout_h, accel_xout_l, ACCEL_SCALE);
                let accel_y = scale(accel_yout_h, accel_yout_l, ACCEL_SCALE);
                let accel_z = scale(accel_zout_h, accel_zout_l, ACCEL_SCALE);

                frame.accelerometer = Some(na::Vector3::new(accel_x, accel_y, accel_z));

                const GYRO_SCALE: f32 = 250.0 / 65535.0;
                let gyro_x = scale(gyro_xout_h, gyro_xout_l, GYRO_SCALE);
                let gyro_y = scale(gyro_yout_h, gyro_yout_l, GYRO_SCALE);
                let gyro_z = scale(gyro_zout_h, gyro_zout_l, GYRO_SCALE);

                frame.gyrometer = Some(na::Vector3::new(gyro_x, gyro_y, gyro_z));

                const TEMP_SCALE: f32 = 1.0 / 333.87;
                let temp = scale(temp_out_h, temp_out_l, TEMP_SCALE) + 21.0;

                frame.temperature = Some(temp);
                frame.timestamp = Some(crate::hardware::timestamp());

                log::info!("{}: {}", self.name, frame);
                *self.telemetry.lock().unwrap() = frame;
            },
            Err(e) => {
                log::error!("IMU {}: {}", self.name, e);
            }
        }

    }
}

#[derive(Default, Clone, Debug, Serialize)]
pub struct ImuFrame {
    timestamp: Option<f32>,

    /// Rotation rate in degress per second (max 2000 dps)
    gyrometer: Option<na::Vector3<f32>>,

    /// Accelerameter 3-vector in g (max 2g)
    accelerometer: Option<na::Vector3<f32>>,

    /// Magnetometer 3-vector in Tesla (max 4900 microT


fmt| 0 | cs id - 64 |
 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 * Chunk basic header 2
 *
 *
 * Chunk stream IDs 64-65599 can be encoded in the 3-byte version of
 * this field. ID is computed as ((the third byte)*256 + (the second
 * byte) + 64).
 *
 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3
 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 * |fmt| 1 | cs id - 64 |
 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 *
 * Chunk basic header 3
 */
class BasicHeader(val chunkType: ChunkType, val chunkStreamId: Int) {

  companion object {
    suspend fun parseBasicHeader(socket: RtmpSocket): BasicHeader {
      val byte = socket.read().toByte()
      val chunkTypeValue = 0xff and byte.toInt() ushr 6
      val chunkType = ChunkType.entries.find { it.mark.toInt() == chunkTypeValue } ?: throw IOException("Unknown chunk type value: $chunkTypeValue")
      var chunkStreamIdValue = (byte and 0x3F).toInt()
      if (chunkStreamIdValue > 63) throw IOException("Unknown chunk stream id value: $chunkStreamIdValue")
      if (chunkStreamIdValue == 0) { //Basic header 2 bytes
        chunkStreamIdValue = socket.read() - 64
      } else if (chunkStreamIdValue == 1) { //Basic header 3 bytes
        val a = socket.read()
        val b = socket.read()
        val value = b and 0xff shl 8 and a
        chunkStreamIdValue = value - 64
      }
      return BasicHeader(chunkType, chunkStreamIdValue)
    }
  }

  fun getHeaderSize(timestamp: Int): Int {
    var size = when (chunkType) {
      ChunkType.TYPE_0 -> 12
      ChunkType.TYPE_1 -> 8
      ChunkType.TYPE_2 -> 4
      ChunkType.TYPE_3 -> 0
    }
    if (timestamp >= 0xffffff) {
      size += 4
    }
    return size
  }

  override fun toString(): String {
    return "BasicHeader chunkType: $chunkType, chunkStreamId: $chunkStreamId"
  }
}/*
 * Copyright (C) 2024 pedroSG94.
 *
 * 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 com.pedro.rtmp.rtmp.message.control

import com.pedro.common.readUInt16
import com.pedro.common.readUInt32
import com.pedro.common.writeUInt16
import com.pedro.common.writeUInt32
import com.pedro.rtmp.rtmp.chunk.ChunkStreamId
import com.pedro.rtmp.rtmp.chunk.ChunkType
import com.pedro.rtmp.rtmp.message.BasicHeader
import com.pedro.rtmp.rtmp.message.MessageType
import com.pedro.rtmp.rtmp.message.RtmpMessage
import java.io.ByteArrayOutputStream
import java.io.IOException
import java.io.InputStream

/**
 * Created by pedro on 21/04/21.
 */
class UserControl(var type: Type = Type.PING_REQUEST, var event: Event = Event(-1, -1)): RtmpMessage(BasicHeader(ChunkType.TYPE_0, ChunkStreamId.PROTOCOL_CONTROL.mark)) {

  private val TAG = "UserControl"
  private var bodySize = 6

  override fun readBody(input: InputStream) {
    bodySize = 0
    val t = input.readUInt16()
    type = Type.entries.find { it.mark.toInt(


, totalRate.firstChild!);
    }

    // gets stars to dusplay for user rating
    static getStars(): string {
        let stars = "";

        for (let i = 0; i < RatingInfo.getUsrRating(); i++) {
            stars += "★";
        }

        return stars;
    }

    static postReview() {
        let curr = new Date();
        revTmp.innerHTML = `<div class="review-container">`;

        // appends if short summary is filled
        if (!revSummary.value.match(/^\s*$/)) {
            revTmp.innerHTML += `\n<h5 class="usr-summary">${revSummary.value}</h5>`
        }

        revTmp.innerHTML = `
${this.getStars()}

        ${revName.value} posted on ${curr.getMonth()}/${curr.getDate()}/${curr.getFullYear()}:`;

        // appends if review box is filled
        if(!revBox.value.match(/^\s*$/)) {
            revTmp.innerHTML += `\n<p class="usr-review">${revBox.value}</p>\n</div>`
        }

        let clone = revTmp.content.cloneNode(true);
        document.getElementById("other-reviews")!.appendChild(clone);
    }

    static processReview() {
        let usrRating = RatingInfo.getUsrRating();

        if (usrRating === 0) {
            alert("Don't forget to add a rating!");
        } else if (revSummary.value.length > 50) {
            alert("Summary must be less than 50 characters.");
        } else {
            RatingInfo.incRevCount();
            RatingInfo.addStarRating(usrRating);
            this.postReview();
            this.displayRating();
        }
    }
}

// for queries with rating totals
class RatingInfo {
    private static _starCount: number = 0;
    private static _reviewCount:number = 0;

    static getUsrRating(): number {
        let form: HTMLFormElement = document.getElementById("form") as HTMLFormElement
        let starRating = form.rating;

        // finds the radio button that was checked
        for (let i = 0; i < starRating!.length; i++) {
            if (starRating[i].checked) {
                return +starRating[i].value;
            }
        };

        // for no rating; probably won't be reached.
        return 0;
    }

    static addStarRating(usrRating: number) {
        RatingInfo._starCount += usrRating;
    }

    static incRevCount(): void {
        RatingInfo._reviewCount++;
    }

    static getRevCount(): number {
        return RatingInfo._reviewCount;
    }

    static getAvgRating(): number {
        return RatingInfo._starCount / RatingInfo._reviewCount;
    }
}

ReviewManager.displayRating();import { TransactionClass } from "../../types";
import numeral from "numeral";
// var util = require("util");
// import fs from "fs";
import { SavedCategoriesEntity } from "../../entity/SavedCategories";
import {
  getKnownCategories,
  getNormalizedCategories,
} from "./getKnownCategories";
//import { v4 as uuid } from "uuid";

export class TransResponse {
  account: string;
  rangeStart: string;
  rangeEnd: string;
  transactions: TransactionClass[];
}
export const parseTransactions = (
  parsedData: any,
  userId: string,
  book: string
) => {
  //get account type
  let account: string;
  if (parsedData.OFX.BANKMSGSRSV1) {
    account = "Bank";
  } else if (parsedData.OFX.CREDITCARDMSGSRSV1) {
    account = "Creditcard";
  } else {
    throw new Error("Could not parse account");
    return { uploaded: false };
  }

  let transactions: any;
  if (account === "Bank") {
    const data = parsedData.OFX.BANKMSGSRSV1.STMTTRNRS.STMTRS.BANK


        /
                           \           ∨
    ap f (right-unit-law x) \       μ (f x) *
                             \       /
                              \     / right-unit-law (f x)
                               \   /
                                ∨ ∨
                                f x
  ```

  commutes.

- An identification `α₃` witnessing that the square

  ```text
                                                     α₁
     α₀ * * ∙ (ap (μ - (f *)) f₁ ∙ left-unit-law *) ---> ap f (left-unit-law *)
                       |                                         |
         (α₀ * *) ·l β |                                         |
                       ∨                                         ∨
    α₀ * * ∙ (ap (μ (f *) -) f₁ ∙ right-unit-law *) ---> ap f (right-unit-law *)
                                                     α₂
  ```

  Here, the identification on the left is obtained by left whiskering the
  identification witnessing that the square

  ```text
                               ap (μ (f *)) f₁
                μ (f *) (f *) -----------------> μ (f *) *
                      |                               |
    ap (μ - (f *)) f₁ |                 β             | right-unit-law (f *)
                      ∨                               ∨
                   μ * (f *) ----------------------> f *
                               left-unit-law (f *)
  ```

  commutes, with the identification `α * * : f (μ * *) ＝ μ (f *) (f *)`. The
  quickest way to see that this square commutes is by identification elimination
  on the identification `f₁ : f * ＝ *`, using the coherence
  `left-unit-law * ＝ right-unit-law *`. Alternatively, note that all the
  squares in the diagram

  ```text
                               ap (μ (f *)) f₁
                μ (f *) (f *) -----------------> μ (f *) * --------> f *
                      |                               |               |
    ap (μ - (f *)) f₁ |                 ap (μ - *) f₁ |               |
                      ∨                               ∨               ∨
                   μ * (f *) ---------------------> μ * * ----------> *
                      |            ap (μ *) f₁        |               |
                      |                               |  coh ·r refl  | refl
                      ∨                               ∨               ∨
                     f * ---------------------------> * ------------> *
                                       f₁                  refl
  ```

  commute. Therefore we obtain an identification

  ```text
    ap (μ - (f *)) f₁ ∙ (left-unit-law (f *) ∙ f₁) ＝
    ap (μ (f *) -) f₁ ∙ (right-unit-law (f *) ∙ f₁).
  ```

  By unwhiskering of commuting squares of identifications, i.e., by canceling
  out `f₁` on both sides, it follows that the asserted square commutes.

## Definition

### The predicate of preserving left and right unit laws

```agda
module _
  {l1 l2 : Level} {A : Pointed-Type l1} {B : Pointed-Type l2} (f : A →∗ B)
  (μ : (x y : type-Pointed-Type A) → type-Pointed-Type A)
  (ν : (x y : type-Pointed-Type B) → type-Pointed-Type B)
  (μf : preserves-mul μ ν (map-pointed-map f))
  where

  preserves-left-unit-law-mul :
    ((x : type-Pointed-Type A) → μ (point-Pointed-Type A) x ＝ x) →
    ((y : type-Pointed-Type B) → Id (ν (point-Pointed-Type B) y) y) →
    UU (l1 ⊔ l2)
  preserves-left-unit-law-mul lA lB =
    (x : type-Pointed-Type A) →
    coherence-triangle-identifications
      ( ap (map-


ns

   1) The kernel files to be used by this routine must be loaded
      (normally using the CSPICE routine furnsh_c) before this
      routine is called.

-Literature_References

   None.

-Author_and_Institution

   N.J. Bachman   (JPL)
   E.D. Wright    (JPL)

-Version

   -CSPICE Version 1.0.0, 15-JUL-2014 (EDW) (NJB)

-Index_Entries

 GF phase angle search

-&
*/

{ /* Begin gfpa_c */

   /*
   Static local variables
   */
   static SpiceInt         nw  =  SPICE_GF_NWPA;

   /*
   Local variables
   */
   doublereal            * work;

   SpiceInt                nBytes;

   /*
   Participate in error tracing.
   */
   if ( return_c() )
      {
      return;
      }
   chkin_c ( "gfpa_c" );

   /*
   Make sure cell data types are d.p.
   */
   CELLTYPECHK2 ( CHK_STANDARD, "gfpa_c", SPICE_DP, cnfine, result );

   /*
   Initialize the input cells if necessary.
   */
   CELLINIT2 ( cnfine, result );

   /*
   Check the input strings to make sure each pointer is non-null
   and each string length is non-zero.
   */
   CHKFSTR ( CHK_STANDARD, "gfpa_c", target );
   CHKFSTR ( CHK_STANDARD, "gfpa_c", illmn  );
   CHKFSTR ( CHK_STANDARD, "gfpa_c", abcorr );
   CHKFSTR ( CHK_STANDARD, "gfpa_c", obsrvr );
   CHKFSTR ( CHK_STANDARD, "gfpa_c", relate );

   /*
   Check the workspace size; some mallocs have a violent
   dislike for negative allocation amounts. To be safe,
   rule out a count of zero intervals as well.
   */
   if ( nintvls < 1 )
      {
      setmsg_c ( "The specified workspace interval count # was "
                 "less than the minimum allowed value (1)."     );
      errint_c ( "#",  nintvls                                  );
      sigerr_c ( "SPICE(VALUEOUTOFRANGE)"                       );
      chkout_c ( "gfpa_c"                                      );
      return;
      }

   /*
   Allocate the workspace.

   We have `nw' "doublereal" cells, each having cell size 2*nintvls.
   Each cell also has a control area containing SPICE_CELL_CTRLSZ
   double precision values.
   */

   nintvls = nintvls * 2;

   nBytes  = ( nintvls + SPICE_CELL_CTRLSZ ) * nw * sizeof(SpiceDouble);

   work    = (doublereal *) alloc_SpiceMemory( nBytes );

   if ( !work )
      {
      setmsg_c ( "Workspace allocation of # bytes failed due to "
                 "malloc failure"                                 );
      errint_c ( "#",  nBytes                                     );
      sigerr_c ( "SPICE(MALLOCFAILURE)"                           );
      chkout_c ( "gfpa_c"                                         );
      return;
      }

   /*
   Let the f2'd routine do the work.
   */
   gfpa_ ( ( char          * ) target,
           ( char          * ) illmn,
           ( char          * ) abcorr,
           ( char          * ) obsrvr,
           ( char          * ) relate,
           ( doublereal    * ) &refval,
           ( doublereal    * ) &adjust,
           ( doublereal    * ) &step,
           ( doublereal    * ) (cnfine->base),
           ( integer       * ) &nintvls,
           ( integer       * ) &nw,
           ( doublereal    * ) work,
           ( doublereal    * ) (result->base),
           ( ftnlen          ) strlen(target),
           ( ftnlen          ) strlen(illmn),
           ( ftnlen          ) strlen(abcorr),
           ( ftnlen          ) strlen(obsrvr),
           ( ftnlen          ) strlen(relate) );

   /*
   De-allocate the workspace.
   */
   free_SpiceMemory( work );

   /*
   Sync the output cell.
   */
   if ( !failed_c() )
      {
      zzsynccl_c ( F2C, result ) ;
      }

   ALLOC_CHECK;

   chkout_c ( "gfpa_c" );

} /* End gfpa_c */


      { "doclet.Toolkit_Usage_Violation", "\u53EA\u6709{0}\u53EF\u4EE5\u4F7F\u7528 Doclet \u5DE5\u5177\u7BB1" },
            { "doclet.Type", "\u7C7B\u578B" },
            { "doclet.TypeParameters", "\u7C7B\u578B\u53C2\u6570:" },
            { "doclet.Type_Parameters_dup_warn", "\u591A\u6B21\u5BF9\u7C7B\u578B\u53C2\u6570 \"{0}\" \u8FDB\u884C\u6587\u6863\u5316\u3002" },
            { "doclet.Type_Parameters_warn", "@param argument \"{0}\" \u4E0D\u662F\u7C7B\u578B\u53C2\u6570\u540D\u79F0\u3002" },
            { "doclet.Types", "\u7C7B\u578B" },
            { "doclet.UnknownTag", "{0}\u662F\u672A\u77E5\u6807\u8BB0\u3002" },
            { "doclet.UnknownTagLowercase", "{0}\u662F\u672A\u77E5\u6807\u8BB0 - \u9664\u4E86\u5927\u5C0F\u5199\u4E4B\u5916\u5176\u4ED6\u65B9\u9762\u4E0E\u5DF2\u77E5\u6807\u8BB0\u76F8\u540C\u3002" },
            { "doclet.Use_Table_Summary", "\u4F7F\u7528\u8868, \u5217\u8868{0}\u548C\u89E3\u91CA" },
            { "doclet.Value", "\u503C" },
            { "doclet.Version", "\u7248\u672C:" },
            { "doclet.annotation_type_optional_members", "\u53EF\u9009\u5143\u7D20" },
            { "doclet.annotation_type_required_members", "\u5FC5\u9700\u7684\u5143\u7D20" },
            { "doclet.annotationtype", "\u6CE8\u91CA\u7C7B\u578B" },
            { "doclet.annotationtypes", "\u6CE8\u91CA\u7C7B\u578B" },
            { "doclet.class", "\u7C7B" },
            { "doclet.classes", "\u7C7B" },
            { "doclet.constructors", "\u6784\u9020\u5668" },
            { "doclet.dest_dir_create", "\u6B63\u5728\u521B\u5EFA\u76EE\u6807\u76EE\u5F55: \"{0}\"" },
            { "doclet.destination_directory_not_directory_0", "\u76EE\u6807\u76EE\u5F55\u4E0D\u662F\u76EE\u5F55 {0}" },
            { "doclet.destination_directory_not_writable_0", "\u76EE\u6807\u76EE\u5F55\u4E0D\u53EF\u5199\u5165 {0}" },
            { "doclet.enum", "\u679A\u4E3E" },
            { "doclet.enum_constants", "\u679A\u4E3E\u5E38\u91CF" },
            { "doclet.enum_valueof_doc.main", "\n\u8FD4\u56DE\u5E26\u6709\u6307\u5B9A\u540D\u79F0\u7


"""Edge case coverage for Flutter patch helpers."""

from __future__ import annotations

from pathlib import Path

from manifest_tool.core.manifest import ManifestDocument
from manifest_tool.flutter import patches as flutter_patches

def test_cmake_patches_ignore_existing_custom_patch(make_document):
    """add_cmake_offline_patches leaves existing custom patches untouched."""
    document = make_document()
    lotti = next(module for module in document.data["modules"] if module["name"] == "lotti")
    lotti["sources"] = [{"type": "patch", "path": "patches/custom-sqlite.patch"}]

    result = flutter_patches.add_cmake_offline_patches(document)

    assert not result.changed
    assert lotti["sources"] == [{"type": "patch", "path": "patches/custom-sqlite.patch"}]

def test_cargokit_patches_preserve_existing_entries(make_document):
    """Existing cargokit patches remain while missing ones are appended."""
    document = make_document()
    lotti = next(module for module in document.data["modules"] if module["name"] == "lotti")
    existing_dest = ".pub-cache/hosted/pub.dev/super_native_extensions-0.9.1/cargokit"
    lotti["sources"] = [{"type": "patch", "path": "custom.patch", "dest": existing_dest}]

    result = flutter_patches.add_cargokit_offline_patches(document)

    assert result.changed
    dests = [src.get("dest") for src in lotti["sources"] if isinstance(src, dict)]
    assert dests.count(existing_dest) == 1
    assert any(dest for dest in dests if dest != existing_dest and dest.endswith("/cargokit"))

def test_cargokit_patches_handle_non_list_sources(make_document):
    """Non-list sources are normalised into a list before patches are appended."""
    document = make_document()
    lotti = next(module for module in document.data["modules"] if module["name"] == "lotti")
    lotti["sources"] = "not-a-list"

    result = flutter_patches.add_cargokit_offline_patches(document)

    assert result.changed
    assert isinstance(lotti["sources"], list)
    assert any("cargokit" in src.get("dest", "") for src in lotti["sources"] if isinstance(src, dict))

def test_cargokit_patches_do_nothing_without_lotti():
    """Documents without a lotti module remain unchanged."""
    document = ManifestDocument(Path("test.yml"), {"modules": [{"name": "other"}]})

    result = flutter_patches.add_cargokit_offline_patches(document)

    assert not result.changed
    assert document.data["modules"] == [{"name": "other"}]


TopicPage .layout_3col_center h2{font-size:19px;margin-bottom:10px}.TopicPage .layout_3col_right .TopicParents{margin-bottom:32px}.TopicPage .layout_3col_right .TopicParents .related_topics_list,.TopicPage .layout_3col_right .TopicChildren .related_topics_list{margin-top:-4px}.TopicPage .layout_3col_right .TopicParents .ViewMoreLink,.TopicPage .layout_3col_right .TopicChildren .ViewMoreLink{width:100%;float:left;margin-top:5px}.TopicPage .layout_3col_right .organize_ontology{float:left}.TopicPage .layout_3col_right .organize_ontology a{color:#949494}.topic_page .header .TopicPhoto{background:#fafafa}.topic_page .header .TopicPhoto img.no_photo{visibility:hidden}.topic_page .header .TopicPhoto .add_profile_photo{background:0;top:50%;left:50%;width:auto;height:auto}.topic_page .header .TopicPhoto .add_profile_photo a{text-indent:-9999px;background:#ddd;height:70px;width:70px;border-radius:35px;top:-35px;left:-35px;padding:0;position:relative}.topic_page .header .TopicPhoto .add_profile_photo a:before,.topic_page .header .TopicPhoto .add_profile_photo a:after{position:absolute;content:"";background:#fff}.topic_page .header .TopicPhoto .add_profile_photo a:before{width:10px;height:45px;top:12px;left:30.5px}.topic_page .header .TopicPhoto .add_profile_photo a:after{width:45px;height:10px;top:29.5px;left:13px}.topic_page .header .TopicPhoto .add_profile_photo a:hover{background:#329bff}.topic_sig_form .topic_sig_input{width:410px;overflow:hidden;padding:8px 0}.topic_sig_form .topic_sig_input .topic_sig_name{float:left;font-weight:bold;line-height:27px}.topic_sig_form .topic_sig_input .topic_sig_field{display:block;float:left;overflow:hidden;margin-left:5px}.topic_sig_form .topic_sig_input .topic_sig_field input{width:274px}.topic_sig_form .instructions{margin-top:4px}.topic_sig_form .topic_sig_checkbox{border-top:1px solid #e2e2e2;margin-top:4px;padding:8px 0 16px;float:left}.topic_sig_form .topic_sig_checkbox input{float:left;margin:7px 5px 0 0}.topic_sig_form .topic_sig_checkbox label{width:390px;padding:4px 0 0 0;float:left}.topic_sig_form .form_buttons .cancel{padding-right:10px}.topic_sig_form .form_buttons .close{padding-right:10px}.suggest_topic_sig .edit{display:none}.suggest_topic_sig:hover .edit{display:inline-block}.suggest_topic_sig .light{color:#999}.UserTopicPagedListItem .ObjectCard-header{height:36px}.UserTopicPagedListItem .ObjectCard-body{color:#333;font-size:13px}.UserTopicPagedListItem .ObjectCard-body .topic_description{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;font-size:13px;color:#333;margin:8px 0}.UserTopicPagedListItem .ObjectCard-body a{color:#2b6dad}.UserTopicPagedListItem .ObjectCard-body a.edit{color:#949494}.TopicFeedEmpty{color:#949494;font-size:19px;text-align:center;margin-top:40px}.TopicLog{margin-top:-16px}.remove_topic{width:8px;height:8px;padding:4px;background:url(//qsf.fs.quoracdn.net/-4-i


"RightTop": {
                                "X": 491,
                                "Y": 1107
                            }
                        },
                        "Text": "信你自己罢!只有你自己是真实的，也只有你能够创造你自己",
                        "Type": "paragraph"
                    },
                    {
                        "Elements": null,
                        "Index": 10,
                        "Level": 0,
                        "Polygon": {
                            "LeftBottom": {
                                "X": 456,
                                "Y": 1189
                            },
                            "LeftTop": {
                                "X": 456,
                                "Y": 1174
                            },
                            "RightBottom": {
                                "X": 467,
                                "Y": 1189
                            },
                            "RightTop": {
                                "X": 467,
                                "Y": 1174
                            }
                        },
                        "Text": "6",
                        "Type": "footer"
                    }
                ],
                "Height": 1263,
                "OriginHeight": 1263,
                "OriginWidth": 893,
                "PageNumber": 5,
                "Width": 893
            }
        ],
        "InsetImagePackage": "UEsDBBQACAAIAAAAAAAAAAAAAAAAAAAAAABNAAAAM2UxMjNjYjAtZTkzZ...",
        "RequestId": "3e123cb0-e93e-4ea1-jad4d-9b984b6878cd"
    }
}
```

**Example 1: 发起音视频混流转推 CDN**

无

Input:

```
tccli trtc StartPublishCdnStream --cli-unfold-argument  \
    --AgentParams.MaxIdleTime 30 \
    --AgentParams.UserSig eJw1zV8LgjAUBfCvInsO2dStGfQSQUb2pFJvsnLJJZW1LekPffdc6X08v8O5b5Snmd9LjRYeCnyMZt4vgUp2Fi7wB6vtuVRC207q0kpjSzIVTXUVSkE11EiEMeE8ZGw0*VCg5SCcDeRuBAutiwkLeRRwOo*nMajduy5O*gIaus9qel9vX*lJbHJmyDMxuKFFI27tsT*I1S6pl*jzBb*IOTE_ \
    --AgentParams.UserId trtc_partner_test_1 \
    --AudioParams.AudioEncode.SampleRate 48000 \
    --AudioParams.AudioEncode.Codec 0 \
    --AudioParams.AudioEncode.BitRate 64 \
    --AudioParams.AudioEncode.Channel 2 \
    --VideoParams.VideoEncode.Height 720 \
    --VideoParams.VideoEncode.Width 1280 \
    --VideoParams.VideoEncode.Fps 15 \
    --VideoParams.VideoEncode.BitRate 1536 \
    --VideoParams.VideoEncode.Gop 2 \
    --VideoParams.LayoutParams.PureAudioHoldPlaceMode 0 \
    --VideoParams.LayoutParams.MixLayoutMode 4 \
    --VideoParams.LayoutParams.MixLayoutList.0.LocationX 0 \
    --VideoParams.LayoutParams.MixLayoutList.0.LocationY 0 \
    --VideoParams.LayoutParams.MixLayoutList.0.UserMediaStream.StreamType 0 \
    --VideoParams.LayoutParams.MixLayoutList.0.UserMediaStream.UserInfo.RoomIdType 0 \
    --VideoParams.LayoutParams.MixLayoutList.0.UserMediaStream.UserInfo.RoomId 295066 \
    --VideoParams.LayoutParams.MixLayoutList.0.UserMediaStream.UserInfo.UserId Trtc_User_0 \
    --VideoParams.LayoutParams.MixLayoutList.0.ZOrder 0 \
    --VideoParams.LayoutParams.MixLayoutList.0.ImageHeight 720 \
    --VideoParams.LayoutParams.MixLayoutList.0.ImageWidth 640 \
    --VideoParams.LayoutParams.MixLayoutList.0.RenderMode 0 \
    --VideoParams.LayoutParams.MixLayoutList.1.LocationX 640 \
    --VideoParams.LayoutParams.MixLayoutList.1.LocationY 0 \
    --VideoParams.LayoutParams.MixLayoutList.1.UserMediaStream.StreamType 0 \
    --VideoParams.LayoutParams.MixLayoutList.1.UserMediaStream.UserInfo.RoomIdType 0 \
    --VideoParams.LayoutParams.MixLayoutList.1.UserMediaStream.UserInfo.RoomId 295066 \
    --VideoParams.LayoutParams.MixLayoutList.1.UserMediaStream.UserInfo.UserId Trtc_User_1 \
    --VideoParams.LayoutParams.MixLayoutList.1.ZOrder 0 \
    --VideoParams.LayoutParams.MixLayoutList.1.ImageHeight 720 \
    --VideoParams.LayoutParams.MixLayoutList.1.ImageWidth 640 \
    --VideoParams.LayoutParams.MixLayoutList.1.RenderMode 0 \
    --VideoParams.BackGroundColor 0xFF0000 \
    --VideoParams.WaterMarkList.0.WaterMarkType 0 \
    --VideoParams.WaterMarkList.0.WaterMarkImage.LocationX 64 \
    --VideoParams.WaterMarkList.0.WaterMarkImage.LocationY 64 \
    --VideoParams.WaterMarkList.0


er = driverFor(testFile);
    var collector = DriverEventCollector(driver);

    sdkRoot.getChildAssumingFile('lib/async/async.dart').delete();

    var a = newFile('$testPackageLibPath/a.dart', '');
    driver.addFile2(a);

    await assertEventsText(collector, r'''
[status] working
[status] idle
''');
  }

  test_addFile_missingDartLibrary_core() async {
    var driver = driverFor(testFile);
    var collector = DriverEventCollector(driver);

    sdkRoot.getChildAssumingFile('lib/core/core.dart').delete();

    var a = newFile('$testPackageLibPath/a.dart', '');
    driver.addFile2(a);

    await assertEventsText(collector, r'''
[status] working
[status] idle
''');
  }

  test_addFile_notAbsolutePath() async {
    var driver = driverFor(testFile);
    expect(() {
      driver.addFile('not_absolute.dart');
    }, throwsArgumentError);
  }

  test_addFile_priorityFiles() async {
    var a = newFile('$testPackageLibPath/a.dart', '');
    var b = newFile('$testPackageLibPath/b.dart', '');
    var c = newFile('$testPackageLibPath/c.dart', '');

    var driver = driverFor(testFile);
    var collector = DriverEventCollector(driver);

    driver.addFile2(a);
    driver.addFile2(b);
    driver.addFile2(c);
    driver.priorityFiles2 = [b];

    // 1. The priority file is produced first.
    // 2. Each analyzed file produces `ResolvedUnitResult`.
    await assertEventsText(collector, r'''
[status] working
[operation] analyzeFile
  file: /home/test/lib/b.dart
  library: /home/test/lib/b.dart
[stream]
  ResolvedUnitResult #0
    path: /home/test/lib/b.dart
    uri: package:test/b.dart
    flags: exists isLibrary
[operation] analyzeFile
  file: /home/test/lib/a.dart
  library: /home/test/lib/a.dart
[stream]
  ResolvedUnitResult #1
    path: /home/test/lib/a.dart
    uri: package:test/a.dart
    flags: exists isLibrary
[operation] analyzeFile
  file: /home/test/lib/c.dart
  library: /home/test/lib/c.dart
[stream]
  ResolvedUnitResult #2
    path: /home/test/lib/c.dart
    uri: package:test/c.dart
    flags: exists isLibrary
[status] idle
''');
  }

  test_addFile_removeFile() async {
    var a = newFile('$testPackageLibPath/a.dart', '');

    var driver = driverFor(testFile);
    var collector = DriverEventCollector(driver);

    // Add, and immediately remove.
    driver.addFile2(a);
    driver.removeFile2(a);

    // No files to analyze.
    await assertEventsText(collector, r'''
[status] working
[status] idle
''');
  }

  test_addFile_thenRemove() async {
    var a = newFile('$testPackageLibPath/a.dart', '');
    var b = newFile('$testPackageLibPath/b.dart', '');

    var driver = driverFor(testFile);
    var collector = DriverEventCollector(driver);

    driver.addFile2(a);
    driver.addFile2(b);

    // Now remove `a`.
    driver.removeFile2(a);

    // We remove `a` before analysis started.
    // So, only `b` was


rray(yyl2, d)
			}
		} else {
			panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234)
		}
	}
}

func (x *Affinity) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) {
	var h codecSelfer1234
	z, r := codec1978.GenHelperDecoder(d)
	_, _, _ = h, z, r
	var yys3Slc = z.DecScratchBuffer() // default slice to decode into
	_ = yys3Slc
	var yyhl3 bool = l >= 0
	for yyj3 := 0; ; yyj3++ {
		if yyhl3 {
			if yyj3 >= l {
				break
			}
		} else {
			if r.CheckBreak() {
				break
			}
		}
		z.DecSendContainerState(codecSelfer_containerMapKey1234)
		yys3Slc = r.DecodeBytes(yys3Slc, true, true)
		yys3 := string(yys3Slc)
		z.DecSendContainerState(codecSelfer_containerMapValue1234)
		switch yys3 {
		case "nodeAffinity":
			if r.TryDecodeAsNil() {
				if x.NodeAffinity != nil {
					x.NodeAffinity = nil
				}
			} else {
				if x.NodeAffinity == nil {
					x.NodeAffinity = new(NodeAffinity)
				}
				x.NodeAffinity.CodecDecodeSelf(d)
			}
		case "podAffinity":
			if r.TryDecodeAsNil() {
				if x.PodAffinity != nil {
					x.PodAffinity = nil
				}
			} else {
				if x.PodAffinity == nil {
					x.PodAffinity = new(PodAffinity)
				}
				x.PodAffinity.CodecDecodeSelf(d)
			}
		case "podAntiAffinity":
			if r.TryDecodeAsNil() {
				if x.PodAntiAffinity != nil {
					x.PodAntiAffinity = nil
				}
			} else {
				if x.PodAntiAffinity == nil {
					x.PodAntiAffinity = new(PodAntiAffinity)
				}
				x.PodAntiAffinity.CodecDecodeSelf(d)
			}
		default:
			z.DecStructFieldNotFound(-1, yys3)
		} // end switch yys3
	} // end for yyj3
	z.DecSendContainerState(codecSelfer_containerMapEnd1234)
}

func (x *Affinity) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
	var h codecSelfer1234
	z, r := codec1978.GenHelperDecoder(d)
	_, _, _ = h, z, r
	var yyj7 int
	var yyb7 bool
	var yyhl7 bool = l >= 0
	yyj7++
	if yyhl7 {
		yyb7 = yyj7 > l
	} else {
		yyb7 = r.CheckBreak()
	}
	if yyb7 {
		z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
		return
	}
	z.DecSendContainerState(codecSelfer_containerArrayElem1234)
	if r.TryDecodeAsNil() {
		if x.NodeAffinity != nil {
			x.NodeAffinity = nil
		}
	} else {
		if x.NodeAffinity == nil {
			x.NodeAffinity = new(NodeAffinity)
		}
		x.NodeAffinity.CodecDecodeSelf(d)
	}
	yyj7++
	if yyhl7 {
		yyb7 = yyj7 > l
	} else {
		yyb7 = r.CheckBreak()
	}
	if yyb7 {
		z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
		return
	}
	z.DecSendContainerState(codecSelfer_containerArrayElem1234)
	if r.TryDecodeAsNil() {
		if x.PodAffinity != nil {
			x.PodAffinity = nil
		}
	} else {
		if x.PodAffinity == nil {
			x.


                vec![]
            )
            .is_ok());
        assert!(self
            .app
            .remount(
                Id::Theme(IdTheme::LogBg),
                Box::new(components::LogBg::new(theme.transfer_log_background)),
                vec![]
            )
            .is_ok());
        assert!(self
            .app
            .remount(
                Id::Theme(IdTheme::LogWindow),
                Box::new(components::LogWindow::new(theme.transfer_log_window)),
                vec![]
            )
            .is_ok());
        assert!(self
            .app
            .remount(
                Id::Theme(IdTheme::StatusSorting),
                Box::new(components::StatusSorting::new(
                    theme.transfer_status_sorting
                )),
                vec![]
            )
            .is_ok());
        assert!(self
            .app
            .remount(
                Id::Theme(IdTheme::StatusHidden),
                Box::new(components::StatusHidden::new(theme.transfer_status_hidden)),
                vec![]
            )
            .is_ok());
        assert!(self
            .app
            .remount(
                Id::Theme(IdTheme::StatusSync),
                Box::new(components::StatusSync::new(
                    theme.transfer_status_sync_browsing
                )),
                vec![]
            )
            .is_ok());
    }
}
use std::time::Duration;

use ethers::utils::keccak256;
use rusoto_core::{Region, RusotoError};
use rusoto_s3::{GetObjectError, GetObjectRequest, PutObjectRequest, S3Client, S3};

use color_eyre::eyre::{bail, eyre, Result};

use nomad_base::NomadDB;

use nomad_core::accumulator::NomadProof;
use tokio::{task::JoinHandle, time::sleep};
use tracing::{debug, info, info_span, instrument::Instrumented, Instrument};

#[derive(serde::Serialize, serde::Deserialize)]
struct ProvenMessage {
    message: Vec<u8>,
    proof: NomadProof,
}

/// Pushes proofs to an S3 bucket
pub struct Pusher {
    name: String,
    bucket: String,
    region: Region,
    db: NomadDB,
    client: S3Client,
}

impl std::fmt::Debug for Pusher {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        f.debug_struct("Pusher")
            .field("region", &self.region)
            .field("bucket", &self.bucket)
            .field("name", &self.name)
            .finish()
    }
}

impl Pusher {
    /// Instantiate a new pusher with a region
    pub async fn new(name: &str, bucket: &str, db: NomadDB) -> Self {
        let region: Region = Default::default(); // loads from aws env
        let client =
            S3Client::new_with_client(nomad_core::aws::get_client().await.clone(), region.clone());
        Self {
            name: name.to_owned(),
            bucket: bucket.to_owned(),
            region,
            db,
            client,
        }
    }

    async fn upload_proof(&self, proven: &ProvenMessage) -> Result<()> {
        let key = self.key(proven);
        let proof_json = Vec::from(serde_json::to_string_pretty(proven)?);
        info!(
            leaf = ?proven.proof.leaf,
            leaf_index = proven.proof.index,
            key = %key,
            "Storing proof in s3 bucket",
        );
        let req = PutObjectRequest {
            key,
            bucket: self.bucket.clone(),
            body: Some(proof_json.into()),
            content_type: Some("application/json".to_owned()),
            ..Default::d


r","label":"RTL+","link":"https://www.tvnow.de/?utm_source=rtl&utm_medium=owned&utm_campaign=app-launcher","depth":0,"children":[],"openNewTab":true,"description":"Filme, Shows und Serien streamen."},{"id":"https://company.rtl.com/de/?utm_source=rtl&utm_medium=owned&utm_campaign=app-launcher","label":"Über unser Unternehmen","link":"https://company.rtl.com/de/?utm_source=rtl&utm_medium=owned&utm_campaign=app-launcher","depth":0,"children":[],"openNewTab":true,"description":"Über unser Unternehmen"}]},"_id":"7603cbce171bb08b6b5b8f4df83d1d1a8525a0b61367a0be4d886707d11e096e"},"expires":1636705974822,"lastModified":1636705674822}},"topics-and-persons":{"{\"articleId\":\"4723862\"}":{"data":[{"entity":"ArticleTopic","id":2965,"label":"Angela Merkel","slug":"angela-merkel","type":"person","url":"/themen/personen/angela-merkel-t2965.html"},{"entity":"ArticleTopic","id":8613,"label":"Politik","slug":"politik","type":"ereignis","url":"/themen/thema/politik-t8613.html"},{"entity":"ArticleTopic","id":9399,"label":"Bundesregierung","slug":"bundesregierung","type":"ereignis","url":"/themen/thema/bundesregierung-t9399.html"},{"entity":"ArticleTopic","id":11388,"label":"Coronavirus","slug":"coronavirus","type":"ereignis","url":"/themen/thema/coronavirus-t11388.html"}],"expires":1636705974845,"lastModified":1636705674845}},"content-feed-by-publish-date":{"{\"arc-site\":\"rtl\",\"excludeSections\":\"\",\"feedOffset\":0,\"feedSize\":7,\"includeSections\":\"/news/politik-inland\"}":{"data":{"content_elements":[{"canonical_url":"/cms/norbert-roettgen-will-cdu-chef-werden-4864747.html","description":{"basic":"Der Außenpolitiker Norbert Röttgen will neuer CDU-Vorsitzender werden. Der 56-jährige Bundestagsabgeordnete kündigte am Freitag in Berlin seine Kandidatur für die Nachfolge von Parteichef Armin Laschet an. <br/>"},"headlines":{"basic":"Röttgen kündigt Kandidatur für CDU-Vorsitz an","index_basic":"Norbert Röttgen will CDU-Chef werden ","index_text":"Der Außenpolitiker Norbert Röttgen will neuer CDU-Vorsitzender werden. Der 56-jährige Bundestagsabgeordnete kündigte am Freitag in Berlin seine Kandidatur für die Nachfolge von Parteichef Armin Laschet an."},"label":{"basic":{"text":"Suche nach neuem Vorsitzenden "},"description":{"text":"Der Außenpolitiker Norbert Röttgen will neuer CDU-Vorsitzender werden. Der 56-jährige Bundestagsabgeordnete kündigte am Freitag in Berlin seine Kandidatur für die Nachfolge von Parteichef Armin Laschet an."},"headline":{"text":"Norbert Röttgen will CDU-Chef werden "}},"promo_items":{"basic":{"_id":"3OAUFPIMF75OMHPHRDIJ4WUR6I","additional_properties":{"originalName":"https://ais-akamai.rtl.de/mas


.70.70.jpeg","/content/dam/lq/US/CA/fairfield/6779/guestroomamenity/guestroomamenity-1.jpg/jcr:content/renditions/cq5dam.web.70.70.jpeg","/content/dam/lq/US/CA/fairfield/6779/guestroomamenity/guestroomamenity-2.jpg/jcr:content/renditions/cq5dam.web.70.70.jpeg","/content/dam/lq/US/CA/fairfield/6779/propertyamenity/propertyamenity-2.jpg/jcr:content/renditions/cq5dam.web.70.70.jpeg","/content/dam/lq/US/CA/fairfield/6779/propertyamenity/propertyamenity-3.jpg/jcr:content/renditions/cq5dam.web.70.70.jpeg","/content/dam/lq/US/CA/fairfield/6779/basics/basics.jpg/jcr:content/renditions/cq5dam.web.70.70.jpeg","/content/dam/lq/US/CA/fairfield/6779/guestroomamenity/guestroomamenity-3.jpg/jcr:content/renditions/cq5dam.web.70.70.jpeg","/content/dam/lq/US/CA/fairfield/6779/guestroomamenity/guestroomamenity-4.jpg/jcr:content/renditions/cq5dam.web.70.70.jpeg","/content/dam/lq/US/CA/fairfield/6779/propertyamenity/propertyamenity-4.jpg/jcr:content/renditions/cq5dam.web.70.70.jpeg");
    var aDesc = new Array("ExteriorView","ExteriorView","ExteriorView","Guest Room","Guest Room","Guest Room","Guest Room","Guest Room","Guest Room","Guest Room","PropertyAmenity","PropertyAmenity","HealthClub","PoolView","PoolView","LobbyView","LobbyView","LobbyView","BusinessCenter","GuestRoomAmenity","GuestRoomAmenity","GuestRoomAmenity","PropertyAmenity","PropertyAmenity","Basics","GuestRoomAmenity","GuestRoomAmenity","PropertyAmenity");
    var currentImage;
    var slideshowImage;
    var timer = 0;
    var galleryImage;

    function startSlideShow() {
        var slideShowButton = $('#slideShowButton');
        slideShowButton[0].onclick = stopSlideShowWrapper;

        var image = slideShowButton.find('img');
        image.attr('src', '/etc/designs/lq-com/clientlibs-internal/img/ppGalleryPause-en.png');
        image.css('width', '60px');
        image.css('height', '21px');

        stopSlideShow(false);

        if (slideshowImage == -1)
            slideshowImage = currentImage;

        timer = setInterval("onTimer()", 10000);
    }

    function stopSlideShowWrapper() {
        stopSlideShow(true);
    }

    function stopSlideShow(fromButton) {
        if (fromButton) {
            var slideShowButton = $('#slideShowButton');
            slideShowButton[0].onclick = startSlideShow;

            var image = slideShowButton.find('img');
            image.attr('src', '/etc/designs/lq-com/clientlibs-internal/img/ppGalleryPlay-en.png');
            //image.css('width', '50px');


// @(#)root/hist:$Id$
// Author: Rene Brun   15/09/96

/*************************************************************************
 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

#ifndef ROOT_TGraphErrors
#define ROOT_TGraphErrors

//////////////////////////////////////////////////////////////////////////
//                                                                      //
// TGraphErrors                                                         //
//                                                                      //
// a Graph with error bars                                              //
//                                                                      //
//////////////////////////////////////////////////////////////////////////

#ifndef ROOT_TGraph
#include "TGraph.h"
#endif

class TGraphErrors : public TGraph {

protected:
   Double_t    *fEX;        //[fNpoints] array of X errors
   Double_t    *fEY;        //[fNpoints] array of Y errors

   virtual void       SwapPoints(Int_t pos1, Int_t pos2);

   virtual Double_t** Allocate(Int_t size);
   virtual void       CopyAndRelease(Double_t **newarrays,
                                     Int_t ibegin, Int_t iend, Int_t obegin);
   virtual Bool_t     CopyPoints(Double_t **arrays, Int_t ibegin, Int_t iend,
                                 Int_t obegin);
   Bool_t             CtorAllocate();
   virtual void       FillZero(Int_t begin, Int_t end,
                               Bool_t from_ctor = kTRUE);

public:
   TGraphErrors();
   TGraphErrors(Int_t n);
   TGraphErrors(Int_t n, const Float_t *x, const Float_t *y, const Float_t *ex=0, const Float_t *ey=0);
   TGraphErrors(Int_t n, const Double_t *x, const Double_t *y, const Double_t *ex=0, const Double_t *ey=0);
   TGraphErrors(const TVectorF &vx, const TVectorF &vy, const TVectorF &vex, const TVectorF &vey);
   TGraphErrors(const TVectorD &vx, const TVectorD &vy, const TVectorD &vex, const TVectorD &vey);
   TGraphErrors(const TGraphErrors &gr);
   TGraphErrors& operator=(const TGraphErrors &gr);
   TGraphErrors(const TH1 *h);
   TGraphErrors(const char *filename, const char *format="%lg %lg %lg %lg", Option_t *option="");
   virtual ~TGraphErrors();
   virtual void    Apply(TF1 *f);
   static Int_t    CalculateScanfFields(const char *fmt);
   virtual void    ComputeRange(Double_t &xmin, Double_t &ymin, Double_t &xmax, Double_t &ymax) const;
   Double_t        GetErrorX(Int_t bin)     const;
   Double_t        GetErrorY(Int_t bin)     const;
   Double_t        GetErrorXhigh(Int_t bin) const;
   Double_t        GetErrorXlow(Int_t bin)  const;
   Double_t        GetErrorYhigh(Int_t bin) const;
   Double_t        GetErrorYlow(Int_t bin)  const;
   Double_t       *GetEX() const {return fEX;}
   Double_t       *GetEY() const {return fEY;}
   virtual Int_t   Merge(TCollection* list);
   virtual void    Print(Option_t *chopt="") const;
   virtual void    SavePrimitive(std::ostream &out, Option_t *option = "");
   virtual void    SetPointError(Double_t ex, Double_t ey);  // *MENU
   virtual void    SetPointError(Int_t i, Double_t ex, Double_t ey);

   ClassDef(TGraphErrors,3)  //A graph with error bars
};

inline Double_t **TGraphErrors::Allocate(Int_t size) {
   return AllocateArrays(4, size);
}

#endif


        } else {
            "e-hentai.org"
        }

    override val baseUrl: String
        get() = "https://$domain"

    override val supportsLatest = true

    // KMK -->
    private val ehLang = languageMapping[lang]

    // true if lang is a "natural human language"
    private fun isLangNatural(): Boolean = lang !in listOf("none", "other", "all")

    private fun languageTag(): String {
        return "language:$ehLang"
    }
    // KMK <--

    private val preferences: UnsortedPreferences by injectLazy()
    private val updateHelper: EHentaiUpdateHelper by injectLazy()

    /**
     * Gallery list entry
     */
    data class ParsedManga(val fav: Int, val manga: SManga, val metadata: EHentaiSearchMetadata)

    private fun extendedGenericMangaParse(doc: Document) = with(doc) {
        // Parse mangas (supports compact + extended layout)
        val parsedMangas = select(".itg > tbody > tr").filter { element ->
            // Do not parse header and ads
            element.selectFirst("th") == null && element.selectFirst(".itd") == null
        }.map { body ->
            val thumbnailElement = body.selectFirst(".gl1e img, .gl2c .glthumb img")!!
            val column2 = body.selectFirst(".gl3e, .gl2c")!!
            val linkElement = body.selectFirst(".gl3c > a, .gl2e > div > a")!!
            val infoElement = body.selectFirst(".gl3e")

            // why is column2 null
            val favElement = column2.children().find { it.attr("style").startsWith("border-color") }
            val infoElements = infoElement?.select("div")
            val parsedTags = mutableListOf<RaisedTag>()

            ParsedManga(
                fav = FAVORITES_BORDER_HEX_COLORS.indexOf(
                    favElement?.attr("style")?.substring(14, 17),
                ),
                manga = SManga.create().apply {
                    // Get title
                    title = thumbnailElement.attr("title")
                    url = EHentaiSearchMetadata.normalizeUrl(linkElement.attr("href"))
                    // Get image
                    thumbnail_url = thumbnailElement.attr("src")

                    if (infoElements != null) {
                        linkElement.select("div div").getOrNull(1)?.select("tr")?.forEach { row ->
                            val namespace = row.select(".tc").text().removeSuffix(":")
                            parsedTags.addAll(
                                row.select("div").map { element ->
                                    RaisedTag(
                                        namespace,
                                        element.text().trim(),
                                        when {
                                            element.hasClass("gtl") -> TAG_TYPE_LIGHT
                                            element.hasClass("gtw") -> TAG_TYPE_WEAK
                                            else -> TAG_TYPE_NORMAL
                                        },
                                    )
                                },
                            )
                        }
                    } else {
                        val tagElement = body.selectFirst(".gl3c > a")!!
                        val tagElements = tagElement.select("div")
                        tagElements.forEach { element ->
                            if (element.className() == "gt") {
                                val namespace = element.attr("title").substringBefore(":").trimOrNull() ?: "misc"
                                parsedTags += RaisedTag(
                                    namespace,
                                    element.attr("title").substring


{
    CreateTrigImplRef* ref = (CreateTrigImplRef*)signal->getDataPtrSend();
    ref->senderRef = reference();
    ref->senderData = ss.m_req.senderData;
    ref->tableId = ss.m_req.tableId;
    ref->triggerId = ss.m_req.triggerId;
    ref->triggerInfo = ss.m_req.triggerInfo;
    ref->errorCode = ss.m_error;
    sendSignal(dictRef, GSN_CREATE_TRIG_IMPL_REF,
               signal, CreateTrigImplRef::SignalLength, JBB);
  }

  ssRelease<Ss_CREATE_TRIG_IMPL_REQ>(ssId);
}

// GSN_DROP_TRIG_IMPL_REQ

void
LocalProxy::execDROP_TRIG_IMPL_REQ(Signal* signal)
{
  if (ssQueue<Ss_DROP_TRIG_IMPL_REQ>(signal))
    return;
  const DropTrigImplReq* req = (const DropTrigImplReq*)signal->getDataPtr();
  Ss_DROP_TRIG_IMPL_REQ& ss = ssSeize<Ss_DROP_TRIG_IMPL_REQ>();
  ss.m_req = *req;
  ndbrequire(signal->getLength() == DropTrigImplReq::SignalLength);
  sendREQ(signal, ss);
}

void
LocalProxy::sendDROP_TRIG_IMPL_REQ(Signal* signal, Uint32 ssId,
                                   SectionHandle * handle)
{
  Ss_DROP_TRIG_IMPL_REQ& ss = ssFind<Ss_DROP_TRIG_IMPL_REQ>(ssId);

  DropTrigImplReq* req = (DropTrigImplReq*)signal->getDataPtrSend();
  *req = ss.m_req;
  req->senderRef = reference();
  req->senderData = ssId;
  sendSignalNoRelease(workerRef(ss.m_worker), GSN_DROP_TRIG_IMPL_REQ,
                      signal, DropTrigImplReq::SignalLength, JBB, handle);
}

void
LocalProxy::execDROP_TRIG_IMPL_CONF(Signal* signal)
{
  const DropTrigImplConf* conf = (const DropTrigImplConf*)signal->getDataPtr();
  Uint32 ssId = conf->senderData;
  Ss_DROP_TRIG_IMPL_REQ& ss = ssFind<Ss_DROP_TRIG_IMPL_REQ>(ssId);
  recvCONF(signal, ss);
}

void
LocalProxy::execDROP_TRIG_IMPL_REF(Signal* signal)
{
  const DropTrigImplRef* ref = (const DropTrigImplRef*)signal->getDataPtr();
  Uint32 ssId = ref->senderData;
  Ss_DROP_TRIG_IMPL_REQ& ss = ssFind<Ss_DROP_TRIG_IMPL_REQ>(ssId);
  recvREF(signal, ss, ref->errorCode);
}

void
LocalProxy::sendDROP_TRIG_IMPL_CONF(Signal* signal, Uint32 ssId)
{
  Ss_DROP_TRIG_IMPL_REQ& ss = ssFind<Ss_DROP_TRIG_IMPL_REQ>(ssId);
  BlockReference dictRef = ss.m_req.senderRef;

  if (!lastReply(ss))
    return;

  if (ss.m_error == 0) {
    jam();
    DropTrigImplConf* conf = (DropTrigImplConf*)signal->getDataPtrSend();
    conf->senderRef = reference();
    conf->senderData = ss.m_req.senderData;
    conf->tableId = ss.m_req.tableId;
    conf->triggerId = ss.m_req.triggerId;
    sendSignal(dictRef, GSN_DROP_TRIG_IMPL_CONF,
               signal, DropTrigImplConf::SignalLength, JBB);
  } else {
    DropTrigImplRef* ref = (DropTrigImplRef*)signal->getDataPtrSend();
    ref->senderRef =


---@meta
---@diagnostic disable: missing-return, unused-local

---@alias iterator fun()

---@module 'LuaXML'
---@class LuaXML
local LuaXML

---AI Generated
---Creates a new LuaXML object.
---
---Example:
---```lua
----- create a new XML object and set its tag to "root"
---local x = xml.new("root")
----- append a new subordinate XML object, set its tag to "child", and its content to 123
---x:append("child")[1] = 123
---print(x)
---```
---@param arg string?
---@return LuaXML
function LuaXML.new(arg) end

---AI Generated
---Appends a new subordinate LuaXML object to an existing one, optionally sets tag.
---
---Example:
---```lua
----- append a new subordinate XML object, set its tag to "child", and its content to 123
---x:append("child")[1] = 123
---print(x)
---```
---@param tag string?
---@return table
function LuaXML.append(tag) end

---AI Generated
---Iterate subelements (“XML children”) as key – value pairs.
---
---Example:
---```lua
----- iterate over the XML object's children and print their tags and values
---for k, v in x:children() do
---    print(k, v)
---end
---```
---@return iterator
function LuaXML.children() end

---AI Generated
---Converts a string from XML encoding.
---
---Example:
---```lua
----- decode an XML encoded string
---local xmlstr = "<xml>test</xml>"
---local decoded = xml.decode(xmlstr)
---print(decoded) -- prints "test"
---```
---@param str string?
---@return string?
function LuaXML.decode(str) end

---AI Generated
---Converts a string to XML encoding.
---
---Example:
---```lua
----- encode an string into XML format
---local xmlstr = xml.encode("test")
---print(xmlstr) -- prints "<xml>test</xml>"
---```
---@param str string?
---@return string?
function LuaXML.encode(str) end

---AI Generated
---Iterates a LuaXML object, invoking a callback function for all matching (sub)elements.
---
---Example:
---```lua
----- iterate over the XML object and print its tags and values
---x:interate(function(k, v)
---    print(k, v)
---end)
---```
---@param cb function?
---@return nil
function LuaXML.iterate(cb) end

---AI Generated
---Match XML entity against given (optional) criteria.
---
---Example:
---```lua
----- match an XML element with a specific tag and attribute value
---local x = xml.match(x, "child", "attr", 123)


--

infix operator fun Number.plus(b: Vec4d) = plus(Vec4d(), b, this.d, this.d, this.d, this.d)
fun Number.plus(b: Vec4d, res: Vec4d) = plus(res, b, this.d, this.d, this.d, this.d)
infix fun Number.plus_(b: Vec4d) = plus(b, b, this.d, this.d, this.d, this.d)

infix operator fun Number.minus(b: Vec4d) = minus(Vec4d(), this.d, this.d, this.d, this.d, b)
fun Number.minus(b: Vec4d, res: Vec4d) = minus(res, b, this.d, this.d, this.d, this.d)
infix fun Number.minus_(b: Vec4d) = minus(b, this.d, this.d, this.d, this.d, b)

infix operator fun Number.times(b: Vec4d) = times(Vec4d(), b, this.d, this.d, this.d, this.d)
fun Number.times(b: Vec4d, res: Vec4d) = times(res, b, this.d, this.d, this.d, this.d)
infix fun Number.times_(b: Vec4d) = times(b, b, this.d, this.d, this.d, this.d)

infix operator fun Number.div(b: Vec4d) = div(Vec4d(), this.d, this.d, this.d, this.d, b)
fun Number.div(b: Vec4d, res: Vec4d) = div(res, b, this.d, this.d, this.d, this.d)
infix fun Number.div_(b: Vec4d) = div(b, this.d, this.d, this.d, this.d, b)

infix operator fun Number.rem(b: Vec4d) = rem(Vec4d(), this.d, this.d, this.d, this.d, b)
fun Number.rem(b: Vec4d, res: Vec4d) = rem(res, b, this.d, this.d, this.d, this.d)
infix fun Number.rem_(b: Vec4d) = rem(b, this.d, this.d, this.d, this.d, b)package glm_.vec4.operators

import glm_.f
import glm_.vec4.Vec4
import glm_.vec4.Vec4.Companion.div
import glm_.vec4.Vec4.Companion.minus
import glm_.vec4.Vec4.Companion.plus
import glm_.vec4.Vec4.Companion.rem
import glm_.vec4.Vec4.Companion.times

/**
 * Created by elect on 05/11/16.
 */

interface vec4_operators {

    fun plus(res: Vec4, a: Vec4, bX: Float, bY: Float, bZ: Float, bW: Float): Vec4 {
        res.x = a.x + bX
        res.y = a.y + bY
        res.z = a.z + bZ
        res.w = a.w + bW
        return res
    }

    fun minus(res: Vec4, a: Vec4, bX: Float, bY: Float, bZ: Float, bW: Float): Vec4 {
        res.x = a.x - bX
        res.y = a.y - bY
        res.z = a.z - bZ
        res.w = a.w - bW
        return res
    }

    fun minus(res: Vec4, aX: Float, aY: Float, aZ: Float, aW: Float, b: Vec4): Vec4 {
        res.x = aX - b.x
        res.y = aY - b.y
        res.z = aZ - b.z
        res.w = aW - b.w
        return res
    }

    fun times(res: Vec4, a: Vec4, bX: Float, bY: Float, bZ: Float, bW: Float):


/* OOQP                                                               *
 * Authors: E. Michael Gertz, Stephen J. Wright                       *
 * (C) 2001 University of Chicago. See Copyright Notification in OOQP */

#ifndef QPBOUNDPETSC
#define QPBOUNDPETSC

#include "QpBound.h"
#include "petscmat.h"
#include "petscksp.h"

class QpBoundData;

class QpBoundPetsc : public QpBound {
protected:
  int m;
  KSP mKsp;
public:
  virtual QpBoundData     *makeData( double alpha, Vec g, Mat Q,
				     Vec l, Vec il, Vec u, Vec iu );
  virtual QpBoundData     *makeData();

  virtual Variables       *makeVariables(Data * prob_in);
  virtual Variables       *makeVariables( Data * problem,
					  Vec x,
					  Vec t,   Vec v,
					  Vec tau, Vec nu );
  virtual Residuals       *makeResiduals(Data * prob_in);
  virtual Residuals       *makeResiduals( Data * problem,
					  Vec rg );
  QpBoundPetsc( int nx );
  QpBoundPetsc( int m, int n );
  QpBoundPetsc( int m, int n, KSP ksp );

  virtual LinearSystem   * makeLinsys( Data *prob );
  virtual OoqpVector * newPrimalVector();

};

#endif


using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace PWABuilder.MicrosoftStore.Models
{
    /// <summary>
    /// W3C web manifest. https://www.w3.org/TR/appmanifest/
    /// </summary>
    public class WebAppManifest
    {
        public string? Background_color { get; set; }
        public string? Description { get; set; }
        public string? Dir { get; set; }
        public string? Display { get; set; }
        public string? Lang { get; set; }
        public string? Name { get; set; }
        public string? Orientation { get; set; }
        public bool? Prefer_related_applications { get; set; }
        public string? Scope { get; set; }
        public string? Short_name { get; set; }
        public string? Start_url { get; set; }
        public string? Theme_color { get; set; }
        public string? Url { get; set; }
        public List<string>? Categories { get; set; }
        public List<WebManifestScreenshot>? Screenshots { get; set; }
        public string? Iarc_rating_id { get; set; }
        public List<WebManifestIcon>? Icons { get; set; }
        public List<WebManifestShortcutItem>? Shortcuts { get; set; }

        /// <summary>
        /// Finds a general purpose icon with the specified dimensions.
        /// </summary>
        /// <returns>A match</returns>
        public IEnumerable<WebManifestIcon> GetIconWithDimensions(string dimensions)
        {
            var widthAndHeight = dimensions.Split('x', StringSplitOptions.RemoveEmptyEntries);
            if (!int.TryParse(widthAndHeight.ElementAtOrDefault(0), out var width) || !int.TryParse(widthAndHeight.ElementAtOrDefault(1), out var height))
            {
                throw new ArgumentException($"Invalid dimensions string. Expected format 100x100, but received {dimensions}", nameof(dimensions));
            }

            return GetIconsWithDimensions(width, height);
        }

        /// <summary>
        /// Finds a general purpose icon with the specified dimensions.
        /// </summary>
        /// <returns>A match</returns>
        public IEnumerable<WebManifestIcon> GetIconsWithDimensions(int width, int height)
        {
            if (this.Icons == null)
            {
                return Enumerable.Empty<WebManifestIcon>();
            }

            // Find icons that have the specified dimensions, ordered by those with purpose = "any" (or empty), then ordered by png, then jpg.
            return this.Icons
                .Where(i => i.GetAllDimensions().Any(d => d.width == width && d.height == height))
                .OrderBy(i => !string.IsNullOrEmpty(i.Src) ? 0 : 1)
                .ThenBy(i => i.GetImageFormatPreferredSortOrder());
        }

        /// <summary>
        /// Gets the value of the <see cref="Display"/> member and returns it if it's one of the supported values.
        /// If it's not a supported value, or it's null or empty, null will be returned.
        /// </summary>
        /// <returns>The <see cref="Display"/> value if it's one of the known, supported values. Otherwise null.</returns>
        /// <remarks>
        /// Supported display mode values: https://www.w3.org/TR/appmanifest/#dfn-display-modes-values
        /// </remarks>
        public string? GetDisplayModeOrNull()
        {
            var supportedDisplayModes = new[]
            {
                "fullscreen",
                "standalone",
                "minimal-ui",
                "browser"
            };
            return supportedDisplayModes.FirstOrDefault(d => string.Equals(d, this.Display));
        }
    }

    public class WebManifestIcon
    {
        public string? Src { get; set; }
        public string? Type { get; set; }
        public string? Sizes { get; set; }
        public string? Purpose { get


cm) {
        await _ffiBind.cmInit();
      }
      await _ffiBind.mainDeviceId(id: id);
      await _ffiBind.mainDeviceName(name: name);
      await _ffiBind.mainSetHomeDir(home: _homeDir);
      await _ffiBind.mainInit(
        appDir: _dir,
        customClientConfig: '',
      );
    } catch (e) {
      debugPrintStack(label: 'initialize failed: $e');
    }
    version = await getVersion();
  }

  Future<bool> tryHandle(Map<String, dynamic> evt) async {
    final name = evt['name'];
    if (name != null) {
      final handlers = _eventHandlers[name];
      if (handlers != null) {
        if (handlers.isNotEmpty) {
          for (var handler in handlers.values) {
            await handler(evt);
          }
          return true;
        }
      }
    }
    return false;
  }

  /// Start listening to the Rust core's events and frames.
  void _startListenEvent(RustdeskImpl rustdeskImpl) {
    final appType =
        _appType == kAppTypeDesktopRemote ? '$_appType,$kWindowId' : _appType;
    var sink = rustdeskImpl.startGlobalEventStream(appType: appType);
    sink.listen((message) {
      () async {
        try {
          Map<String, dynamic> event = json.decode(message);
          // _tryHandle here may be more flexible than _eventCallback
          if (!await tryHandle(event)) {
            if (_eventCallback != null) {
              await _eventCallback!(event);
            }
          }
        } catch (e) {
          debugPrint('json.decode fail(): $e');
        }
      }();
    });
  }

  void setEventCallback(StreamEventHandler fun) async {
    _eventCallback = fun;
  }

  void setRgbaCallback(void Function(int, Uint8List) fun) async {}

  void startDesktopWebListener() {}

  void stopDesktopWebListener() {}

  void setMethodCallHandler(FMethod callback) {
    _toAndroidChannel.setMethodCallHandler((call) async {
      callback(call.method, call.arguments);
      return null;
    });
  }

  invokeMethod(String method, [dynamic arguments]) async {
    if (!isAndroid) return Future<bool>(() => false);
    return await _toAndroidChannel.invokeMethod(method, arguments);
  }

  void syncAndroidServiceAppDirConfigPath() {
    invokeMethod(AndroidChannel.kSyncAppDirConfigPath, _dir);
  }

  void setFullscreenCallback(void Function(bool) fun) {}
}
import 'package:flutter/material.dart';
import './common.dart';
import './manager.dart';

final Map<String, LocationModel> _locationModels = {};
final Map<String, OptionModel> _optionModels = {};

class OptionModel with ChangeNotifier {
  String? v;

  String? get value => v;
  set value(String? v) {
    this.v = v;
    notifyListeners();
  }

  static String key(String location, PluginId id, String peer, String k) =>
      '$location|$id|$peer|$k';
}

class PluginModel with ChangeNotifier {
  final List<UiType> uiList = [];
  final Map<String, String> opts = {};

  void add(List<UiType> uiList) {
    bool found = false;
    for (var ui in uiList) {
      for (int i = 0; i < this.uiList.length; i++) {
        if (this.uiList[i].key == ui.key) {
          this.uiList[i] = ui;
          found = true;
        }
      }
      if (!found) {
        this.uiList.add(ui);
      }
    }
    noti


                                                <svg width="23" height="35" viewBox="0 0 23 35" fill="none" xmlns="https://www.w3.org/2000/svg">
                                                    <path d="M22.783 10.92C22.783 17.359 17.783 18.359 17.783 24.36C17.783 27.458 14.66 27.719 12.283 27.719C10.23 27.719 5.69696 26.94 5.69696 24.358C5.69696 18.36 0.782959 17.36 0.782959 10.92C0.782959 4.889 6.06796 0 11.866 0C17.666 0 22.783 4.889 22.783 10.92Z" fill="#FFD983"></path>
                                                    <path d="M15.95 32.36C15.95 33.188 13.716 34.86 11.783 34.86C9.84997 34.86 7.61597 33.188 7.61597 32.36C7.61597 31.532 9.84897 31.86 11.783 31.86C13.716 31.86 15.95 31.532 15.95 32.36Z" fill="#CCD6DD"></path>
                                                    <path d="M16.49 10.153C16.099 9.76201 15.467 9.76201 15.076 10.153L11.783 13.446L8.48996 10.153C8.09896 9.76201 7.46696 9.76201 7.07596 10.153C6.68496 10.544 6.68496 11.176 7.07596 11.567L10.783 15.274V25.86C10.783 26.413 11.231 26.86 11.783 26.86C12.335 26.86 12.783 26.413 12.783 25.86V15.274L16.49 11.567C16.881 11.176 16.881 10.544 16.49 10.153V10.153Z" fill="#FFCC4D"></path>
                                                    <path d="M17.783 30.86C17.783 31.964 16.887 32.86 15.783 32.86H7.78296C6.67896 32.86 5.78296 31.964 5.78296 30.86V24.86H17.783V30.86Z" fill="#99AAB5"></path>
                                                    <path d="M5.78202 31.86C5.30202 31.86 4.87802 31.513 4.79702 31.024C4.70602 30.48 5.07402 29.964 5.61902 29.874L17.619 27.874C18.163 27.776 18.679 28.151 18.769 28.696C18.86 29.24 18.492 29.756 17.947 29.846L5.94702 31.846C5.89202 31.856 5.83602 31.86 5.78202 31.86V31.86ZM5.78202 27.86C5.30202 27.86 4.87802 27.513 4.79702 27.024C4.70602 26.48 5.07402 25.964 5.61902 25.874L17.619 23.874C18.163 23.777 18.679 24.151 18.769 24.696C18.86 25.24 18.492 25.756 17.947 25.846L5.94702 27.846C5.89202 27.856 5.83602 27.86 5.78202 27.86V27.86Z" fill="#CCD6DD"></path>
                                                </svg>

                                                测试分类

                                        </


="24" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24"><path fill="currentColor" d="M13.905 0 8.571 5.4l.037.037.096.096 3.586 3.395-2.24 2.252h-.01l-1.576 1.586 3.737 3.766-3.735 3.803.126.139v.012L12.052 24l1.608-1.64-1.98-2.034 3.737-3.79-1.608-1.642-.01.012-2.13-2.129 3.867-3.866-.017-.015.016-.016-3.641-3.524 3.64-3.694z"/></svg>';
  static const String composer =
      '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="24" height="24" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24"><path fill="currentColor" d="M16.66 0c-.07 0-.114.034-.164.095a.416.416 0 00-.07.43c.19.41.363.83.528 1.25.01.02.022.04.039.068-.04-.002-.05-.022-.063-.043-.297-.31-.648-.557-.998-.804-.473-.337-.99-.603-1.503-.872a.578.578 0 00-.214-.065l-.384-.04c-.202-.025-.355.09-.355.292 0 .108-.046.132-.135.14-.08.004-.187.115-.196.192a.694.694 0 00.228.619c.444.415.873.845 1.303 1.275l.015.007a.1.1 0 01.028.038c-.007.003-.014.003-.02.003a.057.057 0 01-.035-.022c-.002-.002-.005-.005-.005-.007-.062-.036-.127-.07-.187-.11-.3-.2-.595-.404-.895-.598a.943.943 0 00-.461-.17.453.453 0 00-.392.143.28.28 0 00-.088.253c.016.146.115.237.223.312.502.338.95.734 1.366 1.174.036.038.074.079.115.112.118.096.19.224.262.356.033.06.02.074-.043.074-.428 0-.836.118-1.246.204-.168.036-.334.094-.394.28-.065.21-.096.328.16.392a9.57 9.57 0 011.49.516.55.55 0 01.117.077c.12.104.23.219.362.303.38.247.77.478 1.22.583.053.012.1.039.15.05.05.015.085.044.095.094.029.178.139.279.305.33.02.006.038.02.06.028.052.017.076.055.093.108.067.24.137.478.212.715.026.08.002.1-.07.123-.372.108-.742.22-1.112.334-.132.04-.134.043-.067.163l.908 1.635c.127.23.132.23.365.11.024-.012.057-.053.079-.014.02.036.06.089.024.13-.113.129-.19.28-.286.42-.031.045-.031.074-.005.117.1.166.202.334.3.502.012.019.034.043.03.058l-.123.367a2.538 2.538 0 00-.317-.716c-.18-.288-.41-.542-.62-.811-.033-.04-.072-.077-.11-.115-.2-.207-.456-.332-.7-.478a1.026 1.026 0 00-.34-.127c-.374-.08-.746-.11-1.12.004-.075.024-.116.


 router.delete(`/${routePath}/:id`, (req: Request, res: Response) => {
        const id = req.params.id;

        if (!id) {
            res.status(500)
                .send({ error: 'Sorry, Missing parameter: id' })
                .end();
        }

        try {
            repository.remove(id);
            res.send(id).end();
        } catch (e) {
            res.status(500).send(e).end();
        }

        res.send(id).end();
    });

    return router;
}
/*
Aufgabe: Aufgabe 7
Name: Ruth Sutor
Matrikel: 254899
Datum: 9/05/2017
Hiermit versichere ich, dass ich diesen
Code selbst geschrieben habe. Er wurde
nicht kopiert und auch nicht diktiert.
*/
namespace Blumenwiese {
    export class FLower {
        xposition: number;
        yposition: number;
        form: boolean;
        color: string;
        //Methoden:
        constructor() {
            //Position
            this.yposition = Math.round((Math.random() * 100) + 160);
            this.xposition = Math.round((Math.random() * 400) + 0);
            //Blumensorte
            let flowerKind: number = Math.round(Math.random());
            if (flowerKind == 0) {
                this.form = true;
            }
            if (flowerKind == 1) {
                this.form = false;
            }
            //Farbe
            let c: number = Math.round(Math.random());
            if (c == 0) {
                this.color = "#ff99ff";
            }
            if (c == 1) {
                this.color = "#cc66ff";
            }
            this.draw();
        }
        draw(): void {
            if (this.form == true) {
                leinwand.beginPath();
                leinwand.moveTo(this.xposition, this.yposition);
                leinwand.quadraticCurveTo(this.xposition, this.yposition - 5, this.xposition + 5, this.yposition);
                leinwand.quadraticCurveTo(this.xposition + 7.5, this.yposition - 5, this.xposition + 10, this.yposition);
                leinwand.quadraticCurveTo(this.xposition + 15, this.yposition - 5, this.xposition + 15, this.yposition);
                leinwand.quadraticCurveTo(this.xposition + 7.5, this.yposition + 15, this.xposition, this.yposition);
                leinwand.closePath();
                leinwand.fillStyle = this.color;
                leinwand.fill();
                leinwand.beginPath();
                leinwand.moveTo(this.xposition + 10, this.yposition + 15);
            }
            if (this.form == true) {
                leinwand.beginPath();
                leinwand.arc(this.xposition + 5, this.yposition, 2.5, 0, 2 * Math.PI);
                leinwand.arc(this.xposition - 5, this.yposition, 2.5, 0, 2 * Math.PI);
                leinwand.arc(this.xposition, this.yposition + 5, 2.5, 0, 2 * Math.PI);
                leinwand.arc(this.xposition, this.yposition - 5, 2.5, 0, 2 * Math.PI);
                leinwand.closePath();
                leinwand.fillStyle = this.color;
                leinwand.fill();
                leinwand.beginPath();
                leinwand.arc(this.xposition + 3.5, this.yposition + 3.5, 2.5, 0, 2 * Math.PI);
                leinwand.arc(this.xposition + 3.5, this.yposition - 3.5, 2.5, 0, 2 * Math.PI);
                leinwand.arc(this.xposition - 3.5, this.yposition + 3.5,


additional capabilities needed for
/// physical query execution (such as the ability to perform a scan). The reason for
/// having two separate traits is to avoid having the logical plan code be dependent
/// on the DataFusion execution engine. Other projects may want to use DataFusion's
/// logical plans and have their own execution engine.
pub trait TableSource: Sync + Send {
    fn as_any(&self) -> &dyn Any;

    /// Get a reference to the schema for this table
    fn schema(&self) -> SchemaRef;

    /// Get the type of this table for metadata/catalog purposes.
    fn table_type(&self) -> TableType {
        TableType::Base
    }

    /// Tests whether the table provider can make use of a filter expression
    /// to optimise data retrieval.
    fn supports_filter_pushdown(
        &self,
        _filter: &Expr,
    ) -> datafusion_common::Result<TableProviderFilterPushDown> {
        Ok(TableProviderFilterPushDown::Unsupported)
    }
}
<reponame>rsnively/rangetools
use crate::Rangetools;

/// Helper trait for performing range intersection.
///
/// In most cases, users should import the `Rangetools` trait instead of this one, as it performs
/// the necessary forwarding.  See [`.intersection()`](crate::Rangetools::intersection) for more information.
pub trait RangeIntersection<Rhs, RhsInner> {
    /// The output type of the intersection.
    type Output;
    /// Returns the set intersection of `self` and `other`.
    fn intersection(self, other: Rhs) -> Self::Output
    where
        Rhs: Rangetools<Inner = RhsInner>;
}
extern crate iron;
#[macro_use]
extern crate tera;
#[macro_use]
extern crate lazy_static;

extern crate koo;

use iron::prelude::Iron;
use tera::{Tera, Context};
use koo::routers::router_generator;

// 延迟渲染模版
lazy_static! {
    pub static ref TEMPLATES: Tera = {
        let tera = compile_templates!("templates/**/*");
        tera
    };
}

fn main () {
    let _server = Iron::new(router_generator()).http("localhost:3000").unwrap();
    println!("Server on :3000");
}
/*   Copyright 2020 <NAME>
 *
 *  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.
 *
 *  SPDX-License-Identifier: Apache-2.0
 *
 *  Tests to verify requirements of RFC4861: Neighbor Discovery for IP version 6
 */

/* Section 2.3: All interfaces on routers MUST have a link-local address.
 * Justification: Kernels responsibility.
 */

/* Section 4.1: [Reserved field] MUST be initialized to zero by the sender and MUST be ignored by
 * the receiver.
 */
#[test]
fn test_reserved_is_zero() {
    let conf = config::Interface {};
    let adv = build_announcement_pure(&conf, Some([1, 2, 3, 4, 5, 6]), Some(1500));
    let pkt = icmppkt::serialise(&icmppkt::Icmp6::RtrAdvert(adv));
    assert_eq!(pkt[4..9], [0, 0, 0, 0]);
}
use std::mem::MaybeUninit;

use crate::{
    api::{self, napi_node_version},
    prelude::*,
};

#[repr(C)]
#[derive(Clone, Copy, Debug)]
pub struct NapiEnv(pub(crate) napi_env);

impl AsRef<napi_env> for NapiEnv {


// SPDX-License-Identifier: Apache-2.0
// Copyright 2023 The Prime Citizens
//
// Copyright 2018 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build pcz && arm

#include "textflag.h"

TEXT ·IndexSliceByte(SB),NOSPLIT,$0-20
	MOVW b_base+0(FP), R0
	MOVW b_len+4(FP), R1
	MOVBU c+12(FP), R2 // byte to find
	MOVW $ret+16(FP), R5
	B indexbytebody<>(SB)

TEXT ·IndexByte(SB),NOSPLIT,$0-16
	MOVW s_base+0(FP), R0
	MOV


[rdx+1016]	 # AVX512F Disp8
	vscalefsd	xmm30{k7}, xmm29, QWORD PTR [rdx+1024]	 # AVX512F
	vscalefsd	xmm30{k7}, xmm29, QWORD PTR [rdx-1024]	 # AVX512F Disp8
	vscalefsd	xmm30{k7}, xmm29, QWORD PTR [rdx-1032]	 # AVX512F

	vscalefss	xmm30{k7}, xmm29, xmm28	 # AVX512F
	vscalefss	xmm30{k7}{z}, xmm29, xmm28	 # AVX512F
	vscalefss	xmm30{k7}, xmm29, xmm28, {rn-sae}	 # AVX512F
	vscalefss	xmm30{k7}, xmm29, xmm28, {ru-sae}	 # AVX512F
	vscalefss	xmm30{k7}, xmm29, xmm28, {rd-sae}	 # AVX512F
	vscalefss	xmm30{k7}, xmm29, xmm28, {rz-sae}	 # AVX512F
	vscalefss	xmm30{k7}, xmm29, DWORD PTR [rcx]	 # AVX512F
	vscalefss	xmm30{k7}, xmm29, DWORD PTR [rax+r14*8+0x1234]	 # AVX512F
	vscalefss	xmm30{k7}, xmm29, DWORD PTR [rdx+508]	 # AVX512F Disp8
	vscalefss	xmm30{k7}, xmm29, DWORD PTR [rdx+512]	 # AVX512F
	vscalefss	xmm30{k7}, xmm29, DWORD PTR [rdx-512]	 # AVX512F Disp8
	vscalefss	xmm30{k7}, xmm29, DWORD PTR [rdx-516]	 # AVX512F

	vfixupimmps	zmm30, zmm29, zmm28, 0xab	 # AVX512F
	vfixupimmps	zmm30{k7}, zmm29, zmm28, 0xab	 # AVX512F
	vfixupimmps	zmm30{k7}{z}, zmm29, zmm28, 0xab	 # AVX512F
	vfixupimmps	zmm30, zmm29, zmm28, {sae}, 0xab	 # AVX512F
	vfixupimmps	zmm30, zmm29, zmm28, 123	 # AVX512F
	vfixupimmps	zmm30, zmm29, zmm28, {sae}, 123	 # AVX512F
	vfixupimmps	zmm30, zmm29, ZMMWORD PTR [rcx], 123	 # AVX512F
	vfixupimmps	zmm30, zmm29, ZMMWORD PTR [rax+r14*8+0x1234], 123	 # AVX512F
	vfixupimmps	zmm30, zmm29, [rcx]{1to16}, 123	 # AVX512F
	vfixupimmps	zmm30, zmm29, ZMMWORD PTR [rdx+8128], 123	 # AVX512F Disp8
	vfixupimmps	zmm30, zmm29, ZMMWORD PTR [rdx+8192], 123	 # AVX512F
	vfixupimmps	zmm30, zmm29, ZMMWORD PTR [rdx-8192], 123	 # AVX512F Disp8
	vfixupimmps	zmm30, zmm29, ZMMWORD PTR [rdx-8256], 123	 # AVX512F
	vfixupimmps	zmm30, zmm29, [rdx+508]{1to16}, 123	 # AVX512F Disp8
	vfixupimmps	zmm30, zmm29, [rdx+512


lw    $s2, 0x20($sp)
/* 023C30 80023030 8FB30024 */  lw    $s3, 0x24($sp)
/* 023C34 80023034 8FB40028 */  lw    $s4, 0x28($sp)
/* 023C38 80023038 8FB5002C */  lw    $s5, 0x2c($sp)
/* 023C3C 8002303C


unction score)
    nms_threshold = 0.1  # Ngưỡng chồng chéo cho NMS

    print("\n--- Bắt đầu thử nghiệm phát hiện trên các ảnh test (Với HOG) ---")
    for img_file in test_images:
        img_file = os.path.join(IMG_BASE_PATH, img_file)
        if not os.path.exists(img_file):
            print(f"\nCảnh báo: Không tìm thấy file ảnh {img_file}. Bỏ qua.")
            continue
        detect_faces(img_file, best_svm_model, mean, std, PATCH_SIZE,
                     output_folder, conf_thresh=confidence_threshold, nms_thresh=nms_threshold)
    print("--- Kết thúc thử nghiệm phát hiện ---")

if __name__ == "__main__":
    main()


 GPUObject is being used in a current instruction)
	 */
	protected boolean writeLock = false;

	/**
	 * Timestamp, needed by {@link GPUContext\#evict(long)}
	 */
	AtomicLong timestamp = new AtomicLong();

	/**
	 * Whether this block is in sparse format
	 */
	protected boolean isSparse = false;

	/**
	 * Enclosing {@link MatrixObject} instance
	 */
	MatrixObject mat = null;

	/**
	 * Shadow buffer instance
	 */
	final ShadowBuffer shadowBuffer;

	// ----------------------------------------------------------------------
	// Methods used to access, set and check jcudaDenseMatrixPtr

	/**
	 * Pointer to dense matrix
	 *
	 * @return a pointer to the dense matrix
	 */
	public Pointer getDensePointer() {
		if(jcudaDenseMatrixPtr == null && shadowBuffer.isBuffered() && getJcudaSparseMatrixPtr() == null) {
			shadowBuffer.moveToDevice();
		}
		return jcudaDenseMatrixPtr;
	}

	/**
	 * Checks if the dense pointer is null
	 *
	 * @return if the state of dense pointer is null
	 */
	public boolean isDensePointerNull() {
		return jcudaDenseMatrixPtr == null;
	}

	/**
	 * Removes the dense pointer and potential soft reference
	 */
	public void clearDensePointer() {
		jcudaDenseMatrixPtr = null;
		shadowBuffer.clearShadowPointer();
	}

	public MatrixObject getMatrixObject() {
		return mat;
	}

	/**
	 * Convenience method to directly set the dense matrix pointer on GPU
	 *
	 * @param densePtr dense pointer
	 */
	public void setDensePointer(Pointer densePtr) {
		if (!this.isDensePointerNull()) {
			throw new DMLRuntimeException("jcudaDenseMatrixPtr was already allocated for " + this + ", this will cause a memory leak on the GPU");
		}
		this.jcudaDenseMatrixPtr = densePtr;
		this.isSparse = false;
		if(LOG.isDebugEnabled()) {
			LOG.debug("Setting dense pointer of size " + getGPUContext().getMemoryManager().getSizeAllocatedGPUPointer(densePtr));
		}
		if (getJcudaSparseMatrixPtr() != null) {
			getJcudaSparseMatrixPtr().deallocate();
			jcudaSparseMatrixPtr = null;
		}
	}

	public void setDirty(boolean flag) {
		dirty = flag;
	}
	// ----------------------------------------------------------------------

	@Override
	public Object clone() {
		GPUObject me = this;
		GPUObject that = new GPUObject(me.gpuContext, me.mat);
		that.dirty = me.dirty;
		// The only place clone is getting called: LibMatrixCUDA's solve
		that.readLocks.reset();
		that.writeLock = false;

		that.timestamp = new AtomicLong(me.timestamp.get());
		that.isSparse = me.isSparse;

		try {
			if (!me.isDensePointerNull()) {
				long rows = me.mat.getNumRows();
				long cols = me.mat.getNumColumns();
				long size = rows * cols * LibMatrixCUDA.sizeOfDataType;
				that.setDensePointer(allocate(size, false));
				cudaMemcpy(that.getDensePointer(), me.getDensePointer(), size, cudaMemcpyDeviceToDevice);
			}

			if (me.getJcudaSparseMatrixPtr() != null) {
				long rows = mat.getNumRows();
				that.jcudaSparseMatrixPtr = me.jcudaSparseMatrixPtr.clone((int) rows);
			}

		} catch (DMLRuntimeException e) {
			throw new RuntimeException(e);
		}

		return that;
	}

	private Pointer allocate(long size, boolean initialize) {
		return getGPUContext().allocate(null, size, initialize);
	}

	private void cudaFreeHelper(


eward(43),
    ActivityMonsterDrop(44),
    ActivityGather(45),
    ActivitySubfieldDrop(46),
    TowerScheduleReward(47),
    TowerFloorStarReward(48),
    TowerFirstPassReward(49),
    TowerDailyReward(50),
    HitClientTrivialEntity(51),
    OpenWorldBossChest(52),
    MaterialDeleteReturn(53),
    SignInReward(54),
    OpenBlossomChest(55),
    Recharge(56),
    BonusActivityReward(57),
    TowerCommemorativeReward(58),
    TowerSkipFloorReward(59),
    RechargeBonus(60),
    RechargeCard(61),
    RechargeCardDaily(62),
    RechargeCardReplace(63),
    RechargeCardReplaceFree(64),
    RechargePlayReplace(65),
    MpPlayTakeReward(66),
    ActivityWatcher(67),
    SalesmanDeliverItem(68),
    SalesmanReward(69),
    Rebate(70),
    McoinExchangeHcoin(71),
    DailyTaskExchangeLegendaryKey(72),
    UnlockPersonLine(73),
    FetterLevelReward(74),
    BuyResin(75),
    RechargePackage(76),
    DeliveryDailyReward(77),
    CityReputationLevel(78),
    CityReputationQuest(79),
    CityReputationRequest(80),
    CityReputationExplore(81),
    OffergingLevel(82),
    RoutineHost(83),
    RoutineGuest(84),
    TreasureMapSpotToken(89),
    TreasureMapBonusLevelReward(90),
    TreasureMapMpReward(91),
    Convert(92),
    OverflowTransform(93),
    ActivityAvatarSelectionReward(96),
    ActivityWatcherBatch(97),
    HitTreeDrop(98),
    GetHomeLevelupReward(99),
    HomeDefaultFurniture(100),
    ActivityCond(101),
    BattlePassNotify(102),
    PlayerUseItem(1001),
    DropItem(1002),
    WeaponUpgrade(1011),
    WeaponPromote(1012),
    WeaponAwaken(1013),
    RelicUpgrade(1014),
    Ability(1015),
    DungeonStatueDrop(1016),
    OfflineMsg(1017),
    AvatarUpgrade(1018),
    AvatarPromote(1019),
    QuestAction(1021),
    CityLevelup(1022),
    UpgradeSkill(1024),
    UnlockTalent(1025),
    UpgradeProudSkill(1026),
    PlayerLevelLimitUp(1027),
    DungeonDaily(1028),
    ItemGiving(1030),
    ForgeCost(1031),
    InvestigationReward(1032),
    InvestigationTargetReward(1033),
    GadgetInteract(1034),
    SeaLampCiMaterial(1036),
    SeaLampContributionReward(1037),
    SeaLampPhaseReward(1038),
    SeaLampFlyLamp(1039),
    AutoRecover(1040),
    ActivityExpireItem(1041),
    SubCoinNegative(1042),
    BargainDeduct(1043),
    BattlePassPaidReward(1044),
    BattlePassLevelReward(1045),
    TrialAvatarActivityFirstPassReward(1046),
    BuyBattlePassLevel(1047),
    GrantBirthdayBenefit(1048),
    AchievementReward(1049),
    AchievementGoalReward(1050),
    FirstShareToSocialNetwork(1051),
    DestroyMaterial(1052),
    CodexLevelupReward(1053),
    HuntingOfferReward(1054),
    UseWidgetAnchorPoint(1055),
    UseWidgetBonfire(1056),
    UngradeWeaponReturnMaterial(1057),
    UseWidgetOneoffGatherPointDetector(1058),
    UseWidgetClientCollector(1059),
    UseWidgetClientDetector(1060),
    TakeGeneralReward(1061),
    AsterTakeSpecialReward(1062),
    RemoveCodexBook(1063),
    OfferingItem(10


y containing report processors, e.g.

* AIO installations: /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/reports/
* Fedora: /usr/share/ruby/vendor_ruby/puppet/reports/
* Debian or Ubuntu: /usr/lib/ruby/vendor_ruby/puppet/reports/
* other OSes, look for tagmail.rb in the Puppet installation (`locate tagmail.rb`)

Copy [the report processor source](https://raw.githubusercontent.com/theforeman/puppet-puppetserver_foreman/master/files/report.rb) to this report directory and name it `foreman.rb`.

Create a new configuration file at `/etc/puppetlabs/puppet/foreman.yaml` (Puppet 4 AIO) or `/etc/puppet/foreman.yaml` (non-AIO) containing:
```yaml
---
# Update for your Foreman and Puppet server hostname(s)
:url: "https://foreman.example.com"
:ssl_ca: "/etc/puppetlabs/puppet/ssl/certs/ca.pem"
:ssl_cert: "/etc/puppetlabs/puppet/ssl/certs/puppet.example.com.pem"
:ssl_key: "/etc/puppetlabs/puppet/ssl/private_keys/puppet.example.com.pem"

# Advanced settings
:puppetdir: "/opt/puppetlabs/server/data/puppetserver"
:puppetuser: "puppet"
:facts: true
:timeout: 10
:threads: null
```

Edit the URL field to point to your Foreman instance, and the SSL fields for the hostname of the Puppet server (which may be the same host). Paths to Puppet's SSL certificates will be under /var/lib/puppet/ssl/ when using Puppet with non-AIO.

Lastly add this report processor to your Puppet server configuration.  In your server puppet.conf under the `[main]` section add:

```ini
reports=log, foreman
```

and restart your Puppet server.

You should start seeing reports coming in under the reports link.

##### Debugging reports

If reports aren't showing up in Foreman when an agent is run, there can be a number of reasons.  First check through the above configuration steps, and then look at these places to narrow down the cause:

1. Puppetserver logs may show an issue either loading or executing the report processor.  Check syslog (/var/log/messages or syslog) for `puppetserver` messages, or /var/log/puppetlabs/puppetserver/.
1. /var/log/foreman/production.log should show a `POST "/api/reports"` request each time a report is received, and will end in `Completed 201 Created` when successful.  Check for errors within the block of log messages.
1. When viewing reports in Foreman's UI, be aware that the default search is for "eventful" reports.  Clear the search ('x') to see reports with no changes.

#### Expire reports automatically

You will probably want to delete your reports after some time to limit database growth. To do so, you can set a cronjob:

Available conditions:

* days => number of days to keep reports (defaults to 7)
* status => status of the report (defaults to 0 --> "reports with no errors")

To expires all reports regardless of their status:

```
foreman-rake reports:expire days=7
```

To expire all non-interesting reports after one day:

```
foreman-rake reports:expire days=1 status=0
```
* Only VMware clusters using vSphere are supported, not standalone ESX or ESXi servers ([#1945](http://projects.theforeman.org/issues/1945)).

#### Image provisioning

Image based provisioning can be used by provisioning a new VM from a template and then running a finish script over SSH, in the same manner as the EC2 provider.  The type of provisioning method can be selected under the "Operating system" tab when creating a new host.  To configure image/template-based provisioning:

* Images refer to templates stored in vSphere which will be used as the basis for a