Image, canvas, video and data textures need to have the following flag set if they are changed:

				texture.needsUpdate = true;

Render targets update automatically.

Examples

				[example:webgl_materials_video WebGL / materials / video]

				[example:webgl_rtt WebGL / rtt]

Cameras

A camera's position and target is updated automatically. If you need to change

					fov

					aspect

					near

					far

				then you'll need to recompute the projection matrix:

camera.aspect = window.innerWidth / window.innerHeight;
camera.updateProjectionMatrix();

<!DOCTYPE html>

		<meta charset="utf-8">
		<base href="../../../" />

		<link type="text/css" rel="stylesheet" href="page.css" />

Links úteis

			Veja a seguir uma coleção de links que podem ser úteis para aprender three.js.

			Se você encontrar algo que gostaria de adicionar aqui ou achar que um dos links abaixo não está mais
			relevante ou funcionando, sinta-se à vontade para clicar no botão 'editar' no canto inferior direito e fazer algumas alterações!

			Note também que, como o three.js está em rápido desenvolvimento, muitos desses links conterão informações que estão
			desatualizadas - se algo não estiver funcionando como esperado ou como um desses links diz que deveria funcionar,
			verifique se há avisos ou erros no console do navegador. Verifique também as páginas de documentação relevantes.

Fóruns de ajuda

			Three.js utiliza oficialmente o [link:https://discourse.threejs.org/ forum] e o [link:http://stackoverflow.com/tags/three.js/info Stack Overflow] para
			pedidos de ajuda.

			Se você precisar de ajuda com algo, esse é o caminho. NÃO abra uma issue no Github para pedidos de ajuda.

Cursos e tutoriais

Primeiros passos com o three.js

				[link:https://threejs.org/manual/#en/fundamentals Three.js Fundamentals starting lesson]

				[link:https://codepen.io/rachsmith/post/beginning-with-3d-webgl-pt-1-the-scene Beginning with 3D WebGL] de [link:https://codepen.io/rachsmith/ Rachel Smith].

				[link:https://www.august.com.au/blog/animating-scenes-with-webgl-three-js/ Animating scenes with WebGL and three.js]

Artigos e cursos mais extensos / avançados

			<li


;
}

.card-product-lainnya .desc-lainnya .title-lainnya h3 {
    color: #4B4B44;
    font-family: 'Poppins', sans-serif;
    font-size: 18px;
    font-style: normal;
    font-weight: 600;
}

.card-product-lainnya .desc-lainnya .price {
    color: #797979;
    font-family: 'Poppins', sans-serif;
    font-size: 18px;
    font-style: normal;
    font-weight: 500;
    line-height: normal;
}

.card-product-lainnya .desc-lainnya .rate {
    display: flex;
    gap: 5px;
    margin-top: 10px;
    align-items: center;
    color: var(--aksen2);
    font-family: 'Poppins', sans-serif;
    font-size: 18px;
}

@media only screen and (max-width: 1000px) {
    .con-product-lainnya {
        gap: 15px;
    }

    .card-product-lainnya {
        padding: 12px;
    }

    .card-product-lainnya .img-lainnya {
        max-width: 100%;
    }

    .card-product-lainnya .desc-lainnya .title-lainnya h3 {
        font-size: 17px;
    }

    .card-product-lainnya .desc-lainnya .price {
        font-size: 17px;
    }

    .card-product-lainnya .desc-lainnya .rate {
        font-size: 17px;
    }
}

@media only screen and (max-width: 800px) {
    .con-product-lainnya {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media only screen and (max-width: 600px) {
    .con-product-lainnya {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .card-product-lainnya .desc-lainnya .title-lainnya h3 {
        font-size: 16px;
    }

    .card-product-lainnya .desc-lainnya .price {
        font-size: 15px;
    }

    .card-product-lainnya .desc-lainnya .rate {
        font-size: 15px;
        margin-top: 5px;
    }
}

/* end lainnya product */

/* question */

.question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px;
    background: var(--aksen1);
    border-radius: 10px;
    margin-top: 30px;
    gap: 20px;
}

.question p {
    color: #FFF;
    font-family: 'Poppins', sans-serif;
    font-size: 20px;
    font-style: normal;
    font-weight: 500;
    line-height: normal;
}

.con-btn-header-information button {
    display: flex;
    width: 150px;
    height: 50px;
    padding-right: 0px;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 22px;
    font-weight: 500;
    position: relative;
    transition: all .35s;
    background: none;
    cursor: pointer;
    border-radius: 5px;
    border: 3px solid #fff;
}

.question button span {
    position: relative;
    z-index: 2;
}

.question button:after {
    position: absolute;
    content: "";
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: #fff;
    transition: all .2s;
}

.question button:hover {
    color: var(--aksen2)
}


curve: ECCurve_secp256r1(), secretBits: 256);

  SSHKexNist.p384() : this(curve: ECCurve_secp384r1(), secretBits: 384);

  SSHKexNist.p521() : this(curve: ECCurve_secp521r1(), secretBits: 521);

  /// Compute shared secret.
  @override
  BigInt computeSecret(Uint8List remotePubilcKey) {
    final s = curve.curve.decodePoint(remotePubilcKey)!;
    return (s * privateKey)!.x!.toBigInteger()!;
  }

  BigInt _generatePrivateKey() {
    late BigInt x;
    do {
      x = decodeBigIntWithSign(1, randomBytes(secretBits ~/ 8)) % curve.n;
    } while (x == BigInt.zero);
    return x;
  }
}
import 'dart:typed_data';

import 'package:convert/convert.dart';
import 'package:dartssh2/src/ssh_hostkey.dart';
import 'package:dartssh2/src/ssh_message.dart';
import 'package:pointycastle/export.dart';

class SSHEcdsaPublicKey implements SSHHostKey {
  final String type;

  final String curveId;

  final Uint8List q;

  SSHEcdsaPublicKey({
    required this.type,
    required this.curveId,
    required this.q,
  });

  factory SSHEcdsaPublicKey.decode(Uint8List data) {
    final reader = SSHMessageReader(data);
    final type = reader.readUtf8();
    if (!type.startsWith('ecdsa-sha2-')) {
      throw Exception('Invalid key type: $type');
    }
    final curveId = reader.readUtf8();
    final q = reader.readString();
    return SSHEcdsaPublicKey(type: type, curveId: curveId, q: q);
  }

  @override
  Uint8List encode() {
    final writer = SSHMessageWriter();
    writer.writeUtf8(type);
    writer.writeUtf8(curveId);
    writer.writeString(q);
    return writer.takeBytes();
  }

  bool verify(
    Uint8List message,
    SSHEcdsaSignature signature,
  ) {
    final signer = ECDSASigner(curveHash);

    signer.init(
      false,
      PublicKeyParameter(
        ECPublicKey(curve.curve.decodePoint(q), curve),
      ),
    );

    return signer.verifySignature(
      message,
      ECSignature(signature.r, signature.s),
    );
  }

  ECDomainParameters get curve {
    switch (curveId) {
      case 'nistp256':
        return ECCurve_secp256r1();
      case 'nistp384':
        return ECCurve_secp384r1();
      case 'nistp521':
        return ECCurve_secp521r1();
      default:
        throw Exception('Unsupported curve: $curveId');
    }
  }

  Digest get curveHash {
    switch (curveId) {
      case 'nistp256':
        return SHA256Digest();
      case 'nistp384':
        return SHA384Digest();
      case 'nistp521':
        return SHA512Digest();
      default:
        throw Exception('Unsupported curve: $curveId');
    }
  }

  @override
  String toString() {
    return 'SSHEcdsaKey(type: $type, curveId: $curveId, q: ${hex.encode(q)})';
  }
}

class SSHEcdsaSignature implements SSHSignature {
  final String type;

  final BigInt r;

  final BigInt s;

  SSHEcdsaSignature(this.type, this.r, this.s);

  factory SSHEcdsaSignature.decode(Uint8List data) {
    final reader = SSHMessageReader(data);
    final type = reader.readUtf8();
    if (!type.startsWith('ecdsa-sha2-')) {


f12,     t2,      24

    //32-39
    vld            vr7,     a2,      30
    z1_filter_edge_data_init3
    vbsrl.v        vr13,    vr7,     4
    vextrins.b     vr13,    vr13,    0x65
    vextrins.b     vr13,    vr13,    0x75
    z1_filter_edge_calc_loop2
    fst.d          f12,     t2,      32

    b              .IPRED_Z1_FS_END

.IPRED_Z1_FS_W32_H16:
    andi           t0,      a4,      16
    beqz           t0,      .IPRED_Z1_FS_W32_H32

    //0-7
    vld            vr7,     a2,      -1
    z1_filter_edge_data_init1
    vbsrl.v        vr13,    vr7,     3
    z1_filter_edge_calc_loop2
    fst.d          f12,     t2,      0

    //8-15
    vld            vr7,     a2,      6
    z1_filter_edge_data_init2
    vbsrl.v        vr13,    vr7,     4
    z1_filter_edge_calc_loop2
    fst.d          f12,     t2,      8

    //16-23
    vld            vr7,     a2,      14
    z1_filter_edge_data_init2

    vbsrl.v        vr13,    vr7,     4
    z1_filter_edge_calc_loop2
    fst.d          f12,     t2,      16

    //24-31
    vld            vr7,     a2,      22
    z1_filter_edge_data_init2
    vbsrl.v        vr13,    vr7,     4
    z1_filter_edge_calc_loop2
    fst.d          f12,     t2,      24

    //32-39
    vld            vr7,     a2,      30
    z1_filter_edge_data_init2
    vbsrl.v        vr13,    vr7,     4
    z1_filter_edge_calc_loop2
    fst.d          f12,     t2,      32

    //40-47
    vld            vr7,     a2,      38
    z1_filter_edge_data_init3
    vbsrl.v        vr13,    vr7,     4
    vextrins.b     vr13,    vr13,    0x65
    vextrins.b     vr13,    vr13,    0x75
    z1_filter_edge_calc_loop2
    fst.d          f12,     t2,      40

    b              .IPRED_Z1_FS_END

.IPRED_Z1_FS_W32_H32:
    andi           t0,      a4,      32
    beqz           t0,      .IPRED_Z1_FS_W32_H64

    //0-7
    vld            vr7,     a2,      -1
    z1_filter_edge_data_init1
    vbsrl.v        vr13,    vr7,     3
    z1_filter_edge_calc_loop2
    fst.d          f12,     t2,      0

    //8-15
    vld            vr7,     a2,      6
    z1_filter_edge_data_init2
    vbsrl.v        vr13,    vr7,     4
    z1_filter_edge_calc_loop2
    fst.d          f12,     t2,      8

    //16-23
    vld            vr7,     a2,      14
    z1_filter_edge_data_init2
    vbsrl.v        vr13,    vr7,     4
    z1_filter_edge_calc_loop2
    fst.d


use of job scheduling.\",\"d3f:ref-count\":{\"@type\":\"http://www.w3.org/2001/XMLSchema#integer\",\"@value\":\"3\"},\"rdfs:label\":\"Scheduled Job Analysis\"},{\"@id\":\"d3f:SystemDaemonMonitoring\",\"d3f:d3fend-id\":\"D3-SDM\",\"d3f:definition\":\"Tracking changes to the state or configuration of critical system level processes.\",\"d3f:ref-count\":{\"@type\":\"http://www.w3.org/2001/XMLSchema#integer\",\"@value\":\"3\"},\"rdfs:label\":\"System Daemon Monitoring\"},{\"@id\":\"d3f:SystemFileAnalysis\",\"children\":[{\"@id\":\"d3f:ServiceBinaryVerification\",\"d3f:d3fend-id\":\"D3-SBV\",\"d3f:definition\":\"Analyzing changes in service binary files by comparing to a source of truth.\",\"d3f:ref-count\":{\"@type\":\"http://www.w3.org/2001/XMLSchema#integer\",\"@value\":\"1\"},\"rdfs:label\":\"Service Binary Verification\"}],\"d3f:d3fend-id\":\"D3-SFA\",\"d3f:definition\":\"Monitoring system files such as authentication databases, configuration files, system logs, and system executables for modification or tampering.\",\"d3f:ref-count\":{\"@type\":\"http://www.w3.org/2001/XMLSchema#integer\",\"@value\":\"3\"},\"rdfs:label\":\"System File Analysis\"},{\"@id\":\"d3f:SystemInitConfigAnalysis\",\"d3f:d3fend-id\":\"D3-SICA\",\"d3f:definition\":\"Analysis of any system process startup configuration.\",\"d3f:ref-count\":{\"@type\":\"http://www.w3.org/2001/XMLSchema#integer\",\"@value\":\"3\"},\"rdfs:label\":\"System Init Config Analysis\"},{\"@id\":\"d3f:UserSessionInitConfigAnalysis\",\"d3f:d3fend-id\":\"D3-USICA\",\"d3f:definition\":\"Analyzing modifications to user session config files such as .bashrc or .bash_profile.\",\"d3f:ref-count\":{\"@type\":\"http://www.w3.org/2001/XMLSchema#integer\",\"@value\":\"4\"},\"rdfs:label\":\"User Session Init Config Analysis\"}],\"d3f:d3fend-id\":\"D3-OSM\",\"d3f:definition\":\"The operating system software, for D3FEND's purposes, includes the kernel and its process management functions, hardware drivers, initialization or boot logic. It also includes and other key system daemons and their configuration. The monitoring or analysis of these components for unauthorized activity constitute **Operating System Monitoring**.\",\"d3f:ref-count\":{\"@type\":\"http://www.w3.org/2001/XMLSchema#integer\",\"@value\":\"2\"},\"rdfs:label\":\"Operating System Monitoring\"},{\"@id\":\"d3f:FileIntegrityMonitoring\",\"d3f:d3fend-id\":\"D3-FIM\",\"d3f:definition\":\"Detecting any suspicious changes to files in a computer system.\",\"d3f:ref-count\":{\"@type\":\"http://www.w3.org/2001/XMLSchema#integer\",\"@value\":\"2\"},\"rdfs:label\":\"File Integrity Monitoring\"},{\"@id\":\"d3f:OperatingModeMonitoring\",\"d3f:d3fend-id\":\"D3-OMM\",\"d3f:definition\":\"Detects operating modes such as Program, Run, Remote, or Stop.\",\"d3f:ref-count\":{\"@type\":\"http://www.w3.org/2001/XMLSchema#integer\",\"@value\":\"2\"},\"rdfs:label\":\"Operating Mode Monitoring\"}],\"d3f:d3fend-id\":


            la      t2, Lbrev8_const

        ld      t0, 0(t2)  # 0xAAAAAAAAAAAAAAAA
        slli    t1, a5, 1
        and     t1, t1, t0
        and     a5, a5, t0
        srli    a5, a5, 1
        or      a5, t1, a5

        ld      t0, 8(t2)  # 0xCCCCCCCCCCCCCCCC
        slli    t1, a5, 2
        and     t1, t1, t0
        and     a5, a5, t0
        srli    a5, a5, 2
        or      a5, t1, a5

        ld      t0, 16(t2) # 0xF0F0F0F0F0F0F0F0
        slli    t1, a5, 4
        and     t1, t1, t0
        and     a5, a5, t0
        srli    a5, a5, 4
        or      a5, t1, a5

    sd        a4, 0(a0)
    sd        a5, 8(a0)
    ret
.size gcm_ghash_rv64i_zbc,.-gcm_ghash_rv64i_zbc
.p2align 3
.globl gcm_ghash_rv64i_zbc__zbkb
.type gcm_ghash_rv64i_zbc__zbkb,@function
gcm_ghash_rv64i_zbc__zbkb:
    # Load Xi and bit-reverse it
    ld        a4, 0(a0)
    ld        a5, 8(a0)
    .word 1752651539
    .word 1752684435

    # Load the key (already bit-reversed)
    ld        a6, 0(a1)
    ld        a7, 8(a1)

    # Load the reduction constant
    la        t6, Lpolymod
    lbu       t6, 0(t6)

Lstep_zkbk:
    # Load the input data, bit-reverse them, and XOR them with Xi
    ld        t4, 0(a2)
    ld        t5, 8(a2)
    add       a2, a2, 16
    add       a3, a3, -16
    .word 1753144979
    .word 1753177875
    xor       a4, a4, t4
    xor       a5, a5, t5

    # Multiplication (without Karatsuba)
    .word 186105395
    .word 186094515
    .word 186072883
    .word 186061619
    xor       t2, t2, t5
    .word 185057075
    .word 185048755
    xor       t2, t2, t5
    xor       t1, t1, t4
    .word 185024307
    .word 185012915
    xor       t1, t1, t5

    # Reduction with clmul
    .word 201211699
    .word 201203379
    xor       t2, t2, t5
    xor       t1, t1, t4
    .word 200523571
    .word 200515251
    xor       a5, t1, t5
    xor       a4, t0, t4

    # Iterate over all blocks
    bnez      a3, Lstep_zkbk

    # Bit-reverse final Xi back and store it
    .word 1752651539
    .word 1752684435
    sd a4,  0(a0)
    sd a5,  8(a0)
    ret
.size gcm_ghash_rv64i_zbc__zbkb,.-gcm_ghash_rv64i_zbc__zbkb
#endif

.p2align 3
Lbrev8_const:
    .dword  0xAAAAAAAAAAAAAAAA
    .dword  0xCCCCCCCCCCCCCCCC
    .dword  0xF0F0F0F0F0F0F0F0
.size Lbrev8_const,.-Lbrev8_const


nslationMatrix.mul(scalingMatrix.mul(rotationMatrix)));
			getModelMatrices().add(rotationMatrix);
			getLowPolyIndices().add(i);
		}

		setModelMatricesBuffer(new GLUniformBuffer());
		getModelMatricesBuffer().allocate(buffersize);

		setWorldMatricesBuffer(new GLUniformBuffer());
		getWorldMatricesBuffer().allocate(buffersize);

		/**
		 * init matrices UBO's
		 */
		int size = Float.BYTES * 16 * instances;

		FloatBuffer worldMatricesFloatBuffer = BufferUtil.createFloatBuffer(size);
		FloatBuffer modelMatricesFloatBuffer = BufferUtil.createFloatBuffer(size);

		for(Matrix4f matrix : getWorldMatrices()){
			worldMatricesFloatBuffer.put(BufferUtil.createFlippedBuffer(matrix));
		}
		for(Matrix4f matrix : getModelMatrices()){
			modelMatricesFloatBuffer.put(BufferUtil.createFlippedBuffer(matrix));
		}

		getWorldMatricesBuffer().updateData(worldMatricesFloatBuffer, size);
		getModelMatricesBuffer().updateData(modelMatricesFloatBuffer, size);

		for (Renderable object : objects){
			addChild(object);
		}

		((GLMeshVBO) ((GLRenderInfo) ((Renderable) getChildren().get(0)).getComponent(NodeComponentType.MAIN_RENDERINFO)).getVbo()).setInstances(getHighPolyInstances());
		((GLMeshVBO) ((GLRenderInfo) ((Renderable) getChildren().get(1)).getComponent(NodeComponentType.MAIN_RENDERINFO)).getVbo()).setInstances(getHighPolyInstances());
		((GLMeshVBO) ((GLRenderInfo) ((Renderable) getChildren().get(2)).getComponent(NodeComponentType.MAIN_RENDERINFO)).getVbo()).setInstances(getLowPolyInstances());
	}

	public void updateUBOs(){

		getHighPolyIndices().clear();

		int index = 0;

		for (Matrix4f transform : getWorldMatrices()){
			if (transform.getTranslation().sub(BaseContext.getCamera().getPosition()).length() < 220){
				getHighPolyIndices().add(index);
			}

			index++;
		}
		getHighPolyInstances().setValue(getHighPolyIndices().size());
	}

	public void renderShadows(){

		getHighPolyInstances().setValue(0);

		super.renderShadows();

		getHighPolyInstances().setValue(getHighPolyIndices().size());
	}
}package org.oreon.examples.gl.oreonworlds.rocks;

import java.util.ArrayList;
import java.util.List;

import org.oreon.core.gl.memory.GLMeshVBO;
import org.oreon.core.gl.scenegraph.GLRenderInfo;
import org.oreon.core.gl.util.GLAssimpModelLoader;
import org.oreon.core.gl.wrapper.parameter.DefaultRenderParams;
import org.oreon.core.instanced.InstancedObject;
import org.oreon.core.math.Vec3f;
import org.oreon.core.model.Model;
import org.oreon.core.scenegraph.NodeComponentType;
import org.oreon.core.scenegraph.Renderable;
import org.oreon.core.util.Util;
import org.oreon.examples.gl.oreonworlds.shaders.rocks.RockHighPolyShader;
import org.oreon.examples.gl.oreonworlds.shaders.rocks.RockShadowShader;

public class Rock02ClusterGroup extends InstancedObject{

	public Rock02ClusterGroup(){

		List<Model> models = GLAssimpModelLoader.loadModel("oreonworlds/assets/rocks/Rock_02","rock02.obj");

		List<Renderable> objects = new ArrayList<>();

		for (Model model : models){


    'P' => {
                l = 0
            }
            'A' => {
                a += 1;
                if a >= 2 { return false }
                l = 0;
            }
            'L' => {
                l += 1;
                if l >= 3 { return false }
            }
            _ => unreachable!()
        }
    }
    true
}

#[test]
fn example_1() {
    assert_eq!(
        check_record("PPALLP".to_string()),
        true
    )
}

#[test]
fn example_2() {
    assert_eq!(
        check_record("PPALLL".to_string()),
        false
    )
}
<gh_stars>100-1000
use clap::{App, Arg};
use futures::*;
use sqlx::{
    sqlite::{SqliteConnectOptions, SqliteJournalMode, SqlitePoolOptions, SqliteSynchronous},
    Pool, Sqlite,
};
use std::time::{Duration, Instant};
use std::{fs, str::FromStr};

struct User {
    id: uuid::Uuid,
    created_at: chrono::DateTime<chrono::Utc>,
    username: String,
}

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let cli_matches = App::new("Rust to the mooooon")
        .version("1.0")
        .arg(
            Arg::with_name("concurrency")
                .short("c")
                .long("concurrency")
                .help("Number of concurrent inserts")
                .default_value("3"),
        )
        .arg(
            Arg::with_name("inserts")
                .short("i")
                .long("inserts")
                .help("Number of inserts to perform")
                .default_value("40000"),
        )
        .get_matches();

    let concurrency = cli_matches
        .value_of("concurrency")
        .unwrap()
        .parse::<usize>()
        .unwrap_or(1);
    let inserts = cli_matches
        .value_of("inserts")
        .unwrap()
        .parse::<usize>()
        .unwrap_or(1);

    let database_file = "db.sqlite";
    let database_url = format!("sqlite://{}", database_file);
    let pool_timeout = Duration::from_secs(30);
    // with pool_max_connections = 1, the pool timeout maybe related to https://github.com/launchbadge/sqlx/issues/1210
    let pool_max_connections = if concurrency == 1 {
        2
    } else {
        concurrency as u32
    };

    let _ = fs::remove_file(database_file);

    let connection_options = SqliteConnectOptions::from_str(&database_url)?
        .create_if_missing(true)
        .journal_mode(SqliteJournalMode::Wal)
        .synchronous(SqliteSynchronous::Normal)
        .busy_timeout(pool_timeout);

    let sqlite_pool = SqlitePoolOptions::new()
        .max_connections(pool_max_connections)
        .connect_timeout(pool_timeout)
        .connect_with(connection_options)
        .await?;

    sqlx::migrate!("./db").run(&sqlite_pool).await?;

    // sqlx::query("pragma journal_mode = WAL;")
    //     .execute(&sqlite_pool)
    //     .await?;
    // sqlx::query("pragma synchronous = normal;")
    //     .execute(&sqlite_pool)
    //     .await?;
    sqlx::query("pragma temp_store = memory;")
        .execute(&sqlite_pool)
        .await?;
    sqlx::query("pragma mmap_size = 30000000000;")


+ "ItemsEntry\022\013\n"
          + "\003key\030\001 \001(\t\022D\n"
          + "\005value\030\002"
          + " \001(\01325.google.cloud.compute.v1.ServiceAttachmentsScopedList:\0028\001B\005\n"
          + "\003_idB\007\n"
          + "\005_kindB\022\n"
          + "\020_next_page_tokenB\014\n\n"
          + "_self_linkB\n\n"
          + "\010_warning\"\330\003\n"
          + "\"ServiceAttachmentConnectedEndpoint\022 \n"
          + "\020consumer_network\030\345\335\244y \001(\tH\000\210\001\001\022\030\n"
          + "\010endpoint\030\225\273\234> \001(\tH\001\210\001\001\022\022\n"
          + "\007nat_ips\030\216\360\2138 \003(\t\022,\n"
          + "\033propagated_connection_count\030\322\323\343\232\001 \001(\r"
          + "H\002\210\001\001\022\"\n"
          + "\021psc_connection_id\030\335\245\243\213\001 \001(\004H\003\210\001\001\022\026\n"
          + "\006status\030\362\237\267V \001(\tH\004\210\001\001\"\224\001\n"
          + "\006Status\022\024\n"
          + "\020UNDEFINED_STATUS\020\000\022\017\n"
          + "\010ACCEPTED\020\247\237\322u\022\016\n"
          + "\006CLOSED\020\354\252\243\265\001\022\027\n"
          + "\017NEEDS_ATTENTION\020\274\213\242\244\001\022\016\n"
          + "\007PENDING\020\367\252\360\020\022\017\n"
          + "\010REJECTED\020\376\210\204S\022\031\n"
          + "\022S",
      "TATUS_UNSPECIFIED\020\312\314\213\024B\023\n"
          + "\021_consumer_networkB\013\n"
          + "\t_endpointB\036\n"
          + "\034_propagated_connection_countB\024\n"
          + "\022_psc_connection_idB\t\n"
          + "\007_status\"\305\001\n"
          + "%ServiceAttachmentConsumerProjectLimit\022 \n"
          + "\020connection_limit\030\232\236\324> \001(\r"
          + "H\000\210\001\001\022\033\n"
          + "\013network_url\030\336\217\346b \001(\tH\001\210\001\001\022\"\n"
          + "\021project_id_or_num\030\250\212\345\246\001 \001(\tH\002\210\001\001B\023\n"
          + "\021_connection_limitB\016\n"
          + "\014_network_urlB\024\n"
          + "\022_project_id_or_num\"\263\002\n"
          + "\025ServiceAttachmentList\022\020\n"
          + "\002id\030\233\032 \001(\tH\000\210\001\001\022<\n"
          + "\005items\030\300\317\367/"
          + " \003(\0132*.google.cloud.compute.v1.ServiceAttachment\022\024\n"
          + "\004kind\030\224\367\310\001 \001(\tH\001\210\001\001\022\037\n"
          + "\017next_page_token\030\225\272\206& \001(\tH\


      position: fixed;
      bottom: 5%;
      left: 0;
      right: 0;
      width: 60%;
      margin-left: auto;
      margin-right: auto;
    }

  }
}
page-goal-detail-summary {
  .num {
    font-size: 30px;
    font-family: "Oswald","Segoe UI", "Noto Sans", sans-serif;
  }

  .checkmark-circle {
    width: 150px;
    height: 150px;
    position: relative;
    display: inline-block;
    vertical-align: top;
    margin:0 auto;
  }
  .checkmark-circle .background {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: #999;
    position: absolute;
  }

  .checkmark-circle .active {
    background: #488aff;
  }

  .checkmark-circle .checkmark {
    border-radius: 5px;
  }
  .checkmark-circle .checkmark.draw:after {
    -webkit-animation-delay: 100ms;
    -moz-animation-delay: 100ms;
    animation-delay: 100ms;
    -webkit-animation-duration: 1s;
    -moz-animation-duration: 1s;
    animation-duration: 1s;
    -webkit-animation-timing-function: ease;
    -moz-animation-timing-function: ease;
    animation-timing-function: ease;
    -webkit-animation-name: checkmark;
    -moz-animation-name: checkmark;
    animation-name: checkmark;
    -webkit-transform: scaleX(-1) rotate(135deg);
    -moz-transform: scaleX(-1) rotate(135deg);
    -ms-transform: scaleX(-1) rotate(135deg);
    -o-transform: scaleX(-1) rotate(135deg);
    transform: scaleX(-1) rotate(135deg);
    -webkit-animation-fill-mode: forwards;
    -moz-animation-fill-mode: forwards;
    animation-fill-mode: forwards;
  }
  .checkmark-circle .checkmark:after {
    opacity: 1;
    height: 75px;
    width: 37.5px;
    -webkit-transform-origin: left top;
    -moz-transform-origin: left top;
    -ms-transform-origin: left top;
    -o-transform-origin: left top;
    transform-origin: left top;
    border-right: 15px solid white;
    border-top: 15px solid white;
    border-radius: 2.5px !important;
    content: '';
    left: 25px;
    top: 75px;
    position: absolute;
  }

  @-webkit-keyframes checkmark {
    0% {
      height: 0;
      width: 0;
      opacity: 1;
    }
    20% {
      height: 0;
      width: 37.5px;
      opacity: 1;
    }
    40% {
      height: 75px;
      width: 37.5px;
      opacity: 1;
    }
    100% {
      height: 75px;
      width: 37.5px;
      opacity: 1;
    }
  }
  @-moz-keyframes checkmark {
    0% {
      height: 0;
      width: 0;
      opacity: 1;
    }
    20% {
      height: 0;
      width: 37.5px;
      opacity: 1;
    }
    40% {
      height: 75px;
      width: 37.5px;
      opacity: 1;
    }
    100% {
      height: 75px;
      width: 37.5px;
      opacity: 1;
    }
  }
  @keyframes checkmark {
    0% {
      height: 0;
      width: 0;
      opacity: 1;
    }
    20% {
      height: 0;


 Integer.parseInt(args[2]);
				y = Integer.parseInt(args[3]);
			} catch (NumberFormatException ex) {
				player.message(badSyntaxPrefix + command.toUpperCase() + " [id] (dir) (x) (y)");
				return;
			}
		}
		else {
			x = player.getX();
			y = player.getY();
		}

		if(!player.getWorld().withinWorld(x, y))
		{
			player.message(messagePrefix + "Invalid coordinates");
			return;
		}

		Point objectLoc = Point.location(x, y);
		final GameObject object = player.getViewArea().getGameObject(objectLoc);

		if (object != null && object.getType() == 1) {
			player.message("There is already a boundary in that spot: " + object.getGameObjectDef().getName());
			return;
		}

		/* TODO: check boundary id is within bounds properly per server & not per client
		if (player.getWorld().getServer().getEntityHandler().getGameObjectDef(id) == null) {
			player.message(messagePrefix + "Invalid scenery id");
			return;
		}*/
		if (id > player.getClientLimitations().maxBoundaryId) {
			player.message(messagePrefix + "Invalid boundary id");
			return;
		}

		final GameObject newObject = new GameObject(player.getWorld(), Point.location(x, y), id, dir, 1);

		player.getWorld().registerGameObject(newObject);
		player.message(messagePrefix + "Added boundary: " + newObject.getGameObjectDef().getName() + " with ID " + newObject.getID() + " at " + newObject.getLocation());
	}

	private void removeObject(Player player, String command, String[] args) {
		if(args.length == 1) {
			player.message(badSyntaxPrefix + command.toUpperCase() + " (x) (y)");
			return;
		}

		int x = -1;
		if(args.length >= 1) {
			try {
				x = Integer.parseInt(args[0]);
			} catch (NumberFormatException ex) {
				player.message(badSyntaxPrefix + command.toUpperCase() + " (x) (y)");
				return;
			}
		} else {
			x = player.getX();
		}

		int y = -1;
		if(args.length >=2) {
			try {
				y = Integer.parseInt(args[1]);
			} catch (NumberFormatException ex) {
				player.message(badSyntaxPrefix + command.toUpperCase() + " (x) (y)");
				return;
			}
		} else {
			y = player.getY();
		}

		if(!player.getWorld().withinWorld(x, y))
		{
			player.message(messagePrefix + "Invalid coordinates");
			return;
		}

		final Point objectLocation = Point.location(x, y);
		final GameObject object = player.getViewArea().getGameObject(objectLocation);

		if(object == null)
		{
			player.message(messagePrefix + "There is no scenery at coordinates " + objectLocation);
			return;
		}

		player.message(messagePrefix + "Removed scenery: " + object.getGameObjectDef().getName() + " with ID " + object.getID());
		player.getWorld().unregisterGameObject(object);
	}

	private void cycleScenery(Player player, String[] args) {
		// render player invisible
		for (int i = 0; i < 12; i++) {
			player.updateWornItems(i, 0);
		}
		player.toggleDenyAllLogoutRequests();

		player.message("Now displaying all scenery in RSC in 5 second intervals.");

		int maxScenery;
		if (player.getConfig().RESTRICT_SCENERY_ID >= 0) {


2DList.containerId).find(".s3dContent2DListPageListContainer");
        let newPageItemHtml = thatContent2DList.getPageItemHtml(newPageInfo);
        $(pageListContainer).append(newPageItemHtml);

        thatContent2DList.refreshNonePageItem();

        let newPageItem = $(pageListContainer).find(".s3dContent2DListItem[pageCode='" + newPageInfo.code + "']");
        $(newPageItem).contextmenu(function(ev){
            if(ev.button === 2){
                ev.preventDefault();
                let pageCode = $(this).attr("pageCode");
                thatContent2DList.showMenu(pageCode, ev);
            }
        });

        //菜单
        $(newPageItem).find(".s3dContent2DListItemBtn").click(function(ev){
            ev.preventDefault();
            let pageCode = $(this).parent().attr("pageCode");
            thatContent2DList.showMenu(pageCode, ev);
            return false;
        });

        //菜单下拉按钮
        $(newPageItem).find(".s3dContent2DListItemBtn").contextmenu(function(ev){
            if(ev.button === 2){
                ev.preventDefault();
                let pageCode = $(this).parent().attr("pageCode");
                thatContent2DList.showMenu(pageCode, ev);
            }
        });

        $(newPageItem).click(function () {
            let pageCode = $(this).attr("pageCode");
            thatContent2DList.focusPage(pageCode);
            thatContent2DList.editPage(pageCode);
        });
    }

    this.addNewPage = function () {
        thatContent2DList.manager.localContent2DPicker.showPicker({
            paramInfo: {
                afterPickContent2D: thatContent2DList.afterPickContent2D
            }
        });
    }
    this.afterPickContent2D = function (p){
        if(p.moduleCode != null) {
            let newPageInfo = thatContent2DList.manager.userContent2D.getNewPageInfo("页面", p.themeCode, p.moduleCode);
            thatContent2DList.beginAddToUndoList(s3dContent2DEditType.add, newPageInfo.code, null);
            thatContent2DList.manager.userContent2D.addPage(newPageInfo);
            thatContent2DList.endAddToUndoList(s3dContent2DEditType.add, newPageInfo, newPageInfo);
            thatContent2DList.insertPageItem(newPageInfo);
            thatContent2DList.focusPage(newPageInfo.code);
            thatContent2DList.showPageInfo(newPageInfo.code);
        }
    }

    this.copyPage = function (sourcePageCode){
        let sourcePageInfo = thatContent2DList.manager.userContent2D.getPageInfo(sourcePageCode);
        let newPageInfo = thatContent2DList.manager.userContent2D.clonePageInfo(sourcePageInfo);
        thatContent2DList.beginAddToUndoList(s3dContent2DEditType.add, newPageInfo.code, null);
        thatContent2DList.manager.userContent2D.addPage(newPageInfo);
        thatContent2DList.endAddToUndoList(s3dContent2DEditType.add, newPageInfo, newPageInfo);
        thatContent2DList.insertPageItem(newPageInfo);
        thatContent2DList.showPageInfo(newPageInfo.code);
    }

    //开启添加到undo list
    this.beginAddToUndoList = function(editType, targetCode, pageInfo)


2、[AWS Lambda 推广者关于 .NET 的故事](https://fbouteruche.medium.com/why-i-have-been-in-love-with-c-and-net-for-more-than-15-years-34af4ddce0d8)

![image](https://github.com/DotNETWeekly-io/DotNetWeekly/assets/11272110/f1d6eda7-4535-45ed-bf38-21b0c5691205)

这个一篇来自 `.NET` 开发者的文章，他回顾了自己 `.NET` 经历的开端，然后分析了 `.NET` 社区的缺陷和进步，并且分析了 `AWS` 中 的 `Lambda` 中使用 `.NET` 的故事。

3、[MAUI 教程](https://jesseliberty.com/2022/06/05/learning-net-maui-posting-0/)

![image](https://dotnetweeklyimages.blob.core.windows.net/016/maui.png)

`MAUI` 已经发布了一段时间了，这一系列文章列出了 `MAUI` 的学习资源。

4、[.NET 内存测验](https://tooslowexception.com/net-quiz-check-your-level-of-knowledge-about-net-memory-management/)

![image](https://github.com/DotNETWeekly-io/DotNetWeekly/assets/11272110/da630bd3-a000-4f76-a3c9-b7ca9771db39)

这是这是一些列测试题目问卷，考察一下你对 `.NET` 内存的了解程度。

5、[string.Empty 和 "" 比较](https://www.youtube.com/watch?v=qWBi32-Njm8&ab_channel=NickChapsas)

![image](https://github.com/DotNETWeekly-io/DotNetWeekly/assets/11272110/4d7a12f4-145d-473d-9bff-40a85865fa91)

在 `C#` 中， `string.Empty` 和 `""` 是一样的吗？首先 `string.Empty` 不是一个字面常量，也就是说它不能作为一个函数的默认参数。那么他们之间有什么性能上的差别吗？

```Csharp
string emptyString1 = string.Empty;
string emptyString2 = "";
```

首先看一下 `IL` 代码，

```IL
IL_0000: ldarg.0
IL_0001: ldsfld string [System.Runtime]System.String::Empty
IL_0006: stfld string C::emptyString1
IL_000b: ldarg.0
IL_000c: ldstr ""
IL_0011: stfld string C::emptyString2
IL_0016: ldarg.0
IL_0017: call instance void [System.Runtime]System.Object::.ctor()
```

`ldsfld` 操作是将一个静态字段入栈，而 `ldstr`则将一个对象


            { 955391357uL, "Feint" },
            { 955391358uL, "Palisade" },
            { 955391359uL, "Head Graze" },
            { 955391360uL, "Arm Graze" },
            { 955391361uL, "Foot Graze" },
            { 955391362uL, "Leg Graze" },
            { 955391363uL, "Tactician" },
            { 955391364uL, "Refresh" },
            { 955391365uL, "Peloton" },
            { 955391366uL, "Break" },
            { 955391367uL, "Surecast" },
            { 955391368uL, "Addle" },
            { 955391369uL, "Swiftcast" },
            { 955391370uL, "Lucid Dreaming" },
            { 955391371uL, "Apocatastasis" },
            { 955391372uL, "Drain" },
            { 955391373uL, "Mana Shift" },
            { 955391374uL, "Erase" },
            { 955391375uL, "Cleric Stance" },
            { 955391376uL, "Esuna" },
            { 955391377uL, "Eye for an Eye" },
            { 955391378uL, "Largesse" },
            { 955391379uL, "Rescue" },
            { 955391380uL, "Protect" },
            { 955391669uL, "Doom of the Living" },
            { 955391670uL, "Vermillion Scourge" },
            { 955391671uL, "Leg Sweep" },
            { 955391672uL, "Earth Tackle" },
            { 955391673uL, "Wind Tackle" },
            { 955391674uL, "Fire Tackle" },
            { 955391675uL, "Iaijutsu" },
            { 955391676uL, "Riddle of Wind" },
            { 955391711uL, "Fathom" },
            { 955391712uL, "Shark Eye" },
            { 955391713uL, "Shark Eye II" },
            { 955391714uL, "Veteran Trade" },
            { 955391715uL, "Bountiful Catch" },
            { 955391716uL, "Calm Waters" },
            { 955391717uL, "Nature's Bounty" },
            { 955391718uL, "Salvage" },
            { 955391719uL, "Truth of Oceans" },
            { 955392132uL, "Stellar Detonation" },
            { 955392823uL, "Remove Barrel" },
            { 955393180uL, "Bishop Overdrive" },
            { 248940431009uL, "Basic Synthesis" },
            { 248940431010uL, "Basic Touch" },
            { 248940431011uL, "Master's Mend" },
            { 248940431012uL, "Standard Touch" },
            { 248940431013uL, "Master's Mend II" },
            { 248940431014uL, "Brand of Wind" },
            { 248940431015uL, "Standard Synthesis" },
            { 248940431016uL, "Advanced Touch" },
            { 248940431017uL, "Byregot's Blessing" },
            { 248940431018uL, "Observe" },
            { 248940431071uL, "Careful Synthesis" },
            { 248940431074uL, "Brand of Lightning" },
            { 248940431077uL


 41 can improve today", () {
      final item = schedule.items?.firstWhere((element) => element.id == 41);
      if (tz.TZDateTime.now(tz.getLocation('Asia/Tokyo')).weekday != DateTime.monday) {
        expect(item?.isAbleNow(), isTrue);
      }
    });

    test("item 41 wednesday req", () {
      final item = schedule.items?.firstWhere((element) => element.id == 41);

      var actImprove = item?.activeImprove(dayIndex: DateTime.tuesday);

      var act = actImprove?.first?.activeReq(dayIndex: DateTime.tuesday).first;

      expect(act?.ship?.length, 1);
      expect(act?.ship?[0], 107);
    });
  });
}
import 'dart:convert';

import 'package:conning_tower/models/data/kancolle_calc_net/deck_builder_entity.dart';
import 'package:flutter_test/flutter_test.dart';

main() {
  test("deck builder", () {
    var json = jsonDecode('''
{"version": 4,"hqlv":120,"f1":{"s1":{"id":916,"lv":167,"luck":24,"items":{"i1":{"id":465,"rf":0},"i2":{"id":276,"rf":6},"i3":{"id":216,"rf":0,"mas":7},"i4":{"id":490,"rf":0,"mas":7},"i5":{"id":365,"rf":0},"ix":{"id":460,"rf":0}}}},"f2":{"s1":{"id":418,"lv":98,"luck":20,"items":{"i1":{"id":68,"rf":0},"i2":{"id":68,"rf":0},"i3":{"id":68,"rf":0}}},"s2":{"id":366,"lv":82,"luck":16,"items":{"i1":{"id":75,"rf":0},"i2":{"id":75,"rf":0},"i3":{"id":75,"rf":0}}},"s3":{"id":221,"lv":77,"luck":12,"items":{"i1":{"id":75,"rf":0},"i2":{"id":90,"rf":0},"i3":{"id":90,"rf":0}}},"s4":{"id":363,"lv":82,"luck":30,"items":{"i1":{"id":315,"rf":0}}},"s5":{"id":472,"lv":64,"luck":13,"items":{"i1":{"id":75,"rf":0},"i2":{"id":75,"rf":0}}},"s6":{"id":710,"lv":32,"luck":7,"items":{}}},"f3":{"s1":{"id":718,"lv":66,"luck":10,"items":{"i1":{"id":68,"rf":0},"i2":{"id":68,"rf":0},"i3":{"id":68,"rf":0}}},"s2":{"id":434,"lv":95,"luck":14,"items":{"i1":{"id":68,"rf":0},"i2":{"id":75,"rf":0},"i3":{"id":75,"rf":0}}},"s3":{"id":258,"lv":72,"luck":20,"items":{"i1":{"id":75,"rf":0},"i2":{"id":75,"rf":0},"i3":{"id":75,"rf":0}}},"s4":{"id":259,"lv":85,"luck":12,"items":{"i1":{"id":75,"rf":0},"i2":{"id":75,"rf":0},"i3":{"id":75,"rf":0}}},"s5":{"id":309,"lv":86,"luck":14,"items":{"i1":{"id":75,"rf":0},"i2":{"id":75,"rf":0},"i3":{"id":75,"rf":0}}},"s6":{"id":160,"lv":78,"luck":13,"items":{"i1":{"id":303,"rf":0},"i2":{"id":303,"rf":0}}}},"f4":{"s1":{"id":308,"lv":83,"luck":12,"items":{"i1":{"id":75,"rf":0},"i2":{"id":75,"rf":0},"i3":{"id":75,"rf":0}}},"s2":{"id":474,"lv":93,"luck":12,"items":{"i1":{"id":75,"rf":0},"i2":{"id":75,"rf":0}}},"s3":{"id":702,"lv":64,"luck":18,"items":{"i1":{"id":75,"rf":0},"i2":{"id":75,"rf":0},"i3":{"id":75,"rf":0}}},"s4":{"id":435,"lv":


     *  y = (1/2)((2x)^4)			; [0, 0.5)
     *  y = -(1/2)((2x-2)^4 - 2)	; [0.5, 1]
     *  @see gtx_easing */
    fun quarticEaseInOut(a: Float): Float {
        // Only defined in [0, 1]
        assert(a in 0f..1f)

        return when {
            a < 0.5f -> 8f * a * a * a * a
            else -> {
                val f = a - 1f
                -8f * f * f * f * f + 1f
            }
        }
    }

    /** Modelled after the quintic y = x^5
     *  @see gtx_easing */
    fun quinticEaseIn(a: Float): Float {
        // Only defined in [0, 1]
        assert(a in 0f..1f)

        return a * a * a * a * a
    }

    /** Modelled after the quintic y = (x - 1)^5 + 1
     *  @see gtx_easing */
    fun quinticEaseOut(a: Float): Float {
        // Only defined in [0, 1]
        assert(a in 0f..1f)

        val f = a - 1f
        return f * f * f * f * f + 1f
    }

    /** Modelled after the piecewise quintic
     *  y = (1/2)((2x)^5)		; [0, 0.5)
     *  y = (1/2)((2x-2)^5 + 2) ; [0.5, 1]
     *  @see gtx_easing */
    fun quinticEaseInOut(a: Float): Float {
        // Only defined in [0, 1]
        assert(a in 0f..1f)

        return when {
            a < 0.5f -> 16f * a * a * a * a * a
            else -> {
                val f = 2f * a - 2f
                0.5f * f * f * f * f * f + 1f
            }
        }
    }

    /** Modelled after quarter-cycle of sine wave
     *  @see gtx_easing */
    fun sineEaseIn(a: Float): Float {
        // Only defined in [0, 1]
        assert(a in 0f..1f)

        return sin((a - 1f) * glm.HPIf) + 1f
    }

    /** Modelled after quarter-cycle of sine wave (different phase)
     *  @see gtx_easing */
    fun sineEaseOut(a: Float): Float {
        // Only defined in [0, 1]
        assert(a in 0f..1f)

        return sin(a * glm.HPIf)
    }

    /** Modelled after half sine wave
     *  @see gtx_easing */
    fun sineEaseInOut(a: Float): Float {
        // Only defined in [0, 1]
        assert(a in 0f..1f)

        return 0.5f * (1f - cos(a * glm.PIf))
    }

    /** Modelled after shifted quadrant IV of unit circle
     *  @see gtx_easing */
    fun circularEaseIn(a: Float): Float {
        // Only defined in [0, 1]
        assert(a in 0f..1f)

        return 1f - sqrt(1f - a * a)
    }

    /** Modelled after shifted quadrant II of unit circle
     *  @see gtx_easing */
    fun circularEaseOut(a: Float): Float {
        // Only defined in [0, 1]
        assert(a in 0f..1f)

        return sqrt((2f - a) * a)
    }

    /** Modelled after the piecewise circular function
     *  y = (1/2)(1 - sqr


_loc4_cb, atrac3p_huff_gain_loc2_cb,
        atrac3p_huff_gain_loc5_cb
    };
    static const uint8_t * const gain_xlats[11] = {
        NULL, atrac3p_huff_gain_npoints2_xlat, atrac3p_huff_gain_lev1_xlat,
        atrac3p_huff_gain_lev2_xlat, atrac3p_huff_gain_lev3_xlat,
        atrac3p_huff_gain_lev4_xlat, atrac3p_huff_gain_loc3_xlat,
        atrac3p_huff_gain_loc1_xlat, atrac3p_huff_gain_loc4_xlat,
        atrac3p_huff_gain_loc2_xlat, atrac3p_huff_gain_loc5_xlat
    };

    static const uint8_t * const tone_cbs[7] = {
        atrac3p_huff_tonebands_cb,  atrac3p_huff_numwavs1_cb,
        atrac3p_huff_numwavs2_cb,   atrac3p_huff_wav_ampsf1_cb,
        atrac3p_huff_wav_ampsf2_cb, atrac3p_huff_wav_ampsf3_cb,
        atrac3p_huff_freq_cb
    };
    static const uint8_t * const tone_xlats[7] = {
        NULL, NULL, atrac3p_huff_numwavs2_xlat, atrac3p_huff_wav_ampsf1_xlat,
        atrac3p_huff_wav_ampsf2_xlat, atrac3p_huff_wav_ampsf3_xlat,
        atrac3p_huff_freq_xlat
    };

    for (i = 0, wl_vlc_offs = 0, ct_vlc_offs = 2508; i < 4; i++) {
        wl_vlc_tabs[i].table = &tables_data[wl_vlc_offs];
        wl_vlc_tabs[i].table_allocated = 1 << wl_nb_bits[i];
        ct_vlc_tabs[i].table = &tables_data[ct_vlc_offs];
        ct_vlc_tabs[i].table_allocated = 1 << ct_nb_bits[i];

        ff_init_vlc_sparse(&wl_vlc_tabs[i], wl_nb_bits[i], wl_nb_codes[i],
                           wl_bits[i],  1, 1,
                           wl_codes[i], 1, 1,
                           wl_xlats[i], 1, 1,
                           INIT_VLC_USE_NEW_STATIC);

        ff_init_vlc_sparse(&ct_vlc_tabs[i], ct_nb_bits[i], ct_nb_codes[i],
                           ct_bits[i],  1, 1,
                           ct_codes[i], 1, 1,
                           ct_xlats[i], 1, 1,
                           INIT_VLC_USE_NEW_STATIC);

        wl_vlc_offs += wl_vlc_tabs[i].table_allocated;
        ct_vlc_offs += ct_vlc_tabs[i].table_allocated;
    }

    for (i = 0, sf_vlc_offs = 76; i < 8; i++) {
        sf_vlc_tabs[i].table = &tables_data[sf_vlc_offs];
        sf_vlc_tabs[i].table_allocated = 1 << sf_nb_bits[i];

        ff_init_vlc_sparse(&sf_vlc_tabs[i], sf_nb_bits[i], sf_nb_codes[i],
                           sf_bits[i],  1, 1,
                           sf_codes[i], 2, 2,
                           sf_xlats[i], 1, 1,
                           INIT_VLC_USE_NEW_STATIC);
        sf_vlc_offs += sf_vlc_tabs[i].table_allocated;
    }

    tab_offset = 2564;

    /* build huffman tables for spectrum decoding */
    for (i = 0; i < 112; i++) {
        if (atrac3p_spectra_tabs[i].cb)
            build_canonical_huff(atrac3p_spectra_tabs[i].cb,


import numpy as np

def make_dummy_json(
    n_utts=10,
    ilen_range=(100, 300),
    olen_range=(10, 300),
    idim=83,
    odim=52,
    num_inputs=1,
):
    ilens = np.random.randint(ilen_range[0], ilen_range[1], n_utts)
    olens = np.random.randint(olen_range[0], olen_range[1], n_utts)
    dummy_json = {}
    for idx in range(n_utts):
        input = []
        for input_idx in range(num_inputs):
            input += [{"shape": [ilens[idx], idim]}]
        output = [{"shape": [olens[idx], odim]}]
        dummy_json["utt_%d" % idx] = {"input": input, "output": output}
    return dummy_json

def make_dummy_json_st(
    n_utts=10,
    ilen_range=(100, 300),
    olen_range=(10, 300),
    olen_asr_range=(10, 300),
    idim=83,
    odim=52,
):
    ilens = np.random.randint(ilen_range[0], ilen_range[1], n_utts)
    olens = np.random.randint(olen_range[0], olen_range[1], n_utts)
    olens_asr = np.random.randint(olen_asr_range[0], olen_asr_range[1], n_utts)
    dummy_json = {}
    for idx in range(n_utts):
        input = [{"shape": [ilens[idx], idim]}]
        output = [{"shape": [olens[idx], odim]}, {"shape": [olens_asr[idx], odim]}]
        dummy_json["utt_%d" % idx] = {"input": input, "output": output}
    return dummy_json

def make_dummy_json_mt(
    n_utts=10, ilen_range=(100, 300), olen_range=(10, 300), idim=83, odim=52
):
    ilens = np.random.randint(ilen_range[0], ilen_range[1], n_utts)
    olens = np.random.randint(olen_range[0], olen_range[1], n_utts)
    dummy_json = {}
    for idx in range(n_utts):
        output = [{"shape": [olens[idx], odim]}, {"shape": [ilens[idx], idim]}]
        dummy_json["utt_%d" % idx] = {"output": output}
    return dummy_json


iteSub,
    _ISO_2022_SafeClone,
    _ISO_2022_GetUnicodeSet,

    NULL,
    NULL
};
static const UConverterStaticData _ISO2022CNStaticData={
    sizeof(UConverterStaticData),
    "ISO_2022_CN",
    0,
    UCNV_IBM,
    UCNV_ISO_2022,
    1,
    8, /* max 8 bytes per UChar: 4-byte CNS designator + 2 bytes for SS2/SS3 + DBCS */
    { 0x1a, 0, 0, 0 },
    1,
    false,
    false,
    0,
    0,
    { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } /* reserved */
};

namespace {

const UConverterSharedData _ISO2022CNData=
        UCNV_IMMUTABLE_SHARED_DATA_INITIALIZER(&_ISO2022CNStaticData, &_ISO2022CNImpl);

}  // namespace
#endif /* #if !UCONFIG_ONLY_HTML_CONVERSION */

#endif /* #if !UCONFIG_NO_LEGACY_CONVERSION */
// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
**********************************************************************
*   Copyright (C) 2009-2015, International Business Machines
*   Corporation and others.  All Rights Reserved.
**********************************************************************
*/

#include "unicode/bytestream.h"
#include "unicode/utypes.h"
#include "unicode/ures.h"
#include "unicode/localpointer.h"
#include "unicode/putil.h"
#include "unicode/uenum.h"
#include "unicode/uloc.h"
#include "ustr_imp.h"
#include "bytesinkutil.h"
#include "charstr.h"
#include "cmemory.h"
#include "cstring.h"
#include "putilimp.h"
#include "uinvchar.h"
#include "ulocimp.h"
#include "uassert.h"

/* struct holding a single variant */
typedef struct VariantListEntry {
    const char              *variant;
    struct VariantListEntry *next;
} VariantListEntry;

/* struct holding a single attribute value */
struct AttributeListEntry : public icu::UMemory {
    const char              *attribute;
    struct AttributeListEntry *next;
};

/* struct holding a single extension */
struct ExtensionListEntry : public icu::UMemory {
    const char                  *key;
    const char                  *value;
    struct ExtensionListEntry   *next;
};

#define MAXEXTLANG 3
typedef struct ULanguageTag {
    char                *buf;   /* holding parsed subtags */
    const char          *language;
    const char          *extlang[MAXEXTLANG];
    const char          *script;
    const char          *region;
    VariantListEntry    *variants;
    ExtensionListEntry  *extensions;
    const char          *privateuse;
    const char          *legacy;
} ULanguageTag;

#define MINLEN 2
#define SEP '-'
#define PRIVATEUSE 'x'
#define LDMLEXT 'u'

#define LOCALE_SEP '_'
#define LOCALE_EXT_SEP '@'
#define LOCALE_KEYWORD_SEP ';'
#define LOCALE_KEY_TYPE_SEP '='

#define ISALPHA(c) uprv_isASCIILetter(c)
#define


(widget.H / 2) - 1)) * ent.YdrawCoef) + ent.YdrawOffs
						local w = (widget.W / 3) * ent.XdrawCoef
						local h = 2 * ent.YdrawCoef
						surface.DrawRect(x1, y1, w, h)

						local drawPos = ((widget.value * (widget.H - (2 * offs))) + offs) - (widget.H / 24)
						--surface.SetDrawColor(ent.currentScheme.foregroundb.r, ent.currentScheme.foregroundb.g, ent.currentScheme.foregroundb.b, 255)
						local x1 = ((widget.X + (widget.W * 0.15)) * ent.XdrawCoef) + ent.XdrawOffs
						local y1 = ((widget.Y + drawPos) * ent.YdrawCoef) + ent.YdrawOffs
						local w = (widget.W * 0.7) * ent.XdrawCoef
						local h = (widget.H / 12) * ent.YdrawCoef
						surface.DrawRect(x1, y1, w, h)

					end,
	modClicked =	function (ply, widget, Xpos, Ypos)
						local offs = 10
						--Msg("widget.H = "..widget.H.."\n")
						widget.value = (math.Min(math.Max(Ypos, offs), widget.H - 6) - offs) / (widget.H - (2 * offs))
						--clientSendOutput(widget, 1, math.Max(1 - widget.value, 0))
						widget.parent:widgetOutput(ply, widget.modName, "value", math.Max(1 - widget.value, 0))
						--send value to client here for draw
						guiP_cl_drawUpdate(widget, 1, widget.value)
					end,
	modThink = nil,	--if this is a function then the widget is added to the client side think list
	triggerInput =	function (widget, inIndex, value)
						if (inIndex == "value") then
							widget.value = value
							guiP_cl_drawUpdate(widget, 1, value)
						end
					end,
	drawUpdate =	function (widget, paramNum, value)
						if (paramNum == 1) then
							widget.value = value
						end
					end,
	inputs = {value = {index = 1, msgType = 1}},
	outputs = {"value"},
}


.GetCount())
}

func TestReuseConnectionWhenDialBeforeListen(t *testing.T) {
	reuse := newReuse(nil, nil, defaultListenUDP, defaultSourceIPSelectorFn, nil, nil)
	cleanup(t, reuse)

	// dial any address
	raddr, err := net.ResolveUDPAddr("udp4", "1.1.1.1:1234")
	require.NoError(t, err)
	rTr, err := reuse.TransportWithAssociationForDial(nil, "udp4", raddr)
	require.NoError(t, err)

	// open a listener
	laddr := &net.UDPAddr{IP: net.IPv4zero, Port: 1234}
	lTr, err := reuse.TransportForListen("udp4", laddr)
	require.NoError(t, err)

	// new dials should go via the listener connection
	raddr, err = net.ResolveUDPAddr("udp4", "1.1.1.1:1235")
	require.NoError(t, err)
	tr, err := reuse.TransportWithAssociationForDial(nil, "udp4", raddr)
	require.NoError(t, err)
	require.Equal(t, lTr, tr)
	require.Equal(t, 2, tr.GetCount())

	// a listener on an unspecified port should reuse the dialer
	laddr2 := &net.UDPAddr{IP: net.IPv4zero, Port: 0}
	lconn2, err := reuse.TransportForListen("udp4", laddr2)
	require.NoError(t, err)
	require.Equal(t, rTr, lconn2)
	require.Equal(t, 2, lconn2.GetCount())
}

func TestReuseListenOnSpecificInterface(t *testing.T) {
	if platformHasRoutingTables() {
		t.Skip("this test only works on platforms that support routing tables")
	}
	reuse := newReuse(nil, nil, defaultListenUDP, defaultSourceIPSelectorFn, nil, nil)
	cleanup(t, reuse)

	router, err := netroute.New()
	require.NoError(t, err)

	raddr, err := net.ResolveUDPAddr("udp4", "1.1.1.1:1234")
	require.NoError(t, err)
	_, _, ip, err := router.Route(raddr.IP)
	require.NoError(t, err)
	// listen
	addr, err := net.ResolveUDPAddr("udp4", ip.String()+":0")
	require.NoError(t, err)
	lconn, err := reuse.TransportForListen("udp4", addr)
	require.NoError(t, err)
	require.Equal(t, 1, lconn.GetCount())
	// dial
	conn, err := reuse.TransportWithAssociationForDial(nil, "udp4", raddr)
	require.NoError(t, err)
	require.Equal(t, 1, conn.GetCount())
}

func TestReuseGarbageCollect(t *testing.T) {
	maxUnusedDurationOrig := maxUnusedDuration
	garbageCollectIntervalOrig := garbageCollectInterval
	t.Cleanup(func() {
		maxUnusedDuration = maxUnusedDurationOrig
		garbageCollectInterval = garbageCollectIntervalOrig
	})
	garbageCollectInterval = 50 * time.Millisecond
	maxUnusedDuration = 100 * time.Millisecond
	if os.Getenv("CI") != "" {
		// Increase these timeouts if in CI
		garbageCollectInterval = 10 * garbageCollectInterval
		maxUnusedDuration = 10 * maxUnusedDuration
	}

	reuse := newReuse(nil, nil, defaultListenUDP, defaultSourceIPSelectorFn, nil, nil)
	cleanup(t, reuse)

	numGlobals := func() int {
		reuse.mutex.Lock()
		defer reuse.


(HttpResponse::build(actix_web::http::StatusCode::CONFLICT)
                    .set_header("Error", conflict.clone())
                    .content_length(conflict.len() as u64)
                    .body(conflict));
            }
        }

        let map = match osm::to_delta(&body) {
            Ok(map) => map,
            Err(err) => {
                trans.set_rollback();
                trans.finish().unwrap();
                return Err(HecateError::new(500, err.to_string(), None));
            }
        };

        let delta_id = match delta::modify_props(delta_id, &trans, &map, uid) {
            Ok(id) => id,
            Err(err) => {
                trans.set_rollback();
                trans.finish().unwrap();
                return Err(err);
            }
        };

        if trans.commit().is_err() {
            return Err(HecateError::new(500, String::from("Failed to commit transaction"), None));
        }

        let delta_id = delta_id.to_string();
        Ok(HttpResponse::build(actix_web::http::StatusCode::OK)
            .content_length(delta_id.len() as u64)
            .body(delta_id))
    }))
}

fn osm_changeset_upload(
    auth: auth::Auth,
    auth_rules: web::Data<auth::AuthContainer>,
    conn: web::Data<DbReadWrite>,
    schema: web::Data<Option<serde_json::value::Value>>,
    worker: web::Data<worker::Worker>,
    delta_id: web::Path<i64>,
    body: web::Payload
) -> impl Future<Item = HttpResponse, Error = HecateError> {
    let conn = match conn.get() {
        Ok(conn) => conn,
        Err(err) => { return Either::A(futures::future::err(err)); }
    };

    if let Err(err) = auth::check(&auth_rules.0.osm.create, auth::RW::Full, &auth) {
        return Either::A(futures::future::err(err));
    }

    let uid = auth.uid.unwrap();

    Either::B(body.map_err(HecateError::from).fold(bytes::BytesMut::new(), move |mut body, chunk| {
        body.extend_from_slice(&chunk);
        Ok::<_, HecateError>(body)
    }).and_then(move |body| {
        let body = match String::from_utf8(body.to_vec()) {
            Ok(body) => body,
            Err(err) => { return Err(HecateError::new(400, String::from("Invalid UTF8 Body"), Some(err.to_string()))); }
        };

        let trans = match conn.transaction() {
            Ok(trans) => trans,
            Err(_) => { return Err(HecateError::new(500, String::from("Failed to open transaction"), None)); }
        };

        let delta_id = delta_id.into_inner();
        match delta::is_open(delta_id, &trans) {
            Ok(true) => (),
            _ => {
                trans.set_rollback();
                trans.finish().unwrap();

                let conflict = format!("The changeset {} was closed at previously", &delta_id);
                return Ok(HttpResponse::build(actix_web::http::StatusCode::CONFLICT)
                    .set_header("Error", conflict.clone())
                    .content_length(conflict.len() as u64)
                    .body(conflict));
            }
        }

        let (mut fc, tree) = match osm::to_features(&body) {
            Ok(fctree) => fctree,
            Err(err) => { return Err(HecateError::new(417, err.to_string(), None)); }
        };

        let mut ids: HashMap<i64, feature::Response> = HashMap::new();

        for feat in &mut fc.features {
            if let Ok(action) = feature::get_action(&feat) {
                if action == feature::Action::Create {


tateComponent.isIdle)
        assertTrue(stateComponent.isIn(EntityState.IDLE))

        val state = object : EntityState() { }

        stateComponent.changeState(state)

        assertFalse(stateComponent.isIdle)
        assertFalse(stateComponent.isIn(EntityState.IDLE))

        assertThat(stateComponent.currentStateProperty().get(), `is`<EntityState>(state))
        assertThat(stateComponent.currentState, `is`<EntityState>(state))
        assertTrue(stateComponent.isIn(state))

        stateComponent.changeStateToIdle()

        assertTrue(stateComponent.isIdle)
        assertTrue(stateComponent.isIn(EntityState.IDLE))
    }

    @Test
    fun `On update`() {
        var count = 0.0

        val state = object : EntityState() {
            override fun onUpdate(tpf: Double) {
                count = tpf
            }
        }

        stateComponent.onUpdate(1.0)
        stateComponent.changeState(state)
        assertThat(count, `is`(0.0))

        stateComponent.onUpdate(1.0)
        assertThat(count, `is`(1.0))
    }

    @Test
    fun `Entity state toString`() {
        val state1 = object : EntityState() { }
        val state2 = object : EntityState("StateName") { }

        assertThat(state1.toString(), containsString(state1.javaClass.name))
        assertThat(state2.toString(), `is`("StateName"))
    }
}/*
 * FXGL - JavaFX Game Library. The MIT License (MIT).
 * Copyright (c) AlmasB (almaslvl@gmail.com).
 * See LICENSE for details.
 */
@file:Suppress("JAVA_MODULE_DOES_NOT_DEPEND_ON_MODULE")
package com.almasb.fxgl.entity.components

import com.almasb.fxgl.core.serialization.Bundle
import javafx.geometry.Point2D
import javafx.geometry.Point3D
import org.hamcrest.CoreMatchers.`is`
import org.hamcrest.MatcherAssert.assertThat
import org.hamcrest.number.IsCloseTo.closeTo
import org.junit.jupiter.api.Assertions.assertTrue
import org.junit.jupiter.api.Test

class TransformComponentTest {

    @Test
    fun `Serialization`() {
        val c = TransformComponent(Point2D(30.0, 55.0))
        c.scaleOrigin = Point2D(1.0, 1.0)
        c.scaleX = 1.5
        c.scaleY = 3.0
        c.angle = 45.0
        c.rotationOrigin = Point2D(2.0, 2.0)

        val bundle = Bundle("test")
        c.write(bundle)

        val c2 = TransformComponent()
        c2.read(bundle)

        assertTrue(areEqual(c, c2))
    }

    @Test
    fun `To String`() {
        val c = TransformComponent(100.0, 100.0, 30.0, 2.0, 2.0)

        assertThat(c.toString(), `is`("Transform(100.0, 100.0, 30.0, 2.0, 2.0)"))
    }

    @Test
    fun `Rotations`() {
        val c = TransformComponent()

        assertThat(c.rotationX, `is`(0.0))
        assertThat(c.rotationY, `is`(0.0))
        assertThat(c.rotationZ, `is`(0.0))

        // rotate along X by -25.0
        c.lookDownBy(25.0)

        assertThat(c.rotationX, `is`(-25.0))
        assertThat(c.rotationY, `is`(0.0))
        assertThat(c.rotationZ, `is`(0.0))

        // rotate along Y by -35.0
        c.lookLeftBy(35.0)

        assertThat(c.rotationX, `is`(-25.0))
        assertThat(c.rotationY, `is`(-35.0))
        assertThat(c.rotationZ, `is`(0.0))

        // rotate along X by 10.0
        c.lookUpBy(10.0)

        assertThat(c.rotationX, `is`(-15.0))


        // 添加前后置
        envScenarioProcessors.stream()
                .filter(MsProcessor::getEnable)
                .forEach(processor -> {
                    processor.setProjectId(msScenario.getProjectId());
                    getConverterFunc.apply(processor.getClass()).parse(tree, processor, config);
                });
    }

    /**
     * 是否需要解析环境
     *
     * @param msScenario
     * @return
     */
    private boolean needParseEnv(MsScenario msScenario) {
        if (isRef(msScenario.getRefType())) {
            ScenarioStepConfig scenarioStepConfig = msScenario.getScenarioStepConfig();
            if (scenarioStepConfig == null || BooleanUtils.isFalse(scenarioStepConfig.getEnableScenarioEnv())) {
                // 引用的场景，如果没有开启源场景环境，不解析环境
                return false;
            }
            return true;
        } else if (isCopy(msScenario.getRefType())) {
            // 复制场景，不解析环境
            return false;
        } else {
            // 当前场景，解析环境
            return true;
        }
    }

    private void addScenarioProcessor(HashTree tree, MsScenario msScenario, ParameterConfig config, boolean isPre) {
        // 获取场景前后置
        ScenarioConfig scenarioConfig = msScenario.getScenarioConfig();
        if (isCopy(msScenario.getRefType()) || scenarioConfig == null) {
            // 复制的场景，没有前后置
            return;
        }
        MsProcessorConfig processorConfig = isPre ? scenarioConfig.getPreProcessorConfig() : scenarioConfig.getPostProcessorConfig();

        if (processorConfig == null || CollectionUtils.isEmpty(processorConfig.getProcessors())) {
            return;
        }
        List<MsProcessor> scenarioPreProcessors = processorConfig.getProcessors();

        Function<Class<?>, MsProcessorConverter<MsProcessor>> getConverterFunc =
                isPre ? MsProcessorConverterFactory::getPreConverter : MsProcessorConverterFactory::getPostConverter;

        // 添加场景前置处理器
        scenarioPreProcessors.stream()
                .filter(MsProcessor::getEnable)
                .forEach(processor -> {
                    processor.setProjectId(msScenario.getProjectId());
                    getConverterFunc.apply(processor.getClass()).parse(tree, processor, config);
                });
    }

    private boolean isRef(String refType) {
        return StringUtils.equalsAny(refType, ApiScenarioStepRefType.REF.name(), ApiScenarioStepRefType.PARTIAL_REF.name());
    }

    private boolean isRootScenario(String refType) {
        return StringUtils.equals(refType, ApiScenarioStepRefType.DIRECT.name());
    }

    private boolean isCopy(String refType) {
        return StringUtils.equals(refType, ApiScenarioStepRefType.COPY.name());
    }

    /**
     * 获取生效的环境
     * 如果使用源场景环境，则使用源场景的环境信息
     *
     * @param msScenario
     * @param config
     * @return
     */
    private ApiScenarioParamConfig getEnableConfig(MsScenario msScenario, ApiScenarioParamConfig config) {
        ApiScenarioParamConfig enableConfig = config;
        if (!isRef(msScenario.getRefType())) {
            if (isRootScenario(msScenario.getRefType())) {
                setScenarioConfig(msScenario, enableConfig);
            }
            // 非引用的场景，使用当前环境参数
            return enableConfig;
        }
        ScenarioStepConfig scenarioStepConfig = msScenario.getScenarioStepConfig();
        if (scenarioStepConfig != null && BooleanUtils.isTrue(scenarioStepConfig.getEnableScenarioEnv())) {


ata['combined_feat'])

    # normalize combined feat
    feat_all = np.concatenate(feat_all, axis=0)
    mean_all = np.mean(feat_all, axis=0, keepdims=True)
    std_all = np.std(feat_all, axis=0, keepdims=True)
    mean_all = np.zeros_like(mean_all)
    std_all = np.ones_like(std_all)
    for seq, data in data_dict.items():
        data_dict[seq]['combined_feat'] = (data['combined_feat'] - mean_all) /  std_all

    meta = {
        "std": std_all,
        "mean": mean_all
    }

    out_folder = f'./data/motion/{arctic_out}'
    if not op.exists(out_folder):
        os.makedirs(out_folder)

    print("Dumping Training data")
    train_data_dict = {k: v for k, v in data_dict.items() if k in train_seqs}
    val_data_dict = {k: v for k, v in data_dict.items() if k in val_seqs}
    np.save(os.path.join(out_folder, 'train.npy'), train_data_dict)
    np.save(os.path.join(out_folder, 'val.npy'), val_data_dict)
    np.save(os.path.join(out_folder, 'meta.npy'), meta)
    if export_single:
        for seq, data in tqdm(data_dict.items()):
            out = op.join(out_folder, 'seq', data['seq_name']+'.npy')
            os.makedirs(op.dirname(out), exist_ok=True)
            np.save(out, {"gt": data})
    return

def construct_args():
    parser = argparse.ArgumentParser()
    parser.add_argument(
        "--protocol",
        type=str,
        default=None,
    )
    parser.add_argument(
        "--split",
        type=str,
        choices=["train", "val", "test", "all"],
        default=None,
    )
    parser.add_argument(
        "--process_folder", type=str, default="./data/ARCTIC/arctic_data/data/processed/seqs"
    )
    args = parser.parse_args()
    return args

if __name__ == "__main__":
    from IPython import get_ipython
    from ipdb.__main__ import _get_debugger_cls
    import ipdb
    debugger = _get_debugger_cls()
    shell = get_ipython()
    shell.debugger_history_file = '.pdbhistory'
    args = construct_args()
    protocol = 'p2'
    split = args.split

    build_split(protocol, args.process_folder)


            (15, Region::new("us-west1")),
            (16, Region::new("us-west2")),
        ];

        let shard_id = 0;
        // map them all to the same shard
        let processes = processes
            .into_iter()
            .map(|(process_id, region)| (process_id, shard_id, region))
            .collect();

        // sort processes
        let region = Region::new("europe-west3");
        let planet = Planet::new();
        let sorted = sort_processes_by_distance(&region, &planet, processes);

        let expected =
            vec![8, 9, 6, 7, 5, 14, 10, 13, 12, 15, 16, 11, 1, 0, 4, 3, 2];
        // map them all to the same shard
        let expected: Vec<_> = expected
            .into_iter()
            .map(|process_id| (process_id, shard_id))
            .collect();

        assert_eq!(expected, sorted);
    }
}
<gh_stars>100-1000
#![feature(const_generics_defaults)]

// test that defaulted const params are not used to help type inference

struct Foo<const N: u32 = 2>;

impl<const N: u32> Foo<N> {
    fn foo() -> Self { loop {} }
}

fn main() {
    let foo = Foo::<1>::foo();
    let foo = Foo::foo();
    //~^ error: type annotations needed for `Foo<{_: u32}>`
}
/*
Copyright (C) 2018-2019 <EMAIL>

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

use core::fmt;

// GENERATOR-BEGIN: CodeSize
// ⚠This was generated by GENERATOR!🦹♂
/// The code size (16/32/64) that was used when an instruction was decoded
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub enum CodeSize {
	/// Unknown size
	Unknown = 0,
	/// 16-bit code
	Code16 = 1,
	/// 32-bit code
	Code32 = 2,
	/// 64-bit code
	Code64 = 3,
}
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
static GEN_DEBUG_CODE_SIZE: [&str; 4] = [
	"Unknown",
	"Code16",
	"Code32",
	"Code64",
];
impl fmt::Debug for CodeSize {
	#[inline]
	fn fmt<'a>(&self, f: &mut fmt::Formatter<'a>) -> fmt::Result {
		write!(f, "{}", GEN_DEBUG_CODE_SIZE[*self as usize])?;
		Ok(())
	}
}
impl Default for CodeSize {
	#[cfg_attr(has_must_use, must_use)]
	#[inline]
	fn defaul


nt()
        )

        val timeWriter = ListJsonWriter { generator: JsonGenerator, `object`: Timestamp? ->
            if (`object` != null) {
                generator.writeNumber(`object`.time)
            }
        }

        val o = writer("TestRecord", timeWriter).toStringUnchecked(new("TestRecord", JsonNullable.of<List<Any>>(listOf())))

        assertThat(o).isEqualTo(
            """
            {"test_field":[]}
            """.trimIndent()
        )
    }

    @Test
    fun jsonWriterUserNullableAlwaysIsPresent() {
        compile(
            """
            @JsonWriter
            data class TestRecord(@field:JsonInclude(IncludeType.ALWAYS) @field:JsonField("test_field") val testField: JsonNullable<List<java.sql.Timestamp>>)
            """.trimIndent()
        )

        val timeWriter = ListJsonWriter { generator: JsonGenerator, `object`: Timestamp? ->
            if (`object` != null) {
                generator.writeNumber(`object`.time)
            }
        }

        val o = writer("TestRecord", timeWriter).toStringUnchecked(new("TestRecord", JsonNullable.of<List<Timestamp>>(listOf(Timestamp.from(Instant.ofEpochMilli(1))))))

        assertThat(o).isEqualTo(
            """
            {"test_field":[1]}
            """.trimIndent()
        )
    }
}
package ru.tinkoff.kora.json.ksp

import com.squareup.kotlinpoet.ClassName

object JsonTypes {

    val json = ClassName("ru.tinkoff.kora.json.common.annotation", "Json")
    val jsonInclude = ClassName("ru.tinkoff.kora.json.common.annotation", "JsonInclude")
    val jsonDiscriminatorField = ClassName("ru.tinkoff.kora.json.common.annotation", "JsonDiscriminatorField")
    val jsonDiscriminatorValue = ClassName("ru.tinkoff.kora.json.common.annotation", "JsonDiscriminatorValue")

    val jsonNullable = ClassName("ru.tinkoff.kora.json.common", "JsonNullable")
    val jsonReaderAnnotation = ClassName("ru.tinkoff.kora.json.common.annotation", "JsonReader")
    val jsonWriterAnnotation = ClassName("ru.tinkoff.kora.json.common.annotation", "JsonWriter")

    val jsonReader = ClassName("ru.tinkoff.kora.json.common", "JsonReader")
    val jsonWriter = ClassName("ru.tinkoff.kora.json.common", "JsonWriter")

    val enumJsonReader = ClassName("ru.tinkoff.kora.json.common", "EnumJsonReader")
    val enumJsonWriter = ClassName("ru.tinkoff.kora.json.common", "EnumJsonWriter")

    val jsonFieldAnnotation = ClassName("ru.tinkoff.kora.json.common.annotation", "JsonField")
    val jsonSkipAnnotation = ClassName("ru.tinkoff.kora.json.common.annotation", "JsonSkip")

    val bufferingJsonParser = ClassName("ru.tinkoff.kora.json.common.util", "BufferingJsonParser");
    val discriminatorHelper = ClassName("ru.tinkoff.kora.json.common.util", "DiscriminatorHelper");

    val jsonParseException = ClassName("com.fasterxml.jackson.core", "JsonParseException")
    val jsonParser = ClassName("com.fasterxml.jackson.core", "JsonParser")
    val jsonGenerator = ClassName("com.fasterxml.jackson.core", "JsonGenerator")
    val jsonToken = ClassName("com.fasterxml.jackson.core", "JsonToken")
    val jsonParserSequence = ClassName("com.fasterxml.jackson.core.util", "JsonParserSequence")
    val serializedString = ClassName("com.fasterxml.jackson.core.io", "SerializedString")
}
package ru.tinkoff.kora.json.ksp.reader

import com.google.devtools.ksp.isConstructor
import com.google.devtools.ksp.isPublic
import com.google.devtools.ksp.processing.KSPLogger
import com.google.devtools.ksp.symbol.*
import com.squareup.kotlinpoet.TypeName
import com.squareup.kotlinpoet.ks


BeExcluded(exclusionPolicies, workConfiguration.exclusions.toList()).also {
    if (it.excluded) {
      log.debug("Excluding resource because reasons: {}, resource: {}", it.reasons, excludable)
    }
  }.excluded
}

data class ExclusionResult(
  val excluded: Boolean,
  val reasons: Set<String>
)

interface Excludable : Identifiable {
  /**
   * @param exclusionPolicies: all possible policies defined in code
   * @param exclusions: actual configured policies based on swabbie.yml
   */
  fun shouldBeExcluded(exclusionPolicies: List<ExclusionPolicy>, exclusions: List<Exclusion>): ExclusionResult {
    exclusionPolicies.mapNotNull { it.apply(this, exclusions) }.let { reasons ->
      return ExclusionResult(!reasons.isEmpty(), reasons.toSet())
    }
  }
}

interface ResourceExclusionPolicy : ExclusionPolicy
interface BasicExclusionPolicy : ExclusionPolicy
/*
 *
 *  * Copyright 2018 Netflix, Inc.
 *  *
 *  * 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.netflix.spinnaker.swabbie.repository

interface ResourceUseTrackingRepository {
  /**
   * record that resource is used by another resource at this exact time
   */
  fun recordUse(resourceIdentifier: String, usedByResourceIdentifier: String)

  /**
   * gets resources that haven't been seen in use for X days
   */
  fun getUnused(): List<LastSeenInfo>

  /**
   * gets all resources that we have seen in use within the threshold
   */
  fun getUsed(): Set<String>

  fun isUnused(resourceIdentifier: String): Boolean

  fun getLastSeenInfo(resourceIdentifier: String): LastSeenInfo?

  /**
   * Returns true if data is present for the whole outOfUseThreshold period.
   * Returns false if data is only present for part of the period,
   *  i.e. if the outOfUseThreshold is 10 days but we only have data for 5.
   */
  fun hasCompleteData(): Boolean
}

data class LastSeenInfo(
  val resourceId: String,
  val usedByResourceId: String,
  val timeSeen: Long
)
/*
 * Copyright 2019 Netflix, Inc.
 *
 * 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.netflix.spinnaker.swabbie.tagging

import com.netflix.spinnaker.swabbie.model.BasicTag
import java.time.temporal.ChronoUnit

class TemporalTags {
  companion object {
    val supportedTemporalTagValues = listOf("^\\d+(d|m|y|w)$", "never")
    val temporalTags = listOf("expiration_time", "expires", "ttl")

    private val supportedTemporalUnits = mapOf(
      "d" to ChronoUnit.DAYS,
      "m" to ChronoUnit.MONTHS,
      "y" to ChronoUnit.YEARS,
      "w" to ChronoUni


final data = ref.read(gradeViewModel).chartDataForDegree(studyId);
    final averageGrade = ref.read(gradeViewModel).getAverageGrade();
    return CardWithPadding(
      child: Column(
        mainAxisSize: MainAxisSize.min,
        children: [
          PopupMenuButton<String>(
            itemBuilder: (context) =>
                ref.read(gradeViewModel).getMenuEntries(context),
            onSelected: (selected) {
              ref.read(gradeViewModel).setSelectedDegree(selected);
            },
            child: IconText(
              iconData: Icons.keyboard_arrow_down,
              label: "$title ($degreeShort)",
              style: Theme.of(context).textTheme.bodyLarge,
              mainAxisAlignment: MainAxisAlignment.center,
              leadingIcon: false,
            ),
          ),
          SfCartesianChart(
            primaryXAxis: const CategoryAxis(),
            primaryYAxis: NumericAxis(
              minimum: 0,
              maximum: data.values.reduce(max).toDouble(),
              interval: 1,
            ),
            series: <CartesianSeries<MapEntry<dynamic, int>, String>>[
              ColumnSeries<MapEntry<dynamic, int>, String>(
                dataSource: data.entries.toList(),
                xValueMapper: (MapEntry<dynamic, int> data, _) =>
                    data.key.toString(),
                yValueMapper: (MapEntry<dynamic, int> data, _) => data.value,
                pointColorMapper: (MapEntry<dynamic, int> data, _) =>
                    GradeViewModel.getColor(data.key),
              ),
            ],
          ),
          if (averageGrade != null) ...[
            const Divider(),
            Row(
              children: [
                Expanded(
                  child: Text(
                    context.tr("averageGrade"),
                    style: Theme.of(context).textTheme.bodyLarge,
                  ),
                ),
                Text(
                  averageGrade.averageGrade.toString(),
                  style: Theme.of(
                    context,
                  ).textTheme.bodyLarge?.copyWith(fontWeight: FontWeight.bold),
                ),
              ],
            ),
          ],
        ],
      ),
    );
  }
}
import 'package:campus_flutter/base/routing/routes.dart';
import 'package:campus_flutter/studiesComponent/view/lectureDetail/lecture_info_card_view.dart';
import 'package:campus_flutter/studiesComponent/viewModel/lecture_details_viewmodel.dart';
import 'package:campus_flutter/studiesComponent/view/lectureDetail/basic_lecture_info_row_view.dart';
import 'package:campus_flutter/base/extensions/context.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:go_router/go_router.dart';

class LectureMeetingInfoView extends ConsumerWidget {
  const LectureMeetingInfoView({super.key, required this.viewModel});

  final Provider<LectureDetailsViewModel> viewModel;

  @override
  Widget build(BuildContext context, WidgetRef ref) {
    return LectureInfoCardView(
      icon: Icons.calendar_month,
      title: context.tr("thisMeeting"),
      widgets: [
        BasicLectureInfoRowView(
          information: ref.read(viewModel).event!.timePeriodText(context),
          iconData: Icons.hourglass_top,
        ),
        BasicLectureInfoRowView(
          information:
              ref.


mber {}'
    result = []
    for idx, (user, user_client) in enumerate(authors_map.items(), 1):
        response = create_single_comment(
            user_client, titles[0]['id'], reviews[0]['id'], text.format(idx)
        )
        result.append(
            {
                'id': response.json()['id'],
                'author': user.username,
                'text': text.format(idx),
            }
        )
    return result, reviews, titles

def check_fields(obj_type, url_pattern, obj, expected_data, detail=False):
    obj_types = {
        'comment': 'комментария(ев) к отзыву',
        'review': 'отзыва(ов)'
    }
    results_in_msg = ' в ключе `results`'
    if detail:
        results_in_msg = ''
    for field in expected_data:
        assert obj.get(field) == expected_data[field], (
            f'Проверьте, что ответ на GET-запрос к `{url_pattern}` содержит '
            f'данные {obj_types[obj_type]}{results_in_msg}. Поле '
            f'`{field}` не найдено или содержит некорректные данные.'
        )
    assert obj.get('pub_date'), (
        f'Проверьте, что ответ на GET-запрос к `{url_pattern}` содержит '
        f'данные {obj_types[obj_type]}{results_in_msg}. Поле `pub_date` не '
        'найдено.'
    )
    assert isinstance(obj.get('id'), int), (
        f'Проверьте, что ответ на GET-запрос к `{url_pattern}` содержит '
        f'данные {obj_types[obj_type]}{results_in_msg}. Поле `id` не '
        'найдено или не является целым числом.'
    )


]
* chrono::year_month_weekday[link year_month_weekday.md]
* chrono::sys_days[link sys_time.md]
* chrono::year_month_day[link year_month_day.md]

### 出力
```
2020-04-05
```

## バージョン
### 言語
- C++20

### 処理系
- [Clang](/implementation.md#clang): 8.0 (入出力ストリームなし) [mark verified]
- [GCC](/implementation.md#gcc): 10.1 [mark noimpl]
- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl]

## 参照
- [P2592R3 Hashing support for `std::chrono` value classes](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2592r3.html)
    - C++26でハッシュサポートが追加された
# choose
* chrono[meta header]
* std::chrono[meta namespace]
* enum[meta id-type]
* cpp20[meta cpp]

```cpp
namespace std::chrono {
  enum class choose {
    earliest,
    latest
  };
}
```

## 概要
`choose`は、タイムゾーン情報に従ってローカル時間からシステム時間に変換する際にあいまいになる場合、早い時間と遅い時間どちら側の候補に変換するかをユーザーが選択できるようにするための列挙型である。

各列挙値は、以下を意味する：

| 列挙値 | 説明 |
|--------|------|
| `earliest` | 早い時間側に変化する |
| `latest`   | 遅い時間側に変換する |

この列挙型は、サマータイムを採用しているタイムゾーンにおいて、重複するローカル時間があるため対応するシステム時間が一意に決まらない場合に、複数候補のどれに変換するかを決めるためのものである。

## 例
```cpp example
#include <chrono>
#include <iostream>

namespace chrono = std::chrono;
using namespace std::chrono_literals;

int main()
{
  // ニューヨーク (EDTタイムゾーン) のローカル時間を、システム時間 (UTCタイムゾーン) に変換する。
  // ローカル時間2016-11-06 01:30:00 EDTに対応するシステム時間は、以下の2つがあり、一意に決まらない：
  //   2016-11-06 05:30:00 UTC
  //   2016-11-06 06:30:00 UTC
  // ここではlatestを指定することで、遅い時間 (06:30:00) を選択する
  chrono::local_time local_now = chrono::local_days{2016y/11/6} + 1h + 30min;

  chrono::zoned_time zt{"America/New_York", local_now, chrono::choose::latest};
  chrono::sys_time st = zt.get_sys_time();

  std::cout << st << std::endl;
}
```
* chrono::choose::latest[color ff0000]
* chrono::local_days[link local_time.md]
* chrono::local_time[link local_time.md]
* 2016y[link year/op_y.md]
* 1h[link duration/op_h.md]
* 30min[link duration/op_min.md]
* chrono::zoned_time[link zoned_time.md]
* zt.get_sys_time()[link zoned_time/get_sys_time


text,
) {
    private val Context.dataStore by preferencesDataStore(name = DATASTORE_NAME)
    private val keyMemberId = longPreferencesKey(KEY_MEMBER_ID)

    suspend fun saveMemberId(memberId: Long): Result<Unit> =
        runCatching {
            context.dataStore.edit { prefs ->
                prefs[keyMemberId] = memberId
            }
        }

    suspend fun getMemberId(): Result<Long> =
        runCatching {
            val prefs = context.dataStore.data.first()
            val memberId = prefs[keyMemberId]
            requireNotNull(memberId) { ERROR_MEMBER_ID_NULL }
        }

    companion object {
        private const val DATASTORE_NAME = "user_info"
        private const val KEY_MEMBER_ID = "KEY_MEMBER_ID"
        private const val ERROR_MEMBER_ID_NULL = "[ERROR] 회원 ID가 null 입니다"
    }
}
package com.bottari.data.service

import com.bottari.data.model.bottari.BottariResponse
import com.bottari.data.model.bottari.CreateBottariRequest
import com.bottari.data.model.bottari.FetchBottariesResponse
import com.bottari.data.model.bottari.UpdateBottariTitleRequest
import retrofit2.Response
import retrofit2.http.Body
import retrofit2.http.DELETE
import retrofit2.http.GET
import retrofit2.http.PATCH
import retrofit2.http.POST
import retrofit2.http.Path

interface BottariService {
    @GET("/bottaries")
    suspend fun fetchBottaries(): Response<List<FetchBottariesResponse>>

    @GET("/bottaries/{id}")
    suspend fun findBottari(
        @Path("id") id: Long,
    ): Response<BottariResponse>

    @POST("/bottaries")
    suspend fun createBottari(
        @Body request: CreateBottariRequest,
    ): Response<Unit>

    @DELETE("/bottaries/{id}")
    suspend fun deleteBottari(
        @Path("id") id: Long,
    ): Response<Unit>

    @PATCH("/bottaries/{id}")
    suspend fun saveBottariTitle(
        @Path("id") id: Long,
        @Body request: UpdateBottariTitleRequest,
    ): Response<Unit>
}
package com.bottari.data.local.notification

import android.content.Context
import androidx.room.Database
import androidx.room.Room
import androidx.room.RoomDatabase
import androidx.room.TypeConverters
import com.bottari.data.common.util.LocalDateConverter
import com.bottari.data.common.util.LocalTimeConverter
import com.bottari.data.common.util.RepeatDaysConverter
import com.bottari.data.model.notification.NotificationEntity

@Database(entities = [NotificationEntity::class], version = 1)
@TypeConverters(LocalTimeConverter::class, LocalDateConverter::class, RepeatDaysConverter::class)
abstract class NotificationDatabase : RoomDatabase() {
    abstract fun notificationDao(): NotificationDao

    companion object {
        private const val DATABASE_NAME = "Notification"

        @Volatile
        private var instance: NotificationDatabase? = null

        fun getDatabase(context: Context): NotificationDatabase =
            instance ?: synchronized(this) {
                Room
                    .databaseBuilder(
                        context.applicationContext,
                        NotificationDatabase::class.java,
                        DATABASE_NAME,
                    ).build()
                    .also { instance = it }
            }
    }
}
package com.bottari.data.source.remote

import com.bottari.data.model.team.CreateTeamBottariAssignedItemRequest
import com.bottari.data.model.team.CreateTeamBottariPersonalItemRequest
import com.bottari.data.model.team.CreateTeamBottariRequest
import com.bottari.data.model.team.CreateTeamBottariSharedItemRequest


dioContext.createMediaStreamSource(stream);
    analyser = audioContext.createAnalyser();
    analyser.fftSize = 2048;
    source.connect(analyser);
}

function detectSilence() {
    if (!analyser) return;

    const bufferLength = analyser.fftSize;
    const dataArray = new Uint8Array(bufferLength);
    analyser.getByteTimeDomainData(dataArray);

    let sum = 0;
    for (let i = 0; i < bufferLength; i++) {
        const sample = dataArray[i] / 128 - 1;
        sum += sample * sample;
    }
    const rms = Math.sqrt(sum / bufferLength);
    const silence = rms < SILENCE_THRESHOLD;

    if (silence) {
        if (!silenceTimeout) {
            silenceTimeout = setTimeout(() => {
                stopRecordingDueToSilence();
            }, SILENCE_DURATION);
        }
    } else {
        clearTimeout(silenceTimeout);
        silenceTimeout = null;
    }
}

function stopRecordingDueToSilence() {
    if (mediaRecorder && mediaRecorder.state !== 'inactive') {
        mediaRecorder.stop();
    }
}

toggleButton.addEventListener('click', () => {
    if (isListening) {
        stopListening();
    } else {
        startListening();
    }
});
</script>
{% endblock %}
{% extends "layout.html" %}

{% block title %}404 - Page Not Found | OpenAlgo{% endblock %}

{% block content %}

                    404 - Page Not Found

                    The page you're looking for doesn't exist or has been moved.
                    Don't worry, let's get you back on track.

                        <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                            <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
                                  d="M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6" />
                        </svg>
                        Back to Home

                        <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                            <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
                                  d="M11 16l-4-4m0 0l4-4m-4 4h14m-5 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h7a3 3 0 013 3v1" />
                        </svg>
                        Login

Quick Links

                    <a href="https://docs.openalgo.in" target="_blank" rel


address).
     *
     * @return the giaddr field converted to <tt>InetAddress</tt> object.
     */
    public InetAddress getGiaddr() {
        try {
            return InetAddress.getByAddress(this.getGiaddrRaw());
        } catch (UnknownHostException e) {
//            logger.log(Level.SEVERE, "Unexpected UnknownHostException", e);
            return null;    // normaly impossible
        }
    }

    /**
     * Returns the giaddr field (Relay agent IP address).
     *
     *
This is the low-level maximum performance getter for this field.
     *
     * @return Returns the giaddr as raw byte[4].
     */
    public byte[] getGiaddrRaw() {
        return this.giaddr.clone();
    }

    /**
     * Sets the giaddr field (Relay agent IP address).
     *
     *
Ths <tt>giaddr</tt> field must be of <tt>Inet4Address</tt> class or
     * an <tt>IllegalArgumentException</tt> is thrown.
     *
     * @param giaddr The giaddr to set.
     */
    public void setGiaddr(InetAddress giaddr) {
        if (!(giaddr instanceof Inet4Address)) {
            throw new IllegalArgumentException("Inet4Address required");
        }
        this.setGiaddrRaw(giaddr.getAddress());
    }

    /**
     * Sets the giaddr field (Relay agent IP address).
     *
     * @param giaddr The giaddr to set.
     * @throws UnknownHostException
     */
    public void setGiaddr(String giaddr) throws UnknownHostException {
        this.setGiaddr(InetAddress.getByName(giaddr));
    }

    /**
     * Sets the giaddr field (Relay agent IP address).
     *
     *
<tt>giaddr</tt> must be a 4 bytes array, or an <tt>IllegalArgumentException</tt>
     * is thrown.
     *
     *
This is the low-level maximum performance setter for this field.
     * The array is internally copied so any further modification to <tt>ciaddr</tt>
     * parameter has no side effect.
     *
     * @param giaddr The giaddr to set.
     */
    public void setGiaddrRaw(byte[] giaddr) {
        if (giaddr.length != 4) {
            throw new IllegalArgumentException("4-byte array required");
        }
        System.arraycopy(giaddr, 0, this.giaddr, 0, 4);
    }

    /**
     * Returns the hlen field (Hardware address length).
     *
     *
Typical value is 6 for ethernet - 6 bytes MAC address.
     *
     * @return the hlen field.
     */
    public byte getHlen() {
        return this.hlen;
    }

    /**
     * Sets the hlen field (Hardware address length).
     *
     *
Typical value is 6 for ethernet - 6 bytes MAC address.
     *
     *
hlen value should be between 0 and 16, but no control is done here.
     *
     * @param hlen The hlen to set.
     */
    public void setHlen(byte hlen) {
        this.hlen = hlen;
    }

    /**
     * Returns the hops field.
     *
     * @return the hops field.
     */
    public byte getHops() {
        return this.hops;
    }

    /**
     * Sets the hops field.
     *
     * @param hops The hops to set.
     */
    public void setHops(byte hops) {
        this.hops = hops;
    }

    /**
     * Returns the htype field (Hardware address length).
     *
     *
Predefined val


10 5,10.614 5,12v8c0 1.385 1.278 2,2.096 2H21V10H7.096z M25.429 11L22 13.5v5l3.429 2.5H27V11H25.429z",color:"#000"},76:{width:32,height:32,path:"M18.072 4.001c-2.494 0.201-4.601 5.052-6.906 7.5H8.135c-1.514 0-1.514 9,0 9h3.031c2.305 2.447 4.451 7.268 6.906 7.469c0.053 0.01 0.104 0.03 0.156 0.03c1.672 0,3.031-5.372 3.031-12c0-6.627-1.359-12-3.031-12C18.176 4,18.127 4,18.072 4.001L18.072 4.001zM17.76 6.626c1.057 0,1.938 4.19 1.938 9.375c0 5.184-0.881 9.375-1.938 9.375c-0.826 0-1.514-2.586-1.781-6.188c0.99-0.73 1.625-1.877 1.625-3.188c0-1.312-0.635-2.457-1.625-3.188C16.246 9.211 16.934 6.626 17.76 6.626z",color:"#000"},77:{width:32,height:32,path:"M16.514 6C11.787 6,7.43 7.659 4,10.423l2.377 2.928c2.772-2.224 6.296-3.558 10.137-3.558s7.363 1.334 10.136 3.558l2.361-2.928C25.582 7.664 21.235 6 16.514 6L16.514 6z M16.514 10.927c-3.559 0-6.831 1.247-9.413 3.321l2.361 2.943c1.927-1.544 4.371-2.472 7.052-2.472c2.666 0 5.118 0.911 7.051 2.44l2.361-2.912C23.344 12.174 20.071 10.927 16.514 10.927z M15.994 15.932c-2.172 0.111-4.163 0.924-5.762 2.204l2.361 2.912c1.072-0.849 2.431-1.354 3.919-1.354c1.484 0,2.833 0.51 3.903 1.354l2.361-2.928c-1.722-1.369-3.902-2.188-6.265-2.188C16.34 15.932 16.165 15.922 15.994 15.932L15.994 15.932z M16.514 21.079c-1.143 0-2.2 0.405-3.038 1.07l3.021 3.73l3.038-3.746C18.696 21.477 17.647 21.079 16.514 21.079z",color:"#000"},78:{width:24,height:24,path:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z",color:"#000"},79:{width:24,height:24,path:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z",color:"#000"},80:{width:24,h


NightDesert", x = 87.011039, y = 76.013977, z = 89.952133},
	{family = "Vault", name = "Vault Little Prince", map = "NightDesert", x = 66.691436, y = 72.158546, z = 63.658821},
	{family = "Vault", name = "Vault Little Prince", map = "NightDesert", x = 158.014846, y = 77.405067, z = 335.245422},
	{family = "Vault", name = "Vault Little Prince", map = "NightDesert", x = 164.866561, y = 77.405334, z = 352.186462},
	{family = "Vault", name = "Vault Little Prince", map = "NightDesert", x = 183.502655, y = 77.405265, z = 343.524108},
	{family = "Vault", name = "Vault Little Prince", map = "NightDesert", x = 573.401184, y = 17.064425, z = 165.830093, e = true}, --Empty
	{family = "Vault", name = "Vault Little Prince", map = "NightDesert", x = 573.401184, y = 11.064425, z = 165.830093},
	{family = "Vault", name = "Vault Little Prince", map = "NightDesert", x = 766.331481, y = 90.628509, z = 402.817291},
	{family = "Vault", name = "Vault Little Prince", map = "NightDesert", x = 778.703063, y = 91.167816, z = 415.422760},
	{family = "Vault", name = "Vault Little Prince", map = "NightDesert", x = 792.881042, y = 90.695831, z = 399.077636},
	{family = "Vault", name = "Vault Little Prince", map = "NightDesert", x = 1041.245239, y = 134.933639, z = 392.586730},
	{family = "Vault", name = "Vault Little Prince", map = "NightDesert", x = 1026.362060, y = 150.298233, z = 395.193969},
	{family = "Vault", name = "Vault Little Prince", map = "NightDesert", x = 1025.338745, y = 150.523941, z = 412.695526},
	{family = "Vault", name = "Vault Little Prince", map = "NightDesert", x = 535.000000, y = 8.000000, z = 450.000000}, --Shipwreck area
	{family = "Vault", name = "Vault Little Prince", map = "NightDesert", x = 618.537414, y = 1.227436, z = 600.079589},
	{family = "Vault", name = "Vault Little Prince", map = "NightDesert", x = 605.406005, y = 0.353380, z = 609.522338},
	{family = "Vault", name = "Vault Little Prince", map = "NightDesert", x = 580.832763, y = 4.860373, z = 621.304016},
	{family = "Vault", name = "Vault Little Prince", map = "NightDesert", x = 565.524414, y = 13.000000, z = 440.000000}, --Main Area
	{family = "Vault", name = "Vault Little Prince", map = "NightDesert", x = 377.820281, y = 30.000000, z = -82.598495}, -- Bottle Area
	{family = "Vault", name = "Vault Little Prince", map = "NightDesert", x = 384.046325, y = 20.765531, z = -111.498588},


Line.column, srcLine.column + 1);
          var rangeEnd = srcLine.str.substring(srcLine.column + 1, srcLine.range.end);
          var end   = srcLine.str.substring(srcLine.range.end);
          var el = new Element.html(js.context.callMethod('prettyPrintOne', [toHtml(
              new PreElement()
                ..append(span('src-range-transparent', start))
                ..appendText(rangeStart)
                ..append(span('src-range-point', rangeMiddle))
                ..appendText(rangeEnd)
                ..append(span('src-range-transparent', end)))]));
          add("", el).row.classes.add("source-line");
        }
      }

      var gutter;
      if (id is IR.MultiId) {
        id = gutter = id.ids;
      } else if (id == null) {
        gutter = "";
      } else {
        gutter = id;
      }

      final line = format(ctx, opcode, operands);

      final ln = add(gutter, line, id: id, fields: fieldsFor(instr));
      ln.gutter.parentNode.classes.add("${ctx.ns}-gutter");
      ln.text.parentNode.classes.add("${ctx.ns}-line");
      return ln;
    }

    /** Output a [Branch] instruction. */
    addBranch(ctx, instr) {
      final ln = add(" ", new SpanElement()
                    ..append(span("boldy", "if "))
                    ..append(format(ctx, instr.op, instr.args))
                    ..append(span("boldy", " goto "))
                    ..appendText("(")
                    ..append(makeBlockRef(instr.true_successor))
                    ..appendText(", ")
                    ..append(makeBlockRef(instr.false_successor))
                    ..appendText(")"), fields: fieldsFor(instr));
      ln.gutter.parentNode.classes.add("${ctx.ns}-gutter");
      ln.text.parentNode.classes.add("${ctx.ns}-line");
    }

    final codeRenderer = new CodeRenderer(this, ir.code);
    final contexts = ir.mode.irs.map((irDesc) =>
        new FormattingContext(irDesc, makeBlockRef, makeValueRef)).toList();
    final lastCtx = contexts.last;

    emitInlineCode(FormattingContext ctx, instr) {
      if (ctx == lastCtx &&
          safeCodeMode == 'inline' &&
          instr.code != null) {
        ctx.codeOf(instr, skipComment: true).forEach(codeRenderer.display);
      }
    }

    if (safeCodeMode != 'none') {
      ir.code.prologue.forEach(codeRenderer.display);
    }

    final nesting = havlak.findLoops(ir.blocks.values.toList(growable: false)).nesting;

    final maxNesting = nesting.fold(0, math.max);

    hotness(block) => math.max(1, 5 - maxNesting + nesting[block.id]);

    for (var block in ir.blocks.values) {
      // currentRowClass = graph.selectBorder(block, nesting[block.id]);
      if (nesting[block.id] > 0) {
        currentRowClass = ["loop-${nesting[block.id]}", "loop-hotness-${hotness(block)}"];
      } else {
        currentRowClass = null;
      }
      add(" ", " ");
      add(span('boldy', block.name), " ", id: block.name);

      for (var ctx in contexts) {
        final blockIr = ctx.ir(block);
        if (blockIr.isEmpty) continue;

        var branch = blockIr.last;
        for (var index = 0; index < blockIr.length - 1; index++) {
          final instr = bloc