        }
    }

    /// The symbol size range.
    #[inline]
    pub fn size(&self) -> u64 {
        self.size
    }
}

/// A relocation.
#[derive(Debug, Clone)]
pub struct Relocation<'input> {
    pub(crate) address: u64,
    pub(crate) size: u8,
    pub(crate) symbol: &'input str,
}

impl<'input> Relocation<'input> {
    /// The relocation address.
    #[inline]
    pub fn address(&self) -> u64 {
        self.address
    }

    /// The relocation size.
    #[inline]
    pub fn size(&self) -> u8 {
        self.size
    }

    /// The name of the symbol referenced by the relocation.
    #[inline]
    pub fn symbol(&self) -> &'input str {
        self.symbol
    }
}
//! Functions for portably serializing (resp. parsing) `f64` numbers
//! to (resp. from) their IEEE 754 bytes.

use std::f64;
use std::num::FpCategory;

fn f64_to_parts(sn: f64) -> (i8, u16, u64) {
    match sn.classify() {
        FpCategory::Nan => {
            return (1, 0x7FF, 1 << 51)
        },
        FpCategory::Infinite => {
            return (sn.signum() as i8, 0x7FF, 0)
        },
        FpCategory::Zero => {
            return (sn.signum() as i8, 0, 0)
        },
        FpCategory::Subnormal => (),
        FpCategory::Normal => (),
    }

    let sign = sn.signum() as i8;
    let n = if sign > 0 { sn } else { -sn };

    // Round exponent down (to 1) after multiplying
    // by the exponent we want 1 <= x < 2.

    let mut exp = n.log2().floor() as i32;

    // Sometimes this floating point log hasn't enough
    // precision to round down when it should.
    if n < (exp as f64).exp2() {
        exp -= 1;
    }

    // If exponent is -1023, biased exponent would be 0.
    // If exponent is -1022, biased exponent is 1.

    // An exponent of -1023 or less is represented by
    // a biased exponent of 0. We shift the number by
    // 1022 (less than the exponent) so it will have a leading 0.

    let expf;
    let bexp;
    if exp < -1022 {
        expf = -1022;
        bexp = 0u16;
    } else {
        expf = exp;
        bexp = (exp + 1023) as u16;
    };

    let normn = n / (expf as f64).exp2();

    // If the number is normal, subtract the leading 1.
    let frac = if bexp > 0 {
        normn - 1f64
    } else {
        normn
    };

    let mant = ((52f64).exp2() * frac) as u64;

    (sign, bexp, mant)
}

fn f64_from_parts(sign: i8, bexp: u16, mant: u64) -> f64 {
    if bexp == 0x7FF {
        if mant > 0 {
            return f64::NAN;
        }
        return if sign > 0 { f64::INFINITY } else { f64::NEG_INFINITY };
    }
    if bexp == 0 && mant == 0 {
        return if sign > 0 { 0f64 } else { -0f64 };
    }

    let frac = mant as f64 / (52f64).exp2();
    let normn = if bexp > 0 { frac + 1f64 } else { frac };
    let expf = if bexp > 0 { bexp as i32 - 1023 } else { -1022 };

    normn * (expf as f64).exp2() * sign as f64
}

/*
// NOTE: this is not used, except for checking visually that our
// conversions agree with the underlying IEEE-754 representation,
// assuming that's what the platform uses. The whole point of the
// rest of the code is


        }
    }

    /**
     * 将ActivitPage包装成Intent返回
     *
     * @param page
     */
    public static Intent pack(ActivityPage page) {
        return ActivityHolder.pack(activityRegistry, page);
    }

    /**
     * 启动某个页面
     *
     * @param page
     */
    public static void start(ActivityPage page) {
        startActivityForResult(page, -1);
    }

    /**
     * 启动某个页面，并将最终结果通过onActivityResult返回到之前的页面。RequestCode == -1 时不会有回调
     *
     * @param page        页面路由[针脚]
     * @param requestCode RequestCode，-1表示不接收返回值
     */
    public static void startActivityForResult(ActivityPage page, int requestCode) {
        ActivityHolder.startActivityForResult(activityRegistry, page, requestCode);
    }
}
/*
 * Copyright (c) 2018, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
 *
 * WSO2 Inc. licenses this file to you 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 org.ballerinalang.observe.metrics.extension.defaultimpl;

import io.ballerina.runtime.observability.metrics.AbstractMetric;
import io.ballerina.runtime.observability.metrics.Gauge;
import io.ballerina.runtime.observability.metrics.MetricId;
import io.ballerina.runtime.observability.metrics.Snapshot;
import io.ballerina.runtime.observability.metrics.StatisticConfig;

import java.util.concurrent.atomic.DoubleAdder;
import java.util.concurrent.atomic.LongAdder;

/**
 * An implementation of {@link Gauge}.
 *
 * @since 0.980.0
 */
public class DefaultGauge extends AbstractMetric implements Gauge {

    private static final RollingHistogram[] EMPTY_ROLLING_HISTOGRAMS = new RollingHistogram[0];
    private static final Snapshot[] EMPTY_SNAPSHOTS = new Snapshot[0];

    private final LongAdder count = new LongAdder();
    private final DoubleAdder sum = new DoubleAdder();
    private final DoubleAdder value = new DoubleAdder();
    private final RollingHistogram[] rollingHistograms;

    private DefaultGauge(MetricId id, Clock clock, StatisticConfig... statisticConfigs) {
        super(id);
        if (statisticConfigs != null) {
            rollingHistograms = new RollingHistogram[statisticConfigs.length];
            for (int i = 0; i < statisticConfigs.length; i++) {
                rollingHistograms[i] = new RollingHistogram(clock, statisticConfigs[i]);
            }
        } else {
            rollingHistograms = EMPTY_ROLLING_HISTOGRAMS;
        }
    }

    DefaultGauge(MetricId id, StatisticConfig... statisticConfigs) {
        this(id, Clock.DEFAULT, statisticConfigs);
    }

    private void updateHistogram(double value) {
        count.increment();
        sum.add(value);
        for (RollingHistogram rollingHistogram : rollingHistograms) {
            rollingHistogram.record(value);
        }
    }

    @Override
    public void increment(double amount) {
        synchronized (this) {
            value.add(a


mock.Anything, testGroupID).Return(group.Group{
					Metadata: metadata.Metadata{
						"key": map[int]any{},
					},
				}, nil)
			},
			request: connect.NewRequest(&frontierv1beta1.GetGroupRequest{
				Id:    testGroupID,
				OrgId: testOrgID,
			}),
			want:        nil,
			wantErr:     true,
			wantErrCode: connect.CodeInternal,
			wantErrMsg:  ErrInternalServerError,
		},
	}
	for _, tt := range tests {
		t.Run(tt.name, func(t *testing.T) {
			mockOrgSvc := new(mocks.OrganizationService)
			mockGroupSvc := new(mocks.GroupService)
			if tt.setup != nil {
				tt.setup(mockGroupSvc, mockOrgSvc)
			}
			h := &ConnectHandler{
				groupService: mockGroupSvc,
				orgService:   mockOrgSvc,
			}
			got, err := h.GetGroup(context.Background(), tt.request)
			if tt.wantErr {
				assert.Error(t, err)
				connectErr := &connect.Error{}
				assert.True(t, errors.As(err, &connectErr))
				assert.Equal(t, tt.wantErrCode, connectErr.Code())
				assert.Equal(t, tt.wantErrMsg.Error(), connectErr.Message())
				assert.Nil(t, got)
			} else {
				assert.NoError(t, err)
				assert.Equal(t, tt.want.Msg, got.Msg)
			}
		})
	}
}

func TestConnectHandler_UpdateGroup(t *testing.T) {
	someGroupID := utils.NewString()
	tests := []struct {
		name        string
		setup       func(gs *mocks.GroupService, ms *mocks.MetaSchemaService, os *mocks.OrganizationService)
		request     *connect.Request[frontierv1beta1.UpdateGroupRequest]
		want        *connect.Response[frontierv1beta1.UpdateGroupResponse]
		wantErr     bool
		wantErrCode connect.Code
		wantErrMsg  error
	}{
		{
			name: "should return bad request error if body is empty",
			setup: func(gs *mocks.GroupService, ms *mocks.MetaSchemaService, os *mocks.OrganizationService) {
			},
			request: connect.NewRequest(&frontierv1beta1.UpdateGroupRequest{
				Id:   someGroupID,
				Body: nil,
			}),
			want:        nil,
			wantErr:     true,
			wantErrCode: connect.CodeInvalidArgument,
			wantErrMsg:  ErrBadRequest,
		},
		{
			name: "should return error if org does not exist",
			setup: func(gs *mocks.GroupService, ms *mocks.MetaSchemaService, os *mocks.OrganizationService) {
				os.EXPECT().Get(mock.Anything, testOrgID).Return(organization.Organization{}, organization.ErrNotExist)
			},
			request: connect.NewRequest(&frontierv1beta1.UpdateGroupRequest{
				Id:    someGroupID,
				OrgId: testOrgID,
				Body: &frontierv1beta1.GroupRequestBody{
					Name: "new-group",
				},
			}),
			want:        nil,
			wantErr:     true,
			wantErrCode: connect.CodeNotFound,
			wantErrMsg:  ErrOrgNotFound,
		},
		{
			name: "should return org is disabled",
			setup: func(gs *mocks.GroupService, ms *mocks.MetaSchemaService, os *mocks.OrganizationService) {
				os.EXPECT().Get(mock.Anything, testOrgID).Return(organization.Organization{}, organization.ErrDisabled)
			},
			request: connect.NewRequest(&frontierv1beta1.UpdateGroupRequest{
				Id:    someGroupID,
				OrgId: testOrgID,
				Body: &frontierv1beta1.GroupRequestBody{
					Name: "new-group",
				},
			}),
			want:


:
    VkDebugReportCallbackEXT m_debugReportCallbackEXT;
  };
  static_assert( sizeof( DebugReportCallbackEXT ) == sizeof( VkDebugReportCallbackEXT ), "handle and wrapper have different size!" );

  template <>
  struct cpp_type<ObjectType::eDebugReportCallbackEXT>
  {
    using type = DebugReportCallbackEXT;
  };

  class DebugUtilsMessengerEXT
  {
  public:
    using CType = VkDebugUtilsMessengerEXT;

    static VULKAN_HPP_CONST_OR_CONSTEXPR ObjectType objectType = ObjectType::eDebugUtilsMessengerEXT;

  public:
    VULKAN_HPP_CONSTEXPR DebugUtilsMessengerEXT() VULKAN_HPP_NOEXCEPT
      : m_debugUtilsMessengerEXT(VK_NULL_HANDLE)
    {}

    VULKAN_HPP_CONSTEXPR DebugUtilsMessengerEXT( std::nullptr_t ) VULKAN_HPP_NOEXCEPT
      : m_debugUtilsMessengerEXT(VK_NULL_HANDLE)
    {}

    VULKAN_HPP_TYPESAFE_EXPLICIT DebugUtilsMessengerEXT( VkDebugUtilsMessengerEXT debugUtilsMessengerEXT ) VULKAN_HPP_NOEXCEPT
      : m_debugUtilsMessengerEXT( debugUtilsMessengerEXT )
    {}

#if defined(VULKAN_HPP_TYPESAFE_CONVERSION)
    DebugUtilsMessengerEXT & operator=(VkDebugUtilsMessengerEXT debugUtilsMessengerEXT) VULKAN_HPP_NOEXCEPT
    {
      m_debugUtilsMessengerEXT = debugUtilsMessengerEXT;
      return *this;
    }
#endif

    DebugUtilsMessengerEXT & operator=( std::nullptr_t ) VULKAN_HPP_NOEXCEPT
    {
      m_debugUtilsMessengerEXT = VK_NULL_HANDLE;
      return *this;
    }

    bool operator==( DebugUtilsMessengerEXT const & rhs ) const VULKAN_HPP_NOEXCEPT
    {
      return m_debugUtilsMessengerEXT == rhs.m_debugUtilsMessengerEXT;
    }

    bool operator!=(DebugUtilsMessengerEXT const & rhs ) const VULKAN_HPP_NOEXCEPT
    {
      return m_debugUtilsMessengerEXT != rhs.m_debugUtilsMessengerEXT;
    }

    bool operator<(DebugUtilsMessengerEXT const & rhs ) const VULKAN_HPP_NOEXCEPT
    {
      return m_debugUtilsMessengerEXT < rhs.m_debugUtilsMessengerEXT;
    }

    VULKAN_HPP_TYPESAFE_EXPLICIT operator VkDebugUtilsMessengerEXT() const VULKAN_HPP_NOEXCEPT
    {
      return m_debugUtilsMessengerEXT;
    }

    explicit operator bool() const VULKAN_HPP_NOEXCEPT
    {
      return m_debugUtilsMessengerEXT != VK_NULL_HANDLE;
    }

    bool operator!() const VULKAN_HPP_NOEXCEPT
    {
      return m_debugUtilsMessengerEXT == VK_NULL_HANDLE;
    }

  private:
    VkDebugUtilsMessengerEXT m_debugUtilsMessengerEXT;
  };
  static_assert( sizeof( DebugUtilsMessengerEXT ) == sizeof( VkDebugUtilsMessengerEXT ), "handle and wrapper have different size!" );

  template <>
  struct cpp_type<ObjectType::eDebugUtilsMessengerEXT>
  {
    using type = DebugUtilsMessengerEXT;
  };

  class DisplayKHR
  {
  public:
    using CType = VkDisplayKHR;

    static VULKAN_HPP_CONST_OR_CONSTEXPR ObjectType objectType = ObjectType::eDisplayKHR;

  public:
    VULKAN_HPP_CONST


}
    },
    LAYERED_STYLE("LayeredStyle") {
        override fun explain(): String {
            return """LayeredStyle is a defined for layered architecture.""".trimIndent()
        }
    };

    abstract fun explain(): String
}

enum class DynamicContext(val value: String) {
    REST_API_SPECIFICATION("ApiSpecification") {
        override fun explain(): String {
            return """ApiSpecification is a specification of a REST API.""".trimIndent()
        }
    },
    FOUNDATION_SPECIFICATION("FoundationSpecification") {
        override fun explain(): String {
            return """FoundationSpecification is a specification of layered architecture, naming style, package naming, class naming.""".trimIndent()
        }
    },
    DOMAIN_SPECIFICATION("DomainSpecification") {
        override fun explain(): String {
            return """DomainSpecification is a specification of a domain model element.""".trimIndent()
        }
    },
    PACKAGE_INFO("PackageInfo") {
        override fun explain(): String {
            return """PackageInfo is a define for ALL package info.""".trimIndent()
        }
    },
    PROJECT_DEPENDENCY("ProjectDependency") {
        override fun explain(): String {
            return """ProjectDependency include all used defines""".trimIndent()
        }
    },
    README("README") {
        override fun explain(): String {
            return """README file contain project introduction.""".trimIndent()
        }
    },
    DOMAIN_MODEL("DomainModel") {
        override fun explain(): String {
            return """DomainModel is a define for domain element.""".trimIndent()
        }
    }
    ;

    abstract fun explain(): String

    companion object {
        private fun from(value: String): DynamicContext? {
            return values().find { it.value == value }
        }

        fun build(values: List<String>, workspace: ComateContext): List<String> =
            values.mapNotNull(Companion::from).map {
                when (it) {
                    REST_API_SPECIFICATION -> RestApiSpec().default().toString()
                    FOUNDATION_SPECIFICATION -> FoundationSpec().default().toString()
                    DOMAIN_SPECIFICATION -> DomainSpec().default().toString()

                    DOMAIN_MODEL -> DomainModelFactory.generate("mvc", workspace.fetchDs())
                    PACKAGE_INFO -> CodeDataStruct.packageInString(workspace.fetchDs())
                    README -> ReadmeParser.introduction(workspace.workdir)
                    PROJECT_DEPENDENCY -> workspace.fetchProjectDependencies().joinToString("\n")
                }
            }

        /**
         * With this method, you can get all the explanations of the context.
         */
        fun explains(): HashMap<String, String> {
            val map = HashMap<String, String>()
            values().forEach {
                map[it.value] = it.explain()
            }

            return map
        }
    }
}package org.archguard.comate.action

import org.archguard.comate.command.ComateContext
import org.archguard.comate.strategy.BasicPromptStrategy
import org.junit.jupiter.api.Assertions.*
import org.junit.jupiter.api.Test
import java.nio.file.Path

class DesignSystemPrompterTest {
    @Test
    fun should_generate_correct_prompt_test() {
        val comateContext =
            ComateContext(Path.of("."), "kotlin", null, extArgs = mutableMapOf("actionInput" to "咖啡外卖"))
        val prompter = DesignSystemPrompter(comateContext, BasicPromptStrategy())
        val output = prompter.execute()
        assertEquals(
            output,
            """You're an Architecture,根据详细分析如下的需求信息，设计完整的端到端需求用例。Here is requirements: 1. 请按如下的 DSL 格式返回，不做解释。

需求信息 如下:

###
咖啡外卖
###

DSL 格式如下:
```kotlin
caseflow("MovieTick


}</email>ਵਾਲੇ ਰੈਫਰਲ ਲਈ ਦਾਅਵਾ ਕੀਤਾ ਜਾ ਰਿਹਾ ਹੈ। <link>ਤੁਸੀਂ ਨਹੀਂ ਹੋ?</link>","ReferralInvite.daysOfBenefit":"{referralTrialDurationDays, plural, one {# ਮੁਫ਼ਤ ਦਿਨ} other {# ਮੁਫ਼ਤ ਦਿਨ}}","ReferralInvite.daysOfService":"{referralTrialDurationDays, plural, one {# ਦਿਨ} other {# ਦਿਨ}}","ReferralInvite.dollarValue":"(ਇੱਕ {offerDollarValue} ਵੈਲਯੂ)","ReferralInvite.errorDescription":"ਤੁਹਾਨੂੰ ਰੀਡਾਇਰੈਕਟ ਕੀਤਾ ਜਾਵੇਗਾ, ਜਾਂ <link>ਇੱਥੇ ਕਲਿੱਕ ਕਰੋ।</link>","ReferralInvite.errorHeader":"ਸੱਦੇ ਵਿੱਚ ਤਰੁੱਟੀ","ReferralInvite.loadingDescription":"ਤੁਹਾਡਾ ਪੰਨਾ ਲੋਡ ਹੋ ਜਾਵੇਗਾ, ਜਾਂ <link>ਇੱਥੇ ਕਲਿੱਕ ਕਰਕੇ ਹੋਮ ’ਤੇ ਜਾਉ।</link>","ReferralInvite.loadingHeader":"ਸੱਦਾ ਲੋਡ ਹੋ ਰਿਹਾ ਹੈ","ReferralInvite.monthsOfBenefit":"{referralTrialDurationMonths, plural, one {ਮੁਫ਼ਤ ਮਹੀਨਾ} other {# ਮੁਫ਼ਤ ਮਹੀਨੇ}}","ReferralInvite.monthsOfService":"{referralTrialDurationMonths, plural, one {# ਮਹੀਨਾ} other {# ਮਹੀਨੇ}}","ReferralInvite.referralCodeContent":"ਰੈਫਰਲ ਕੋਡ: {codeToken}","ReferralInvite.signUpCtaBack":"ਪਿੱਛੇ ਜਾਓ","ReferralInvite.signUpCtaProceed":"ਅੱਗੇ ਵਧੋ","ReferralInvite.signUpExplainDescription":"ਇੱਕ ਵਾਰ ਜਦੋਂ ਤੁਸੀਂ ਸਾਈਨ ਅੱਪ ਕਰਨਾ ਪੂਰਾ ਕਰ ਲੈਂਦੇ ਹੋ, ਤਾਂ ਆਪਣੇ ਸੱਦੇ ਲਈ ਦਾਅਵਾ ਕਰਨ ਲਈ ਇਸ ਪੰਨੇ \'ਤੇ ਵਾਪਸ ਜਾਉ।","ReferralInvite.sign


ite;
  border-color: white;
  color: #0a0a0a;
}

.hero.is-black.is-bold {
  background-image: linear-gradient(141deg, black 0%, #0a0a0a 71%, #181616 100%);
}

@media screen and (max-width: 768px) {
  .hero.is-black.is-bold .navbar-menu {
    background-image: linear-gradient(141deg, black 0%, #0a0a0a 71%, #181616 100%);
  }
}

.hero.is-light {
  background-color: whitesmoke;
  color: #363636;
}

.hero.is-light a:not(.button),
.hero.is-light strong {
  color: inherit;
}

.hero.is-light .title {
  color: #363636;
}

.hero.is-light .subtitle {
  color: rgba(54, 54, 54, 0.9);
}

.hero.is-light .subtitle a:not(.button),
.hero.is-light .subtitle strong {
  color: #363636;
}

@media screen and (max-width: 1023px) {
  .hero.is-light .navbar-menu {
    background-color: whitesmoke;
  }
}

.hero.is-light .navbar-item,
.hero.is-light .navbar-link {
  color: rgba(54, 54, 54, 0.7);
}

.hero.is-light a.navbar-item:hover, .hero.is-light a.navbar-item.is-active,
.hero.is-light .navbar-link:hover,
.hero.is-light .navbar-link.is-active {
  background-color: #e8e8e8;
  color: #363636;
}

.hero.is-light .tabs a {
  color: #363636;
  opacity: 0.9;
}

.hero.is-light .tabs a:hover {
  opacity: 1;
}

.hero.is-light .tabs li.is-active a {
  opacity: 1;
}

.hero.is-light .tabs.is-boxed a, .hero.is-light .tabs.is-toggle a {
  color: #363636;
}

.hero.is-light .tabs.is-boxed a:hover, .hero.is-light .tabs.is-toggle a:hover {
  background-color: rgba(10, 10, 10, 0.1);
}

.hero.is-light .tabs.is-boxed li.is-active a, .hero.is-light .tabs.is-boxed li.is-active a:hover, .hero.is-light .tabs.is-toggle li.is-active a, .hero.is-light .tabs.is-toggle li.is-active a:hover {
  background-color: #363636;
  border-color: #363636;
  color: whitesmoke;
}

.hero.is-light.is-bold {
  background-image: linear-gradient(141deg, #dfd8d9 0%, whitesmoke 71%, white 100%);
}

@media screen and (max-width: 768px) {
  .hero.is-light.is-bold .navbar-menu {
    background-image: linear-gradient(141deg, #dfd8d9 0%, whitesmoke 71%, white 100%);
  }
}

.hero.is-dark {
  background-color: #363636;
  color: whitesmoke;
}

.hero.is-dark a:not(.button),
.hero.is-dark strong {
  color: inherit;
}

.hero.is-dark .title {
  color: whitesmoke;
}

.hero.is-dark .subtitle {
  color: rgba(245, 245, 245, 0.9);
}

.hero.is-dark .subtitle a:


t LookupEntityWithoutTransaction();
await LookupEntityWithTransaction();

async Task InsertEntity()
{
    Console.WriteLine("Inserting entity");
    string guid = Guid.NewGuid().ToString();
    var entity = new Entity
    {
        Key = entityKey,
        Properties =
        {
            ["guid"] = guid,
        }
    };
    await datastore.InsertAsync(entity);
    Console.WriteLine($"Inserted entity with guid '{guid}'");
}

async Task LookupEntityWithoutTransaction()
{
    Console.WriteLine("Looking up entity without a transaction");
    var entity = await datastore.LookupAsync(entityKey);
    Console.WriteLine(entity is null
        ? "Entity lookup returned null"
        : $"Entity lookup returned entity with guid '{entity["guid"].StringValue}'");
}

async Task LookupEntityWithTransaction()
{
    Console.WriteLine("Looking up entity with a transaction");
    using var transaction = await datastore.BeginTransactionAsync();
    var entity = await transaction.LookupAsync(entityKey);
    Console.WriteLine(entity is null
        ? "Entity lookup returned null"
        : $"Entity lookup returned entity with guid '{entity["guid"].StringValue}'");
}


(  360deg); }
      100% { transform: rotate(  360deg); }
    }

    .generate-slide-loop(@i + 1);
  }

  .generate-slide-loop(1);
}
/* https://tailwindcss.com/docs/theme#default-theme-variable-reference */
/* prettier-ignore */
@theme inline static {
  /* Typography */
  --font-sans: ui-sans-serif, system-ui, 'Helvetica Neue', Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
  --font-serif: ui-serif, Georgia, Cambria, 'Times New Roman', Times, serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

  /* Colors */
  --color-fg: oklch(clamp(0%, calc(var(--fg-l) + var(--lch-l-offset)), 100%) var(--primary-c) var(--primary-h));
  --color-bg: oklch(clamp(0%, calc(var(--bg-l) + var(--lch-l-offset)), 100%) var(--primary-c) var(--primary-h));
  --color-ac: oklch(clamp(0%, calc(var(--ac-l) + var(--lch-l-offset)), 100%) var(--secondary-c) var(--secondary-h));
  --color-hl: oklch(clamp(0%, calc(var(--hl-l) + var(--lch-l-offset)), 100%) var(--primary-c) var(--primary-h));
  --color-black: oklch(calc(0% + var(--lch-l-offset)) 0 0);
  --color-white: oklch(calc(100% + var(--lch-l-offset)) 0 0);

  --color-gray-50: oklch(clamp(var(--lch-l-clamp-min), calc(99% + var(--lch-l-offset)), var(--lch-l-clamp-max)) 0.02 var(--hue-gray));
  --color-gray-100: oklch(clamp(var(--lch-l-clamp-min), calc(97% + var(--lch-l-offset)), var(--lch-l-clamp-max)) 0.02 var(--hue-gray));
  --color-gray-200: oklch(clamp(var(--lch-l-clamp-min), calc(95% + var(--lch-l-offset)), var(--lch-l-clamp-max)) 0.02 var(--hue-gray));
  --color-gray-300: oklch(clamp(var(--lch-l-clamp-min), calc(90% + var(--lch-l-offset)), var(--lch-l-clamp-max)) 0.02 var(--hue-gray));
  --color-gray-400: oklch(clamp(var(--lch-l-clamp-min), calc(85% + var(--lch-l-offset)), var(--lch-l-clamp-max)) 0.02 var(--hue-gray));
  --color-gray-500: oklch(clamp(var(--lch-l-clamp-min), calc(75% + var(--lch-l-offset)), var(--lch-l-clamp-max)) 0.02 var(--hue-gray));
  --color-gray-600: oklch(clamp(var(--lch-l-clamp-min), calc(65% + var(--lch-l-offset)), var(--lch-l-clamp-max)) 0.02 var(--hue-gray));
  --color-gray-700: oklch(cla


fast approximate Firth correction was used in regenie as well as a SPA correction.

As seen in the Manhattan plots below (note that the scaling of the y-axis changes above the upper dashed line),
all four approaches show very good agreement for the most balanced trait (CAD; case-control ratio=1:11),
but as the fraction of cases decreases BOLT-LMM tends to give inflated test statistics.
However both regenie with Firth and SPA corrections, as well as SAIGE, which uses SPA correction,
are all robust to this inflation and show similar agreement for the associations detected.

We assessed the computational requirements of regenie and SAIGE using a larger set of 50
binary traits from the UK Biobank that have a range of different case-control ratios and distinct missing data patterns.
469,336 LD-pruned SNPs were used as model SNPs when fitting the null model (step 1)
and tests were performed on 11.4M imputed SNPs (step 2).
In step 1, regenie was run using LOOCV and for two traits SAIGE did not finish as it took longer than the 4-week limit.
In step 2, the approximate Firth correction was used in regenie in addition to SPA correction.

From the table above, Step 1 of regenie was about 350x faster and required only $40\%$ of the memory used by SAIGE.
In Step 2, regenie Firth and SPA were 2x and 3x faster than SAIGE in CPU time, respectively, but were 21x and 34x
faster than SAIGE in elapsed time, respectively, which suggests that regenie makes better use of parallelization in this step.
Overall, regenie using Firth correction was 8x faster than SAIGE in CPU hours
and 26.8x faster in elapsed time.

All runs above were done on the same computing environment (16 virtual CPU cores of
a 2.1GHz AMD EPYC 7571 processor, 64GB of memory, and 600GB solid-state disk).

Timings improvements in v2.2

We have several changes in regenie v2.2 to improve the computational efficiency:

The genotype file reading in Step 1 is now multi-threaded for all supported formats (i.e. BED, PGEN, and BGEN) and uses a faster file reading implementation for BGEN v1.2 format with 8-bit encoding. From our timings experiments below, these changes helped reduce the CPU time by 40-60% depending on the input format.

Note that we used a small number of SNPs for Step 1 in our experiments (20K) so the timing improvement will not be as high in a real Step 1 run where ~500K SNPs would be used.

We have improved the implementation of the score tests for binary traits to reduce the number of matrix operations performed and this reduced the CPU timings by ~60% from the previous version 2.0.2.

Note that there is an added memory cost of ~8NKP bytes [N=#


ay throw [UnsupportedCommandException].
  ///
  /// Parameter [layerPartBlob] :
  /// The base64-encoded layer part payload.
  ///
  /// Parameter [partFirstByte] :
  /// The position of the first byte of the layer part witin the overall image
  /// layer.
  ///
  /// Parameter [partLastByte] :
  /// The position of the last byte of the layer part within the overall image
  /// layer.
  ///
  /// Parameter [repositoryName] :
  /// The name of the repository that you're uploading layer parts to.
  ///
  /// Parameter [uploadId] :
  /// The upload ID from a previous InitiateLayerUpload operation to
  /// associate with the layer part upload.
  ///
  /// Parameter [registryId] :
  /// The Amazon Web Services account ID, or registry alias, that's associated
  /// with the registry that you're uploading layer parts to. If you do not
  /// specify a registry, the default public registry is assumed.
  Future<UploadLayerPartResponse> uploadLayerPart({
    required Uint8List layerPartBlob,
    required int partFirstByte,
    required int partLastByte,
    required String repositoryName,
    required String uploadId,
    String? registryId,
  }) async {
    _s.validateNumRange(
      'partFirstByte',
      partFirstByte,
      0,
      1152921504606846976,
      isRequired: true,
    );
    _s.validateNumRange(
      'partLastByte',
      partLastByte,
      0,
      1152921504606846976,
      isRequired: true,
    );
    final headers = <String, String>{
      'Content-Type': 'application/x-amz-json-1.1',
      'X-Amz-Target': 'SpencerFrontendService.UploadLayerPart'
    };
    final jsonResponse = await _protocol.send(
      method: 'POST',
      requestUri: '/',
      exceptionFnMap: _exceptionFns,
      // TODO queryParams
      headers: headers,
      payload: {
        'layerPartBlob': base64Encode(layerPartBlob),
        'partFirstByte': partFirstByte,
        'partLastByte': partLastByte,
        'repositoryName': repositoryName,
        'uploadId': uploadId,
        if (registryId != null) 'registryId': registryId,
      },
    );

    return UploadLayerPartResponse.fromJson(jsonResponse.body);
  }
}

/// An authorization token data object that corresponds to a public registry.
class AuthorizationData {
  /// A base64-encoded string that contains authorization data for a public Amazon
  /// ECR registry. When the string is decoded, it's presented in the format
  /// user:password for public registry authentication using
  /// docker login.
  final String? authorizationToken;

  /// The Unix time in seconds and milliseconds when the authorization token
  /// expires. Authorization tokens are valid for 12 hours.
  final DateTime? expiresAt;

  AuthorizationData({
    this.authorizationToken,
    this.expiresAt,
  });

  factory AuthorizationData.fromJson(Map<String, dynamic> json) {
    return AuthorizationData(
      authorizationToken: json['authorizationToken'] as String?,
      expiresAt: timeStampFromJson(json['expiresAt']),
    );
  }

  Map<String, dynamic> toJson() {
    final authorizationToken = this.authorizationToken;
    final expiresAt = this.expiresAt;
    return {
      if (authorizationToken != null) 'authorizationToken': authorizationToken,
      if (expiresAt != null) 'expiresAt': unixTimestampToJson(expiresAt),
    };
  }
}

class BatchCheckLayerAvailabilityResponse {
  /// Any failures associated with the call.
  final List<LayerFailure>? failures;

  /// A list of image layer objects that correspond to the image layer references
  /// in the request.
  final List<Layer>? layers;

  BatchCheckLayerAvailabilityResponse({
    this.failures,
    this.layers,


vc.ListSecurityGroup)
	h.Add("ListSecurityGroupExt", http.MethodPost, "/vendors/{vendor}/security_groups/list", svc.ListSecurityGroupExt)
	h.Add("BatchDeleteSecurityGroup", http.MethodDelete, "/security_groups/batch", svc.BatchDeleteSecurityGroup)
	h.Add("BatchUpdateSecurityGroupCommonInfo", http.MethodPatch, "/security_groups/common/info/batch/update",
		svc.BatchUpdateSecurityGroupCommonInfo)
	h.Add("BatchUpdateSecurityGroupMgmtAttr", http.MethodPatch, "/security_groups/mgmt_attrs/batch/update",
		svc.BatchUpdateSecurityGroupMgmtAttr)

	h.Add("CountSecurityGroupRules", http.MethodPost, "/vendors/{vendor}/security_groups/rules/count",
		svc.CountSecurityGroupRules)

	h.Load(cap.WebService)
}

type securityGroupSvc struct {
	dao dao.Set
}

// BatchCreateSecurityGroup create security group.
func (svc *securityGroupSvc) BatchCreateSecurityGroup(cts *rest.Contexts) (interface{}, error) {
	vendor := enumor.Vendor(cts.PathParameter("vendor").String())
	if err := vendor.Validate(); err != nil {
		return nil, errf.NewFromErr(errf.InvalidParameter, err)
	}

	switch vendor {
	case enumor.TCloud:
		return batchCreateSecurityGroup[corecloud.TCloudSecurityGroupExtension](vendor, svc, cts)
	case enumor.Aws:
		return batchCreateSecurityGroup[corecloud.AwsSecurityGroupExtension](vendor, svc, cts)
	case enumor.HuaWei:
		return batchCreateSecurityGroup[corecloud.HuaWeiSecurityGroupExtension](vendor, svc, cts)
	case enumor.Azure:
		return batchCreateSecurityGroup[corecloud.AzureSecurityGroupExtension](vendor, svc, cts)
	default:
		return nil, fmt.Errorf("unsupport %s vendor for now", vendor)
	}
}

// BatchUpdateSecurityGroup update security group.
func (svc *securityGroupSvc) BatchUpdateSecurityGroup(cts *rest.Contexts) (interface{}, error) {
	vendor := enumor.Vendor(cts.PathParameter("vendor").String())
	if err := vendor.Validate(); err != nil {
		return nil, errf.NewFromErr(errf.InvalidParameter, err)
	}

	switch vendor {
	case enumor.TCloud:
		return batchUpdateSecurityGroup[corecloud.TCloudSecurityGroupExtension](cts, svc)
	case enumor.Aws:
		return batchUpdateSecurityGroup[corecloud.AwsSecurityGroupExtension](cts, svc)
	case enumor.HuaWei:
		return batchUpdateSecurityGroup[corecloud.HuaWeiSecurityGroupExtension](cts, svc)
	case enumor.Azure:
		return batchUpdateSecurityGroup[corecloud.AzureSecurityGroupExtension](cts, svc)
	default:
		return nil, fmt.Errorf("unsupport %s vendor for now", vendor)
	}
}

// BatchDeleteSecurityGroup delete security group.
func (svc *securityGroupSvc) BatchDeleteSecurityGroup(cts *rest.Contexts) (interface{}, error) {
	req := new(protocloud.SecurityGroupBatchDeleteReq)
	if err := cts.DecodeInto(req); err != nil {
		return nil, err
	}

	if err := req.Validate(); err != nil {
		return nil, errf.NewFromErr(errf.InvalidParameter, err)
	}

	opt := &types.ListOption{
		Fields: []string{"id", "vendor"},
		Filter: req.Filter,
		Page:   core.NewDefaultBasePage


PROC(KBacktraceIterator_init_current)

/* Loop forever on a nap during SMP boot. */
STD_ENTRY(smp_nap)
	nap
	nop       /* avoid provoking the icache prefetch with a jump */
	j smp_nap /* we are not architecturally guaranteed not to exit nap */
	jrp lr    /* clue in the backtracer */
	STD_ENDPROC(smp_nap)

/*
 * Enable interrupts racelessly and then nap until interrupted.
 * Architecturally, we are guaranteed that enabling interrupts via
 * mtspr to INTERRUPT_CRITICAL_SECTION only interrupts at the next PC.
 * This function's _cpu_idle_nap address is special; see intvec.S.
 * When interrupted at _cpu_idle_nap, we bump the PC forward 8, and
 * as a result return to the function that called _cpu_idle().
 */
STD_ENTRY_SECTION(_cpu_idle, .cpuidle.text)
	movei r1, 1
	IRQ_ENABLE_LOAD(r2, r3)
	mtspr INTERRUPT_CRITICAL_SECTION, r1
	IRQ_ENABLE_APPLY(r2, r3)       /* unmask, but still with ICS set */
	mtspr INTERRUPT_CRITICAL_SECTION, zero
	.global _cpu_idle_nap
_cpu_idle_nap:
	nap
	nop       /* avoid provoking the icache prefetch with a jump */
	jrp lr
	STD_ENDPROC(_cpu_idle)


lerina.runtime.api.types.semtype.SubType;

import java.util.Objects;

import static io.ballerina.runtime.api.types.semtype.Bdd.bddEveryPositive;

/**
 * Runtime representation of a subtype of error type.
 *
 * @since 2201.12.0
 */
public class BErrorSubType extends SubType implements DelegatedSubType {

    public final Bdd inner;

    private BErrorSubType(Bdd inner) {
        super(inner.isAll(), inner.isNothing());
        this.inner = inner;
    }

    public static BErrorSubType createDelegate(SubType inner) {
        if (inner instanceof Bdd bdd) {
            return new BErrorSubType(bdd);
        } else if (inner.isAll() || inner.isNothing()) {
            throw new IllegalStateException("unimplemented");
        } else if (inner instanceof BErrorSubType bError) {
            return new BErrorSubType(bError.inner);
        }
        throw new IllegalArgumentException("Unexpected inner type");
    }

    @Override
    public SubType union(SubType other) {
        if (!(other instanceof BErrorSubType otherError)) {
            throw new IllegalArgumentException("union of different subtypes");
        }
        return createDelegate(inner.union(otherError.inner));
    }

    @Override
    public SubType intersect(SubType other) {
        if (!(other instanceof BErrorSubType otherError)) {
            throw new IllegalArgumentException("intersect of different subtypes");
        }
        return createDelegate(inner.intersect(otherError.inner));
    }

    @Override
    public SubType complement() {
        return createDelegate(Builder.getBddSubtypeRo().diff(inner));
    }

    @Override
    public boolean isEmpty(Context cx) {
        Bdd b = inner;
        // The goal of this is to ensure that mappingFormulaIsEmpty call in errorBddIsEmpty beneath
        // does not get an empty posList, because it will interpret that
        // as `map<any|error>` rather than `readonly & map<readonly>`.
        b = b.posMaybeEmpty() ? (Bdd) b.intersect(Builder.getBddSubtypeRo()) : b;
        return cx.memoSubtypeIsEmpty(cx.mappingMemo, BErrorSubType::errorBddIsEmpty, b);
    }

    private static boolean errorBddIsEmpty(Context cx, Bdd b) {
        return bddEveryPositive(cx, b, null, null, BMappingSubType::mappingFormulaIsEmpty);
    }

    @Override
    public SubTypeData data() {
        return inner();
    }

    @Override
    public Bdd inner() {
        return inner;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (!(o instanceof BErrorSubType that)) {
            return false;
        }
        return Objects.equals(inner, that.inner);
    }

    @Override
    public int hashCode() {
        return Objects.hashCode(inner);
    }

}
/*
 *  Copyright (c) 2025, WSO2 LLC. (http://www.wso2.com).
 *
 *  WSO2 LLC. licenses this file to you 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 io.ballerina.runtime.internal.types.semtype;

import io.ballerina.runtime.api.types.semtype.SubType;

/**
 * Represents the corresponding subtype pairs of two semtypes.


D3C  39 61 00 20 */	addi r11, r1, 0x20
/* 80428800 00423D40  48 0E ED 31 */	bl _savegpr_27
/* 80428804 00423D44  7C 7B 1B 78 */	mr r27, r3
/* 80428808 00423D48  80 63 00 58 */	lwz r3, 0x58(r3)
/* 8042880C 00423D4C  48 00 45 21 */	bl func_8042CD2C
/* 80428810 00423D50  80 6D DC 48 */	lwz r3, lbl_806A28E8-_SDA_BASE_(r13)
/* 80428814 00423D54  3B 80 00 00 */	li r28, 0
/* 80428818 00423D58  3B E0 00 00 */	li r31, 0
/* 8042881C 00423D5C  3B C0 00 00 */	li r30, 0
/* 80428820 00423D60  83 A3 00 08 */	lwz r29, 8(r3)
lbl_80428824:
/* 80428824 00423D64  7C 7B F2 14 */	add r3, r27, r30
/* 80428828 00423D68  80 63 00 38 */	lwz r3, 0x38(r3)
/* 8042882C 00423D6C  2C 03 00 00 */	cmpwi r3, 0
/* 80428830 00423D70  41 82 00 1C */	beq lbl_8042884C
/* 80428834 00423D74  7C 9B FA 14 */	add r4, r27, r31
/* 80428838 00423D78  88 04 00 0A */	lbz r0, 0xa(r4)
/* 8042883C 00423D7C  28 00 00 3C */	cmplwi r0, 0x3c
/* 80428840 00423D80  41 82 00 0C */	beq lbl_8042884C
/* 80428844 00423D84  7F 84 E3 78 */	mr r4, r28
/* 80428848 00423D88  48 00 5E 65 */	bl func_8042E6AC
lbl_8042884C:
/* 8042884C 00423D8C  3B 9C 00 01 */	addi r28, r28, 1
/* 80428850 00423D90  3B DE 00 04 */	addi r30, r30, 4
/* 80428854 00423D94  28 1C 00 08 */	cmplwi r28, 8
/* 80428858 00423D98  3B FF 00 06 */	addi r31, r31, 6
/* 8042885C 00423D9C  41 80 FF C8 */	blt lbl_80428824
/* 80428860 00423DA0  80 8D DC 48 */	lwz r4, lbl_806A28E8-_SDA_BASE_(r13)
/* 80428864 00423DA4  7F A3 EB 78 */	mr r3, r29
/* 80428868 00423DA8  80 04 00 08 */	lwz r0, 8(r4)
/* 8042886C 00423DAC  7C 9D 00 50 */	subf r4, r29, r0
/* 80428870 00423DB0  48 07 A6 E1 */	bl func_804A2F50
/* 80428874 00423DB4  39 61 00 20 */	addi r11, r1, 0x20
/* 80428878 00423DB8  48 0E ED 05 */	bl func_8051757C
/* 8042887C 00423DBC  80 01 00 24 */	lwz r0, 0x24(r1)
/* 80428880 00423DC0  7C 08


aflow123456");
        config.setGateway("http://127.0.0.1:8888");
        config.setTaskToken("qwertyuiopasdfghjklzxcvbnm");
        config.setStartupNotifyUrl("http://127.0.0.1:8888/api/tasks/123455/operations");
        config.setInstanceName("test-instance");
        config.setCatalogType("console");
        config.setStateArgs(buildStateArgs());
        config.setMetricArgs(buildMetricArgs());
        return config;
    }

    private static StateArgsClass buildStateArgs() {
        StateArgsClass stateArgs = new StateArgsClass();
        stateArgs.setRuntimeMetaArgs(new RuntimeMetaArgsClass(
            new GeaflowPluginConfig(GeaflowPluginCategory.RUNTIME_META, buildJdbcPluginConfig())));
        stateArgs.setHaMetaArgs(
            new HaMetaArgsClass(new GeaflowPluginConfig(GeaflowPluginCategory.HA_META, buildRedisPluginConfig())));
        stateArgs.setPersistentArgs(
            new PersistentArgsClass(new GeaflowPluginConfig(GeaflowPluginCategory.DATA, buildDfsPluginConfig())));
        return stateArgs;
    }

    private static MetricArgsClass buildMetricArgs() {
        return new MetricArgsClass(new GeaflowPluginConfig(GeaflowPluginCategory.METRIC, buildInfluxPluginConfig()));
    }

    private static K8SClusterArgsClass buildClusterArgs() {
        K8SClusterArgsClass config = new K8SClusterArgsClass();
        config.setTaskClusterConfig(buildClusterConfig());
        config.setClusterConfig(buildK8sPluginConfig());
        config.setEngineJarUrls("http://127.0.0.1/geaflow/files/versions/0.1/geaflow.jar");
        config.setTaskJarUrls("http://127.0.0.1/geaflow/files/users/123456/udf.jar");
        return config;
    }

    private static JobArgsClass buildJobArgs() {
        JobArgsClass config = new JobArgsClass();
        config.setSystemStateType(GeaflowPluginType.ROCKSDB);
        config.setJobConfig(buildJobConfig());
        return config;
    }

    private static K8sPluginConfigClass buildK8sPluginConfig() {
        K8sPluginConfigClass config = new K8sPluginConfigClass();
        config.setMasterUrl("https://0.0.0.0:6443");
        config.setImageUrl("tugraph/geaflow:0.1");
        config.setServiceAccount("geaflow");
        config.setServiceType("NODE_PORT");
        config.setNamespace("default");
        config.setCertData("xxx");
        config.setCertKey("yyy");
        config.setCaData("zzz");
        config.setRetryTimes(100);
        config.setClusterName("aaa");
        config.setPodUserLabels("bbb");
        config.setServiceSuffix("ccc");
        config.setStorageLimit("50Gi");
        return config;
    }

    private static JdbcPluginConfigClass buildJdbcPluginConfig() {
        JdbcPluginConfigClass config = new JdbcPluginConfigClass();
        config.setDriverClass("com.mysql.jdbc.Driver");
        config.setUrl("jdbc:mysql://127..0.0.1:3306/geaflow");
        config.setUsername("geaflow");
        config.setPassword("geaflow");
        config.setRetryTimes(3);
        config.setConnectionPoolSize(10);
        config.setConfigJson("{}");
        return config;
    }

    private static RedisPluginConfigClass buildRedisPluginConfig() {
        RedisPluginConfigClass config = new RedisPluginConfigClass();
        config.setHost("127.0.0.1");
        config.setPort(6379);
        config.setRetryTimes(10);
        return config;
    }

    private static PluginConfigClass buildInfluxPluginConfig() {
        InfluxdbPluginConfigClass config = new InfluxdbPluginCo


 CreatureAI* GetAI(Creature* creature) const
    {
        return new alliance_riflemanAI(creature);
    }

    struct alliance_riflemanAI : public Scripted_NoMovementAI
    {
        alliance_riflemanAI(Creature* c) : Scripted_NoMovementAI(c)
        {
            Reset();
        }

        uint32 ExplodeTimer;

        void JustDied(Unit* /*who*/)
        {
        }

        void Reset()
        {
            ExplodeTimer = 5000+rand()%5000;
        }

        void MoveInLineOfSight(Unit* who)
        {
            if (!who || me->getVictim())
                return;

            if (me->IsValidAttackTarget(who))
            {
                //float attackRadius = me->GetAttackDistance(who);
                if (me->IsWithinDistInMap(who, 30))
                    AttackStart(who);
            }
        }

        void EnterCombat(Unit* /*who*/)
        {
        }

        void UpdateAI(const uint32 diff)
        {
            //Check if we have a target
            if (!UpdateVictim())
                return;
            if (ExplodeTimer <= diff)
            {
                if (!me->IsWithinDistInMap(me->getVictim(), 30))
                {
                    EnterEvadeMode();
                    return;
                }
                int dmg = 500+rand()%700;
                me->CastCustomSpell(me->getVictim(), SPELL_EXPLODING_SHOT, &dmg, 0, 0, false);
                ExplodeTimer = 5000+rand()%5000;
            } else ExplodeTimer -= diff;
            DoMeleeAttackIfReady();
        }
    };
};

void AddSC_hyjal_trash()
{
    new mob_giant_infernal();
    new mob_abomination();
    new mob_ghoul();
    new mob_necromancer();
    new mob_banshee();
    new mob_crypt_fiend();
    new mob_fel_stalker();
    new mob_frost_wyrm();
    new mob_gargoyle();
    new alliance_rifleman();
}
/*
 * Copyright (C) 2011 - 2013 ArkCORE <http://www.arkania.net/>

 * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the
 * Free Software Foundation; either version 2 of the License, or (at your
 * option) any later version.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
 * more details.
 *
 * You should have received a copy of the GNU General Public License along
 * with this program. If not, see <http://www.gnu.org/licenses/>.
 */

/* ScriptData
 SDName: Borean_Tundra
 SD%Complete: 100
 SDComment: Quest support: 11708. Taxi vendors.
 SDCategory: Borean Tundra
 EndScriptData */

/* ContentData
 npc_iruk
 npc_corastrasza
 npc_jenny
 npc_sinkhole_kill_credit
 npc_khunok_the_behemoth
 npc_scourge_prisoner
 mob_nerubar_victim
 npc_keristrasza
 npc_nesingwary_trapper
 npc_lurgglbr
 npc_nexus_drake_hatchling
 EndContentData */

#include "ScriptPCH.h"
#include "ScriptedEscortAI.h"
#include "ScriptedFollowerAI.h"

/*######
 ## npc_sinkhole_kill_credit
 ######*/

enum eSinkhole {
    SPELL_SET_CART = 46797,
    SPELL_EXPLODE_CART = 46799,
    SPELL_SUMMON_CART = 46798,
    SPELL_SUMMON_WORM = 46800,
};

class npc_sinkhole_kill_credit: public CreatureScript {
public:
    npc_sinkhole_kill_credit() :


mPaint.isAntiAlias = true
        typedArray.recycle()
    }

    override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) {
        super.onMeasure(widthMeasureSpec, heightMeasureSpec)
        mWidth = MeasureSpec.getSize(widthMeasureSpec)
        mHeight = mWidth
    }

    override fun onDraw(canvas: Canvas) {
        mPaint.color = mBgColor
        drawBackgroundText(canvas)
    }

    fun setMode(@BevelLabelMode mode: Int) {
        mMode = mode
        invalidate()
    }

    fun setTextColor(@ColorInt color: Int) {
        mTextColor = color
        invalidate()
    }

    fun setBgColor(@ColorInt color: Int) {
        mBgColor = color
        invalidate()
    }

    private fun drawBackgroundText(canvas: Canvas) {
        check(mWidth == mHeight) {
            "width must equal to height" //标签view 是一个正方形，
        }
        when (mMode) {
            MODE_LEFT_TOP -> {
                mCorner = 0 //没有铺满的时候mCorner要归零；
                leftTopMeasure()
                getLeftTop()
            }
            MODE_RIGHT_TOP -> {
                mCorner = 0
                rightTopMeasure()
                getRightTop()
            }
            MODE_LEFT_BOTTOM -> {
                mCorner = 0
                leftBottomMeasure()
                getLeftBottom()
            }
            MODE_RIGHT_BOTTOM -> {
                mCorner = 0
                rightBottomMeasure()
                getRightBottom()
            }
            MODE_LEFT_TOP_FILL -> {
                leftTopMeasure()
                getLeftTopFill()
                if (mCorner != 0) {
                    canvas.drawPath(path, mPaint)
                    getLeftTop()
                }
            }
            MODE_RIGHT_TOP_FILL -> {
                rightTopMeasure()
                getRightTopFill()
                if (mCorner != 0) {
                    canvas.drawPath(path, mPaint)
                    getRightTop()
                }
            }
            MODE_LEFT_BOTTOM_FILL -> {
                leftBottomMeasure()
                getLeftBottomFill()
                if (mCorner != 0) {
                    canvas.drawPath(path, mPaint)
                    getLeftBottom()
                }
            }
            MODE_RIGHT_BOTTOM_FILL -> {
                rightBottomMeasure()
                getRightBottomFill()
                if (mCorner != 0) {
                    canvas.drawPath(path, mPaint)
                    getRightBottom()
                }
            }
            else -> {}
        }
        canvas.drawPath(path, mPaint)
        mPaint.textSize = mTextSize.toFloat()
        mPaint.textAlign = Paint.Align.CENTER
        mPaint.color = mTextColor
        canvas.translate(mX.toFloat(), mY.toFloat())
        canvas.rotate(mRotate.toFloat())
        val baseLineY = (-(mPaint.descent() + mPaint.ascent())).toInt() / 2 //基线中间点的y轴计算公式
        canvas.drawText(mText, 0f, baseLineY.toFloat(), mPaint)
    }

    private fun rightBottomMeasure() {
        mRotate = -45
        mX = mWidth / 2 + mLength / 4
        mY = mX
    }

    private fun leftBottomMeasure() {
        mRotate = 45
        mX = mWidth / 2 - mLength / 4


attle = BattleData();
      await battle.init(db.gameData.questPhases[9300040603]!, setting, null);

      final henry = battle.onFieldAllyServants[0]!;
      await battle.activateSvtSkill(0, 0);
      henry.np = 10000;
      expect(henry.logicalClassId, SvtClass.assassin.value);
      expect(henry.skillInfoList[0].chargeTurn, 5);
      expect(henry.skillInfoList[2].skill, isNotNull);
      expect(henry.skillInfoList[2].skill!.id, 71255);
      await battle.playerTurn([CombatAction(henry, henry.getNPCard()!)]);
      expect(henry.logicalClassId, SvtClass.berserker.value);
      expect(henry.skillInfoList[0].chargeTurn, 5 - 1);
      expect(henry.skillInfoList[2].skill, isNotNull);
      expect(henry.skillInfoList[2].skill!.id, 71255);
    });

    test('gainNpIndividualSum', () async {
      final List<PlayerSvtData> setting = [
        PlayerSvtData.id(502600)
          ..lv = 80
          ..setSkillStrengthenLvs([2, 1, 1]),
        PlayerSvtData.id(302500)..lv = 80,
      ];
      final battle = BattleData();
      await battle.init(db.gameData.questPhases[9300040603]!, setting, null);

      final eliz = battle.onFieldAllyServants[0]!;
      final kyohime = battle.onFieldAllyServants[1]!;
      expect(eliz.np, 0);

      await battle.activateSvtSkill(1, 2);
      await battle.activateSvtSkill(0, 0);
      expect(eliz.np, 2000);

      kyohime.skillInfoList[2].chargeTurn = 0;
      await battle.activateSvtSkill(1, 2);
      battle.enemyTargetIndex = 1;
      kyohime.skillInfoList[2].chargeTurn = 0;
      await battle.activateSvtSkill(1, 2);
      battle.enemyTargetIndex = 2;
      kyohime.skillInfoList[2].chargeTurn = 0;
      await battle.activateSvtSkill(1, 2);
      // each enemy should have one buff now

      eliz.skillInfoList[0].chargeTurn = 0;
      await battle.activateSvtSkill(0, 0);
      expect(eliz.np, 8000);
    });

    test('cardRest clear fixCommandCard & donotSelectCommand', () async {
      final List<PlayerSvtData> setting = [
        PlayerSvtData.id(2300200), // bb SSR
        PlayerSvtData.id(2300900), // ciel
      ];
      final battle = BattleData();
      await battle.init(db.gameData.questPhases[9300040603]!, setting, null);

      final bb = battle.onFieldAllyServants[0]!;

      await battle.activateSvtSkill(0, 2);
      expect(bb.battleBuff.validBuffs.any((buff) => buff.buff.type == BuffType.fixCommandcard), true);

      await battle.activateSvtSkill(1, 2);
      expect(bb.battleBuff.validBuffs.any((buff) => buff.buff.type == BuffType.fixCommandcard), false);
      expect(bb.battleBuff.validBuffs.any((buff) => buff.buff.type == BuffType.donotSelectCommandcard), false);
    });
  });
}
import 'package:chaldea/app/battle/utils/battle_utils.dart';
import 'package:chaldea/generated/l10n.dart';
import 'package:chaldea/models/models.dart';
import 'package:chaldea/utils/catcher/catcher_util


>tysubx0=%rsi
mov  $1,%rsi

# qhasm: tysubx1 = 0
# asm 1: mov  $0,>tysubx1=int64#6
# asm 2: mov  $0,>tysubx1=%r9
mov  $0,%r9

# qhasm: tysubx2 = 0
# asm 1: mov  $0,>tysubx2=int64#7
# asm 2: mov  $0,>tysubx2=%rax
mov  $0,%rax

# qhasm: tysubx3 = 0
# asm 1: mov  $0,>tysubx3=int64#8
# asm 2: mov  $0,>tysubx3=%r10
mov  $0,%r10

# qhasm: tysubx4 = 0
# asm 1: mov  $0,>tysubx4=int64#9
# asm 2: mov  $0,>tysubx4=%r11
mov  $0,%r11

# qhasm: txaddy0 = 1
# asm 1: mov  $1,>txaddy0=int64#10
# asm 2: mov  $1,>txaddy0=%r12
mov  $1,%r12

# qhasm: txaddy1 = 0
# asm 1: mov  $0,>txaddy1=int64#11
# asm 2: mov  $0,>txaddy1=%r13
mov  $0,%r13

# qhasm: txaddy2 = 0
# asm 1: mov  $0,>txaddy2=int64#12
# asm 2: mov  $0,>txaddy2=%r14
mov  $0,%r14

# qhasm: txaddy3 = 0
# asm 1: mov  $0,>txaddy3=int64#13
# asm 2: mov  $0,>txaddy3=%r15
mov  $0,%r15

# qhasm: txaddy4 = 0
# asm 1: mov  $0,>txaddy4=int64#14
# asm 2: mov  $0,>txaddy4=%rbx
mov  $0,%rbx

# qhasm: =? u - 1
# asm 1: cmp  $1,<u=int64#5
# asm 2: cmp  $1,<u=%r8
cmp  $1,%r8

# qhasm: t = *(uint64 *)(basep + 0 + pos)
# asm 1: movq   0(<basep=int64#4,<pos=int64#1),>t=int64#15
# asm 2: movq   0(<basep=%rcx,<pos=%rdi),>t=%rbp
movq   0(%rcx,%rdi),%rbp

# qhasm: tysubx0 = t if =
# asm 1: cmove <t=int64#15,<tysubx0=int64#2
# asm 2: cmove <t=%rbp,<tysubx0=%rsi
cmove %rbp,%rsi

# qhasm: t = *(uint64 *)(basep + 8 + pos)
# asm 1: movq   8(<basep=int64#4,<pos=int64#1),>t=int64#15
# asm 2: movq   8(<basep=%rcx,<pos=%rdi),>t=%rbp
movq   8(%rcx,%rdi),%rbp

# qhasm: tysubx1 = t if =
# asm 1: cmove <t=int64#15,<tysubx1=int64#6
# asm 2: cmove <t=%rbp,<tysubx1=%r9
cmove %rbp,%r9

# qhasm: t = *(uint64 *)(basep + 16 + pos)
# asm 1: movq   16(<basep=int64#4,<pos=int64#1),>t=int64#15
# asm 2: movq   16(<basep=%rcx,<pos=%rdi),


 json.Marshal
		return bytes.TrimRight(buffer.Bytes(), "\n"), err
	}
	return json.Marshal(t)
}

func dumpWriter(writer *jwriter.Writer) ([]byte, error) {
	if writer.Error != nil {
		return nil, writer.Error
	}

	var buf bytes.Buffer
	buf.Grow(writer.Size())
	if _, err := writer.DumpTo(&buf); err != nil {
		return nil, err
	}

	return buf.Bytes(), nil
}

// UnmarshalJSON implements the json.Unmarshaler interface.
func (om *OrderedMap[K, V]) UnmarshalJSON(data []byte) error {
	if om.list == nil {
		om.initialize(0, om.disableHTMLEscape)
	}

	return jsonparser.ObjectEach(
		data,
		func(keyData []byte, valueData []byte, dataType jsonparser.ValueType, offset int) error {
			if dataType == jsonparser.String {
				// jsonparser removes the enclosing quotes; we need to restore them to make a valid JSON
				valueData = data[offset-len(valueData)-2 : offset]
			}

			var key K
			var value V

			switch typedKey := any(&key).(type) {
			case *string:
				s, err := decodeUTF8(keyData)
				if err != nil {
					return err
				}
				*typedKey = s
			case encoding.TextUnmarshaler:
				if err := typedKey.UnmarshalText(keyData); err != nil {
					return err
				}
			case *int, *int8, *int16, *int32, *int64, *uint, *uint8, *uint16, *uint32, *uint64:
				if err := json.Unmarshal(keyData, typedKey); err != nil {
					return err
				}
			default:
				// this switch takes care of wrapper types around primitive types, such as
				// type myType string
				switch reflect.TypeOf(key).Kind() {
				case reflect.String:
					s, err := decodeUTF8(keyData)
					if err != nil {
						return err
					}

					convertedKeyData := reflect.ValueOf(s).Convert(reflect.TypeOf(key))
					reflect.ValueOf(&key).Elem().Set(convertedKeyData)
				case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64,
					reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64:
					if err := json.Unmarshal(keyData, &key); err != nil {
						return err
					}
				default:
					return fmt.Errorf("unsupported key type: %T", key)
				}
			}

			if err := json.Unmarshal(valueData, &value); err != nil {
				return err
			}

			om.Set(key, value)
			return nil
		})
}

func decodeUTF8(input []byte) (string, error) {
	remaining, offset := input, 0
	runes := make([]rune, 0, len(remaining))

	for len(remaining) > 0 {
		r, size := utf8.DecodeRune(remaining)
		if r == utf8.RuneError && size <= 1 {
			return "", fmt.Errorf("not a valid UTF-8 string (at


#ifndef __LINUX_SPINLOCK_TYPES_H
#define __LINUX_SPINLOCK_TYPES_H

/*
 * include/linux/spinlock_types.h - generic spinlock type definitions
 *                                  and initializers
 *
 * portions Copyright 2005, Red Hat, Inc., Ingo Molnar
 * Released under the General Public License (GPL).
 */

#include <linux/spinlock_types_raw.h>

#ifndef CONFIG_PREEMPT_RT

/* Non PREEMPT_RT kernels map spinlock to raw_spinlock */
typedef struct spinlock {
	union {
		struct raw_spinlock rlock;

#ifdef CONFIG_DEBUG_LOCK_ALLOC
# define LOCK_PADSIZE (offsetof(struct raw_spinlock, dep_map))
		struct {
			u8 __padding[LOCK_PADSIZE];
			struct lockdep_map dep_map;
		};
#endif
	};
} spinlock_t;

#define ___SPIN_LOCK_INITIALIZER(lockname)	\
	{					\
	.raw_lock = __ARCH_SPIN_LOCK_UNLOCKED,	\
	SPIN_DEBUG_INIT(lockname)		\
	SPIN_DEP_MAP_INIT(lockname) }

#define __SPIN_LOCK_INITIALIZER(lockname) \
	{ { .rlock = ___SPIN_LOCK_INITIALIZER(lockname) } }

#define __SPIN_LOCK_UNLOCKED(lockname) \
	(spinlock_t) __SPIN_LOCK_INITIALIZER(lockname)

#define DEFINE_SPINLOCK(x)	spinlock_t x = __SPIN_LOCK_UNLOCKED(x)

#else /* !CONFIG_PREEMPT_RT */

/* PREEMPT_RT kernels map spinlock to rt_mutex */
#include <linux/rtmutex.h>

typedef struct spinlock {
	struct rt_mutex_base	lock;
#ifdef CONFIG_DEBUG_LOCK_ALLOC
	struct lockdep_map	dep_map;
#endif
} spinlock_t;

#define __SPIN_LOCK_UNLOCKED(name)				\
	{							\
		.lock = __RT_MUTEX_BASE_INITIALIZER(name.lock),	\
		SPIN_DEP_MAP_INIT(name)				\
	}

#define __LOCAL_SPIN_LOCK_UNLOCKED(name)			\
	{							\
		.lock = __RT_MUTEX_BASE_INITIALIZER(name.lock),	\
		LOCAL_SPIN_DEP_MAP_INIT(name)			\
	}

#define DEFINE_SPINLOCK(name)					\
	spinlock_t name = __SPIN_LOCK_UNLOCKED(name)

#endif /* CONFIG_PREEMPT_RT */

#include <linux/rwlock_types.h>

#endif /* __LINUX_SPINLOCK_TYPES_H */


int type()
  {
    return type_;
  }

  /** Returns number of extra columns for sprint algorithm - 0 means off.
         Also number of iterations before recompute
     */
  virtual int numberSprintColumns(int &numberIterations) const;
  /// Switch off sprint idea
  virtual void switchOffSprint();
  /// Called when maximum pivots changes
  virtual void maximumPivotsChanged() {}

  //@}

  //---------------------------------------------------------------------------

protected:
  ///@name Protected member data
  //@{
  /// Pointer to model
  ClpSimplex *model_;
  /// Type of column pivot algorithm
  int type_;
  /// Says if looks optimal (normally computed)
  bool looksOptimal_;
  //@}
};
#ifndef CLP_PRIMAL_SLACK_MULTIPLIER
#define CLP_PRIMAL_SLACK_MULTIPLIER 1.01
#endif
#endif

/* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2
*/
/* $Id$ */
// Copyright (C) 2002, International Business Machines
// Corporation and others.  All Rights Reserved.
// This code is licensed under the terms of the Eclipse Public License (EPL).

/* Defines COIN_DBL_MAX and relatives and provides CoinFinite and CoinIsnan. */

#ifndef CoinFinite_H
#define CoinFinite_H

#include <limits>

//=============================================================================
// Smallest positive double value and Plus infinity (double and int)

#if 1
const double COIN_DBL_MIN = (std::numeric_limits< double >::min)();
const double COIN_DBL_MAX = (std::numeric_limits< double >::max)();
const int COIN_INT_MAX = (std::numeric_limits< int >::max)();
const double COIN_INT_MAX_AS_DOUBLE = (std::numeric_limits< int >::max)();
#else
#define COIN_DBL_MIN (std::numeric_limits< double >::min())
#define COIN_DBL_MAX (std::numeric_limits< double >::max())
#define COIN_INT_MAX (std::numeric_limits< int >::max())
#define COIN_INT_MAX_AS_DOUBLE (std::numeric_limits< int >::max())
#endif

/** checks if a double value is finite (not infinity and not NaN) */
extern bool CoinFinite(double val);

/** checks if a double value is not a number */
extern bool CoinIsnan(double val);

#endif

/* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2
*/
// (C) Copyright Carnegie Mellon University 2005, 2006
// All Rights Reserved.
// This code is published under the Eclipse Public License.
//
// Authors :
// P. Bonami, Carnegie Mellon University
//
// Date :  05/26/2005

#ifndef BonOaNlpOptim_HPP
#define BonOaNlpOptim_HPP
#include "CglCutGenerator.hpp"
#include "BonOsiTMINLPInterface.hpp"
#include "BonOAMessages.hpp"
#include "BonBabSetupBase.hpp"
namespace Bonmin
{
  /** Generate cuts for the nlp corresponding to continuous relaxation at a node.*/
  class OaNlpOptim : public CglCutGenerator
  {
  public:
    /// Default constructor
    OaNlpOptim(OsiTMINLPInterface * si = NULL,
        int maxDepth = 10, bool addOnlyViolated = false,
        bool globalCuts = true);

    /// Constructor with basic setup
    OaNlpOptim(BabSetupBase &b);
    /// Copy constructor
    OaNlpOptim(const OaNlpOptim &copy)
        :
        CglCutGenerator(copy),
        nlp_(copy.nlp_),
        maxDepth_(copy.maxDepth_),
        nSolve_(0),
        addOnlyViolated_(copy.addOnlyViolated_),
        global_(copy.global_),
	solves_per_level_(copy.solves_per_level_)
    {
      handler_ = new CoinMessageHandler();
      handler_ -> setLogLevel(copy.handler_->logLevel());
      messages_ = OaMessages();
    }
    void passInMessageHandler(const CoinMessageHandler * handler)
    {
      delete handler_;
      handler_


#pragma once
//------------------------------------------------------------------------------
/**
    @class VisTree
    @brief sparse quad-tree for LOD and visibility detection
*/
#include "Core/Types.h"
#include "Core/Containers/Array.h"
#include "glm/vec3.hpp"
#include "GeomPool.h"
#include "GeomMesher.h"
#include "VisNode.h"
#include "VisBounds.h"
#include "Camera.h"

class VisTree {
public:
    /// number of levels, the most detailed level is 0
    static const int NumLevels = 8;

    /// setup the vistree
    void Setup(int displayWidth, float fov);
    /// discard the vistree
    void Discard();

    /// get node by index
    VisNode& NodeAt(int16_t nodeIndex);
    /// allocate and init a node
    int16_t AllocNode();
    /// free any geoms in a node (non-recursive)
    void FreeGeoms(int16_t nodeIndex);
    /// split a node (create child nodes)
    void Split(int16_t nodeIndex);
    /// merge a node, frees all child nodes recursively
    void Merge(int16_t nodeIndex);
    /// compute the screen-space error for a bounding rect and viewer pos x,y
    float ScreenSpaceError(const VisBounds& bounds, int lvl, int x, int y) const;
    /// traverse the tree, deciding which nodes to render
    void Traverse(const Camera& camera);
    /// apply geoms to a node
    void ApplyGeoms(int16_t nodeIndex, int16_t* geoms, int numGeoms);
    /// internal, recursive traversal method
    void traverse(const Camera& camera, int16_t nodeIndex, const VisBounds& bounds, int lvl, int x, int y);
    /// gather a drawable node, prepare for drawing if needed
    void gatherDrawNode(const Camera& camera, int16_t nodeIndex, int lvl, const VisBounds& bounds);
    /// invalidate any child nodes (free geoms, free nodes)
    void invalidateChildNodes(int16_t nodeIndex);

    /// compute minimal distance between position and bounds
    static float MinDist(int x, int y, const VisBounds& bounds);
    /// get a node's bounds
    static VisBounds Bounds(int lvl, int x, int y);
    /// compute translation vector for a bounds
    static glm::vec3 Translation(const VisBounds& bounds);
    /// compute scale vector for a bounds rect
    static glm::vec3 Scale(const VisBounds& bounds);

    struct GeomGenJob {
        GeomGenJob() : NodeIndex(Oryol::InvalidIndex), Level(0) { }
        GeomGenJob(int16_t nodeIndex, int lvl, const VisBounds& bounds, const glm::vec3& scale, const glm::vec3& trans) :
            NodeIndex(nodeIndex), Level(lvl), Bounds(bounds), Scale(scale), Translate(trans) { }

        int16_t NodeIndex;
        int Level;
        VisBounds Bounds;
        glm::vec3 Scale;
        glm::vec3 Translate;
    };

    float K;
    static const int MaxNumNodes = 1024;
    VisNode nodes[MaxNumNodes];
    Oryol::Array<int16_t> freeNodes;
    Oryol::Array<int16_t> drawNodes;
    Oryol::Array<GeomGenJob> geomGenJobs;
    Oryol::Array<int16_t> freeGeoms;
    Oryol::Array<int16_t> traverseStack;
    int16_t rootNode;
};


               "IMCP to {0} took {1} ms.",
                                Host,
                                reply.RoundtripTime);

                            return (reply.RoundtripTime > Timeout)
                                ? HealthCheckResult.Degraded(msg)
                                : HealthCheckResult.Healthy(msg);

                        default:
                            var err = String.Format(
                                "IMCP to {0} failed: {1}",
                                Host,
                                reply.Status);
                            return HealthCheckResult.Unhealthy(err);
                    }
                }
            }
            catch (Exception e)
            {
                var err = String.Format(
                    "IMCP to {0} failed: {1}",
                    Host,
                    e.Message);
                return HealthCheckResult.Unhealthy(err);
            }
        }
    }
}


位的时候，每个段的明文长度是 172，该编码器默认生成的长度是 1024 且在前端无法更改，但是可以通过替换 antData 目录下的 key_rsa 和 key_rsa.pub 两个文件来更换密钥长度，这两个文件可以通过 openssl 生成。

生成方式如下：

1.  生成 rsa 私钥

```
openssl genrsa -out key_rsa 2048
```

1.  生成公钥

```
openssl rsa -in key_rsa -pubout -out key_rsa.pub
```

然后分别替换 key_rsa 和 key_rsa.pub 即可。替换之后可以发现每个分段的长度明显增加从之前的 172 变成 344，当密钥长度增加到 3072 时，分段长度增加到 512，同时加密所需时间明显增加。

**冰蝎 Shell 管理工具**
-----------------

冰蝎 Shell 管理工具是一款流行的、采用二进制动态加密传输数据的网站管理工具。

### **服务端**

相关链接:

《利用动态二进制加密实现新型一句话木马之 Java 篇》：

[https://xz.aliyun.com/t/2744](https://xz.aliyun.com/t/2744)

《利用动态二进制加密实现新型一句话木马之. NET 篇》：

[https://xz.aliyun.com/t/2758](https://xz.aliyun.com/t/2758)

《利用动态二进制加密实现新型一句话木马之 PHP 篇》：

[https://xz.aliyun.com/t/2774](https://xz.aliyun.com/t/2774)

### **配置**

目前冰蝎 Shell 管理工具的配置仅支持代理和自定义 HTTP 头部。

### **通信流量**

**（1）请求侧**

[![](https://xzfile.aliyuncs.com/media/upload/picture/20210410231153-151d311a-9a0f-1.jpg)](https://xzfile.aliyuncs.com/media/upload/picture/20210410231153-151d311a-9a0f-1.jpg)

**（2）响应侧**

[![](https://xzfile.aliyuncs.com/media/upload/picture/20210410231153-1543ba56-9a0f-1.jpg)](https://xzfile.aliyuncs.com/media/upload/picture/20210410231153-1543ba56-9a0f-1.jpg)**检测**

1. 文件检测：文件的特征主要在解密算法部分和执行 payload 的部分。

2. 流量检测：由于最新版冰蝎 Shell 管理工具这个交互过程都采用加密传输，无法采用检测关键字的方法进行检测。相比于 2.0 的版本，3.0 去除了协商密钥的过程，但这带来了一个问题就是，整个过程的密钥是不变的，同时分析冰蝎的源码可以发现：在传输 php，jsp，aspx 时前面的字段是固定的，这就导致了在一个 WebShell 中每一个流的前面的字节都是相同，php 前面是 assert|eval(base64_decode(、csharp 是 dll 文件的头部格式、java 则是 class 文


હેતુ વાડીના ફાળામાં રૂા. ૧૧૦૦૦/- કે તેથી વધુનું દાન આપેલ હતું. તેવા તમામ પરિવારોને યજ્ઞમાં સાતક બેસવાનો લાહવો વિનામૂલ્યે આપવાનો હતો. આ મહાયજ્ઞમાં કુલ ૧૫૩ પરિવારોએ ભાગ લઈ ધન્યતાનો અનુભવ કરેલો હતો.',
            style: Styles.normal(fontSize: 20),
            textAlign: TextAlign.justify,
          ),
          const Gap(16),
        ],
      ),
    );
  }
}
import 'dart:convert';
import 'dart:developer';
import 'dart:io';
import 'package:chat_ai/constants/api_consts.dart';
import 'package:chat_ai/models/chat_model.dart';
import 'package:chat_ai/models/models_model.dart';
import 'package:http/http.dart' as http;

class ApiService {
  static Future<List<ModelsModel>> getModels() async {
    try {
      var response = await http.get(
        Uri.parse("$BASE_URL/models"),
        headers: {'Authorization': 'Bearer $API_KEY'},
      );

      Map jsonResponse = jsonDecode(response.body);

      if (jsonResponse['error'] != null) {
        // print("jsonResponse['error'] ${jsonResponse['error']["message"]}");
        throw HttpException(jsonResponse['error']["message"]);
      }


Battle,channel:DiscordTextChannel){
    battle.on(BattleEvent.RoundBegin,function(e:IBattleRoundBeginEvent){
        sendRoundBegan(channel);
    });

    battle.on(BattleEvent.EffectApplied,(e:IBattleEffectEvent)=>{
        sendEffectMsg(channel,e.message,e.color);
    });

    battle.on(BattleEvent.Attack,(e:IBattleAttackEvent)=>{
        sendAttacked(channel,e);
    });

    battle.on(BattleEvent.Block,(e:IBattleBlockEvent)=>{
        sendBlocked(channel,e.blocker.pc.title);
    });

    battle.on(BattleEvent.PlayerDefeated,(e:IBattlePlayerDefeatedEvent)=>{
        sendPassedOut(channel,e.player.pc.title);
    });

    battle.on(BattleEvent.CoopBattleEnd,(e:ICoopBattleEndEvent)=>{
       sendCoopBattleEnded(channel,e);
    });

    battle.on(BattleEvent.PvPBattleEnd,function(e:IPvPBattleEndEvent){
        sendPvPBattleEnded(channel,e);
    });

    battle.on(BattleEvent.PvPBattleExpired,function(e:IPvPBattleExpiredEvent){
        sendPvPBattleExpired(channel,e);
    });
}

function sendRoundBegan(channel:DiscordTextChannel){
    channel.sendMessage('```css\n--- NEW ROUND ---\n```');
}

function sendAttacked(channel:DiscordTextChannel,attack:IBattleAttackEvent){
    let embed = attack.message;

    attack.attacked.forEach(function(attacked){
        if(Object.keys(attacked.damages).length > 0){
            embed += '\n'+getDamagesLine(
                attacked.creature,
                attacked.damages,
                attacked.blocked,
                attacked.exhaustion
            );
        }
    });

    channel.sendMessage('',getEmbed(embed,EMBED_COLORS.attack));
}

function sendBlocked(channel:DiscordTextChannel,blockerTitle:string){
    channel.sendMessage(`:shield: ${blockerTitle} blocks! :shield:`);
}

function sendEffectMsg(channel:DiscordTextChannel,msg:string,color:number){
    channel.sendMessage('',getEmbed(msg,color));
}

function sendPassedOut(channel:DiscordTextChannel,creatureTitle:string,lostWishes?:number){
    const wishesLost = lostWishes?` (Lost ${lostWishes} wishes)`:'';

    channel.sendMessage(`:skull_crossbones: ${creatureTitle} passed out!${wishesLost} :skull_crossbones:`);
}

function sendPvPBattleEnded(channel:DiscordTextChannel,e:IPvPBattleEndEvent){
    channel.sendMessage('```fix\nBattle Over\n```');

    channel.sendMessage('',getEmbed(`:tada: ${e.winner.pc.title} has defeated ${e.loser.pc.title} :tada:`));

    channel.sendMessage('',getEmbed(`Channel will expire in 1 minute`));
}

function sendPvPBattleExpired(channel:DiscordTextChannel,e:IPvPBattleExpiredEvent){
    channel.sendMessage('```fix\nBattle Expired\n```');

    channel.sendMessage('',getEmbed(`Neither player participated so the battle ended in a draw`));

    channel.sendMessage('',getEmbed(`Channel will expire in 1 minute`));
}

function sendCoopBattleEnded(channel:DiscordTextChannel,e:ICoopBattleEndEvent){
    channel.sendMessage('```fix\nBattle Over\n```');

    if(e.victory){
        channel.sendMessage('',getEmbed('\n:tada: YOU WERE VICTORIOUS :tada:',EMBED_COLORS.victorious));
    }
    else{
        channel.sendMessage('',getEmbed('\n:dizzy_face: YOU WERE DEFEATED :dizzy_face:',EMBED_COLORS.defeated));
    }
}

const EMBED_COLORS = {
    newRound: 0xFFA500,


                emitError(XMLErrs::InvalidAttValue, fXsiNil.getRawBuffer(), valuePtr);
                    fBufMgr.releaseBuffer(fXsiNil);
                }
            }
        }

        if (!fXsiType.isEmpty())
        {
            int colonPos = -1;
            unsigned int uriId = resolveQName
            (
                fXsiType.getRawBuffer(), fPrefixBuf, ElemStack::Mode_Element, colonPos
            );
            ((SchemaValidator*)fValidator)->setXsiType(fPrefixBuf.getRawBuffer(), fXsiType.getRawBuffer() + colonPos + 1, uriId);
        }
    }
}

void XSAXMLScanner::switchGrammar( const XMLCh* const uriStr
                                 , bool laxValidate)
{
    Grammar* tempGrammar = 0;

    if (XMLString::equals(uriStr, SchemaSymbols::fgURI_SCHEMAFORSCHEMA)) {
        tempGrammar = fSchemaGrammar;
    }
    else {
        tempGrammar = fGrammarResolver->getGrammar(uriStr);
    }

    if (tempGrammar && tempGrammar->getGrammarType() == Grammar::SchemaGrammarType)
    {
        fGrammar = tempGrammar;
        fGrammarType = Grammar::SchemaGrammarType;
        fValidator->setGrammar(fGrammar);
    }
    else if(!laxValidate) {
        fValidator->emitError(XMLValid::GrammarNotFound, uriStr);
    }
}

}
/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You 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.
 */

/*
 * $Id$
 */

#include <xercesc/internal/BinMemOutputStream.hpp>
#include <xercesc/util/XMLString.hpp>
#include <cstring>

namespace XERCES_CPP_NAMESPACE {

BinMemOutputStream::BinMemOutputStream( XMLSize_t            initCapacity
                                      , MemoryManager* const manager)
: fMemoryManager(manager)
, fDataBuf(0)
, fIndex(0)
, fCapacity(initCapacity)
{
    // Buffer is one larger than capacity, to allow for zero term
    fDataBuf = (XMLByte*) fMemoryManager->allocate
    (
        (fCapacity + 4) * sizeof(XMLByte)
    );

    // Keep it null terminated
    fDataBuf[0] = XMLByte(0);
}

BinMemOutputStream::~BinMemOutputStream()
{
    fMemoryManager->deallocate(fDataBuf);
}

void BinMemOutputStream::writeBytes( const XMLByte*     const      toGo
                                   , const XMLSize_t               maxToWrite)
{

    if (maxToWrite)
    {
        ensureCapacity(maxToWrite);
        memcpy(&fDataBuf[fIndex], toGo, maxToWrite * sizeof(XMLByte));
        fIndex += maxToWrite;
    }

}

const XMLByte* BinMemOutputStream::getRawBuffer() const
{
    fDataBuf[fIndex] = 0;
    fDataBuf[fIndex + 1] = 0;
    fDataBuf[fIndex + 2] = 0;
    fDataBuf[fIndex + 3] = 0;
    return fDataBuf;
}

void BinMemOutputStream::reset()
{
    fIndex = 0;
    for (int i = 0; i < 4; i++)
    {
        fDataBuf[fIndex + i] = 0;
    }
}

XMLFilePos BinMemOutputStream::curPos() const
{
    return fIndex;
}

XMLFilePos BinMem


baseImport := path.Join(base, `restapi/operations`)
				assertRegexpInCode(t, baseImport, code)

				assertInCode(t, `api.GetConflictHandler = operations.GetConflictHandlerFunc(`, code)
				assertInCode(t, `api.GetAnotherConflictHandler = operations.GetAnotherConflictHandlerFunc(`, code)
				assertInCode(t, `api.GetNotagHandler = operations.GetNotagHandlerFunc(`, code)

				buf2, err := os.ReadFile(filepath.Join(opsTarget, "unsafe_tag_names_api.go"))
				require.NoError(t, err)
				api := string(buf2)

				assertInCode(t, `GetConflictHandler: GetConflictHandlerFunc(func(params GetConflictParams) middleware.Responder {`, api)
				assertInCode(t, `GetAnotherConflictHandler: GetAnotherConflictHandlerFunc(func(params GetAnotherConflictParams) middleware.Responder {`, api)
				assertInCode(t, `NotagHandler: GetNotagHandlerFunc(func(params GetNotagParams) middleware.Responder {`, api)

				assertInCode(t, `DeleteTestOverrideHandler DeleteTestOverrideHandler`, api)
				assertInCode(t, `GetAnotherConflictHandler GetAnotherConflictHandler`, api)
				assertInCode(t, `GetConflictHandler GetConflictHandler`, api)
				assertInCode(t, `GetCustomHandler GetCustomHandler`, api)
				assertInCode(t, `GetMultipleHandler GetMultipleHandler`, api)
				assertInCode(t, `GetNotagHandler GetNotagHandler`, api)
				assertInCode(t, `GetOtherReservedHandler GetOtherReservedHandler`, api)
				assertInCode(t, `GetOtherUnsafeHandler GetOtherUnsafeHandler`, api)
				assertInCode(t, `GetReservedHandler GetReservedHandler`, api)
				assertInCode(t, `GetTestOverrideHandler GetTestOverrideHandler`, api)
				assertInCode(t, `GetUnsafeHandler GetUnsafeHandler`, api)
				assertInCode(t, `GetYetAnotherUnsafeHandler GetYetAnotherUnsafeHandler`, api)
				assertInCode(t, `PostTestOverrideHandler PostTestOverrideHandler`, api)
				assertInCode(t, `PutTestOverrideHandler PutTestOverrideHandler`, api)
				assertInCode(t, `TestIDHandler TestIDHandler`, api)
			},
		},
		"main_package": {
			spec: "../fixtures/bugs/2111/fixture-2111.yaml",
			prepare: func(_ *testing.T, opts *GenOpts) {
				opts.IncludeMain = true
				opts.MainPackage = "custom-api"
				opts.SkipTagPackages = true
			},
			verify: func(t *testing.T, target string) {
				assert.True(t, fileExists(filepath.Join(target, "cmd", "custom-api"), "main.go"))
			},
		},
		"external_model": {
			spec: "../fixtures/bugs/1897/fixture-1897.yaml",
			prepare: func(t *testing.T, opts *GenOpts) {
				modelOpts := *opts
				modelOpts.AcceptDefinitionsOnly = true
				modelOpts.Spec = "../fixtures/bugs/1897/model.yaml"
				modelOpts.ModelPackage = "external"
				modelOpts.Target = filepath.Dir(modelOpts.Spec)

				require.NoError(t, GenerateModels(nil, &modelOpts))

				t.Run("external model should be available", func(t *testing.T) {
					require.True(t, fileExists(modelOpts.Target, "external"))
					require.True(t, fileExists(modelOpts.Target, filepath.Join("external", "error.go")))
				})

				opts.IncludeMain = true
			},
			verify: func(t *testing.T, target string) {
				location := filepath.Join(target, "cmd", "repro1897-server")
				require.True(t, file


age*80)/100;
	conf.ialloc = ((conf.npage-conf.upages)/2)*BY2PG;

	/* set up other configuration parameters */
	conf.nproc = 100 + ((conf.npage*BY2PG)/MB)*5;
	if(cpuserver)
		conf.nproc *= 3;
	if(conf.nproc > 2000)
		conf.nproc = 2000;
	conf.nswap = conf.npage*3;
	conf.nswppo = 4096;
	conf.nimage = 200;

	/*
	 * it's simpler on mp systems to take page-faults early,
	 * on reference, rather than later, on write, which might
	 * require tlb shootdowns.
	 */
	conf.copymode = 1;		/* copy on reference */

	/*
	 * Guess how much is taken by the large permanent
	 * datastructures. Mntcache and Mntrpc are not accounted for
	 * (probably ~300KB).
	 */
	kpages = conf.npage - conf.upages;
	kpages *= BY2PG;
	kpages -= conf.upages*sizeof(Page)
		+ conf.nproc*sizeof(Proc)
		+ conf.nimage*sizeof(Image)
		+ conf.nswap
		+ conf.nswppo*sizeof(Page*);
	mainmem->maxsize = kpages;
	if(!cpuserver)
		/*
		 * give terminals lots of image memory, too; the dynamic
		 * allocation will balance the load properly, hopefully.
		 * be careful with 32-bit overflow.
		 */
		imagmem->maxsize = kpages;

//	archconfinit();
}

int
cmpswap(long *addr, long old, long new)
{
	return cas((int *)addr, old, new);
}

void
advertwfi(void)			/* advertise my wfi status */
{
	ilock(&active);
	active.wfi |= 1 << m->machno;
	iunlock(&active);
}

void
unadvertwfi(void)		/* do not advertise my wfi status */
{
	ilock(&active);
	active.wfi &= ~(1 << m->machno);
	iunlock(&active);
}

void
idlehands(void)
{
#ifdef use_ipi
	int advertised;

	/* don't go into wfi until my local timer is ticking */
	if (m->ticks <= 1)
		return;

	advertised = 0;
	m->inidlehands++;
	/* avoid recursion via ilock, advertise iff this cpu is initialised */
	if (m->inidlehands == 1 && m->syscall > 0) {
		advertwfi();
		advertised = 1;
	}

	wfi();

	if (advertised)
		unadvertwfi();
	m->inidlehands--;
#endif
}

void
wakewfi(void)
{
#ifdef use_ipi
	uint cpu;

	/*
	 * find any cpu other than me currently in wfi.
	 * need not be exact.
	 */
	cpu = BI2BY*BY2WD - 1 - clz(active.wfi & ~(1 << m->machno));
	if (cpu < MAXMACH)
		intrcpu(cpu);
#endif
}


t" coords="197,164,396,180" href="#setDescrFormaDoc(java.lang.String)" alt=""><area shape="rect" coords="197,180,429,197" href="#setExModeloSet(java.util.Set)" alt=""><area shape="rect" coords="197,197,410,214" href="#setExTipoDocumentoSet(java.util.Set)" alt=""><area shape="rect" coords="197,214,463,231" href="#setExTipoFormaDoc(br.gov.jfrj.siga.ex.ExTipoFormaDoc)" alt=""><area shape="rect" coords="197,231,379,247" href="#setIdFormaDoc(java.lang.Integer)" alt=""><area shape="rect" coords="197,247,391,264" href="#setSiglaFormaDoc(java.lang.String)" alt=""><area shape="rect" coords="189,-190,292,-171" href="package-summary.html" alt=""></map>
<map name="umlmap90W1H1"><area shape="rect" coords="-83,-163,146,-140" href="#" alt=""><area shape="rect" coords="-105,-121,61,-104" href="#ExTipoDocumentoSet" alt=""><area shape="rect" coords="-105,-104,45,-88" href="#descrFormaDoc" alt=""><area shape="rect" coords="-105,-88,79,-71" href="#exModeloSet" alt=""><area shape="rect" coords="-105,-71,113,-54" href="#exTipoFormaDoc" alt=""><area shape="rect" coords="-105,-54,-4,-38" href="#hashValue" alt=""><area shape="rect" coords="-105,-38,30,-21" href="#idFormaDoc" alt=""><area shape="rect" coords="-105,-21,41,-4" href="#siglaFormaDoc" alt=""><area shape="rect" coords="-105,-3,80,12" href="#AbstractExFormaDocumento()" alt=""><area shape="rect" coords="-105,12,118,29" href="#AbstractExFormaDocumento(java.lang.Integer)" alt=""><area shape="rect" coords="-105,30,50,47" href="#equals(java.lang.Object)" alt=""><area shape="rect" coords="-105,47,72,64" href="#getDescrFormaDoc()" alt=""><area shape="rect" coords="-105,64,105,80" href="#getExModeloSet()" alt=""><area shape="rect" coords="-105,80,86,97" href="#getExTipoDocumentoSet()" alt=""><area shape="rect" coords="-105,97,139,114" href="#getExTipoFormaDoc()" alt=""><area shape="rect" coords="-105,114,55,130" href="#getIdFormaDoc()" alt=""><area shape="rect" coords="-105,130,67,147" href="#getSiglaFormaDoc()" alt=""><area shape="rect" coords="-105,147,3,164" href="#hashCode()" alt=""><area shape="rect" coords="-105,164,94,180" href="#setDescrFormaDoc(java.lang.String)" alt=""><area shape="rect" coords="-105,180,127,197" href="#setExModeloSet(java.util.Set)" alt=""><area shape="rect" coords="-105,197,108,214" href="#setExTipoDocumentoSet(java.util.Set)" alt=""><area shape="rect" coords="-105,214,161,231" href="#setExTipoFormaDoc(br.gov.jfrj.siga.ex.ExTipoFormaDoc)" alt=""><area shape="rect" coords="-105,231,77,247" href="#setIdFormaDoc(java.lang.Integer)" alt=""><area shape="rect" coords="-105,247,89,264" href="#setSiglaFormaDoc(java.lang.String)" alt=""><area shape="rect" coords="-113,-190,-10,-171" href="package-summary.html" alt=""></map>
<


IL 1569

CABLE SECRETARIAT DISSEMINATION

CONT: SB-8

MESSAGE FORM
TOTAL COPIES: 26

SECRET

INFO:
FILE: CS/DO
WH-8, RIJAN, CIFIC-ZF

CITE DIRECTOR 92246

SECRET

13 01 30 APR69

TO:
PRIORITY LIMA ROUTINE MEXICO CITY
REDTOP ASKICK

REFERENCE: LIMA 4446 (IN 34738)

1. LEONOV DPO3 AUGUST 1928, RYAZAN OBLAST. SUBJECT IS 178 CENTIMETERS TALL, ELENDER BUILD, BLOND HAIR, BLUE EYES. LEONOV IS VERY ATHLETIC AND HIS GENERAL FACIAL FEATURES AND BUILD ARE THOSE OF RICHARD WIDMARK, STEVE MCQUEEN, AND ALLAN LADD. HIS SPANISH IS FLUENT. HIS APPEARANCE IS NORDIC. OCCASIONALLY HIS LONG BLOND HAIR IS WORN IN CREW CUT STYLE.

2. LEONOV WILL BE SURVEILLANCE CONSCIOUS AND IS ADEPT IN COUNTERMEASURES.

3. POUCHING PHOTOGRAPHS PRIORITY WEEK 14 APRIL.

END OF MESSAGE

*HQS COMMENT: STATION REQUESTED PHYSICAL DESCRIPTION AND PHOTOS PRIORITY TO FACILITATE SURVEILLANCE.

CSDO NOTE: TYPED AND RELEASED BY DIRECTION OF JOHN HORTON, DC/WH.

C/WH/3 AL SPERA (TELECOORD)

![signature of CORNELICUS MCCAJLEY]

CORNELICUS MCCAJLEY
RELEASING OFFICER
CSDO

CS COPY
COORDINATING OFFICERS

SECRET

REPRODUCTION BY OTHER THAN THE ISSUING OFFICE IS PROHIBITED.

13 APR 69
201-132139

L.MESTRES
SB/XO
AUTHENTICATING OFFICER

COPY NO.

-------------------------------------------------------------------------------- Page 126

CABLE SECRETARIAT DISSEMINATION
PERSONVUNIT NOTIFIED.

CLASSIFIED MESSAGE

# SECRET
(When Filled in)

REPRODUCTION OF THIS COPY PROHIBITED

ADVANCE COPY
ISSUED
SLOTTED

CSDO

AT 2200

DISSEM BY
ACTION
PER

SB8
RID COPY

INFO: RY/100, CS/00, WH8, CI/OPS, FI2, CI/162

SECRET 12225 Z APR 69 CITY LIMA 4446

PRIORITY DIRECTOR, MEXICO CITY

REDIOP AEKICK

REF DIRECTOR 91937 (NOT SENT MEXICO CITY)

1. IN ORDER FACILITATE SURVIELLANCE KGB OFFICER,
   NOKOLAY SERGE WICH LEONOV (201-132139) REQUEST DETAILED
   PHYSICAL DESOR IFT ION BY CABLE AND PHOTOS BY POUCH.

2. FILE: 201-132139.

SECRET

CS COPY

SECRET

12 APR 69
201-132139

![routing and coordinating sheet]

-------------------------------------------------------------------------------- Page 127

# DIANA DAVIS

S8/X/WH

6412 1315

11 APR 69

MESSAGE FORM TOTAL COPIES: 23

SECRET

ROUTING AND/OR INITIALS SEEN ST

INDEX NO INDEX RETURN TO BRANCH FILE RID

FILE IN CS FILE NO.

SB 8 FILE. VR. RIAN, EURG, C.I/OPS, C/IC2, FI2

SECRET

1123 22/Apr69

CITE DIRECTOR 94987

* PRIORITY LIMA

REDTOP AEKICK

1. ACCORDING TO SENSITIVE HEADQUARTERS SOURCE, FRENCH DOUBLE ENTRY TRANSIT VISA GRANTED TO NIKOLAY SERGEYEVICH LEONOV WHO PLANS TRAVEL TO PERU DEPARTING MOSCOW 10 APRIL.

2. LEONOV IS SUBJECT OF 201-132139. HE WAS PREVIOUSLY PCS IN MEXICO FROM 1953 TO 1956 AS INTERPRETER AND AMBASSASDOR'S SECRETARY AND FROM 1961 TO 22 DECEMBER 1968 AS SECOND SECRETARY AND PRESS ATTACHE. LEONOV IS KNOWN KGB AND HIGHLY EXPERIENCED OFFICER, HE IF IT DETERMINED PERUVIANS NOT FOLLOWING HIM WOULD BE WORTHY OF DISCREET U


}
.PositionSeller-token-selector .Modal .Modal-content {
  width: 38rem;
  max-height: 80vh;
  top: auto;
  bottom: auto;
}

.PositionSeller-token-selector .Modal .Modal-content .Modal-body {
  max-height: calc(80vh - 13rem);
}

.PositionSeller-token-selector.warning .TokenSelector-box {
  color: rgb(247, 147, 26);
}

.PositionSeller-token-selector .TokenSelector-box {
  display: inline-flex;
}

.PositionSelector-selected-receive-token {
  white-space: normal;
  display: inline-flex;
  flex: 1;
}

.PositionSeller-token-selector .TokenSelector-box .TokenSelector-caret {
  margin-left: 0;
  margin-right: -2px;
  margin-bottom: -2px;
}

.PositionSeller-fee-item {
  margin-bottom: 4px;
}

.PositionSeller-fees-tooltip .Tooltip-popup {
  min-width: 30rem;
}

@media (max-width: 700px) {
  .PositionSeller-fees-tooltip .Tooltip-popup {
    min-width: 30rem;
  }

  .PositionSeller-token-selector .Modal .Modal-content {
    bottom: auto;
  }
}

@media (max-width: 350px) {
  .PositionSeller-receive-row.Exchange-info-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
  }

  .Exchange-info-row.PositionSeller-receive-row .TokenSelector-box {
    margin-top: 8px;
    text-align: left;
  }

  .PositionSelector-selected-receive-token.align-right {
    margin-top: 8px;
    text-align: left;
  }
}
.ClaimEsUtx input {
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: var(--font-base);
  width: 100%;
  box-sizing: border-box;
}

.ClaimEsUtx label {
  display: block;
  margin-bottom: 0.8rem;
}

.ClaimEsUtx-content {
  padding: 4.65rem;
  padding-top: 1.5rem;
  max-width: 38.75rem;
}

.ClaimEsUtx-row {
  margin-bottom: 1.5rem;
}

.ClaimEsUtx button {
  margin-top: 0.8rem;
}

.ClaimEsUtx-vesting-options {
  display: flex;
  flex-direction: column;
}

.ClaimEsUtx-vesting-options .Checkbox.btn-lg {
  font-size: 1.85rem;
  margin-bottom: 0.8rem;
  display: block;
  width: 35.65rem;
  padding-left: 1.85rem;
  padding-top: 0.465rem;
}

.ClaimEsUtx-vesting-options .Checkbox.btn-lg.selected.arbitrum {
  background: rgba(41, 160, 240, 0.2);
}

.ClaimEsUtx-vesting-options .Checkbox.btn-lg.selected.avalanche {
  background: rgba(232, 65, 65, 0.2);
}

.ClaimEsUtx-vesting-options .Checkbox img {
  height: 1.5rem;
}

.ClaimEsUtx-vesting-options .Checkbox.selected .ClaimEsUtx-option-label {
  opacity: 1;
}

.ClaimEsUtx-vesting-options .Checkbox.arbitrum .Checkbox-icon.active {
  color: #29a0f0;
}

.ClaimEsUtx-vesting-options .Checkbox.avalanche .Checkbox-icon.active {
  c


.append(start);
		isVisited[start] = true;
		while (!activeNodes.empty()) {
			node v = activeNodes.pop(); //running node
			parent[v] = start; //representative points to itself
#if 0
			std::cout << "Setting parent of " << v->index() << "  to " << start->index() << "\n";
#endif
			count++;

			for (adjEntry adj : v->adjEntries) {
				node w = adj->twinNode();

				if (v == w) {
					continue; // ignore self-loops
				}

				if (inCluster[w] && !isVisited[w]) {
					//use for further traversal
					activeNodes.append(w);
					isVisited[w] = true;
					//remove the node from the candidate list
					nodesInCluster.del(listPointer[w]);
				}
			}
		}
	}

#if 0
	std::cout << "Number of chunks: " << numChunks << "\n";
#endif
	//Now all node parents point to the representative of their chunk (start node in search)
	numBags = numChunks; //We count backwards if chunks are connected by subcluster

	//Now we use an idea similar to UNION FIND to gather the bags
	//out of the chunks. Each node has a parent pointer, leading to
	//a representative. Initially, it points to the rep of the chunk,
	//but each time we encounter a subcluster connecting multiple
	//chunks, we let all of them point to the same representative.
	for (cluster cc : c->children) {
		const List<node>& nodesInChild = static_cast<CPlanarityMaster*>(master_)->getClusterNodes(cc);
#if 0
		cc->getClusterNodes(nodesInChild);
		std::cout << nodesInChild.size() << "\n";
#endif
		ListConstIterator<node> itN = nodesInChild.begin();
		node bagRep = nullptr; //stores the representative for the whole bag
		if (itN.valid()) {
			bagRep = getRepresentative(*itN, parent);
		}
#if 0
		std::cout << " bagRep is " << bagRep->index() << "\n";
#endif
		while (itN.valid()) {
			node w = getRepresentative(*itN, parent);
#if 0
			std::cout << "  Rep is: " << w->index() << "\n";
#endif
			if (w != bagRep) {
				numBags--; //found nodes with different representative, merge
				parent[w] = bagRep;
				parent[*itN] = bagRep; //shorten search path
#if 0
				std::cout << "  Found new node with different rep, setting numBags to " << numBags << "\n";
#endif
			}
			++itN;
		}
	}

	return numBags;
#if 0
	std::cout << "#Number of bags: " << numBags << "\n";
#endif
}

//! returns connectivity status for complete connectivity
//! returns 1 in this case, 0 otherwise
// New version using arrays to check cluster affiliation during graph traversal,
// old version used graph copies

// For complete connectivity also the whole graph needs to
// be connected (root cluster). It therefore does not speed up
// the check to test connectivity of the graph in advance.
// Note that then a cluster induced graph always has to be
// connected to the complement, besides one of the two is empty.

// Uses an array that keeps the information on the cluster
// affiliation and bfs to traverse the graph.
//we rely on the fact that support is a graphcopy of the underlying graph
//with some edges added or removed
bool CPlanaritySub::checkCConnectivity(const GraphCopy& support) {
	OGDF_ASSERT(isConnected(support));
	const ClusterGraph& CG = *static_cast<CPlanarityMaster*>(master_)->getClusterGraph();
	const Graph& G = CG.constGraph();
	//if there are no nodes, there is nothing to check
	if (G.numberOfNodes() < 2) {
		return true;
	}

	//there is always at


/*
 * This file is part of the Sofia-SIP package
 *
 * Copyright (C) 2008 Nokia Corporation.
 *
 * Contact: Pekka Pessi <pekka.pessi@nokia.com>
 *
 * This 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.
 *
 * This 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 this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 * 02110-1301 USA
 */

#ifndef S2SIP_H
#define S2SIP_H

#include <sofia-sip/su_wait.h>
#include <sofia-sip/sip.h>
#include <sofia-sip/tport.h>

#include "s2util.h"

extern struct s2sip
{
  su_home_t home[1];

  su_root_t *root;
  msg_mclass_t const *mclass;
  int flags;

  int server_uses_rport;

  char const *hostname;
  tport_t *master;

  sip_to_t *aor;
  sip_contact_t *contact;

  struct {
    sip_contact_t *contact;
    tport_t *tport;
  } udp, tcp, tls;

  struct {
    sip_to_t *aor;
    sip_contact_t *contact;
    tport_t *tport;
  } sut;

  struct message {
    struct message *next, **prev;
    msg_t *msg;
    sip_t *sip;
    tport_t *tport;
    su_time_t when;
  } *received;

  unsigned long tid;
} *s2sip;

struct dialog
{
  su_home_t home[1];
  sip_from_t *local;
  sip_to_t *remote;
  sip_call_id_t *call_id;
  uint32_t lseq, rseq;
  sip_contact_t *target;
  sip_route_t *route;
  sip_contact_t *contact;

  tport_t *tport;
  msg_t *invite;		/* latest invite sent */
};

extern tp_stack_class_t const s2_sip_stack[1];

extern int s2_sip_msg_flags;

char *s2_sip_generate_tag(su_home_t *home);

sip_via_t *s2_sip_tport_via(tport_t const *);
sip_contact_t *s2_sip_tport_contact(tport_t const *);

struct message *s2_sip_remove_message(struct message *m);
void s2_sip_free_message(struct message *m);
void s2_sip_flush_messages(void);

struct message *s2_sip_next_response(void);
struct message *s2_sip_wait_for_response(int status, sip_method_t , char const *);
int s2_sip_check_response(int status, sip_method_t method, char const *name);

struct message *s2_sip_next_request(sip_method_t method, char const *name);
struct message *s2_sip_wait_for_request(sip_method_t method, char const *name);
struct message *s2_sip_wait_for_request_timeout(sip_method_t, char const *,
					    unsigned timeout);
int s2_sip_check_request(sip_method_t method, char const *name);
int s2_sip_check_request_timeout(sip_method_t method, char const *, unsigned timeout);

void s2_sip_save_uas_dialog(struct dialog *d, sip_t *sip);

struct message *s2_sip_respond_to(struct message *m, struct dialog *d,
			      int status, char const *phrase,
			      tag_type_t tag, tag_value_t value, ...);

int s2_sip_request_to(struct dialog *d,
		  sip_method_t method, char const *name,
		  tport_t *tport,
		  tag_type_t tag, tag_value_t value, ...);

int s2_sip_update_dialog(struct dialog *d, struct message *response);

void s2_sip_setup(char const *hostname,
		 char const * const *protocols,
		 tag_type_t tag, tag_value_t value, ...);
void s2_sip_teardown(void);

#endif


       DataType::Dictionary(key_type, _) => {
            with_match_dictionary_key_type!(key_type.as_ref(), |$T| {
                _write_dictionary::<$T>(
                    array,
                    buffers,
                    arrow_data,
                    nodes,
                    offset,
                    is_little_endian,
                    write_keys,
                )
            })
        }
        _ => unreachable!(),
    }
}

pub fn write(
    array: &dyn Array,
    buffers: &mut Vec<Schema::Buffer>,
    arrow_data: &mut Vec<u8>,
    nodes: &mut Vec<Message::FieldNode>,
    offset: &mut i64,
    is_little_endian: bool,
) {
    nodes.push(Message::FieldNode::new(
        array.len() as i64,
        array.null_count() as i64,
    ));
    use PhysicalType::*;
    match array.data_type().to_physical_type() {
        Null => (),
        Boolean => write_boolean(array, buffers, arrow_data, offset, is_little_endian),
        Primitive(primitive) => with_match_primitive_type!(primitive, |$T| {
            write_primitive::<$T>(array, buffers, arrow_data, offset, is_little_endian)
        }),
        Binary => write_binary::<i32>(array, buffers, arrow_data, offset, is_little_endian),
        LargeBinary => write_binary::<i64>(array, buffers, arrow_data, offset, is_little_endian),
        FixedSizeBinary => {
            write_fixed_size_binary(array, buffers, arrow_data, offset, is_little_endian)
        }
        Utf8 => write_utf8::<i32>(array, buffers, arrow_data, offset, is_little_endian),
        LargeUtf8 => write_utf8::<i64>(array, buffers, arrow_data, offset, is_little_endian),
        List => write_list::<i32>(array, buffers, arrow_data, nodes, offset, is_little_endian),
        LargeList => write_list::<i64>(array, buffers, arrow_data, nodes, offset, is_little_endian),
        FixedSizeList => {
            write_fixed_size_list(array, buffers, arrow_data, nodes, offset, is_little_endian)
        }
        Struct => write_struct(array, buffers, arrow_data, nodes, offset, is_little_endian),
        Dictionary(_) => {
            write_dictionary(
                array,
                buffers,
                arrow_data,
                nodes,
                offset,
                is_little_endian,
                true,
            );
        }
        Union => {
            write_union(array, buffers, arrow_data, nodes, offset, is_little_endian);
        }
        Map => {
            write_map(array, buffers, arrow_data, nodes, offset, is_little_endian);
        }
    }
}

/// writes `bytes` to `arrow_data` updating `buffers` and `offset` and guaranteeing a 8 byte boundary.
#[inline]
fn write_bytes(
    bytes: &[u8],
    buffers: &mut Vec<Schema::Buffer>,
    arrow_data: &mut Vec<u8>,
    offset: &mut i64,
) {
    let len = bytes.len();
    let pad_len = pad_to_8(len as u32);
    let total_len: i64 = (len + pad_len) as i64;
    // assert_eq!(len % 8, 0, "Buffer width not a multiple of 8 bytes");
    buffers.push(Schema::Buffer::new(*offset, total_len));
    arrow_data.extend_from_slice(bytes);
    arrow_data.extend_from_slice(&vec![0u8; pad_len][..]);
    *


,
						Tile.RIVER, false);
				m.spreadTiles(x, y, x + 15, y + 15, Tile.RIVER, m.floor());

				// rotate clockwise to correct orientation
				// 20 = N/W/E position etc..
				m.rotateArea(x, y, 16, t - 20);
				break;
			}
			case 24 :
				buildWaterGarden(m, x, y);
				break;

		}
	}

	// adds a town feature in specified area
	public static void addFeature(Map m, int x1, int y1, int x2, int y2,
			int dx, int dy, int t) {
		// randomize feature
		if (t == 0) {
			t = Rand.d(10);
		}

		switch (t) {
			case 1 :
				addShop(m, x1, y1, x2, y2, dx, dy, 0);
				break;

			default :
				addRoom(m, x1, y1, x2, y2, dx, dy);
				break;
		}

	}

	public static void addGraveYard(Map m, int x1, int y1, int x2, int y2) {
		for (int i = 0; i < ((x2 - x1 + 1) * (y2 - y1 + 1)) / 8; i++) {
			m.addThing(Lib.createType("IsGraveStone", m.getLevel()), x1, y1,
					x2, y2);
		}

		for (int i = 0; i < ((x2 - x1 + 1) * (y2 - y1 + 1)) / 18; i++) {
			m.addThing(Lib.createType("potted flower", m.getLevel()), x1, y1,
					x2, y2);
		}
	}

	public static void addTownies(Map m) {
		for (int i = 0; i <= 10; i++) {
			Point ts = m.findFreeSquare();
			m.addThing(Lib.create("farmer"), ts.x, ts.y);
		}
		for (int i = 0; i <= 6; i++) {
			Point ts = m.findFreeSquare();
			m.addThing(Lib.create("village woman"), ts.x, ts.y);
		}
		for (int i = 0; i <= 4; i++) {
			Point ts = m.findFreeSquare();
			m.addThing(Lib.create("village girl"), ts.x, ts.y);
		}
		for (int i = 0; i <= 8; i++) {
			Point ts = m.findFreeSquare();
			m.addThing(Lib.create("guard"), ts.x, ts.y);
		}

		Point ts = m.findFreeSquare();
		m.addThing(Lib.create("teacher"), ts.x, ts.y);
	}

	public static Thing stockingPoint(Thing sk,String type, int level) {
		Thing t = Lib.create("base stocking point");
		t.set("Name", "shop stocking point");
		t.set("StockingType", type);
		t.set("StockingLevel", level);
		t.set("Shopkeeper",sk);
		return t;
	}

	// Create standard shops
	//
	// note that areas are likely to be rotated
	// this will mess up GuardAI(x1,y1,x2,y2) objects
	// hence use secret markers to mark out the shop area
	public static void addShop(Map m, int x1, int y1, int x2, int y2, int dx,
			int dy, int t) {
		int doorx, doory;
		doorx = (dx == 0)
				? RPG.rspread(x1 + 1, x2 - 1)
				: ((dx == -1) ? x1 : x2);
		doory = (dy == 0)
				? RPG.rspread(y1 + 1, y2 - 1)
				: ((dy == -1) ? y1 : y2);
		m.fillArea(x1, y1, x2, y2, Tile.FLOOR);
		m.fillBorder(x