_WINDOWS,
                        )?;
                        let alpha = zs[0].clone();

                        let offset = offset + NUM_WINDOWS + 1;

                        config.copy_decompose(
                            &mut region,
                            offset,
                            alpha,
                            self.strict,
                            WORD_NUM_BITS,
                            NUM_WINDOWS,
                        )?;

                        Ok(())
                    },
                )
            }
        }

        // Random base field element
        {
            let alpha = pallas::Base::random(OsRng);

            // Strict full decomposition should pass.
            let circuit: MyCircuit<pallas::Base, L_BASE, FIXED_BASE_WINDOW_SIZE, { NUM_WINDOWS }> =
                MyCircuit {
                    alpha: Some(alpha),
                    strict: true,
                };
            let prover = MockProver::<pallas::Base>::run(8, &circuit, vec![]).unwrap();
            assert_eq!(prover.verify(), Ok(()));
        }

        // Random 64-bit word
        {
            let alpha = pallas::Base::from(rand::random::<u64>());

            // Strict full decomposition should pass.
            let circuit: MyCircuit<
                pallas::Base,
                L_SHORT,
                FIXED_BASE_WINDOW_SIZE,
                { NUM_WINDOWS_SHORT },
            > = MyCircuit {
                alpha: Some(alpha),
                strict: true,
            };
            let prover = MockProver::<pallas::Base>::run(8, &circuit, vec![]).unwrap();
            assert_eq!(prover.verify(), Ok(()));
        }

        // 2^66
        {
            let alpha = pallas::Base::from_u128(1 << 66);

            // Strict partial decomposition should fail.
            let circuit: MyCircuit<
                pallas::Base,
                L_SHORT,
                FIXED_BASE_WINDOW_SIZE,
                { NUM_WINDOWS_SHORT },
            > = MyCircuit {
                alpha: Some(alpha),
                strict: true,
            };
            let prover = MockProver::<pallas::Base>::run(8, &circuit, vec![]).unwrap();
            assert_eq!(
                prover.verify(),
                Err(vec![
                    VerifyFailure::Permutation {
                        column: (Any::Fixed, 0).into(),
                        location: FailureLocation::OutsideRegion { row: 0 },
                    },
                    VerifyFailure::Permutation {
                        column: (Any::Fixed, 0).into(),
                        location: FailureLocation::OutsideRegion { row: 1 },
                    },
                    VerifyFailure::Permutation {
                        column: (Any::Advice, 0).into(),
                        location: FailureLocation::InRegion {
                            region: (0, "decompose").into(),
                            offset: 22,
                        },
                    },
                    VerifyFailure::Permutation {
                        column: (Any::Advice, 0).into(),
                        location: FailureLocation::InRegion {
                            region: (0, "decompose").into(),
                            offset: 45,
                        },
                    },
                ])
            );

            // Non-strict partial decomposition should pass.
            let circuit: MyCircuit<
                pallas::Base,
                { L_SHORT },
                FIXED_BASE_WINDOW_SIZE,
                { NUM_WINDOWS_SHORT },
            > = MyCircuit {
                alpha: Some(alpha),
                strict: false,
            };
            let prover = MockProver


from django.urls import path
from . import views

app_name = 'conversation'

urlpatterns = [
    path('', views.inbox, name='inbox'),
    path('<int:pk>/', views.detail, name='detail'),
    path('new/<int:item_pk>/', views.new_conversation, name='new'),
]


/* Multiple versions of strlen.
   Copyright (C) 2015-2024 Free Software Foundation, Inc.
   This file is part of the GNU C Library.

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

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

   You should have received a copy of the GNU Lesser General Public
   License along with the GNU C Library; if not, see
   <https://www.gnu.org/licenses/>.  */

#include <ifunc-strlen.h>

#if HAVE_STRLEN_IFUNC
# define strlen __redirect_strlen
# include <string.h>
# include <ifunc-resolve.h>
# undef strlen

# if HAVE_STRLEN_C
extern __typeof (__redirect_strlen) STRLEN_C attribute_hidden;
# endif

# if HAVE_STRLEN_Z13
extern __typeof (__redirect_strlen) STRLEN_Z13 attribute_hidden;
# endif

s390_libc_ifunc_expr (__redirect_strlen, strlen,
		      (HAVE_STRLEN_Z13 && (hwcap & HWCAP_S390_VX))
		      ? STRLEN_Z13
		      : STRLEN_DEFAULT
		      )
#endif


/commit/e5fbaae0d4278681e5f589aa46c867e7904c4646))

### Testing

- **postman:** Update postman collection files ([`2593dd1`](https://github.com/juspay/hyperswitch/commit/2593dd17c30d7f327b54f3c386a9fd42ae8146ca))

### Miscellaneous Tasks

- **deps:** Bump rustix from 0.37.24 to 0.37.25 ([#2637](https://github.com/juspay/hyperswitch/pull/2637)) ([`67d0062`](https://github.com/juspay/hyperswitch/commit/67d006272158372a4b9ec65cbbe7b2ae8f35eb69))

### Build System / Dependencies

- **deps:** Use `async-bb8-diesel` from `crates.io` instead of git repository ([#2619](https://github.com/juspay/hyperswitch/pull/2619)) ([`14c0821`](https://github.com/juspay/hyperswitch/commit/14c0821b8085279072db3484a3b1bcdde0f7893b))

**Full Changelog:** [`v1.61.0...v1.62.0`](https://github.com/juspay/hyperswitch/compare/v1.61.0...v1.62.0)

- - -

## 1.61.0 (2023-10-18)

### Features

- **Connector:** [Paypal] add support for dispute webhooks for paypal connector ([#2353](https://github.com/juspay/hyperswitch/pull/2353)) ([`6cf8f05`](https://github.com/juspay/hyperswitch/commit/6cf8f0582cfa4f6a58c67a868cb67846970b3835))
- **apple_pay:** Add support for decrypted apple pay token for checkout ([#2628](https://github.com/juspay/hyperswitch/pull/2628)) ([`794dbc6`](https://github.com/juspay/hyperswitch/commit/794dbc6a766d12ff3cdf0b782abb4c48b8fa77d0))
- **connector:**
  - [Aci] Update connector_response_reference_id with merchant reference ([#2551](https://github.com/juspay/hyperswitch/pull/2551)) ([`9e450b8`](https://github.com/juspay/hyperswitch/commit/9e450b81ca8bc4b1ddbbe2c1d732dbc58c61934e))
  - [Bambora] use connector_request_reference_id ([#2518](https://github.com/juspay/hyperswitch/pull/2518)) ([`73e9391`](https://github.com/juspay/hyperswitch/commit/73e93910cd3bd668d721b15edb86240adc18f46b))
  - [Tsys] Use connector_request_reference_id as reference to the connector ([#2631](https://github.com/juspay/hyperswitch/pull/2631)) ([`b145463`](https://github.com/juspay/hyperswitch/commit/b1454634259144d896716e5cef37d9b8491f55b9))
- **core:** Replace temp locker with redis ([#2594](https://github.com/juspay/hyperswitch/pull/2594)) ([`2edbd61`](https://github.com/juspay/hyperswitch/commit/2edbd6123512a6f2f4d51d5c2d1ed8b6ee502813))
- **events:** Add events for incoming API requests ([#2621](https://github.com/juspay/hyperswitch/pull/2621)) ([`7a76d6


G_SHADE_A, G_RM_AA_ZB_TEX_EDGE2),
    gsDPSetTextureImage_Dolphin(G_IM_FMT_CI, G_IM_SIZ_4b, 32, 48, int_sum_slot_front_tex_txt),
    gsDPSetTile_Dolphin(G_DOLPHIN_TLUT_DEFAULT_MODE, 0, 15, GX_CLAMP, GX_CLAMP, 0, 0),
    gsSPNTrianglesInit_5b(4, 11, 12, 13, 11, 14, 15, 13, 16, 11),
    gsSPNTriangles_5b(15, 12, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0),
    gsDPSetTextureImage_Dolphin(G_IM_FMT_CI, G_IM_SIZ_4b, 32, 16, int_sum_slot_foot_tex_txt),
    gsDPSetTile_Dolphin(G_DOLPHIN_TLUT_DEFAULT_MODE, 0, 15, GX_CLAMP, GX_CLAMP, 0, 0),
    gsSPLoadGeometryMode(G_ZBUFFER | G_SHADE | G_FOG | G_LIGHTING | G_SHADING_SMOOTH | G_DECAL_LEQUAL),
    gsSPNTrianglesInit_5b(2, 17, 18, 19, 20, 21, 22, 0, 0, 0),
    gsSPEndDisplayList(),
};

Gfx int_sum_slot_lever_model[] = {
    gsSPTexture(0, 0, 0, G_TX_RENDERTILE, G_ON),
    gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_AA_ZB_TEX_EDGE2),
    gsDPSetCombineLERP(TEXEL0, 0, SHADE, 0, 0, 0, 0, TEXEL0, PRIMITIVE, 0, COMBINED, 0, 0, 0, 0, COMBINED),
    gsDPLoadTLUT_Dolphin(15, 16, 1, int_sum_slot_pal),
    gsDPSetTextureImage_Dolphin(G_IM_FMT_CI, G_IM_SIZ_4b, 16, 32, int_sum_slot_lever_tex_txt),
    gsDPSetTile_Dolphin(G_DOLPHIN_TLUT_DEFAULT_MODE, 0, 15, GX_CLAMP, GX_CLAMP, 0, 0),
    gsDPSetPrimColor(0, 128, 255, 255, 255, 255),
    gsSPLoadGeometryMode(G_ZBUFFER | G_SHADE | G_FOG | G_LIGHTING | G_SHADING_SMOOTH | G_DECAL_LEQUAL),
    gsSPVertex(&int_sum_slot_v[18], 5, 0),
    gsSPNTrianglesInit_5b(2, 0, 1, 2, 0, 3, 4, 0, 0, 0),
    gsSPEndDisplayList(),
};

u8 cKF_ckcb_r_int_sum_slot_tbl[] = { 0, 0, 0, 2, 4 };

s16 cKF_kn_int_sum_slot_tbl[] = { 11, 6 };

s16 cKF_c_int_sum_slot_tbl[] = { 0, 1250, 100, 0, 0, 900, 0, 0, 0, 0, 0, 0, 0, 0, 0, 900 };

s16 cKF_ds_int_sum_slot_tbl[] = { 1,    0,   -98,  3,    -13,    -393, 16,   -746,   -3008, 17,  -850,   -2237, 18,
                                  -895, 185, 20,   -707, 4584,   22,   -344, 5387,   24,    -48, 2595,   25,    0,
                                  724,  26,  0,    0,    121,    0,    0,    1,      0,     4,   27,     4,     -106,
                                  29,   -10, -447, 115,  -14395, -327, 117,  -14400, 0,     121, -14400, 0 };

cKF_Animation_R_c cKF_ba_r_int_sum_slot = {
    cKF_ckcb_r_int_sum_slot_tbl, cKF_ds_int_sum_slot_tbl, cKF_kn_int_sum_slot_tbl, cKF_c_int_sum_slot_tbl, -1, 121
};

cKF_Joint_R_c cKF_je_r_int_sum_slot_tbl[] = { { NULL, 1, cKF_JOINT_FLAG_DISP_OPA, { 0, 1250, 100 } },
                                              { int_sum_slot_base_model, 2, cKF_JOINT_FLAG_DISP_OPA, { 0, 0, 0 } },
                                              { NULL, 1, cKF_JOINT_FLAG_DISP_OPA, { 2050, 0, 65436 } },
                                              { int_sum_slot_lever_model, 0, cKF_JOINT_FLAG_DISP_OPA, { 0, 0, 0 } },
                                              { int_sum_slot_reel_model, 0, cKF_JOINT_FLAG_DISP_OPA, { 2050, 0, 0 } } };

cKF_Skeleton_R_c cKF_bs_r_int_sum_slot = { ARRAY_COUNT(cKF_je_r_int_sum_slot_tbl), 3, cKF_je_r_int_sum_slot_tbl };


вним, з гейзерами рідкого азоту.
    Тритон — єдиний великий супутник, що рухається в зворотному напрямку.
    Також Нептун супроводжують астероїди, що називаються троянцями Нептуна,
    які перебувають з ним в резонансі 1:1.

<!DOCTYPE HTML>

  <meta charset="utf-8">


/ - Do we construct the chain with assignment ("Assign") or with constructors
//   ("Construct")?
//
// - Do we set the value of the label at the start of the chain
//   ("Start") or the label at the end ("End")?
//
// - Are we testing the propagation of a relationship between variable
//   values ("Relation"), or the propagation of a known constant value
//   ("Value")?
//
// - Do we set the value before building the chain ("Before") or after
//   the chain has been built ("After")?
//
// - Do we add new relationships to the end of the existing chain
//   ("Forward") or to the beginning ("Backward")?
//
// Of course, "Construct" and "Backward" can't be combined, which
// eliminates eight combinations, and "Construct", "End", and "Before"
// can't be combined, which eliminates two more, so there are are 22
// combinations, not 32.

TEST(LabelChain, AssignStartRelationBeforeForward) {
  Label a, b, c, d;
  Label x;
  a = x;
  b = a + 0x1;
  c = b + 0x10;
  d = c + 0x100;
  EXPECT_EQ(0x111U, d-x);
  EXPECT_EQ(0x11U,  c-x);
  EXPECT_EQ(0x1U,   b-x);
  EXPECT_EQ(0U,     a-x);
}

TEST(LabelChain, AssignStartRelationBeforeBackward) {
  Label a, b, c, d;
  Label x;
  a = x;
  d = c + 0x100;
  c = b + 0x10;
  b = a + 0x1;
  EXPECT_EQ(0x111U, d-x);
  EXPECT_EQ(0x11U,  c-x);
  EXPECT_EQ(0x1U,   b-x);
  EXPECT_EQ(0U,     a-x);
}

TEST(LabelChain, AssignStartRelationAfterForward) {
  Label a, b, c, d;
  Label x;
  b = a + 0x1;
  c = b + 0x10;
  d = c + 0x100;
  a = x;
  EXPECT_EQ(0x111U, d-x);
  EXPECT_EQ(0x11U,  c-x);
  EXPECT_EQ(0x1U,   b-x);
  EXPECT_EQ(0U,     a-x);
}

TEST(LabelChain, AssignStartRelationAfterBackward) {
  Label a, b, c, d;
  Label x;
  d = c + 0x100;
  c = b + 0x10;
  b = a + 0x1;
  a = x;
  EXPECT_EQ(0x111U, d-x);
  EXPECT_EQ(0x11U,  c-x);
  EXPECT_EQ(0x1U,   b-x);
  EXPECT_EQ(0U,     a-x);
}

TEST(LabelChain, AssignStartValueBeforeForward) {
  Label a, b, c, d;
  a = 0xa131200190546ac2ULL;
  b = a + 0x1;
  c = b + 0x10;
  d = c + 0x100;
  EXPECT_EQ(0xa131200190546ac2ULL + 0x111U, d.Value());
  EXPECT_EQ(0xa131200190546ac2ULL + 0x11U,  c.Value());
  EXPECT_EQ(0xa131200190546ac2ULL + 0x1U,   b.Value());
  EXPECT_EQ(0xa131200190546ac2ULL + 0U,     a.Value());
}

TEST(LabelChain, AssignStartValueBeforeBackward) {
  Label a, b, c, d;
  a = 0x8da17e1670ad4fa2ULL;
  d = c + 0x100;
  c = b + 0x10;


/**
 * @file RandUtils.h
 * @author bab2min (bab2min@gmail.com)
 * @brief
 * @version 0.5.1
 * @date 2024-09-08
 *
 * @copyright Copyright (c) 2020-2024
 *
 */

#ifndef EIGENRAND_RAND_UTILS_AVX512_H
#define EIGENRAND_RAND_UTILS_AVX512_H

#include <immintrin.h>

namespace Eigen
{
	namespace internal
	{
		template<typename Rng>
		struct RawbitsMaker<Packet8i, Rng, Packet16i, Rand::RandomEngineType::packet>
		{
			EIGEN_STRONG_INLINE Packet8i rawbits(Rng& rng)
			{
				return rng.half();
			}

			EIGEN_STRONG_INLINE Packet8i rawbits_34(Rng& rng)
			{
				return rng.half();
			}

			EIGEN_STRONG_INLINE Packet8i rawbits_half(Rng& rng)
			{
				return rng.half();
			}
		};

		template<typename Rng>
		struct RawbitsMaker<Packet16i, Rng, Packet8i, Rand::RandomEngineType::packet>
		{
			EIGEN_STRONG_INLINE Packet16i rawbits(Rng& rng)
			{
				return _mm512_inserti64x4(_mm512_castsi256_si512(rng()), rng(), 1);
			}

			EIGEN_STRONG_INLINE Packet16i rawbits_34(Rng& rng)
			{
				return _mm512_inserti64x4(_mm512_castsi256_si512(rng()), rng(), 1);
			}

			EIGEN_STRONG_INLINE Packet8i rawbits_half(Rng& rng)
			{
				return rng();
			}
		};

		template<typename Rng, typename RngResult>
		struct RawbitsMaker<Packet16i, Rng, RngResult, Rand::RandomEngineType::scalar_fullbit>
		{
			EIGEN_STRONG_INLINE Packet16i rawbits(Rng& rng)
			{
				if (sizeof(decltype(rng())) == 8)
				{
					return _mm512_set_epi64(rng(), rng(), rng(), rng(),
						rng(), rng(), rng(), rng());
				}
				else
				{
					return _mm512_set_epi32(rng(), rng(), rng(), rng(),
						rng(), rng(), rng(), rng(),
						rng(), rng(), rng(), rng(),
						rng(), rng(), rng(), rng());
				}
			}

			EIGEN_STRONG_INLINE Packet16i rawbits_34(Rng& rng)
			{
				return rawbits(rng);
			}

			EIGEN_STRONG_INLINE Packet8i rawbits_half(Rng& rng)
			{
				if (sizeof(decltype(rng())) == 8)
				{
					return _mm256_set_epi64x(rng(), rng(), rng(), rng());
				}
				else
				{
					return _mm256_set_epi32(rng(), rng(), rng(), rng(),
						rng(), rng(), rng(), rng());
				}
			}
		};

		template<typename Rng>
		struct RawbitsMaker<Packet16i, Rng, Packet16i, Rand::RandomEngineType::packet>
		{
			EIGEN_STRONG_INLINE Packet16i rawbits(Rng& rng)
			{
				return rng();
			}

			EIGEN_STRONG_INLINE Packet16i rawbits_34(Rng& rng)
			{
				return rng();
			}

			EIGEN_STRONG_INLINE Packet8i rawbits_half(Rng& rng)
			{
				return rng.half();
			}
		};

		template<typename Rng>
		struct UniformRealUtils<Packet16f, Rng> : public RawbitsMaker<Packet16i, Rng>
		{
			EIGEN_STRONG_INLINE Packet16f zero_to_one(Rng& rng)
			{
				return pdiv(_mm512_cvtepi32_ps(pand(this->rawbits(rng), pset1<Packet16i>(0x7FFFFFFF))),
					pset1<Packet16f>(0x7FFFFFFF));
			}

			EIGEN_STRONG_INLINE Packet16f uniform_real(Rng& rng)
			{
				return bit_to_ur_float(this->rawbits_34(rng));
			}
		};

		template<typename Rng>
		struct UniformRealUtils<Packet8d, Rng> : public RawbitsMaker<Packet16i, Rng>
		{
			EIGEN_STRONG_INLINE Packet8d zero_to_one(Rng& rng)
			{
				return pdiv(_mm512_cvtepi32_pd(pand(this->rawbits_half(rng), pset1<Packet8i>(0x7FFFFFFF))),
					pset1<Packet8d>(0x7FFFFFFF));
			}

			EIGEN_STRONG_INLINE Packet8d uniform_real(Rng& rng)
			{
				return bit_to_ur_double(this->rawbits(rng));
			}
		};
	}
}
#endif


 DataTables prior to v1.10, however
	 * from v1.10 onwards the primary interface is camel case. In order to avoid
	 * breaking backwards compatibility utterly with this change, the Hungarian
	 * version is still, internally the primary interface, but is is not documented
	 * - hence the @name tags in each doc comment. This allows a Javascript function
	 * to create a map from Hungarian notation to camel case (going the other direction
	 * would require each property to be listed, which would at around 3K to the size
	 * of DataTables, while this method is about a 0.5K hit.
	 *
	 * Ultimately this does pave the way for Hungarian notation to be dropped
	 * completely, but that is a massive amount of work and will break current
	 * installs (therefore is on-hold until v2).
	 */

	/**
	 * Initialisation options that can be given to DataTables at initialisation
	 * time.
	 *  @namespace
	 */
	DataTable.defaults = {
		/**
		 * An array of data to use for the table, passed in at initialisation which
		 * will be used in preference to any data which is already in the DOM. This is
		 * particularly useful for constructing tables purely in Javascript, for
		 * example with a custom Ajax call.
		 *  @type array
		 *  @default null
		 *
		 *  @dtopt Option
		 *  @name DataTable.defaults.data
		 *
		 *  @example
		 *    // Using a 2D array data source
		 *    $(document).ready( function () {
		 *      $('#example').dataTable( {
		 *        "data": [
		 *          ['Trident', 'Internet Explorer 4.0', 'Win 95+', 4, 'X'],
		 *          ['Trident', 'Internet Explorer 5.0', 'Win 95+', 5, 'C'],
		 *        ],
		 *        "columns": [
		 *          { "title": "Engine" },
		 *          { "title": "Browser" },
		 *          { "title": "Platform" },
		 *          { "title": "Version" },
		 *          { "title": "Grade" }
		 *        ]
		 *      } );
		 *    } );
		 *
		 *  @example
		 *    // Using an array of objects as a data source (`data`)
		 *    $(document).ready( function () {
		 *      $('#example').dataTable( {
		 *        "data": [
		 *          {
		 *            "engine":   "Trident",
		 *            "browser":  "Internet Explorer 4.0",
		 *            "platform": "Win 95+",
		 *            "version":  4,
		 *            "grade":    "X"
		 *          },
		 *          {
		 *            "engine":   "Trident",
		 *            "browser":  "Internet Explorer 5.0",
		 *            "platform": "Win 95+",
		 *            "version":  5,
		 *            "grade":    "C"
		 *          }
		 *        ],
		 *        "columns": [
		 *          { "title": "Engine",   "data": "engine" },
		 *          { "title": "Browser",  "data": "browser" },
		 *          { "title": "Platform", "data": "platform" },
		 *          { "title": "Version",  "data": "version" },
		 *          { "title": "Grade",    "data": "grade" }
		 *        ]
		 *      } );
		 *    } );
		 */
		"aaData": null,

		/**
		 * If ordering is enabled, then DataTables will perform a first pass sort on
		 * initialisation. You can define which column(s) the sort is performed
		 * upon, and the sorting direction, with this variable. The `sorting` array
		 * should contain an array for each column to be sorted initially containing
		 * the column's index and a direction string ('asc' or 'desc').
		 *  @type array
		 *  @default [[0,'asc']]
		 *
		 *  @dtopt Option
		 *  @name DataTable.defaults.order
		 *
		 *  @example
		 *    // Sort by 3rd column first, and then 4th column
		 *    $(document).ready( function() {
		 *      $('#example').dataTable( {
		 *        "order": [[2,'asc'], [3,'desc']]
		 *      } );
		 *    } );
		 *
		 *    //


x.min.css>\[f(x) = \int_{-\infty}^\infty\hat f(\xi)\,e^{2 \pi i \xi x}\,d\xi\]

Display Mode Example

Here is some inline example: \(\pi(x)\)
, rendered in the same line. And below is display example, having display: block
\[f(x) = \int_{-\infty}^\infty\hat f(\xi)\,e^{2 \pi i \xi x}\,d\xi\]
Text continues here.

Mermaid Chart

Mermaid is library for generating svg charts and diagrams from text.

{{< mermaid [class="text-center"]>}}
sequenceDiagram
    Alice->>Bob: Hello Bob, how are you?
    alt is sick
        Bob->>Alice: Not so good :(
    else is well
        Bob->>Alice: Feeling fresh like a daisy
    end
    opt Extra response
        Bob->>Alice: Thanks for asking
    end
{{< /mermaid >}}

sequenceDiagram
Alice->>Bob: Hello Bob, how are you?
alt is sick
Bob->>Alice: Not so good :(
else is well
Bob->>Alice: Feeling fresh like a daisy
end
opt Extra response
Bob->>Alice: Thanks for asking
end

Tabs

Tabs let you organize content by context, for example installation instructions for each supported platform.

{{< tabs "uniqueid" >}}
{{< tab "MacOS" >}} # MacOS Content {{< /tab >}}
{{< tab "Linux" >}} # Linux Content {{< /tab >}}
{{< tab "Windows"</


 1,
            namespace: Option::Some("test".to_owned()), metric: MetricType::Timer(1005) },
        MetricData{name: "HelloCounter".to_owned(), occurred: 2,
            namespace: Option::Some("test".to_owned()), metric: MetricType::Counter(12) },
        MetricData{name: "HelloGauge".to_owned(), occurred: 3,
            namespace: Option::Some("test".to_owned()), metric: MetricType::Gauge(GaugeOptions::Increase(13))},
        MetricData{name: "HelloGauge".to_owned(), occurred: 4,
            namespace: Option::Some("test".to_owned()), metric: MetricType::Gauge(GaugeOptions::Decrease(2)) },
    ]
}

#[derive(Debug, PartialEq, Clone)]
pub enum MetricType {
    Counter(u32),
    Timer(u128),
    Gauge(GaugeOptions)
}

#[derive(Clone)]
pub struct Namespace(pub String);

impl Namespace {
    pub fn new(namespace: String) -> Self {
        Namespace(namespace)
    }

    pub fn namespace(&self, namespace: String) -> Self {
        Namespace::new(format!("{}.{}", self.0, namespace))
    }

    pub fn counter(&self, name: String) -> Counter {
        CounterBuilder::new(name).namespace(Option::Some(self.0.clone())).build()
    }

    pub fn timer(&self, name: String) -> Timer {
        TimerBuilder::new(name).namespace(Option::Some(self.0.clone())).build()
    }

    pub fn gauge(&self, name: String) -> Gauge {
        GaugeBuilder::new(name).namespace(Option::Some(self.0.clone())).build()
    }
}

mod counter;
mod timer;
mod gauge;

pub use counter::{Counter, CounterBuilder};
pub use timer::{Timer, TimerBuilder};
pub use gauge::{Gauge, GaugeBuilder};
use crate::metric::gauge::GaugeOptions;
<gh_stars>1-10
use crate::cli::helper::vec_to_str;

use failure::Fail;
use failure::_core::fmt::{Display, Error, Formatter};
use failure::_core::str::FromStr;
use fakes_gen::date_time_format::{
    DEFAULT_DATE_FORMAT, DEFAULT_DATE_TIME_FORMAT, DEFAULT_TIME_FORMAT,
};
use fakes_gen::faker::category::Category;
use fakes_gen::faker::fake_options::FakeOption;
use regex::{Captures, Regex};
use std::process::exit;

#[derive(Debug, Eq, PartialEq, Clone)]
pub struct Scanner {
    input: String,
}

impl Scanner {
    // option name
    const JOIN: &'static str = "Join";
    const FIXED_STRING: &'static str = "String";
    const FIXED_NOT_STRING: &'static str = "NotString";
    const SELECT_STRING: &'static str = "String";
    const SELECT_NOT_STRING: &'static str = "NotString";
    const LOREM_WORD: &'static str = "Word";
    const LOREM_SENTENCE: &'static str = "Sentence";
    const LOREM_PARAGRAPH: &'static str = "Paragraph";
    const NAME_FIRST_NAME: &'static str = "FirstName";
    const NAME_FIRST_NAME_FURIGANA: &'static str = "FirstNameFurigana";
    const NAME_LAST_NAME: &'static str = "LastName";
    const NAME_LAST_NAME_FURIGANA: &'static str = "LastNameFurigana";
    const NAME_FULL_NAME: &'static str = "FullName";
    const NAME_FULL_NAME_FURIGANA: &'static str = "FullNameFurigana";
    const PRIMITIVE_INTEGER: &'static str = "Int";
    const PRIMITIVE_FLOAT: &'static str = "Float";
    const PRIMITIVE_ASCII: &'static str = "Ascii";
    const PRIMITIVE_BOOL: &'static st


rFields{
				FilterFields: []*loop_span.FilterField{
					{
						FieldName: loop_span.SpanFieldDuration,
						FieldType: loop_span.FieldTypeLong,
						Values:    []string{"121"},
						QueryType: ptr.Of(loop_span.QueryTypeEnumGte),
					},
				},
			},
			expectedSql: "SELECT * FROM `observability_spans` WHERE `duration` >= 121 AND start_time >= 1 AND start_time <= 2 LIMIT 100",
		},
		{
			filter: &loop_span.FilterFields{
				FilterFields: []*loop_span.FilterField{
					{
						FieldName: "custom_tag_bool",
						FieldType: loop_span.FieldTypeBool,
						Values:    []string{"true"},
						QueryType: ptr.Of(loop_span.QueryTypeEnumEq),
					},
				},
			},
			expectedSql: "SELECT * FROM `observability_spans` WHERE tags_bool['custom_tag_bool'] = 1 AND start_time >= 1 AND start_time <= 2 LIMIT 100",
		},
		{
			filter: &loop_span.FilterFields{
				FilterFields: []*loop_span.FilterField{
					{
						FieldName: loop_span.SpanFieldInput,
						FieldType: loop_span.FieldTypeString,
						Values:    []string{"123"},
						QueryType: ptr.Of(loop_span.QueryTypeEnumMatch),
					},
				},
			},
			expectedSql: "SELECT * FROM `observability_spans` WHERE `input` like '%123%' AND start_time >= 1 AND start_time <= 2 LIMIT 100",
		},
		{
			filter: &loop_span.FilterFields{
				FilterFields: []*loop_span.FilterField{
					{
						FieldName: loop_span.SpanFieldInput,
						FieldType: loop_span.FieldTypeString,
						Values:    []string{"123"},
						QueryType: ptr.Of(loop_span.QueryTypeEnumNotMatch),
					},
				},
			},
			expectedSql: "SELECT * FROM `observability_spans` WHERE `input` NOT like '%123%' AND start_time >= 1 AND start_time <= 2 LIMIT 100",
		},
	}
	for _, tc := range testCases {
		qDb, err := new(SpansCkDaoImpl).buildSingleSql(context.Background(), db, "observability_spans", &QueryParam{
			StartTime: 1,
			EndTime:   2,
			Filters:   tc.filter,
			Limit:     100,
		})
		assert.Nil(t, err)
		sql := qDb.ToSQL(func(tx *gorm.DB) *gorm.DB {
			return tx.Find([]*model.ObservabilitySpan{})
		})
		t.Log(sql)
		assert.Equal(t, tc.expectedSql, sql)
	}
}

// TestQueryTypeEnumNotMatchSqlExceptionCases 测试 QueryTypeEnumNotMatch 的SQL构建异常流程
func TestQueryTypeEnumNotMatchSqlExceptionCases(t *testing.T) {
	sqlDB, _, err := sqlmock.New()
	if err != nil {
		t.Fatal("Failed to create mock")
	}
	defer func() {
		_ = sqlDB.Close()
	}()
	// 用mock DB替换GORM的DB
	db, err := gorm.Open(clickhouse.New(clickhouse.Config{
		Conn:                      sqlDB,
		SkipInitializeWithVersion: true,
	}), &gorm.Config{})
	if err != nil {
		t.Fatal(err)
	}

	type testCase struct {
		name        string
		filter      *loop_span.FilterFields
		expectedSql string
		shouldError bool
	}

	testCases := []testCase{
		// 边界情况测试
		{
			name: "Empty values array should build valid SQL",
			filter: &loop_span.FilterFields{
				FilterFields: []*loop_span.FilterField{
					{
						FieldName: loop_span.SpanFieldInput,
						FieldType: loop_


import io.kotest.core.spec.style.AnnotationSpec
import io.kotest.matchers.shouldBe
import org.diffkt.*

class MinMaxTest: AnnotationSpec() {

    private val t4x4 = tensorOf(
        2f, 3f, 4f, 1f,
        6f, 20f, 0f, 9f,
        16f, 1f, 3f, 4f,
        10f, 2f, 4f, 1f
    ).reshape(4,4) as FloatTensor

    private val t3x3x3 = tensorOf(
        2f, 6f, 8f,
        4f, 0f, 3f,
        11f, 9f, 2f,

        2f, 2f, 2f,
        1f, 3f, 4f,
        14f, 5f, 1f,

        0f, 4f, 7f,
        6f, 18f, 5f,
        3f, 12f, 2f
    ).reshape(3,3,3) as FloatTensor

    @Test
    fun maxAllAxes2D() {
        t4x4.max() shouldBe FloatScalar(20f)
        t4x4.max(keepDims = true) shouldBe tensorOf(20f).reshape(1,1)
    }

    @Test
    fun minAllAxes2D() {
        t4x4.min() shouldBe FloatScalar(0f)
        t4x4.min(keepDims = true) shouldBe tensorOf(0f).reshape(1,1)
    }

    @Test
    fun maxAllAxes3D() {
        t3x3x3.max() shouldBe FloatScalar(18f)
        t3x3x3.max(keepDims = true) shouldBe tensorOf(18f).reshape(1,1,1)
    }

    @Test
    fun minAllAxes3D() {
        t3x3x3.min() shouldBe FloatScalar(0f)
        t3x3x3.min(keepDims = true) shouldBe tensorOf(0f).reshape(1,1,1)
    }

    @Test
    fun maxSingleAxis2D() {
        val resultValues0 = tensorOf(16f, 20f, 4f, 9f)
        val resultValues1 = tensorOf(4f, 20f, 16f, 10f)

        t4x4.max(intArrayOf(0)) shouldBe resultValues0
        t4x4.max(intArrayOf(0), keepDims = true) shouldBe resultValues0.reshape(1,4)

        t4x4.max(intArrayOf(1)) shouldBe resultValues1
        t4x4.max(intArrayOf(1), keepDims = true) shouldBe resultValues1.reshape(4,1)
    }

    @Test
    fun minSingleAxis2D() {
        val resultValues0 = tensorOf(2f, 1f, 0f, 1f)
        val resultValues1 = tensorOf(1f, 0f, 1f, 1f)

        t4x4.min(intArrayOf(0)) shouldBe resultValues0
        t4x4.min(intArrayOf(0), keepDims = true) shouldBe resultValues0.reshape(1,4)

        t4x4.min(intArrayOf(1)) shouldBe resultValues1
        t4x4.min(intArrayOf(1), keepDims = true) shouldBe resultValues1.reshape(4,1)
    }

    @Test
    fun maxSingleAxis3D() {
        val resultValues0 = tensorOf(2f, 6f, 8f, 6f, 18f, 5f, 14f, 12f, 2f)
        val resultValues1 = tensorOf(11f, 9f, 8f, 14f, 5f, 4f, 6f, 18f, 7f)
        val resultValues2 = tensorOf(8f, 4f, 11f, 2f, 4f, 14f, 7f, 18


lTime)
{
#if defined (HAVE_GMTIME_R) || defined(HAVE_LOCALTIME_R)
    struct tm tm_storage;
#endif
    struct tm *tm = NULL;

    if (!dt) {
        return SDL_InvalidParamError("dt");
    }

    const time_t tval = (time_t)SDL_NS_TO_SECONDS(ticks);

    if (localTime) {
#ifdef HAVE_LOCALTIME_R
        tm = localtime_r(&tval, &tm_storage);
#else
        tm = localtime(&tval);
#endif
    } else {
#ifdef HAVE_GMTIME_R
        tm = gmtime_r(&tval, &tm_storage);
#else
        tm = gmtime(&tval);
#endif
    }

    if (tm) {
        dt->year = tm->tm_year + 1900;
        dt->month = tm->tm_mon + 1;
        dt->day = tm->tm_mday;
        dt->hour = tm->tm_hour;
        dt->minute = tm->tm_min;
        dt->second = tm->tm_sec;
        dt->nanosecond = ticks % SDL_NS_PER_SECOND;
        dt->day_of_week = tm->tm_wday;

        /* tm_gmtoff wasn't formally standardized until POSIX.1-2024, but practically it has been available on desktop
         * *nix platforms such as Linux/glibc, FreeBSD, OpenBSD, NetBSD, OSX/macOS, and others since the 1990s.
         *
         * The notable exception is Solaris, where the timezone offset must still be retrieved in the strictly POSIX.1-2008
         * compliant way.
         */
#if (_POSIX_VERSION >= 202405L) || (!defined(sun) && !defined(__sun))
        dt->utc_offset = (int)tm->tm_gmtoff;
#else
        if (localTime) {
            tzset();
            dt->utc_offset = (int)timezone;
        } else {
            dt->utc_offset = 0;
        }
#endif

        return true;
    }

    return SDL_SetError("SDL_DateTime conversion failed (%i)", errno);
}

#endif // SDL_TIME_UNIX


PY_BYTE(N)			\
EXC(	lb	t0, N(src), l_exc);	\
	SUB	len, len, 1;		\
	beqz	len, done;		\
EXC(	 sb	t0, N(dst), s_exc_p1)

	COPY_BYTE(0)
	COPY_BYTE(1)
#ifdef USE_DOUBLE
	COPY_BYTE(2)
	COPY_BYTE(3)
	COPY_BYTE(4)
	COPY_BYTE(5)
#endif
EXC(	lb	t0, NBYTES-2(src), l_exc)
	SUB	len, len, 1
	jr	ra
EXC(	 sb	t0, NBYTES-2(dst), s_exc_p1)
done:
	jr	ra
	 nop
	END(memcpy)

l_exc_copy:
	/*
	 * Copy bytes from src until faulting load address (or until a
	 * lb faults)
	 *
	 * When reached by a faulting LDFIRST/LDREST, THREAD_BUADDR($28)
	 * may be more than a byte beyond the last address.
	 * Hence, the lb below may get an exception.
	 *
	 * Assumes src < THREAD_BUADDR($28)
	 */
	LOAD	t0, TI_TASK($28)
	 nop
	LOAD	t0, THREAD_BUADDR(t0)
1:
EXC(	lb	t1, 0(src),	l_exc)
	ADD	src, src, 1
	sb	t1, 0(dst)	# can't fault -- we're copy_from_user
	bne	src, t0, 1b
	 ADD	dst, dst, 1
l_exc:
	LOAD	t0, TI_TASK($28)
	 nop
	LOAD	t0, THREAD_BUADDR(t0)	# t0 is just past last good address
	 nop
	SUB	len, AT, t0		# len number of uncopied bytes
	/*
	 * Here's where we rely on src and dst being incremented in tandem,
	 *   See (3) above.
	 * dst += (fault addr - src) to put dst at first byte to clear
	 */
	ADD	dst, t0			# compute start address in a1
	SUB	dst, src
	/*
	 * Clear len bytes starting at dst.  Can't call __bzero because it
	 * might modify len.  An inefficient loop for these rare times...
	 */
	beqz	len, done
	 SUB	src, len, 1
1:	sb	zero, 0(dst)
	ADD	dst, dst, 1
	bnez	src, 1b
	 SUB	src, src, 1
	jr	ra
	 nop

#define SEXC(n)				\
s_exc_p ## n ## u:			\
	jr	ra;			\
	 ADD	len, len, n*NBYTES

SEXC(16)
SEXC(15)
SEXC(14)
SEXC(13)
SEXC(12)
SEXC(11)
SEXC(10)
SEXC(9)
SEXC(8)
SEXC(7)
SEXC(6)
SEXC(5)
SEXC(4)
SEXC(3)
SEXC(2)
SEXC(1)

s_exc_p1:
	jr	ra
	 ADD	len, len, 1
s_exc:
	jr	ra
	 nop

	.align	5
LEAF(memmove)
	ADD	t0, a0, a2
	ADD	t1, a1, a2
	sltu	t0, a1, t0			# dst + len <= src -> memcpy
	sltu	t1, a0, t1			# dst >= src + len -> memcpy
	and	t0, t1
	beqz	t0, __memcpy
	 move	v0, a0				/* return value */
	beqz


ange = transformValueToDateRange(
      variableValue,
      availableVariables,
      relativeAvailableVariables,
      variableDelimiters,
    );
  }
  // RelativeDateRange
  else {
    dateRange = transformRelativeDateRangeToDateRange(
      value,
      relativeAvailableVariables,
      variableDelimiters,
    );
  }
  return setDateRangeHours(dateRange);
};

export enum GUFieldType {
  'input' = 'input',
  'select' = 'select',
  'predef' = 'predef'
}

export interface IValidator {
  name: string;
  validator:any;
  message :string;
}

export interface IGUGenericField {
  type: GUFieldType,
  label: string,
  name : string,
  validators: IValidator[],
  description?:string,
  editable?:boolean
}

export interface IGUFieldInput extends IGUGenericField{
  type:GUFieldType.input,
  value:string
}

export interface IGUFieldSelect extends IGUGenericField{
  type:GUFieldType.select;
  options: string[];
}
//TODO add date/date-range[s] fields
export type TGUFields = IGUFieldInput | IGUFieldSelect;

export interface IGUGroupFields{
  name:string;
  type:GUFieldType.predef;
  fields:TGUFields[];
}

export type IGUComplexField = (TGUFields|IGUGroupFields);

export interface IGUServiceData {
  id:number;
  name:string;
  description: string;
  fields: IGUComplexField[];
  // should be status-of-Approval : approved, disparroved, pending
  isApproved:boolean;
  isPublished:boolean;
  // We do not really delete any data just mark it as deleted.
  isDeleted:boolean;
}
export interface IGUPredefinedServiceData{
  title:string;
  description: string;
  template: IGUServiceData
}
import { inspect } from 'util'
import { iterateIndentedLines, maybeMultipleFailures } from '@ts-schema-autogen/utils'
import { OutputDescriptor, Console } from '@ts-schema-autogen/types'

/** Error code as well as discriminant of {@link Success} and {@link Failure} */
export enum Status {
  /** Data does not satisfy JSON schema */
  UnsatisfiedSchema = 12,

  /** Failed to build schema generator */
  GeneratorConstructingFailure = 11,

  /** No file parser specified */
  MissingFileParser = 10,

  /** File content is outdated */
  OutdatedFile = 9,

  /** Two or more configs inherit from each other directly or indirectly */
  CircularReference = 8,

  /** Failed to parse text data into structured data */
  TextParsingFailure = 7,

  /** Failed to delete a file or directory */
  FileRemovalFailure = 6,

  /** Failed to read data from a file */
  FileReadingFailure = 5,

  /** Failed to write data to a file */
  FileWritingFailure = 4,

  /** More than one configs target the same output file */
  OutputFileConflict = 3,

  /** More than one errors */
  MultipleFailures = 2,

  /** Failures unaccounted for */
  FatalError = 1,

  /** Operation succeeded */
  Success = 0
}

export namespace Status {
  // tslint:disable-next-line:no-unnecessary-qualifier
  export type Failure = Exclude<Status, Status.Success>
}

/** Base class of all {@link Success} and {@link Failure} subclasses */
export abstract class ResultBase {
  /** Indicates whether result is a {@link Success} or an {@link Failure}, and which Failure */
  public abstract readonly code: Status

  /** Name of the result. As same as `Status[this.code]` */
  public get name () {
    return Status[this.code]
  }

  /** Return status code to pass to `process.exit`, it is usually (but not always) `this.code` */
  public getStatusCode (): Status {
    return this.code
  }
}

/** Container of value should operation went without errors */


per for Jackson
  - DataStax Java Driver for Apache Cassandra
  - Disruptor Framework
  - error-prone annotations
  - exp4j
  - fastutil
  - Findbugs
  - Google Android Annotations Library
  - Gson
  - Guava
  - Hibernate Validator Engine
  - HPPC Collections
  - htrace-core4
  - IKAnalyzer
  - io.grpc
  - J2ObjC Annotations
  - Jackson
  - Java Agent for Memory Measurements
  - Java Concurrency Tools Core Library
  - JavaPoet
  - javatuples
  - jcseg-core
  - jffi
  - JJWT
  - jnr
  - Joda
  - jraft
  - JSON.simple
  - JVM Integration for Metrics
  - Lucene
  - LZ4 and xxHash
  - Metrics
  - mmseg4j-core
  - Netty
  - Ning-compress-LZF
  - nlp-lang
  - Objenesis
  - OHC core
  - OpenTracing
  - perfmark
  - picocli
  - proto-google-common-protos
  - sigar
  - snappy-java
  - stream-lib
  - swagger
  - Thrift Server implementation backed by LMAX Disruptor
  - jieba for java
  - Java Native Access
  - HanLP
  - SnakeYAML

- Apache License 2.0 + GPLv2 License

  - RocksDB JNI

- BSD License

  - ANTLR 3
  - ASM
  - Chinese to Pinyin
  - Hamcrest
  - JLine
  - jcabi
  - PostgreSQL JDBC Driver - JDBC 4.2
  - Protocol Buffers
  - StringTemplate

- CDDL + GPL License

  - Grizzly
  - Jersey

- CDDL + GPLv2 License

  - glassfish
  - Java Servlet API
  - javax.ws.rs-api
  - jersey-inject-hk2
  - JSR 353 (JSON Processing) Default Provider

- Eclipse Distribution License

  - Eclipse Collections
  - JUnit

- ISC/BSD License

  - jBCrypt

- LGPL License

  - JBoss Logging 3

- LGPL + GPL License

  - jnr-posix

- LGPL 2.1 + MPL 1.1 + Apache License 2.0

  - Javassist

- MIT License

  - Animal Sniffer Annotations
  - Mockito
  - SLF4J
  - Jedis
  - high-scale-lib
  - jnr-x86asm

- GPL + MIT License

  - Checker Qual

- GPL License

  - MySQL Connector/J
  - word

#### Cryptography

None

### Required Resources

#### Mailing lists

- hugegraph-dev: [dev@hugegraph.incubator.apache.org](mailto:dev@hugegraph.incubator.apache.org) for development and users discussions.
- hugegraph-private: [private@hugegraph.incubator.apache.org](mailto:private@hugegraph.incubator.apache.org) for PPMC discussions.
- hugegraph-commits: [commits@hugegraph.incubator.apache.org](mailto:commits@hugegraph.incubator.apache.org) for commits / [pull requests](https://github.com/hugegraph/hugegraph/pulls) and other notifications like code review comments.

#### Subversion Directory

None

#### Git Repositories

1. `hugegraph`: https://github.com/hugegraph/hugegraph.git
2. `hugegraph-computer`: https://github.com/hugegraph/hugegraph-computer.git
3. `hugegraph-commons`: https://github.com/hugegraph/hugegraph-commons.git
4. `hugegraph-toolchain`: https://github.com/hugegraph/hugegraph-toolchain.git

#### Issue Tracking

The community would like to continue using [GitHub Issues](https://github.com/hugegraph/hugegraph/issues) (but will move to github.com/apache/).

#### Other Resources

- The community has already chosen [GitHub actions](https://github.com/hugegraph/hugegraph/actions) as continuous integration tools.
- The community has already used [codecov](https://github.com/marketplace/codecov) to check code coverage.
- The community has already used [mvn repository](https://mvnrepository.com/search?q=hugegraph) as binary package release platform.

### Initial Committers

- Jermy Li (javaloveme at gmail dot com)
- Linary (liningrui at vip dot qq dot com)


orm shapeTransform, float maximumLength,
                                   out RayHit hit)
        {
            int iterations = 0;
            while (true)
            {
                if (GJKToolbox.SphereCast(ray, radius, target, ref shapeTransform, maximumLength, out hit) &&
                    hit.T > 0)
                {
                    //The ray cast isn't embedded in the shape, and it's less than maximum length away!
                    return true;
                }
                if (hit.T > maximumLength || hit.T < 0)
                    return false; //Failure showed it was too far, or behind.

                radius *= MotionSettings.CoreShapeScaling;
                iterations++;
                if (iterations > 3) //Limit could be configurable.
                {
                    //It's iterated too much, let's just do a last ditch attempt using a raycast and hope that can help.
                    return GJKToolbox.RayCast(ray, target, ref shapeTransform, maximumLength, out hit) && hit.T > 0;

                }
            }
        }
    }

}


       cmovle ebx, edx                         ;# if(nn1>nri) nn1=nri
        ;# Cleared the spinlock if we got here.
        ;# eax contains nn0, ebx contains nn1.
        mov [esp + nb101nf_n], eax
        mov [esp + nb101nf_nn1], ebx
        sub ebx, eax                            ;# calc number of outer lists
	mov esi, eax				;# copy n to esi
        jg  .nb101nf_outerstart
        jmp .nb101nf_end

.nb101nf_outerstart:
	;# ebx contains number of outer iterations
	add ebx, [esp + nb101nf_nouter]
	mov [esp + nb101nf_nouter], ebx

.nb101nf_outer:
	mov   eax, [ebp + nb101nf_shift]      ;# eax = pointer into shift[]
	mov   ebx, [eax+esi*4]		;# ebx=shift[n]

	lea   ebx, [ebx + ebx*2]    ;# ebx=3*is
	mov   [esp + nb101nf_is3],ebx    	;# store is3

	mov   eax, [ebp + nb101nf_shiftvec]   ;# eax = base of shiftvec[]

	movss xmm0, [eax + ebx*4]
	movss xmm1, [eax + ebx*4 + 4]
	movss xmm2, [eax + ebx*4 + 8]

	mov   ecx, [ebp + nb101nf_iinr]       ;# ecx = pointer into iinr[]
	mov   ebx, [ecx + esi*4]	    ;# ebx =ii

	movaps xmm3, xmm0
	movaps xmm4, xmm1
	movaps xmm5, xmm2

	lea   ebx, [ebx + ebx*2]	;# ebx = 3*ii=ii3
	mov   eax, [ebp + nb101nf_pos]    ;# eax = base of pos[]
	mov   [esp + nb101nf_ii3], ebx

	addss xmm3, [eax + ebx*4]
	addss xmm4, [eax + ebx*4 + 4]
	addss xmm5, [eax + ebx*4 + 8]
	shufps xmm3, xmm3, 0
	shufps xmm4, xmm4, 0
	shufps xmm5, xmm5, 0
	movaps [esp + nb101nf_ixO], xmm3
	movaps [esp + nb101nf_iyO], xmm4
	movaps [esp + nb101nf_izO], xmm5

	movss xmm3, xmm0
	movss xmm4, xmm1
	movss xmm5, xmm2
	addss xmm0, [eax + ebx*4 + 12]
	addss xmm1, [eax + ebx*4 + 16]
	addss xmm2, [eax + ebx*4 + 20]
	addss xmm3, [eax + ebx*4 + 24]
	addss xmm4, [eax + ebx*4 + 28]
	addss xmm5, [eax + ebx*4 + 32]

	shufps xmm0, xmm0, 0
	shufps xmm1, xmm1, 0
	shufps xmm2, xmm2, 0
	shufps xmm3, xmm3, 0
	shufps xmm4, xmm4, 0
	shufps xmm5, xmm5, 0
	movaps [esp + nb101nf_ixH1], xmm0
	movaps [esp + nb101nf_iyH1], xmm1
	movaps [esp + nb101nf_izH1], xmm2
	movaps [esp + nb101nf_ixH2], xmm3
	movaps [esp + nb101nf_iyH2], xmm4
	movaps [esp + nb101nf_izH2], xmm5

	;# clear vctot and i forces
	xorps xmm4, xmm4
	movaps [esp + nb101nf_vctot], xmm4

	mov   eax, [ebp + nb101nf_jindex]


 in the middle,
// interpreting to that point will cause an Edit_at for the error sentence
// <-value "fail"
// then Edit_at for the previous sentence
// <-value "good":
//   inR: (editAt:stateId,(qedAfterEdit:stateId,qedForNextLemma:stateId))

// */

// export interface Sentence {
//   stateId: number;
//   editId: number;
//   textBegin: number;
//   textEnd: number;
//   status: coqProto.SentenceStatus;
//   goalState: CoqTopGoalResult;
//   computeStart: number[];
//   computeTimeMS: number;
// }

// class SentenceLink implements Sentence {
//   stateId: number;
//   editId: number;
//   textBegin: number;
//   textEnd: number;
//   status: coqProto.SentenceStatus;
//   goalState: CoqTopGoalResult;
//   computeStart: number[];
//   computeTimeMS: number = 0;

//   private previous: SentenceLink = null;
//   private next : SentenceLink = null;
//   constructor(previous:SentenceLink, stateId:number, textBegin:number, textEnd:number) {
//     this.stateId = stateId; this.textBegin = textBegin; this.textEnd = textEnd;
//     this.previous = previous;
//     this.status = coqProto.SentenceStatus.Parsed;
//   }
//   static createRoot(stateId:number) : SentenceLink {
//     return new SentenceLink(null,stateId,0,0);
//   }
//   static createNext(parent: SentenceLink, stateId: number, textBegin:number, textEnd: number) : SentenceLink {
//     const next = new SentenceLink(parent,stateId,textBegin,textEnd);
//     if(parent.next != null)
//       throw "Parent sentence already has child";
//     parent.next = next;
//     return next;
//   }
//   public getParent() {
//     return this.previous;
//   }
//   public getChild() : SentenceLink {
//     return this.next;
//   }
//   public *descendents() : Iterable<SentenceLink> {
//     let child = this.next;
//     while(child!==null) {
//       yield child;
//       child = child.next;
//     }
//   }
//   public rewindToHere() {
//     this.next = null;
//   }
//   public toString() : string {
//     return `{${this.stateId}, [${this.textBegin},${this.textEnd})}`;
//   }
// }

// export class Sentences {
//   private sentences = new Map<number,SentenceLink>();
//   private sentencesByPosition : SentenceLink[] = [];

//   // A stack of the current edit-points; the top is the current tip, and when it is done, it will be popped and the next tip will be at top
//   // assume:
//   //  - tips are always in sentences (if sentences is not empty)
//   //  - tips have no children
//   private tip : SentenceLink = null;

//   constructor() {
//   }

//   public getTip() : Sentence {
//     if(!this.tip)
//       throw "Coq not initialized";
//     return this.tip;
//   }

//   public setTip(newTipId : number) : void {
//     this.tip = this.sentences.get(newTipId);
//   }

//   public hasTip() : boolean {
//     return this.tip != null;
//   }

//   private diffHypotheses(oldHyps: Hypothesis[], newHyps: Hypothesis[]) {
//     newHyps.forEach((hyp,idxHyp) => {
//       var oldHypIdx = idxHyp;
//       var oldHyp = oldHyps[oldHypIdx];
//       if(oldHyp === undefined || oldHyp.identifier !== hyp.identifier) {
//         oldHy


 virtual void WriteFilter(UnityEngine.Object context, LogLevels level, object message, Exception e = null)
        {
            if (LogManager.Instance.GlobalLogLevel.Has(level)) {
                WriteInternal(context, level, message, e);
            }
        }*/

        protected abstract void WriteInternal(LogLevels level, UnityEngine.Object context, object message, Exception e);

        /// <summary>
        /// Returns the global context for variables
        /// </summary>
        public virtual IVariablesContext GlobalVariablesContext
        {
            get { return new NoOpVariablesContext(); }
        }

        /// <summary>
        /// Returns the thread-specific context for variables
        /// </summary>
        /*public virtual IVariablesContext ThreadVariablesContext
        {
            get { return new Loggers.NoOpVariablesContext(); }
        }*/

    }
}
#endif


ns.compose.reload.test.core.InternalHotReloadTestApi
import org.jetbrains.compose.reload.test.core.TestEnvironment
import java.util.zip.ZipFile
import kotlin.io.path.Path
import kotlin.io.path.createParentDirectories
import kotlin.io.path.exists
import kotlin.io.path.readText
import kotlin.io.path.writeText
import kotlin.test.Test
import kotlin.test.fail

class EmbeddedPluginJarTest {
    private val pluginJar =
        Path(System.getProperty("plugin.jar.path") ?: error("Missing 'plugin.jar.path' system property"))

    @Test
    fun `test - jar content`() {
        val entries = hashSetOf<String>()

        ZipFile(pluginJar.toFile()).use { zip ->
            zip.entries().asSequence().toList().forEach { entry ->
                // We are interested in all directories!
                if (entry.isDirectory) {
                    entries.add(entry.name)
                    return@forEach
                }

                // We are only interested in packages
                if (entry.name.endsWith(".class")) {
                    val splitIndex = entry.name.lastIndexOf("/")
                    if (splitIndex > 0) {
                        val dirName = entry.name.substring(0, splitIndex) + "/"
                        entries.add(dirName)
                    }
                } else {
                    // If not a .class file, then we're interested!
                    entries.add(entry.name)
                }
            }
        }

        val actualText = entries.sorted().joinToString("\n").sanitized()
        val expectFile = Path("src/test/resources/plugin-jar/content.txt")
        val actualFile = expectFile.resolveSibling("content-actual.txt")

        if (!expectFile.exists()) {
            expectFile.createParentDirectories().writeText(actualText)
            if (!TestEnvironment.updateTestData) fail("Missing file '${expectFile.toUri()}'; Generated")
            return
        }

        val expectText = expectFile.readText().sanitized()
        if (expectText != actualText) {
            if (TestEnvironment.updateTestData) {
                expectFile.writeText(actualText)
                return
            }

            actualFile.writeText(actualText)
            fail("Plugin Jar content '${expectFile.toUri()}' did not match\nGenerated: ${actualFile.toUri()}")
        }
    }
}
/*
 * Copyright 2024-2025 JetBrains s.r.o. and Compose Hot Reload contributors.
 * Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
 */

package org.jetbrains.compose.reload.gradle

import org.gradle.api.DefaultTask
import org.gradle.api.Project
import org.gradle.api.file.RegularFileProperty
import org.gradle.api.provider.Property
import org.gradle.api.provider.Provider
import org.gradle.api.tasks.Internal
import org.gradle.api.tasks.TaskAction
import org.gradle.api.tasks.TaskProvider
import org.gradle.initialization.BuildCancellationToken
import org.gradle.kotlin.dsl.property
import org.gradle.kotlin.dsl.withType
import org.gradle.work.DisableCachingByDefault
import org.jetbrains.compose.reload.InternalHotReloadApi
import org.jetbrains.compose.reload.core.asTemplateOrThrow
import org.jetbrains.compose.reload.core.leftOr
import org.jetbrains.compose.reload.core.renderOrThrow
import org.jetbrains.compose.reload.orchestration.OrchestrationClient
import org.jetbrains.compose.reload.orchestration.OrchestrationClientRole.Compiler
import org.jetbrains.compose.reload.orchestration.OrchestrationMessage.ReloadClassesRequest
import org.jetbrains.compose.reload.orchestration.OrchestrationMessage.Reload


 fail.
	r := NewDecoder(RawURLEncoding, bytes.NewReader([]byte(source)))
	dec2, err := ioutil.ReadAll(io.LimitReader(r, 100))
	if err != nil || !bytes.Equal(dec2, want) {
		t.Errorf("reading NewDecoder(RawURLEncoding, %q) = %x, %v, want %x, nil", source, dec2, err, want)
	}

	// Should work with padding.
	r = NewDecoder(URLEncoding, bytes.NewReader([]byte(source+"==")))
	dec3, err := ioutil.ReadAll(r)
	if err != nil || !bytes.Equal(dec3, want) {
		t.Errorf("reading NewDecoder(URLEncoding, %q) = %x, %v, want %x, nil", source+"==", dec3, err, want)
	}
}
// Copyright 2013 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package gob_test

import (
	"fmt"
	"log"

	"rsc.io/xstd/go1.12/bytes"
	"rsc.io/xstd/go1.12/encoding/gob"
)

// The Vector type has unexported fields, which the package cannot access.
// We therefore write a BinaryMarshal/BinaryUnmarshal method pair to allow us
// to send and receive the type with the gob package. These interfaces are
// defined in the "encoding" package.
// We could equivalently use the locally defined GobEncode/GobDecoder
// interfaces.
type Vector struct {
	x, y, z int
}

func (v Vector) MarshalBinary() ([]byte, error) {
	// A simple encoding: plain text.
	var b bytes.Buffer
	fmt.Fprintln(&b, v.x, v.y, v.z)
	return b.Bytes(), nil
}

// UnmarshalBinary modifies the receiver so it must take a pointer receiver.
func (v *Vector) UnmarshalBinary(data []byte) error {
	// A simple encoding: plain text.
	b := bytes.NewBuffer(data)
	_, err := fmt.Fscanln(b, &v.x, &v.y, &v.z)
	return err
}

// This example transmits a value that implements the custom encoding and decoding methods.
func Example_encodeDecode() {
	var network bytes.Buffer // Stand-in for the network.

	// Create an encoder and send a value.
	enc := gob.NewEncoder(&network)
	err := enc.Encode(Vector{3, 4, 5})
	if err != nil {
		log.Fatal("encode:", err)
	}

	// Create a decoder and receive a value.
	dec := gob.NewDecoder(&network)
	var v Vector
	err = dec.Decode(&v)
	if err != nil {
		log.Fatal("decode:", err)
	}
	fmt.Println(v)

	// Output:
	// {3 4 5}
}
// Copyright 2009 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:generate go run encgen.go -output enc_helpers.go

package gob

import (
	"math"
	"math/bits"
	"reflect"
	"sync"

	"rsc.io/xstd/go1.12/encoding"
	"rsc.io/xstd/go1.12/encoding/binary"
)

const uint64Size = 8

type encHelper func(state *encoderState, v reflect.Value) bool

// encoderState is the global execution state of an instance of the encoder.
// Field numbers are delta encoded and always increase. The field
// number is initialized to -1 so 0 comes out as delta(1). A delta of
// 0 terminates the structure.
type encoderState struct {
	enc      *Encoder


/**
 * Copyright 2013-2023 Software Radio Systems Limited
 *
 * This file is part of srsRAN.
 *
 * srsRAN is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as
 * published by the Free Software Foundation, either version 3 of
 * the License, or (at your option) any later version.
 *
 * srsRAN is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * A copy of the GNU Affero General Public License can be found in
 * the LICENSE file in the top-level directory of this distribution
 * and at http://www.gnu.org/licenses/.
 *
 */

#include "srsran/common/gen_mch_tables.h"

/******************************************************************************
 * Key Generation
 *****************************************************************************/

void generate_frame_table(uint8_t* table, uint8_t alloc)
{
  table[1] = (alloc >> 5) & 0x01;
  table[2] = (alloc >> 4) & 0x01;
  table[3] = (alloc >> 3) & 0x01;
  table[6] = (alloc >> 2) & 0x01;
  table[7] = (alloc >> 1) & 0x01;
  table[8] = (alloc >> 0) & 0x01;
}

void generate_mch_table(uint8_t* table, uint32_t sf_alloc, uint8_t num_frames)
{
  if (num_frames == 1) {
    uint8_t alloc = (sf_alloc)&0x3F;
    generate_frame_table(table, alloc);
  } else if (num_frames == 4) {
    for (uint32_t j = 0; j < 4; j++) {
      uint8_t alloc = (sf_alloc >> 6 * (3 - j)) & 0x3F;
      generate_frame_table(&table[j * 10], alloc);
    }
  }
}

void generate_mcch_table(uint8_t* table, uint32_t sf_alloc)
{
  uint8_t alloc = (sf_alloc)&0x3F;
  generate_frame_table(table, alloc);
}


The quick brown fox jumps.  The quick brown fox crashes.')
  assertEquals('@@ -1,27 +1,28 @@\n Th\n-e\n+at\n  quick brown fox jumps. \n', tostring(p))
end

function testPatchMake()
  -- Null case.
  local patches = dmp.patch_make('', '')
  assertEquals('', dmp.patch_toText(patches))

  local text1 = 'The quick brown fox jumps over the lazy dog.'
  local text2 = 'That quick brown fox jumped over a lazy dog.'
  -- Text2+Text1 inputs.
  local expectedPatch = '@@ -1,8 +1,7 @@\n Th\n-at\n+e\n  qui\n'
      .. '@@ -21,17 +21,18 @@\n jump\n-ed\n+s\n  over \n-a\n+the\n  laz\n'
  -- The second patch must be "-21,17 +21,18",
  -- not "-22,17 +21,18" due to rolling context.
  patches = dmp.patch_make(text2, text1)
  assertEquals(expectedPatch, dmp.patch_toText(patches))

  -- Text1+Text2 inputs.
  expectedPatch = '@@ -1,11 +1,12 @@\n Th\n-e\n+at\n  quick b\n'
      .. '@@ -22,18 +22,17 @@\n jump\n-s\n+ed\n  over \n-the\n+a\n  laz\n'
  patches = dmp.patch_make(text1, text2)
  assertEquals(expectedPatch, dmp.patch_toText(patches))

  -- Diff input.
  local diffs = dmp.diff_main(text1, text2, false)
  patches = dmp.patch_make(diffs)
  assertEquals(expectedPatch, dmp.patch_toText(patches))

  -- Text1+Diff inputs.
  patches = dmp.patch_make(text1, diffs)
  assertEquals(expectedPatch, dmp.patch_toText(patches))

  -- Text1+Text2+Diff inputs (deprecated).
  patches = dmp.patch_make(text1, text2, diffs)
  assertEquals(expectedPatch, dmp.patch_toText(patches))

  -- Character encoding.
  patches = dmp.patch_make('`1234567890-=[]\\;\',./', '~!@#$%^&*()_+{}|="<>?')
  assertEquals('@@ -1,21 +1,21 @@\n'
      .. '-%601234567890-=%5B%5D%5C;\',./\n'
      .. '+~!@#$%25%5E&*()_+%7B%7D%7C=%22%3C%3E?\n', dmp.patch_toText(patches))

  -- Character decoding.
  diffs = {
        {DIFF_DELETE, '`1234567890-=[]\\;\',./'},
        {DIFF_INSERT, '~!@#$%^&*()_+{}|="<>?'}
      }
  assertEquivalent(diffs, dmp.patch_fromText(
        '@@ -1,21 +1,21 @@'
         .. '\n-%601234567890-=%5B%5D%5C;\',./'
         .. '\n+~!@#$%25%5E&*()_+%7B%7D%7C=%22%3C%3E?\n'
      )[1].diffs)

  -- Long string with repeats.
  text1 = string.rep('abcdef', 100)
  text2 = text1 .. '123'
  expectedPatch = '@@ -573,28 +573,31 @@\n'
      .. ' cdefabcdefabcdefabcdefabcdef\n+123\n'


exedDataflowGranularity>(bPrevDFGGranularity)
            assertEquals(1, bPrevDFGGranularity.partialTarget)

            val callPrint = main.calls["print"]
            assertNotNull(callPrint)
            assertIs<CallExpression>(callPrint)

            val arg = callPrint.arguments<Reference>(0)
            assertNotNull(arg)
            assertRefersTo(arg, a)
            assertContains(arg.prevDFG, a)
        }
    }
}
/*
 * Copyright (c) 2024, Fraunhofer AISEC. All rights reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 *                    $$$$$$\  $$$$$$$\   $$$$$$\
 *                   $$  __$$\ $$  __$$\ $$  __$$\
 *                   $$ /  \__|$$ |  $$ |$$ /  \__|
 *                   $$ |      $$$$$$$  |$$ |$$$$\
 *                   $$ |      $$  ____/ $$ |\_$$ |
 *                   $$ |  $$\ $$ |      $$ |  $$ |
 *                   \$$$$$   |$$ |      \$$$$$   |
 *                    \______/ \__|       \______/
 *
 */
package de.fraunhofer.aisec.cpg

import de.fraunhofer.aisec.cpg.graph.Node
import de.fraunhofer.aisec.cpg.passes.Pass
import de.fraunhofer.aisec.cpg.passes.hardDependencies
import de.fraunhofer.aisec.cpg.passes.hardExecuteBefore
import de.fraunhofer.aisec.cpg.passes.isFirstPass
import de.fraunhofer.aisec.cpg.passes.isLastPass
import de.fraunhofer.aisec.cpg.passes.softDependencies
import de.fraunhofer.aisec.cpg.passes.softExecuteBefore
import kotlin.reflect.KClass

private const val UNKNOWN_PASS = "UnknownPass"
private const val FIRST_PASSES_SUBGRAPH_IDENTIFIER = "FirstPassesSubgraph"
private const val NORMAL_PASSES_SUBGRAPH_IDENTIFIER = "NormalPassesSubgraph"
private const val LAST_PASSES_SUBGRAPH_IDENTIFIER = "LastPassesSubgraph"
private const val FIRST_PASS_IDENTIFIER = "FirstPass"
private const val LAST_PASS_IDENTIFIER = "LastPass"

/** Helper function to replace the first and last passes names by their identifier. */
private fun mermaidPassName(pass: KClass<out Pass<*>>): String {
    return when {
        pass.isFirstPass -> FIRST_PASS_IDENTIFIER
        pass.isLastPass -> LAST_PASS_IDENTIFIER
        else -> pass.simpleName ?: UNKNOWN_PASS
    }
}

/**
 * Builds a markdown representation of a pass dependency graph, based on
 * [Mermaid](https://mermaid.js.org) syntax.
 */
internal fun buildMermaid(passes: List<KClass<out Pass<out Node>>>): String {
    var s = "```mermaid\n"
    s += "flowchart TD;\n"

    s += "    subgraph $FIRST_PASSES_SUBGRAPH_IDENTIFIER [\"First Passes\"];\n"
    passes
        .filter { it.isFirstPass }
        .forEach { s += "    $FIRST_PASS_IDENTIFIER[\"${it.simpleName}\"];\n" }
    s += "    end;\n"
    s += "    subgraph $LAST_PASSES_SUBGRAPH_IDENTIFIER [\"Last Passes\"];\n"
    passes
        .filter { it.isLastPass }
        .forEach { s += "        $LAST_PASS_IDENTIFIER[\"${it.simpleName}\"];\n" }
    s += "    end;\n"

    s += "    $FIRST_PASSES_SUBGRAPH_IDENTIFIER~~~$NORMAL_PASSES_SUBGRAPH_IDENTIFIER;\n"
    s += "    subgraph $NORMAL_PASSES_SUBGRAPH_IDENTIFIER [\"Normal Passes\"];\n"
    for ((pass, deps) in passes.associateWith { it.softDependencies }.entries) {
        for (dep in deps) {


()),
        Err(_) => panic!("invalid write cf key: {}", hex::encode_upper(key)),
    }
}

fn truncate_ts(key: &[u8]) -> &[u8] {
    match Key::truncate_ts_for(key) {
        Ok(prefix) => prefix,
        Err(_) => panic!("invalid write cf key: {}", hex::encode_upper(key)),
    }
}

fn parse_write(value: &[u8]) -> WriteRef {
    match WriteRef::parse(value) {
        Ok(write) => write,
        Err(_) => panic!("invalid write cf value: {}", hex::encode_upper(value)),
    }
}

pub fn is_compaction_filter_allowd(cfg_value: &GcConfig, cluster_version: &ClusterVersion) -> bool {
    cfg_value.enable_compaction_filter
        && (cfg_value.compaction_filter_skip_version_check || {
            cluster_version.get().map_or(false, |cluster_version| {
                let minimal = semver::Version::parse(COMPACTION_FILTER_MINIMAL_VERSION).unwrap();
                cluster_version >= minimal
            })
        })
}

#[cfg(test)]
pub mod tests {
    use super::*;
    use crate::config::DbConfig;
    use crate::storage::kv::{RocksEngine as StorageRocksEngine, TestEngineBuilder};
    use crate::storage::mvcc::tests::{must_get, must_get_none};
    use crate::storage::txn::tests::{must_commit, must_prewrite_delete, must_prewrite_put};
    use engine_rocks::raw::CompactOptions;
    use engine_rocks::util::get_cf_handle;
    use engine_rocks::RocksEngine;
    use engine_traits::{MiscExt, Peekable, SyncMutable};
    use txn_types::TimeStamp;

    // Use a lock to protect concurrent compactions.
    lazy_static! {
        static ref LOCK: Mutex<()> = std::sync::Mutex::new(());
    }

    fn do_gc_by_compact(
        engine: &RocksEngine,
        start: Option<&[u8]>,
        end: Option<&[u8]>,
        safe_point: u64,
        target_level: Option<usize>,
    ) {
        let _guard = LOCK.lock().unwrap();
        let safe_point = Arc::new(AtomicU64::new(safe_point));
        let cfg = GcWorkerConfigManager(Arc::new(Default::default()));
        cfg.0.update(|v| v.enable_compaction_filter = true);
        let cluster_version = ClusterVersion::new(semver::Version::new(5, 0, 0));
        engine.init_compaction_filter(safe_point, cfg, cluster_version);

        let db = engine.as_inner();
        let handle = get_cf_handle(db, CF_WRITE).unwrap();

        let mut compact_opts = CompactOptions::new();
        compact_opts.set_exclusive_manual_compaction(false);
        compact_opts.set_max_subcompactions(1);
        if let Some(target_level) = target_level {
            compact_opts.set_change_level(true);
            compact_opts.set_target_level(target_level as i32);
        }
        db.compact_range_cf_opt(handle, &compact_opts, start, end);
    }

    pub fn gc_by_compact(engine: &StorageRocksEngine, _: &[u8], safe_point: u64) {
        let engine = engine.get_rocksdb();
        // Put a new key-value pair to ensure compaction can be triggered correctly.
        engine.delete_cf("write", b"not-exists-key").unwrap();
        do_gc_by_compact(&engine, None, None, safe_point, None);
    }

    fn rocksdb_level_file_counts(engine: &RocksEngine, cf: &str) -> Vec<us


}function my(n,a){let c=na(n.escapedName,"__#")?D.createPrivateIdentifier(n.escapedName.split("@")[1]):Gi(n.escapedName),u=D.createPropertyAccessExpression(D.createThis(),c);go(u.expression,u),go(u,a),u.flowNode=a.returnFlowNode;let p=Gx(u,n);return ge&&(p===at||p===bn)&&Fe(n.valueDeclaration,_.Member_0_implicitly_has_an_1_type,E(n),Ee(p)),Im(p,zB)?void 0:MD(p)}function Gx(n,a){let c=a?.valueDeclaration&&(!tp(a)||uu(a.valueDeclaration)&2)&&yB(a)||Oe;return Yv(n,at,c)}function GE(n,a){let c=sS(n.valueDeclaration);if(c){let k=Yn(c)?x0(c):void 0;return k&&k.typeExpression?$r(k.typeExpression):n.valueDeclaration&&_C(n.valueDeclaration,n,c)||i0(Ic(c))}let u,p=!1,h=!1;if(id(n)&&(u=my(n,Op(n))),!u){let k;if(n.declarations){let O;for(let H of n.declarations){let J=ar(H)||Pa(H)?H:Us(H)?ar(H.parent)?H.parent:H:void 0;if(!J)continue;let de=Us(J)?nR(J):ic(J);(de===4||ar(J)&&GB(J,de))&&(cf(J)?p=!0:h=!0),Pa(J)||(O=L_(O,J,n,H)),O||(k||(k=[])).push(ar(J)||Pa(J)?Mv(n,a,J,de):lt)}u=O}if(!u){if(!Fn(k))return ve;let O=p&&n.declarations?Bx(k,n.declarations):void 0;if(h){let J=yB(n);J&&((O||(O=[])).push(J),p=!0)}let H=vt(O,J=>!!(J.flags&-98305))?O:k;u=Gr(H)}}let T=Sd(ao(u,!1,h&&!p));return n.valueDeclaration&&jc(T,k=>!!(k.flags&-98305))===lt?(qv(n.valueDeclaration,Se),Se):T}function _C(n,a,c){var u,p;if(!Yn(n)||!c||!rs(c)||c.properties.length)return;let h=Ua();for(;ar(n)||br(n);){let O=vd(n);(u=O?.exports)!=null&&u.size&&ll(h,O.exports),n=ar(n)?n.parent:n.parent.parent}let T=vd(n);(p=T?.exports)!=null&&p.size&&ll(h,T.exports);let k=ls(a,h,Je,Je,Je);return k.objectFlags|=4096,k}function L_(n,a,c,u){var p;let h=Cl(a.parent);if(h){let T=Sd($r(h));if(n)!Ro(n)&&!Ro(T)&&!ph(n,T)&&cLe(void 0,n,u,T);else return T}if((p=c.parent)!=null&&p.valueDeclaration){let T=Cl(c.parent.valueDeclaration);if(T){let k=ja($r(T),c.escapedName);if(k)return Gv(k)}}return n}function Mv(n,a,c,u){if(Pa(c)){if(a)return zn(a);let T=Ic(c.arguments[2]),k=Vc(T,"value");if(k)return k;let O=Vc(T,"get");if(O){let J=G1(O);if(J)return qo(J)}let H=Vc(T,"set");if(H){let J=G1(H);if(J)return uie(


cle19]);
    }
}
// External.
use druid::widget::prelude::*;
use druid::widget::{
    Button, Container, CrossAxisAlignment, Flex, Label, LineBreaking, MainAxisAlignment, Padding,
    Scroll, SizedBox, Slider, ViewSwitcher,
};
use druid::{Color, Data, Lens, LensExt, Selector, Target, WidgetExt};
use rdev::{listen, EventType};
use system_wide_key_state::*;

// Std.
use std::thread;

// Custom.
use crate::misc::{custom_slider_controller::*, locale_keys::*};
use crate::services::user_tcp_service::ConnectResult;
use crate::theme::*;
use crate::ApplicationState;
use crate::CustomSliderID;
use crate::{global_params::*, Layout};

pub const PUSH_TO_TALK_KEY_CHANGE_EVENT: Selector<String> =
    Selector::new("settings_push_to_talk_key_change_event");

#[derive(Data, Copy, Clone, Eq, PartialEq, PartialOrd, Ord)]
pub enum SupportedLocale {
    En,
    Ru,
}

#[derive(Clone, Data, PartialEq)]
pub enum ActiveOption {
    General,
    About,
}

#[derive(Clone, Data, Lens)]
pub struct SettingsLayout {
    pub active_option: ActiveOption,
    pub show_message_notification: bool,
    pub master_volume: f64,
    pub microphone_volume: f64,
    pub push_to_talk_key_text: String,
    pub selected_locale: SupportedLocale,
    #[data(ignore)]
    pub push_to_talk_keycode: KeyCode,
}

impl SettingsLayout {
    pub fn new() -> Self {
        SettingsLayout {
            active_option: ActiveOption::General,
            master_volume: 100.0,
            microphone_volume: 100.0,
            push_to_talk_key_text: "T".to_string(),
            push_to_talk_keycode: KeyCode::KT,
            show_message_notification: true,
            selected_locale: SupportedLocale::En,
        }
    }
    pub fn build_ui() -> impl Widget<ApplicationState> {
        let mut active_option_content = Flex::column()
            .must_fill_main_axis(true)
            .main_axis_alignment(MainAxisAlignment::Center)
            .with_flex_child(SizedBox::empty().expand(), 10.0);

        let res = ViewSwitcher::new(
            |data: &ApplicationState, _env| data.settings_layout.active_option.clone(),
            |selector, _data, _env| match selector {
                &ActiveOption::General => Box::new(
                    Flex::column()
                        .must_fill_main_axis(true)
                        .main_axis_alignment(MainAxisAlignment::Center)
                        .with_flex_child(
                            Container::new(SizedBox::empty().expand())
                                .background(BACKGROUND_SPECIAL_COLOR)
                                .expand(),
                            10.0,
                        )
                        .with_flex_child(SizedBox::empty().expand(), 5.0)
                        .with_flex_child(Container::new(SizedBox::empty().expand()).expand(), 10.0)
                        .expand(),
                ),
                &ActiveOption::About => Box::new(
                    Flex::column()
                        .must_fill_main_axis(true)
                        .main_axis_alignment(MainAxisAlignment::Center)
                        .with_flex_child(Container::new(SizedBox::empty().expand()).expand(), 10.0)
                        .with_flex_child(SizedBox::empty().expand(), 5.0)
                        .with_flex


        # 更新動畫卡片
        for anim_card in animated_cards[:]:
            anim_card.update()
            if not anim_card.moving:
                # 卡片到達目標位置，加入玩家手牌
                players[anim_card.player_index].append(anim_card.card)
                animated_cards.remove(anim_card)

        # 發牌動畫結束判斷：若發牌順序與動畫卡片皆空，則完成發牌
        if not deal_order and not animated_cards:
            dealing_animation = False
            finalize_dealing()

    # 畫出各玩家的手牌
    for i, pos in enumerate(positions):
        card_positions = calculate_card_positions(players[i], pos)
        for j, card in enumerate(players[i]):
            card_image = card_images.get(card)
            if card_image:
                card_x, card_y = card_positions[j]
                # 若該玩家為目前出牌玩家，且該牌被選取，稍作偏移
                if i == current_player and card in selected_cards:
                    if pos == "bottom":
                        card_y -= 20
                    elif pos == "top":
                        card_y += 20
                    elif pos == "left":
                        card_x += 20
                    elif pos == "right":
                        card_x -= 20
                scaled_card = pygame.transform.scale(card_image, (CARD_WIDTH, CARD_HEIGHT))
                screen.blit(scaled_card, (card_x, card_y))

    # 畫出正在發牌動畫中的卡片（覆蓋於已發牌之上）
    if dealing_animation:
        for anim_card in animated_cards:
            anim_card.draw(screen)

    # 畫出最後出牌的牌型圖片
    if played_hand_image:
        image_rect = played_hand_image.get_rect(center=(WIDTH // 2 + 400, HEIGHT // 2 + 100))
        screen.blit(played_hand_image, image_rect)

    # 若有人獲勝，顯示勝利訊息
    if winner is not None:
        font = pygame.font.SysFont(None, 72)
        win_text = f"Player {winner+1} Wins!"
        text_surf = font.render(win_text, True, WHITE)
        text_rect = text_surf.get_rect(center=(WIDTH//2, HEIGHT//2))
        screen.blit(text_surf, text_rect)

    pygame.display.flip()
    clock.tick(FPS)

    # 只在非發牌動畫階段處理玩家操作
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            running = False

        elif event.type == pygame.KEYDOWN:
            if not dealing_animation:
                if winner is not None:
                    if event.key == pygame.K_r:
                        start_dealing()
                        selected_cards.clear()
                else:
                    if event.key == pygame.K_RETURN:
                        play_selected_cards()
                    elif event.key == pygame.K_s:
                        pass_turn()
                    elif event.key == pygame.K_r:
                        start_dealing()
                        selected_cards.clear()
                        played_hand_image = None

        elif event.type == pygame.MOUSEBUTTONDOWN:
            if event.button == 1 and not dealing_animation and winner is None:
                player_pos = positions[current_player]
                hand_positions = calculate_card_positions(players[current_player], player_pos)
                if player_pos in ["left", "right"]:
                    modified_hand_positions = [(x, y - 20) for (x, y) in hand_positions]
                else:
                    modified_hand_positions = hand_positions
                card_index = get_card_at_pos(pygame.mouse.get_pos(), modified_hand_positions)
                if card_index is not None:
                    chosen_card = players[current_player][card_index]
                    # 點選後播放選牌音效
                    if select_sound:
                        select_sound.play()
                    if chosen_card in selected_cards:
                        selected_cards.remove(chosen_card)
                    else:
                        selected_cards.append(chosen_card)

pygame.quit()


chat-file-size,.k-chat-file .k-chat-file-status{font-size:var(--kendo-font-size-xs, inherit)}.k-message-group .k-chat-file+.k-chat-file:not(.k-chat-file-deleted){padding-block-start:0}.k-chat-file-download-wrapper{display:flex;flex-direction:column}.k-message-box-wrapper .k-chat-file,.k-message-group-full-width .k-chat-file,.k-message:has(.k-bubble-expandable)+.k-chat-file-wrapper .k-chat-file{width:240px}.k-chat .k-card-list{margin:var(--kendo-spacing-2, 0.5rem) 0 0}.k-message-group-sender+.k-card-list,.k-message-group-sender+.kendo-chat-message-attachments.k-card-list{align-self:flex-end}.k-chat .k-card-deck{max-width:calc(100% + var(--kendo-spacing-4, 1rem)*2);box-sizing:border-box;margin-inline-start:calc(var(--kendo-spacing-4, 1rem)*-1);margin-inline-end:calc(var(--kendo-spacing-4, 1rem)*-1);padding:var(--kendo-spacing-4, 1rem) var(--kendo-spacing-4, 1rem) var(--kendo-spacing-4, 1rem);overflow:hidden;overflow-x:auto;scroll-behavior:smooth}.k-chat .k-card-deck .k-card{width:200px}.k-chat .k-card-deck-scrollwrap{margin-inline-end:calc(var(--kendo-spacing-4, 1rem)*-1);margin-inline-start:calc(var(--kendo-spacing-4, 1rem)*-1);padding-inline-start:var(--kendo-spacing-4, 1rem);padding-inline-end:var(--kendo-spacing-4, 1rem)}.k-chat .k-card-deck-scrollwrap>.k-card-deck{margin-block-end:-20px;padding-block-end:20px}.k-chat .k-card-deck .k-card-wrap{display:flex;flex-flow:row nowrap;align-items:stretch;flex:0 0 auto;padding-block-end:5px}.k-chat .k-card-deck .k-card-wrap .k-card{flex:0 0 auto}.k-chat .k-card-deck .k-card-wrap.k-selected{background:none}.k-typing-indicator{display:inline-flex;gap:var(--kendo-spacing-1, 0.25rem);flex-flow:row nowrap}.k-typing-indicator span{width:var(--kendo-spacing-2, 0.5rem);height:var(--kendo-spacing-2, 0.5rem);border-radius:50%;flex:0 0 var(--kendo-spacing-2, 0.5rem);background-color:currentColor;opacity:.25}.k-typing-indicator span:nth-of-type(1){animation:1s k-animation-blink infinite .3333s}.k-typing-indicator span:nth-of-type(2){animation:1s k-animation-blink infinite .6666s}.k-typing-indicator span:nth-of-type(3){animation:1s k-animation-blink infinite .9999s}@keyframes k-animation-blink{50%{opacity:.5}}.k-chat-upload .k-external-dropzone{height:auto}.k-chat-upload .k-upload{margin-block-start:var(--kendo-spacing-6, 1.5rem)}.k-chat-upload .k-upload-files{max-height:var(--kendo-spacing-25, 7rem)}.k-rtl .k-message-box .k-button,[dir=rtl] .k-message-box .k-button{transform:scaleX(-1)}.k-chat{border-color:var(--kendo-color-border, rgb(85, 85, 85));color:var(--kendo-color-on-a


: String,
    val address: String,
    val age: Int,
    val annualIncomes: BigDecimal
) {
    companion object
}

sealed class CustomerEligibility {
    object Eligible : CustomerEligibility()
    object ManualEligibilityAssessmentRequired : CustomerEligibility()
    sealed class NotEligible : CustomerEligibility() {
        object InvalidAge : NotEligible()
        object NotEnoughAnnualIncomes : NotEligible()
        object NonPayer : NotEligible()
        object AlreadyInDebt : NotEligible()
    }
}

// simple implementation, for real production code you could have different implementations, as complex as business requires
fun Customer.Companion.eligibilityOf(
    customer: Customer,
    loanRecords: List<LoanRecord>
): CustomerEligibility =
    when {
        customer.age in 18..21 && customer.annualIncomes >= 30000.toBigDecimal() -> ManualEligibilityAssessmentRequired
        customer.age !in 21..60 -> NotEligible.InvalidAge
        customer.annualIncomes < 20000.toBigDecimal() -> NotEligible.NotEnoughAnnualIncomes
        loanRecords.contains(LoanRecord.Unpaid) -> NotEligible.NonPayer
        loanRecords.contains(LoanRecord.Active) -> NotEligible.AlreadyInDebt
        else -> Eligible
    }
package io.qameta.allure.espresso

import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.uiautomator.UiDevice
import org.junit.rules.TestRule
import org.junit.runner.Description
import org.junit.runners.model.Statement
import io.qameta.allure.android.io.TEXT_XML
import io.qameta.allure.android.io.XML_EXTENSION
import io.qameta.allure.espresso.utils.createAttachmentFile
import java.util.concurrent.TimeUnit

class WindowHierarchyRule : TestRule {
    override fun apply(base: Statement, description: Description): Statement {
        return object : Statement() {
            override fun evaluate() {
                try {
                    base.evaluate()
                } catch (t: Throwable) {
                    dumpWindowHierarchy()
                    throw t
                }
            }
        }
    }

    private fun dumpWindowHierarchy() {
        val file = createAttachmentFile()
        with(UiDevice.getInstance(InstrumentationRegistry.getInstrumentation())) {
            waitForIdle(TimeUnit.SECONDS.toMillis(5))
            dumpWindowHierarchy(file)
        }
        AllureAndroidLifecycle.addAttachment(name = "hierarchy", type = TEXT_XML,
                fileExtension = XML_EXTENSION, file = file)
    }
}
package io.qameta.allure.android

import io.qameta.allure.android.model.Parameter
import io.qameta.allure.android.model.Status
import io.qameta.allure.android.model.StatusDetails
import io.qameta.allure.android.model.StepResult

/**
 * @author b.mukvich on 31.05.2017.
 */

inline fun <T : Any?> step(description: String, vararg params: Parameter, block: () -> T): T {
    with(Step()) {
        val result: T
        stepStart(description, *params)
        try {
            result = block()
            stepCompleted()
        } catch (t: Throwable) {
            stepThrown(t)
            throw t
        } finally {
            stepStop()
        }
        return result
    }
}

class Step {
    // todo: commonLifecycle works on Android, only 'cause steps don't call writer
    private val lifecycle: AllureLifecycle = AllureCommonLifecycle

    fun stepComple


Assets, model: str,
                                  num_crops: int, expected_toks_per_img: int,
                                  num_imgs: int):
    """Ensure input_processor_for_phi3v handles num_crops properly."""
    # Same as the previous test - don't initialize mm_processor_kwargs
    # in this test and assume that the kwargs will be correctly expanded by
    # the partial when calling the custom input processor.
    ctx = build_model_context(
        model_name=model,
        tokenizer_name=model,
        trust_remote_code=True,
    )
    tokenizer = AutoTokenizer.from_pretrained(model)
    # Build the image str / prompt based on the number of images we pass
    img_str = "".join([f"<|image_{idx}|>\n" for idx in range(1, num_imgs + 1)])
    prompt = f"<|user|>\n{img_str}<|end|>\n<|assistant|>\n"
    images = [image_assets[0].pil_image] * num_imgs

    llm_inputs = LLMInputs(prompt_token_ids=tokenizer.encode(prompt),
                           prompt=prompt,
                           multi_modal_data={"image": images})

    proc_llm_inputs = input_processor_for_phi3v(
        ctx=ctx,
        llm_inputs=llm_inputs,
        num_crops=num_crops,
    )

    # Ensure we have the right number of placeholders per num_crops size
    img_tok_count = proc_llm_inputs["prompt_token_ids"].count(_IMAGE_TOKEN_ID)
    assert img_tok_count == expected_toks_per_img * num_imgs


[w3schools: empty](https://www.w3schools.com/cssref/sel_empty.asp)
- [CSS Tricks: empty](https://css-tricks.com/almanac/selectors/e/empty/)
- [5 Lesser Used CSS Selectors](https://bitsofco.de/5-lesser-used-css-selectors/)
- [empty and blank](https://zellwk.com/blog/empty-and-blank/)
- [freeCodeCamp: When to use the :empty and :blank CSS pseudo selectors](https://www.freecodecamp.org/news/empty-and-blank-53b9e96151cd/)
- [Why empty states deserve more design time](https://www.invisionapp.com/inside-design/why-empty-states-deserve-more-design-time/)
- [codrops: empty](https://tympanus.net/codrops/css_reference/empty/)
---
title: padEnd String Method in JavaScript
description: padEnd is great for us to add some padding to display our strings in a tabular format. Use this method to pad characters to a string's end
tags: [javascript]
order: 69
createdAt: 2019-07-13
updatedAt: 2019-07-13
---

With `padEnd`, it adds characters to the end of a string so it reaches a specified length. This is great for us to add some padding to display our strings in a tabular format. Isn't it so much easier to read, yay 🍹

```javascript
// Display String in Tabular Format with padEnd

// ❌
'Day: Monday' + 'Drink: 🍵';
'Day: Saturday' + 'Drink: 🍹';

// ✅
'Day: Monday'.padEnd(20) + 'Drink: 🍵';
'Day: Saturday'.padEnd(20) + 'Drink: 🍹';
```

## padEnd Parameters

The `padEnd` accepts 2 parameters:

```javascript
string.padEnd( <length>, <character>)
```

### 1st Parameter: Length

This is the final length of your result string. It is required.

Let's say you begin with a string that has 3 characters. And you set the length to be 5 characters. That means, `padEnd` will pad it with 2 characters so the total length meets your target length of 5 characters.

Here's an example. I'm denoting the space character with `·` to show you the padded space.

```javascript
'abc'.padEnd(5);

// abc··
```

### 2nd Parameter: Character

This is an optional parameter. As you see from above, the default padded character is an empty space. However, you might want to pad it with a different character. No problem! Just pass it here.

```javascript
'hi'.padEnd(10, '!');

// 'hi!!!!!!!!'
```

### Tabular Format only works with Monospace Font

So in my example of using `padEnd` to create table formatted string. One thing to note is that it only works with Monospace Font.

> A monospaced font, also called a fixed-pitch, fixed-width, or non-proportional font, is a font whose letters and characters each occupy the same amount of horizontal space.

_[Wikipedia](https://en.wikipedia.org/wiki/Monospaced_font)_

By Garethlwalt - Own work, <a href="https


rs.url_loader = UrlLoaderManager:new()
	end

	local version_id = PLATFORM .. "#" .. (APPLICATION_SETTINGS.content_revision or LOCAL_CONTENT_REVISION or "")
	local language = Managers.localization:language()

	Managers.backend = BackendManager:new(function ()
		return {
			["request-id"] = math.uuid(),
			["platform-name"] = version_id,
			["accept-language"] = language,
			["is-modded"] = GameParameters.is_modded_crashify_property or nil,
		}
	end)
	Managers.steam = SteamManager:new()
	Managers.grpc = GRPCManager:new()
	Managers.ping = PingManager:new()
	Managers.frame_rate = FrameRateManager:new()
	Managers.data_service = DataServiceManager:new()

	Managers.input:init_all_devices()

	local is_dedicated_hub_server = false
	local is_dedicated_mission_server = false
	local mechanism_name

	if is_dedicated_mission_server then
		mechanism_name = "idle"
	elseif LEVEL_EDITOR_TEST then
		mechanism_name = "sandbox"
	end

	Managers.mechanism = MechanismManager:new(event_delegate, mechanism_name, {
		mission_name = GameParameters.mission,
	})
	Managers.connection = ConnectionManager:new(_connection_options(is_dedicated_hub_server, is_dedicated_mission_server), event_delegate, approve_channel_delegate)
	Managers.multiplayer_session = MultiplayerSessionManager:new()
	Managers.world_level_despawn = WorldLevelDespawnManager:new()
	Managers.profile_synchronization = ProfileSynchronizationManager:new()
	Managers.package_synchronization = PackageSynchronizationManager:new()
	Managers.bot = BotManager:new()

	if not DEDICATED_SERVER then
		local connection_manager = Managers.connection
		local network_hash = connection_manager.combined_hash
		local platform = connection_manager.platform

		if GameParameters.prod_like_backend then
			Managers.presence = PresenceManager:new()
			Managers.party_immaterium = PartyImmateriumManager:new()
		end
	else
		Managers.presence = PresenceManagerDummy:new()
	end

	if IS_PLAYSTATION then
		Managers.ps5_uds = PS5UDSManager:new()
	end

	local is_stat_client = not DEDICATED_SERVER

	Managers.stats = StatsManager:new(is_stat_client, event_delegate)

	local use_batched_saving = is_dedicated_mission_server and GameParameters.save_achievements_in_batch
	local broadcast_unlocks = is_dedicated_mission_server

	Managers.achievements = AchievementsManager:new(not DEDICATED_SERVER, event_delegate, use_batched_saving, broadcast_unlocks)
	Managers.voting = VotingManager:new(event_delegate)
	Managers.progression = ProgressionManager:new()
	Managers.live_event = LiveEventManager:new(DEDICATED_SERVER, event_delegate)
	Managers.telemetry = TelemetryManager:new()
	Managers.telemetry_events = TelemetryEvents:new(Managers.telemetry, Managers.connection)
	Managers.telemetry_reporters = TelemetryReporters:new()
	Managers.account = AccountManager:new()

	if Application.xbox_live and Application.xbox_live() == true then
		Managers.xasync = XAsyncManager:new()
	end

	local disable_ui = DEDICATED_SERVER

	if not disable_ui then
		Managers.font = UIFontManager:new()
		Managers.ui = UIManager:new()
	end

	Managers.loading = LoadingManager:new()
	Managers.narrative


point-to-point (aka outer) CryptoAuth session.
    ca_session: Wrapper<String>,
    /// The address where to send the UDP packets to.
    addr: SocketAddr,
}

/// Creates a reply switch packet to an other switch packet.
/// The content of the reply is given as a byte array (returned CryptoAuth's
/// `wrap_messages`).
fn make_reply<PeerId: Clone>(replied_to_packet: &SwitchPacket, reply_content: Vec<u8>, inner_conn: &Wrapper<PeerId>) -> SwitchPacket {
    let first_four_bytes = BigEndian::read_u32(&reply_content[0..4]);
    if first_four_bytes < 4 {
        // If it is a CryptoAuth handshake packet, send it as is.
        SwitchPacket::new_reply(&replied_to_packet, SwitchPayload::CryptoAuthHandshake(reply_content))
    }
    else if first_four_bytes == 0xffffffff {
        // Control packet
        unimplemented!()
    }
    else {
        // Otherwise, it is a CryptoAuth data packet. We have to prepend
        // the session handle to the reply.
        // This handle is used by the peer to know this packet is coming
        // from us.
        let peer_handle = inner_conn.peer_session_handle().unwrap();
        SwitchPacket::new_reply(&replied_to_packet, SwitchPayload::CryptoAuthData(peer_handle, reply_content))
    }
}

/// Main data structure of the switch.
struct Pinger {
    /// The socket used for receiving and sending UDP packets to peers.
    sock: UdpSocket,
    /// Peers
    interfaces: Vec<Interface>,
    /// My public key, both for outer and inner CryptoAuth sessions.
    my_pk: PublicKey,
    /// My public key, both for outer and inner CryptoAuth sessions.
    my_sk: SecretKey,
    /// CryptoAuth sessions used to talk to switches/routers. Their packets
    /// themselves are wrapped in SwitchPackets, which are wrapped in the
    /// outer CryptoAuth sessions.
    inner_conns: HashMap<u32, ([u8; 8], Wrapper<String>)>,
    /// Credentials of peers which are allowed to connect to us.
    allowed_peers: HashMap<Credentials, String>,

    ping_targets: Vec<Address>,
    ping_nodes: Vec<Node>,
    address_to_handle: HashMap<Address, u32>,

    router: Router,
}

impl Pinger {
    /// Instanciates a switch.
    fn new(sock: UdpSocket, interfaces: Vec<Interface>, my_pk: PublicKey, my_sk: SecretKey, allowed_peers: HashMap<Credentials, String>, ping_targets: Vec<Address>) -> Pinger {
        Pinger {
            sock: sock,
            interfaces: interfaces,
            inner_conns: HashMap::new(),
            my_pk: my_pk,
            my_sk: my_sk,
            allowed_peers: allowed_peers,
            ping_targets: ping_targets,
            ping_nodes: Vec::new(),
            address_to_handle: HashMap::new(),
            router: Router::new(Address::from(&publickey_to_ipv6addr(&my_pk)))
            }
    }

    /// Takes a 3-bit interface id, and reverse its bits.
    /// Used to compute reverse paths.
    fn reverse_iface_id(&self, iface_id: u8) -> u8 {
        match iface_id {
            0b000 => 0b000,
            0b001 => 0b100,
            0b010 => 0b010,
            0b011 => 0b110,
            0b100 => 0b001,
            0b101 => 0b101,
            0b110 => 0b011,
            0b111 => 0b111,
            _ => panic!("Iface id greater than 0b111"),
        }
    }

    /// Sometimes (random) sends a switch as a reply


			if (key[name].code === event.keyCode) {
						key[name].pressed = true;
					}
				}
			}
		}, false);

		element.addEventListener("keyup", function (event) {
			var name;
			for (name in key) {
				if (key.hasOwnProperty(name)) {
					if (key[name].code === event.keyCode) {
						key[name].pressed = false;
					}
				}
			}
		}, false);

		return key;
	}

	// do we realy need this method?
	public static colorToRGB(color: any, alpha: number) {
		if (typeof color === 'string' && color[0] === '#') {
			color = parseInt(color.slice(1), 16);
		}
		alpha = (alpha === undefined) ? 1 : alpha;

		let r = color >> 16 & 0xff;
		let g = color >> 8 & 0xff;
		let b = color & 0xff;
		let a = (alpha < 0) ? 0 : ((alpha > 1) ? 1 : alpha);

		if (a === 1) {
			return "rgb(" + r + "," + g + "," + b + ")";
		} else {
			return "rgba(" + r + "," + g + "," + b + "," + a + ")";
		}
	}

	/**
	 * Convert HSB color into string "rgb(r,g,b)"
	 *
	 * @param {number} hue in degrees (from 0 to 360)
	 * @param {number} saturation in percent (from 0 to 100)
	 * @param {number} brightness in percent (from 0 to 100)
	 * @param {boolean} radians if true, used hue in radians
	 * @return {string} color string "rgb(r,g,b)"
	 */
	public static HSBtoRGB(hue?, saturation?, brightness?, radians?) {
		if (hue === undefined) { hue = 0; }
		if (saturation === undefined) { saturation = 75; }
		if (brightness === undefined) { brightness = 75; }
		if (radians === undefined) { radians = false; }

		if (radians) { hue *= 180 / Math.PI; }
		let HSB = {
			h: hue % 360,
			s: saturation / 100,
			b: brightness / 100
		};
		let RGB = {
			r: null,
			g: null,
			b: null,
			color: function () {
				return "rgb(" + Math.round(this.r) +
					"," + Math.round(this.g) +
					"," + Math.round(this.b) + ")";
			}
		};
		let chroma;
		let hueI;
		let x;
		let m;

		if (HSB.h < 0) {
			HSB.h += 360;
		}
		if (HSB.s > 100) {
			HSB.s = 100;
		} else if (HSB.s < 0) {
			HSB.s = 0;
		}

		if (HSB.b > 100) {
			HSB.b = 100;
		} else if (HSB.b < 0) {
			HSB.b = 0;
		}

		chroma = HSB.s * HSB.b;
		hueI = HSB.h / 60;

		x = chroma * (1 - Math.abs(hueI % 2 - 1));
		switch (Math.floor(hueI)) {
			case 0:
				RGB.r = chroma;
				RGB.g = x;
				RGB.b = 0;
				break;
			case 1:
				RGB.r = x;
				RGB.g = chroma;
				RGB.b = 0;
				break;
			case 2:
				RGB.r = 0;
				RGB.g = chroma;
				RGB.b = x;
				break;
			case 3:
				RGB.r = 0;
				RGB.g = x;
				RGB.b = chroma;
				break;
			case 4:
				RGB.r = x;
				RGB.g = 0;
				RGB.b = chroma;
				break;
			case 5:
				RGB.r = chroma;
				RGB.g = 0;
				RGB.b = x;
				break;
		}
		m = HSB.b - chroma;
		RGB.r += m;
		RGB.g += m;
		RGB.b += m;
		RGB.r *= 255;


       // and then the "after" left/right values are the probability range.
          // x+y is the determinant value because, well, I'm not 100% sure. It's something to do with the axis orientation in OPENRNDR.
          val point0 = Vector2(cos(angle), sin(angle)) * outerRadius + center
          val probabilityCutoff = clamp(map(height * 0.55, height * 1.25, 1.0, 0.0, point0.x+point0.y), 0.0, 1.0)
          if (random(0.0, 1.02, rng) > probabilityCutoff) {
            // ahhhh, this is "wrong" because the angle might e.g. start at PI and then grow, therefore will never be in range [0,1]
            // however, this actually creates some cool artifacts, I think it is probably cooler than if it was "correct".
            // this is one of those "beautiful mistakes" I think!
            // of course... I still want to see what the "correct" version looks like 🙄
            drawer.fill = spectrum.index(map(-PI, PI, 0.0, 1.0, angle))

            // this is the "corrected" version
//            drawer.fill = if (angle > PI) {
//              spectrum.index(map(-PI, PI, 0.0, 1.0, angle - PI * 2.0))
//            } else if (angle < -PI) {
//              spectrum.index(map(-PI, PI, 0.0, 1.0, angle + PI * 2.0))
//            } else {
//              spectrum.index(map(-PI, PI, 0.0, 1.0, angle))
//            }

            // and this is fully-random
            // this was the first iteration, but compared to either of the above options, it is significantly uglier
//            drawer.fill = spectrum.index(random(0.0, 1.0, rng))
            drawer.contour(
              contour {
                moveTo(point0)

                val point1 = Vector2(cos(angle + tileAngularWidth), sin(angle + tileAngularWidth)) * outerRadius + center
                /**
                 * arcTo is pretty undocumented but I guess the params are self-explanatory (???)
                 * crx, cry is the circle radius in x and y dimensions
                 * angle is apparently the angular rotation of the arc?
                 * largeArcFlag makes the arc travel the longest possible distance to close the arc when true
                 * sweepFlag makes the arc bend outwards/inwards
                 * end is the point at which the arc ends
                 */
                arcTo(
                  crx = outerRadius,
                  cry = outerRadius,
                  angle = Math.toDegrees(tileAngularWidth),
                  largeArcFlag = false,
                  sweepFlag = true,
                  end = point1
                )

                val point2 = Vector2(cos(angle + tileAngularWidth), sin(angle + tileAngularWidth)) * innerRadius + center
                lineTo(point2)

                val point3 = Vector2(cos(angle), sin(angle)) * innerRadius + center
                arcTo(
                  crx = innerRadius,
                  cry = innerRadius,
                  angle = Math.toDegrees(tileAngularWidth),
                  largeArcFlag = false,
                  sweepFlag = false,
                  end = point3
                )

                close()
              }
            )
          }
          angle += tileAngularWidth
        }
      }

      if (screenshots.captureEveryFrame) {
        seed = random(0.0, Int.MAX_VALUE.toDouble()).toInt()
        screenshots.name = "screenshots/$progName/${timestamp()}-seed-$seed.


}

        @Nested
        inner class `ignores declaration with var and property delegation` {

            @Test
            fun `does not detect var declaration with property delegate`() {
                val rule = DoubleMutabilityForCollection(
                    TestConfig(MUTABLE_TYPES to listOf("MutableState"))
                )

                val code = """
                    data class MutableState<T>(var state: T)
                    fun <T> mutableStateOf(value: T): MutableState<T> = MutableState(value)
                    fun <T> remember(calculation: () -> T): T = calculation()
                    inline operator fun <T> MutableState<T>.getValue(thisObj: Any?, property: kotlin.reflect.KProperty<*>): T = state
                    inline operator fun <T> MutableState<T>.setValue(thisObj: Any?, property: kotlin.reflect.KProperty<*>, value: T) {
                        this.state = value
                    }
                    class MyClass {
                        var myState by remember { mutableStateOf("foo") }
                    }
                """.trimIndent()
                val result = rule.lintWithContext(env, code)
                assertThat(result).isEmpty()
            }
        }
    }
}
package dev.detekt.psi

import org.jetbrains.kotlin.analysis.api.KaExperimentalApi
import org.jetbrains.kotlin.analysis.api.analyze
import org.jetbrains.kotlin.analysis.api.components.KaDiagnosticCheckerFilter
import org.jetbrains.kotlin.analysis.api.fir.diagnostics.KaFirDiagnostic
import org.jetbrains.kotlin.psi.KtExpression
import org.jetbrains.kotlin.psi.KtSafeQualifiedExpression

/**
 * Return if overall expression is nullable or not nullable
 *
 * ```kotlin
 * var a: Int? = null
 * val b = a // RHS expression will be nullable
 * val c = a!! // RHS expression will be not nullable
 * val d = (a ?: error("null assertion message")) // RHS expression will be not nullable
 * val c = 1?.and(2) // RHS expression will be not nullable
 * ```
 * [shouldConsiderPlatformTypeAsNullable] determines the behaviour of platform type. Passing true considers
 * the platform type as nullable otherwise it is not considered nullable in case of false
 */
@OptIn(KaExperimentalApi::class)
fun KtExpression.isNullable(shouldConsiderPlatformTypeAsNullable: Boolean): Boolean {
    if (this is KtSafeQualifiedExpression) {
        analyze(this) {
            return diagnostics(KaDiagnosticCheckerFilter.ONLY_COMMON_CHECKERS)
                .none { it is KaFirDiagnostic.UnnecessarySafeCall }
        }
    }
    analyze(this) {
        return if (expressionType?.hasFlexibleNullability == true && !shouldConsiderPlatformTypeAsNullable) {
            false
        } else {
            expressionType?.isNullable == true
        }
    }
}
@file:Suppress("TooManyFunctions")

package dev.detekt.psi

import org.jetbrains.kotlin.lexer.KtTokens
import org.jetbrains.kotlin.psi.KtModifierListOwner
import org.jetbrains.kotlin.psi.psiUtil.isPublic

fun KtModifierListOwner.isPublicNotOverridden() =
    isPublicNotOverridden(false)

fun KtModifierListOwner.isPublicNotOverridden(considerProtectedAsPublic: Boolean) =
    if (considerProtectedAsPublic) {
        isPublic || isProtected()
    } else {
        isPublic
    } &&
        !isOverride()

fun KtModifierListOwner.isAbstract() = hasModifier(KtTokens.ABSTRACT_KEYWORD)

fun KtModifierListOwner.isOverride() = hasModifier(KtTokens.OVERRIDE_KEYWORD)