import software.amazon.smithy.model.validation.ValidationEvent
import software.amazon.smithy.rust.codegen.core.util.dq
import software.amazon.smithy.rust.codegen.core.util.expectTrait

class PatternTraitEscapedSpecialCharsValidator : AbstractValidator() {
    private val specialCharsWithEscapes =
        mapOf(
            '\b' to "\\b",
            '\u000C' to "\\f",
            '\n' to "\\n",
            '\r' to "\\r",
            '\t' to "\\t",
        )
    private val specialChars = specialCharsWithEscapes.keys

    override fun validate(model: Model): List<ValidationEvent> {
        val shapes =
            model.getStringShapesWithTrait(PatternTrait::class.java) +
                model.getMemberShapesWithTrait(PatternTrait::class.java)
        return shapes
            .filter { shape -> checkMisuse(shape) }
            .map { shape -> makeError(shape) }
            .toList()
    }

    private fun makeError(shape: Shape): ValidationEvent {
        val pattern = shape.expectTrait<PatternTrait>()
        val replacement =
            pattern.pattern.toString()
                .map { specialCharsWithEscapes.getOrElse(it) { it.toString() } }
                .joinToString("")
                .dq()
        val message =
            """
            Non-escaped special characters used inside `@pattern`.
            You must escape them: `@pattern($replacement)`.
            See https://github.com/smithy-lang/smithy-rs/issues/2508 for more details.
            """.trimIndent()
        return error(shape, pattern, message)
    }

    private fun checkMisuse(shape: Shape): Boolean {
        val pattern = shape.expectTrait<PatternTrait>().pattern.pattern()
        return pattern.any(specialChars::contains)
    }
}
/*
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
 * SPDX-License-Identifier: Apache-2.0
 */

package software.amazon.smithy.rust.codegen.server.smithy.protocols

import software.amazon.smithy.rust.codegen.core.smithy.generators.http.HttpBindingCustomization
import software.amazon.smithy.rust.codegen.core.smithy.generators.protocol.ProtocolSupport
import software.amazon.smithy.rust.codegen.core.smithy.protocols.HttpBindingResolver
import software.amazon.smithy.rust.codegen.core.smithy.protocols.Protocol
import software.amazon.smithy.rust.codegen.core.smithy.protocols.ProtocolGeneratorFactory
import software.amazon.smithy.rust.codegen.core.smithy.protocols.parse.JsonParserCustomization
import software.amazon.smithy.rust.codegen.core.smithy.protocols.restJsonFieldName
import software.amazon.smithy.rust.codegen.core.smithy.protocols.serialize.JsonSerializerGenerator
import software.amazon.smithy.rust.codegen.core.smithy.protocols.serialize.StructuredDataSerializerGenerator
import software.amazon.smithy.rust.codegen.server.smithy.ServerCodegenContext
import software.amazon.smithy.rust.codegen.server.smithy.customizations.BeforeIteratingOverMapOrCollectionJsonCustomization
import software.amazon.smithy.rust.codegen.server.smithy.customizations.BeforeSerializingMemberJsonCustomization
import software.amazon.smithy.rust.codegen.server.smithy.generators.protocol.ServerRestJsonProtocol

/**
 * RestJson1 server-side protocol factory. This factory creates the [ServerHttpProtocolGenerator]
 * with RestJson1 specific configurations.
 */
class ServerRestJsonFactory(
    private val additionalParserCustomizations: List<JsonParserCustomization> = listOf(),
    private val additionalServerHttpBoundProtocolCustomizations: List<ServerHttpBoundProtocolCustomization> = listOf(),
    private val additionalHttpBindingCustomizations: List<HttpBindingCustomization> = listOf(),
) : ProtocolGeneratorFactory<ServerHttpBoundProtocolGenerator, ServerCodegenContext> {
    override fun protocol(codegenContext: ServerCodeg


希望される場合は [お問い合わせ](../contact.md) の内容をご確認の上、<qa@abci.ai> までクラウドストレージアカウント名をお知らせください。

!!! note
    - 削除したアカウントは元に戻せません。アカウント名に間違いがないか確認してください。
    - 削除したアカウントの番号は欠番になります。1グループあたり10アカウント作成できますので、1グループのみに所属していてアカウントを1つ削除した場合、最後に作られるアカウントの番号は 10 ではなく 11 (例: "aaa00000aa.11") です。
# ABCI クラウドストレージ ご利用時の注意

## マルチパートアップロード（MPU）失敗時の課金について {#notice-mpu-fail}

Multipart Upload (MPU) を使用したデータアップロードに失敗した場合に、意図しない課金が発生することがあります。データのアップロードの中断や失敗が起き、以下に当てはまる場合には、[こちら](usage.md#abort-mpu) を確認し、途中となっている MPU を完全に停止させて下さい。

* 使用しているクライアントツール（AWS CLI や s3cmd）が定義する、MPU が自動的に有効になる程の大きなデータをアップロードした。
* クライアントツールのプロセスを強制停止するなど、データのアップロードを中断したり、クライアントツールが意図せずに停止したりした。

!!! note
    MPU 自動でが有効となるデータサイズは、AWS CLI ではデフォルトで [8MB](https://docs.aws.amazon.com/cli/latest/topic/s3-config.html#multipart-threshold) 、s3cmd では [15MB](https://s3tools.org/kb/item13.htm)と定義されています

### MPU の失敗と課金発生の詳細

ABCIクラウドストレージは、データアップロード時にデータを分割、同時に送信することでアップロードを高速化する Multipart Uload (MPU) に対応しています。
MPU は、クライアントツールで定義されるデータサイズを超過するデータに対して自動的に有効となり、例えば AWS CLI の初期設定は、デフォルトで 8MB を超過するデータのアップロードに対して MPU が有効になります。
MPU を使用したデータのアップロードでは、分割されたデータはまずサーバの一時領域に格納され、アップロードが完了した後、指定のパスに完全なオブジェクトとして移動されます。

ここで、上述の一時領域は課金の対象となります。しかし、MPU が失敗した時、一時領域に保存されたデータが残ったままになり、意図しない課金が発生する場合があります。

AWS CLI では、CTRL-C を用いてクライアントとサーバ間の動作を停止してもこの問題は発生しませんが、


link,.rst-content h4 .headerlink,.rst-content h5 .headerlink,.rst-content h6 .headerlink,.rst-content dl dt .headerlink,.icon{display:inline-block;font-family:FontAwesome;font-style:normal;font-weight:normal;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.fa-lg{font-size:1.33333em;line-height:0.75em;vertical-align:-15%}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-fw{width:1.28571em;text-align:center}.fa-ul{padding-left:0;margin-left:2.14286em;list-style-type:none}.fa-ul>li{position:relative}.fa-li{position:absolute;left:-2.14286em;width:2.14286em;top:0.14286em;text-align:center}.fa-li.fa-lg{left:-1.85714em}.fa-border{padding:.2em .25em .15em;border:solid 0.08em #eee;border-radius:.1em}.pull-right{float:right}.pull-left{float:left}.fa.pull-left,.rst-content .pull-left.admonition-title,.rst-content h1 .pull-left.headerlink,.rst-content h2 .pull-left.headerlink,.rst-content h3 .pull-left.headerlink,.rst-content h4 .pull-left.headerlink,.rst-content h5 .pull-left.headerlink,.rst-content h6 .pull-left.headerlink,.rst-content dl dt .pull-left.headerlink,.pull-left.icon{margin-right:.3em}.fa.pull-right,.rst-content .pull-right.admonition-title,.rst-content h1 .pull-right.headerlink,.rst-content h2 .pull-right.headerlink,.rst-content h3 .pull-right.headerlink,.rst-content h4 .pull-right.headerlink,.rst-content h5 .pull-right.headerlink,.rst-content h6 .pull-right.headerlink,.rst-content dl dt .pull-right.headerlink,.pull-right.icon{margin-left:.3em}.fa-spin{-webkit-animation:spin 2s infinite linear;-moz-animation:spin 2s infinite linear;-o-animation:spin 2s infinite linear;animation:spin 2s infinite linear}@-moz-keyframes spin{0%{-moz-transform:rotate(0deg)}100%{-moz-transform:rotate(359deg)}}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg)}}@-o-keyframes spin{0%{-o-transform:rotate(0deg)}100%{-o-transform:rotate(359deg)}}@-ms-keyframes spin{0%{-ms-transform:rotate(0deg)}100%{-ms-transform:rotate(359deg)}}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(359deg)}}.fa-rotate-90{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=$rotation);-webkit-transform:rotate(90deg);-moz-transform:rotate(90deg);-ms-transform:rotate(90deg);-o-transform:rotate(90deg);transform:rotate(90deg)}.fa-rotate-180{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=$rotation);-webkit-transform:rotate(180deg);-moz-transform:rotate(180deg);-ms-transform:rotate(180deg);-o-transform:rotate(180deg);transform:rotate(180deg)}.fa-rotate-270{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=$rotation);-webkit-transform:rotate(270deg);-moz-transform:rotate(270deg);


9F9C;
}
@font-face {
  font-family: "HarmonyOS Sans SC";
  src:
    local("HarmonyOS Sans SC"),
    url("./65d340d5139cb986d314c576701fef6c.woff2") format("woff2");
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  unicode-range:
    U+4F96, U+4FE0, U+5098, U+50AD, U+53AD, U+555E, U+5687, U+582F, U+589C,
    U+58B3, U+5BF5, U+5DBC, U+6065, U+60B6, U+61F6, U+61FC, U+646F, U+647B,
    U+6493, U+64BE, U+64F1, U+650F, U+6689, U+66EC, U+68F2, U+6953, U+6BC6,
    U+6C2B, U+6FF0, U+701D, U+7192, U+71D9, U+71FB, U+720D, U+7587, U+760B,
    U+7661, U+766E, U+775C, U+779E, U+78EF, U+79AA, U+7A62, U+7AAA, U+7C3E,
    U+7CDE, U+7D8F, U+7DB8, U+7DDD, U+7DEF, U+7E37, U+7E46, U+7E6D, U+7E79,
    U+7FA8, U+8073, U+807E, U+814E, U+8525, U+852D, U+8588, U+863F, U+87FB,
    U+881F, U+8993, U+8A23, U+8A60, U+8AA1, U+8AF1, U+8B0E, U+8B20, U+8B74,
    U+8C4E, U+8C9E, U+8EC0, U+919E, U+91AC, U+91D8, U+9223, U+9240, U+92C5,
    U+9318, U+931A, U+9320, U+934D, U+938A, U+93FD, U+9472, U+947F, U+95A5,
    U+96B4, U+96DB, U+97CC, U+985B, U+986B, U+9913, U+99C1, U+99DD, U+99F1,
    U+9C49, U+9D3F, U+9F4B;
}
@font-face {
  font-family: "HarmonyOS Sans SC";
  src:
    local("HarmonyOS Sans SC"),
    url("./25021f42f99604b5fa8adcf5c1e913a7.woff2") format("woff2");
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  unicode-range:
    U+50D5, U+5147, U+524E, U+52F3, U+56D1, U+588A, U+58D8, U+58FA, U+5C4D,
    U+5CA1, U+5EC2, U+5EDA, U+5EEC, U+5F4E, U+5F65, U+60F1, U+61A4, U+61C7,
    U+64CB, U+665D, U+69D3, U+6A01, U+6BBC, U+6DF5, U+6E3E, U+6E4


ry(
                "/google.ai.generativelanguage.v1beta3.DiscussService/CountMessageTokens",
                request_serializer=discuss_service.CountMessageTokensRequest.serialize,
                response_deserializer=discuss_service.CountMessageTokensResponse.deserialize,
            )
        return self._stubs["count_message_tokens"]

    def close(self):
        self.grpc_channel.close()

    @property
    def kind(self) -> str:
        return "grpc"

__all__ = ("DiscussServiceGrpcTransport",)


e(guideViewRoot)
              }
            } else if (!outsideClick) {//外部不能点击(即设置一个空的点击事件，不执行)
              guideViewRoot.click {}
            }
            //引导的点击事件
            if (insideClick) {
              guideView.click {
                extHideGuide(view = guideViewRoot)
                clickGuid?.invoke(guideView)
              }
            }
            //先移除
            guideView.removeParent()
            //添加到需要显示的容器中
            guideViewRoot.addView(guideView)
            //添加容器
            rootView.addView(guideViewRoot, -1, -1)
            //设置布局位置
            val lp = guideView.layoutParams as FrameLayout.LayoutParams
            lp.gravity = Gravity.NO_GRAVITY
            //有相对位置的View
            if (dependView != null) {
              //获取到位置的View信息
              val location = IntArray(2)
              dependView.getLocationOnScreen(location)
              //左上角位置信息
              val dependX = location[0]
              val dependY = if (rootView.paddingTop > 0)
                location[1] - rootView.paddingTop else location[1]
              when (position) {
                GuidePosition.TOP_START -> {
                  lp.topMargin = dependY - guideViewHeight
                  lp.marginStart = dependX
                }
                GuidePosition.TOP_CENTER -> {
                  lp.topMargin = dependY - guideViewHeight
                  lp.marginStart =
                    (dependX + dependView.width / 2f - guideViewWidth / 2f)
                      .toInt()
                }
                GuidePosition.TOP_END -> {
                  lp.topMargin = dependY - guideViewHeight
                  lp.marginStart = dependX + dependView.width - guideViewWidth
                }
                GuidePosition.BOTTOM_START -> {
                  lp.topMargin = dependY + dependView.height
                  lp.marginStart = dependX
                }
                GuidePosition.BOTTOM_CENTER -> {
                  lp.topMargin = dependY + dependView.height
                  lp.marginStart =
                    (dependX + dependView.width / 2f - guideViewWidth / 2f)
                      .toInt()
                }
                GuidePosition.BOTTOM_END -> {
                  lp.topMargin = dependY + dependView.height
                  lp.marginStart = dependX + dependView.width - guideViewWidth
                }
                GuidePosition.START -> {
                  lp.topMargin =
                    (dependY + dependView.height / 2f - guideViewHeight / 2f)
                      .toInt()
                  lp.marginStart = dependX - guideViewWidth

                }
                GuidePosition.CENTER -> {
                  lp.topMargin =
                    (dependY + dependView.height / 2f - guideViewHeight / 2f)
                      .toInt()
                  lp.marginStart =
                    (dependX + dependView.width / 2f


     (192.0 / 255.0, 48.0 / 255.0, 48.0 / 255.0, 0.375),
                3,
                0,
            );
        }
    }

    if let Some(goals) = get_goals(state) {
        for goal in goals.iter() {
            (p.draw_poly_with_matrix_and_colours)(
                mat4x4_mul(&view, &scale_translation(1.0 / 16.0, goal.x, goal.y)),
                (83.0 / 255.0, 36.0 / 255.0, 36.0 / 255.0, 1.0),
                (192.0 / 255.0, 192.0 / 255.0, 48.0 / 255.0, 1.0),
                3,
                0,
            );
        }
    }

    let mut smell_fraction = state.portal_smell as f32 / PORTAL_SMELL_NS_PER as f32;

    smell_fraction = if smell_fraction > 1.0 {
        1.0
    } else if smell_fraction < 0.0 {
        0.0
    } else {
        smell_fraction
    };

    (p.draw_poly_with_matrix_and_colours)(
        mat4x4_mul(&view, &scale_translation(1.0 / 16.0, state.x, state.y)),
        (
            smell_fraction,
            smell_fraction,
            if smell_fraction > 63.0 / 255.0 {
                smell_fraction
            } else {
                63.0 / 255.0
            },
            1.0,
        ),
        (192.0 / 255.0, 192.0 / 255.0, 48.0 / 255.0, 1.0),
        1,
        0,
    );

    match state.phase {
        PlaceFirstPortal(_, _) | PlaceSecondPortal(_, _, _) => {
            draw_portal(mouse_x, mouse_y);
        }
        _ => {}
    }

    false
}

fn get_portals_mut(state: &mut State) -> Option<&mut Vec<PlainPortal>> {
    get_portals_mut_parts(&mut state.screens, state.screen_index)
}

fn get_portals_mut_parts(
    screens: &mut Vec<Screen>,
    screen_index: ScreenIndex,
) -> Option<&mut Vec<PlainPortal>> {
    screens
        .get_mut(screen_index)
        .map(|screen| &mut screen.plain_portals)
}

fn get_function_portals_mut(state: &mut State) -> Option<&mut Vec<FunctionPortal>> {
    get_function_portals_mut_parts(&mut state.screens, state.screen_index)
}

fn get_function_portals_mut_parts(
    screens: &mut Vec<Screen>,
    screen_index: ScreenIndex,
) -> Option<&mut Vec<FunctionPortal>> {
    screens
        .get_mut(screen_index)
        .map(|screen| &mut screen.function_portals)
}

fn get_portals_mut_parts_pair(
    screens: &mut Vec<Screen>,
    screen_index_1: ScreenIndex,
    screen_index_2: ScreenIndex,
) -> Pair<&mut Vec<PlainPortal>> {
    index_twice(screens, screen_index_1, screen_index_2)
        .map_into(|screen| &mut screen.plain_portals)
}

fn get_goals(state: &mut State) -> Option<&Vec<Goal>> {
    get_goals_parts(&mut state.screens, state.screen_index)
}

fn get_goals_parts(screens: &mut Vec<Screen>, screen_index: ScreenIndex) -> Option<&Vec<Goal>> {
    screens.get_mut(screen_index).map(|screen| &screen.goals)
}

fn get_goal_nodes(state: &mut State) -> Option<&Vec<GoalNode>> {
    get_goal_nodes_parts(&mut state.screens, state.screen_index)
}

fn get_goal_nodes_parts(
    screens: &mut Vec<Screen>,
    screen_index: ScreenIndex,
) -> Option<&Vec<GoalNode>> {
    screens
        .get_mut(screen_index)
        .map(|screen| &screen.goal_nodes)
}

// from https://stackoverflow.com/a/30075629


summary>
        public static Color WithGreen(this Color self, float green)
        {
            self.g = green;
            return self;
        }

        /// <summary>
        /// Return 'color' where 'color'.b = blue.
        /// </summary>
        public static Color WithBlue(this Color self, float blue)
        {
            self.b = blue;
            return self;
        }

        /// <summary>
        /// Return 'color' where 'color'.component = value.
        /// </summary>
        public static Color WithComponent(this Color self, RGBA component, float value)
        {
            switch (component)
            {
                case RGBA.Red:
                    self.r = value;
                    break;
                case RGBA.Green:
                    self.g = value;
                    break;


算子の前後、コロンの前後、カンマの後ろとセミコロンの後ろににホワイトスペースを1個置く
* カンマ、セミコロンの前にはホワイトスペースは置かない

```ruby
sum = 1
a, b = 1, 2
1 > 2 ? true : false; puts 'Hi'
```

* 1行の文字数は80文字以下にする
* 80文字を超える時は、以下のルールで改行を入れる
  * メソッドチェーンを途中で改行するときは ``` . ``` （ドット）を改行後の先頭に持ってくる

  ```ruby
    "one string".something_long_long_method(arg1)
      .other_cool_long_method(arg2)
      .another_awsome_long_method(arg3)
  ```

  * メソッドの定義を途中で改行するときは Syntax Error にならないよう適宜 ``` () ``` を用いて改行をする

  ```ruby
    def long_method_name(parameter_1, parameter_2, parameter_3, parameter_4,
      parameter_5, parameter_6, options)
  ```

* 長い文字列リテラルのせいで 80文字を越えてしまう場合のみ、80文字を越えることを許可する

  ```ruby
  # ok
  foo = "This is a very very long string that can't be broken down and may contain #{variable}"
  ```

* [] () {} 全ての前後にホワイトスペースは置かない

```ruby
a = [1, 2, 3] #"[" の左のスペースは = の後ろのもの
[1, 2, 3].each{|num| puts num * 2}
def method(a, b, c)
```

* 改行を含む長い文字列にはヒアドキュメントを使う。ただし、短いメッセージを定義する時や、メソッドチェーンしたいときには、文字列リテラルを使っても良い。
```ruby
  # good
      foo = <<-EOS
From this valley they say you are going,
We will miss your bright eyes and sweet smile,
For they say you are taking the sunshine
That has brightened our pathways a while.
      EOS

  # ok
      foo = "Hi, Johnny.
How are you?"

  # bad
      foo = "From this valley they say you are going,\nWe will miss your bright eyes and sweet smile,\nFor they say you are taking the sunshine\nThat has brightened our pathways a while."
```

* 仮引数の後にホワイトスペースを入れる

```ruby
# good
arr.each{|elem| puts elem}

# bad
arr.each{|elem|puts elem}
```

* Hash は基本的に1.9の省略記法で記載する

```ruby
# bad
h = {:key => :value}

# good
h = {key: :value}
```

* ``` do ``` と仮引数の間にホワイトスペースを入れる

```ruby
# good
arr.each do |elem|
  puts elem
end

# bad
arr.each do|elem|
  puts elem
end
```

* コメントアウトの ``` # ``` の後にはホワイトスペースを置く

```ruby
# this is bad comment

# this is good comment
```

* コメントアウトの ``` =begin ``` の行には何も書いてはいけない

```ruby
=begin # bad style
  do
    so


days.org/blog/index.xml">Feed

CFP OPEN
Campinas
Macapá
Shanghai
Charlotte
Prague
Tokyo
Salt Lake City

Propose a talk at an event near you!

About

    devopsdays is a worldwide community conference series for anyone interested in IT improvement.

    About devopsdays

    Privacy Policy

    Code of Conduct

<!DOCTYPE html>

<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta charset="utf-8">
<meta name="HandheldFriendly" content="True">
<meta name="MobileOptimized" content="320">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><meta name="generator" content="Hugo 0.57.2" />
<meta property="og:title" content="Deploying and Scaling Microservices in Containers With Docker Swarm" />
<meta name="twitter:title" content="Deploying and scaling microservices in containers with Docker Swarm"/>
<meta itemprop="name" content="Deploying and scaling microservices in containers with Docker Swarm"><meta property="og:description" content="The Docker Engine has native orchestration capabilities since June 2016. It touts unmatched operational simplicity and security, but does it live up to the hype?
That’s what we will see in this tutorial. In less than 2 hours, you will setup your own Docker cluster, and use it to “build, ship, and run” from development to production a sample application architectured around microservices.
We will overview the concepts and features of Docker’s “Swarm Mode,“including the “least privilege” security model, load balancing, service discovery, rolling upgrades, and much more." />
  <meta name="twitter:description" content="The Docker Engine has native orchestration capabilities since June 2016. It touts unmatched operational simplicity and security, but does it live up to the hype?
That’s what we will see in this tutorial. In less than 2 hours, yo


22.9.1: 3600.0s
factor:0.130","OCTERACT-4.7.1: 776.0s
Baron-22.9.1: 3600.0s
factor:0.218","OCTERACT-4.7.1: 78.0s
Baron-22.9.1: 3600.0s
factor:0.024","OCTERACT-4.7.1: 1433.0s
Baron-22.9.1: 3600.0s
factor:0.400","OCTERACT-4.7.1: 245.0s
Baron-22.9.1: 3600.0s
factor:0.071","OCTERACT-4.7.1: 3.0s
Baron-22.9.1: 3600.0s
factor:0.004","OCTERACT-4.7.1: 11.0s
Baron-22.9.1: 3600.0s
factor:0.006","OCTERACT-4.7.1: 33.0s
Baron-22.9.1: 3600.0s
factor:0.012","OCTERACT-4.7.1: 187.0s
Baron-22.9.1: 3600.0s
factor:0.055","OCTERACT-4.7.1: 125.0s
Baron-22.9.1: 3600.0s
factor:0.037","OCTERACT-4.7.1: 587.0s
Baron-22.9.1: 3600.0s
factor:0.165","OCTERACT-4.7.1: 1.0s
Baron-22.9.1: 3600.0s
factor:0.003","OCTERACT-4.7.1: 200.0s
Baron-22.9.1: 3600.0s
factor:0.058","OCTERACT-4.7.1: 202.0s
Baron-22.9.1: 3600.0s
factor:0.059","OCTERACT-4.7.1: 1743.0s
Baron-22.9.1: 3600.0s
factor:0.486","OCTERACT-4.7.1: 119.0s
Baron-22.9.1: 3600.0s
factor:0.036"],"name":"OCTERACT-4.7.1","text":["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\ud83d\udd3a","\ud83d\udd3b","\ud83d\udd3b","\ud83d\udd3b","\ud83d\udd3b","\ud83d\udd3b","\ud83d\udd3b","\ud83d\udd3b","\ud83d\udd3b","\ud83d\udd3b","\ud83d\udd3b","\ud83d\udd3b","\ud83d\udd3b","\ud83d\udd3b","\u274c","\ud83d\udd3b","\ud83d\udd3b","\ud83d\udd3b","\ud83d\udd3b","\ud83d\udd3b","\u274c","\u274c","\ud83d\udd3b","\ud83d\udd3b","\ud83d\udd3b","\ud83d\udd3b","\ud83d\udd3b","\ud83d\udd3b","\ud83d\udd3b","\ud83d\udd3b","\ud83d\udd3b","\ud83d\udd3b","\ud83d


、定于6月21日，在六塘、冲脉、马山3个片召开全区性的“刮台风”大会，先把刮的对象集中关押，开大会时押到会场批斗。常委分工是：吕仁志、覃社明在六塘；韦天常、乔宗周到冲脉；韦光甫负责马山片。

   3、各公社回去后立即召开党支部扩大会，传达会议精神，摸出以上7种人该刮的名单报区革委，发动群众参加大会。

   1968年6月19日晚或20日，大多数公社都召开支书扩大会议或队干会议，传达了区会议精神，同时做好“刮台风”大会的准备。

   6月21日中午，六塘区主动向“阶级敌人猛刮12级台风”，分别在六塘、冲脉、马山三个墟场同时发生了。造成了骇人听闻的流血大惨案。这一天六塘片打死三界公社的梁显金、玉顶华；拉燕公社的兰文达、潘中宝；六塘公社的刘良权、覃世坤、韦文清、梁祥春；中团公社的韦延烈；肯社公社的全友义。油兰公社当天没有死人。覃社明检查后，批评支书梁文荣说：“你同情敌人，违抗命令。”冲脉片打死冲脉公社的李盛宗、韦焕新、打成重伤的李太西次日死亡；大要公社的覃有旺、覃有标、覃有群；米村公社因“刮台风”对象逃跑，而未打死人。马山片打死马山公社的兰春林；北浩公社的张旭腾；八甲公社的韦其才；马山小学的韦俊才、莫少斌。横山公社的李社合被打伤后，回去又被打死。这一天，3个片共打死22人。

   6月24日，六塘区革委召开公社支书和机关领导会议。吕仁志总结成绩，表扬打死人多的公社。又批评不打死人的米村、肯洛、油兰公社的支书软弱无力。21日未打死人的米村公社由于受到批评（因“刮台风”对象逃跑），于是，25日押送韦明庚、韦春林父子两人到冲脉街游


href='#toc'>Table of Contents

Name

tsd - scan and report contents of an HDF4 SDS

Synopsis

tsd [parameter=value]

Description

tsd lists the contents of a HDF Scientific Data Set (SDS).  It
can optionally print out the data (in ascii format) from all or specified
SDS# to a specified file, with or without their coordinate values.

Parameters

The
following parameters are recognized in any order if the keyword is also
given:

in=hdf_file

Input file (HDF FLOAT32 SDS), no default.

out=table_file

Optional output file in which an ascii dump of all SDS, printed side by
side, are dumped. Obviously in this mode all datasets must have the same
rank and shape, selected SDS that are not the same size and rank as the
first one, will not be displayed. Currently all the data are accumulated
in memory. Default: none.

format=C_fmt

printf(3)
-like Format specification,
in which the data will be dumped if output requested. A space is automatically
inserted between the columns representing an SDS. [Default: %g].

coord=t|f

Print out the coordinate system too?  If selected, they will be printed
in the first NDIM columns (except if dummy=f was selected, see below),
followed by whichever columns were selected (see select= below). [Default:
f].

select=

Select the SDS# by their position in the file, the first one
being numbered 1. [Default: all].

dummy=t|f

Should coordinate values of dummy
axes (of which the dimension is 1) be displayed? Default: t

Example

    % tsd hdf000bg
Found 3 scientific data sets in /d/hdf000bg
1: Y-VELOCITY AT TIME=0.00E+00(40,67) cm/sec  -> [2680 elements of type: 5
(FLOAT32)]
2: Z-VELOCITY AT TIME=0.00E+00(40,67) cm/sec  -> [2680 elements of type: 5
(FLOAT32)]
3: DENSITY AT TIME=0.00E+00(40,67) gms/cm**3  -> [2680 elements of type: 5
(FLOAT32)]

Note that the dimensions listed, (40,67) in the example above, are not
the usual FORTRAN-convention. The last index (67) will be the one running
fastest, i.e. data is stored (and dumped if requested) in  column-major mode.
For example, in the FITS  conversion program (see <


z-transform: translate(-50%, -50%);
  -ms-transform: translate(-50%, -50%);
  -o-transform: translate(-50%, -50%);
  transform: translate(-50%, -50%); }

.md-btn:active:before {
  width: 120%;
  padding-top: 120%;
  transition: width .2s ease-out, padding-top .2s ease-out; }

.md-btn.orange {
  background-color: #e67e22; }

.md-btn.orange:hover, .btn.orange:focus {
  background-color: #d35400; }

.md-btn.red {
  background-color: #ff5722;
  color: rgba(255, 255, 255, 0.87); }

.md-btn.red:hover, .btn.red:focus {
  background-color: #f4511e; }
/* ----------------------------------------------------------------------
  Material Design Checkbox - by Ravikumar Chauhan
------------------------------------------------------------------------- */
.md-checkbox {
  color: #818181;
  font-size: 15px;
  font-weight: bold;
  font-family: 'Roboto', sans-serif;
  letter-spacing: .5px; }
  .md-checkbox .input-checkbox {
    position: relative;
    display: inline-block;
    width: 32px;
    height: 32px;
    text-align: center;
    vertical-align: -9px; }
    .md-checkbox .input-checkbox input[type="checkbox"] {
      visibility: hidden;
      position: absolute;
      left: 7px;
      bottom: 7px;
      margin: 0;
      padding: 0;
      outline: none;
      cursor: pointer;
      opacity: 0; }
      .md-checkbox .input-checkbox input[type="checkbox"] + .checkbox:before {
        position: absolute;
        left: 4px;
        bottom: 8px;
        width: 18px;
        height: 18px;
        font-family: 'Material Icons';
        font-weight: normal;
        font-style: normal;
        font-size: 24px;
        line-height: 1;
        text-transform: none;
        letter-spacing: normal;
        word-wrap: normal;
        white-space: nowrap;
        direction: ltr;
        vertical-align: -6px;
        /* Support for all WebKit browsers. */
        -webkit-font-smoothing: antialiased;
        /* Support for Safari and Chrome. */
        text-rendering: optimizeLegibility;
        /* Support for Firefox. */
        -moz-osx-font-smoothing: grayscale;
        /* Support for IE. */
        font-feature-settings: 'liga';
        transition: all .2s ease;
        z-index: 1; }
      .md-checkbox .input-checkbox input[type="checkbox"] + .checkbox:before {
        content: "\e835";
        color: #717171; }
      .md-checkbox .input-checkbox input[type="checkbox"]:checked + .checkbox:before {
        content: "\e834"; }
      .md-checkbox .input-checkbox input[type="checkbox"]:active:not(:disabled) + .checkbox:before {
        transform: scale3d(0.88, 0.88, 1); }
      .md-checkbox .input-checkbox input[type="checkbox"]:disabled + .checkbox:before {
        color: rgba(0, 0, 0, 0.157) !important; }
  .md-checkbox.checkbox-light label, .md-checkbox.checkbox-light .label {
    color: #FFF; }
  .md-checkbox.checkbox-light input[


  UMat umatDst = new UMat();
                umatDst.Create(umat.Rows, umat.Cols, DepthType.Cv32F, umat.NumberOfChannels,
                    UMat.Usage.AllocateDeviceMemory);

                String buildOpts = String.Format("-D dstT={0}", Ocl.OclInvoke.TypeToString(umat.Depth));

                String sourceStr = @"
__constant sampler_t samplerLN = CLK_NORMALIZED_COORDS_FALSE | CLK_ADDRESS_CLAMP_TO_EDGE | CLK_FILTER_LINEAR;
__kernel void myshift(const image2d_t src, float shift_x, float shift_y, __global uchar* dst, int dst_step, int dst_offset, int dst_rows, int dst_cols)
{
   int x = get_global_id(0);
   int y = get_global_id(1);
   if (x >= dst_cols) return;
   int dst_index = mad24(y, dst_step, mad24(x, (int)sizeof(dstT), dst_offset));
   __global dstT *dstf = (__global dstT *)(dst + dst_index);
   float2 coord = (float2)((float)x+0.5f+shift_x, (float)y+0.5f+shift_y);
   dstf[0] = (dstT)read_imagef(src, samplerLN, coord).x;
}";

                using (CvString errorMsg = new CvString())
                using (Ocl.ProgramSource ps = new Ocl.ProgramSource(sourceStr))
                using (Ocl.Kernel kernel = new Ocl.Kernel())
                using (Ocl.Image2D image2d = new Ocl.Image2D(umat))
                using (Ocl.KernelArg ka = new Ocl.KernelArg(Ocl.KernelArg.Flags.ReadWrite, umatDst))
                {
                    float shiftX = 100.5f;
                    float shiftY = -50.0f;

                    bool success = kernel.Create("myshift", ps, buildOpts, errorMsg);
                    EmguAssert.IsTrue(success, errorMsg.ToString());
                    int idx = 0;
                    idx = kernel.Set(idx, image2d);
                    idx = kernel.Set(idx, ref shiftX);
                    idx = kernel.Set(idx, ref shiftY);
                    idx = kernel.Set(idx, ka);
                    IntPtr[] globalThreads = new IntPtr[] { new IntPtr(umat.Cols), new IntPtr(umat.Rows), new IntPtr(1) };
                    success = kernel.Run(globalThreads, null, true);
                    EmguAssert.IsTrue(success, "Failed to run the kernel");
                    using (Mat matDst = umatDst.GetMat(AccessType.Read))
                    using (Mat saveMat = new Mat())
                    {
                        matDst.ConvertTo(saveMat, DepthType.Cv8U, 255.0);
                        FileInfo fi = new FileInfo("tmp.jpg");
                        saveMat.Save(fi.FullName);
                    }
                }
            }
        }

        [Test]
        public void TestOclChangeDefaultDevice()
        {
            if (CvInvoke.HaveOpenCL && CvInvoke.UseOpenCL)
            {
                using (VectorOfOclPlatformInfo oclPlatformInfos = Ocl.OclInvoke.GetPlatformsInfo())
                {
                    if (oclPlatformInfos.Size > 0)
                    {
                        for (int i = 0; i < oclPlatformInfos.Size; i++)
                        {
                            Ocl.PlatformInfo platformInfo = oclPlatformInfos[i];

                            for (int j = 0; j < platformInfo.DeviceNumber; j++)
                            {
                                Ocl.Device device = platformInfo.GetDevice(j);

                                Trace.WriteLine(String.Format("{0}Setting device to {1}", Environment.NewLine, device.Name));
                                //OclDevice d = new OclDevice();
                                //d.Set(


, [r4, #0x30]
	ldr r3, [sp, #0x28]
	add r0, r4, #0
	mov r2, #2
	bl ov11_0224C474
	cmp r6, r0
	beq _0222ED54
	add r0, r5, #0
	mov r1, #5
	mov r2, #0
	bl GetMonData
	cmp r0, #0
	beq _0222ED54
	add r0, r5, #0
	mov r1, #0x4c
	mov r2, #0
	bl GetMonData
	cmp r0, #0
	bne _0222ED54
	add r0, r5, #0
	mov r1, #0xa2
	mov r2, #0
	bl GetMonData
	cmp r0, #0
	bne _0222ED60
	b _0222ED54
_0222ED2C:
	mov r1, #5
	mov r2, #0
	bl GetMonData
	cmp r0, #0
	beq _0222ED54
	add r0, r5, #0
	mov r1, #0x4c
	mov r2, #0
	bl GetMonData
	cmp r0, #0
	bne _0222ED54
	add r0, r5, #0
	mov r1, #0xa2
	mov r2, #0
	bl GetMonData
	cmp r0, #0
	bne _0222ED60
_0222ED54:
	ldr r0, [r7, #0x68]
	add r6, r6, #1
	bl Party_GetCount
	cmp r6, r0
	blt _0222ECE0
_0222ED60:
	str r6, [sp]
	ldr r1, [r4, #0x30]
	ldr r3, [sp, #0x20]
	add r0, r4, #0
	mov r2, #2
	bl ov11_0224C54C
	ldr r0, [sp, #0x20]
	ldr r1, [r4, #0x44]
	add r0, r0, #1
	str r0, [sp, #0x20]
	cmp r0, r1
	blt _0222ECC8
_0222ED7A:
	ldr r1, [r4, #0x30]
	add r0, r4, #0
	bl ov11_0224B240
	ldr r0, _0222EEE0 ; =0x000023F8
	mov r1, #1
	strb r1, [r4, r0]
	b _0222EE3E
_0222ED8A:
	ldr r6, _0222EEE4 ; =ov11_0225D998
	mov r5, #0
	add r7, r4, #0
_0222ED90:
	add r0, sp, #0x3c
	strb r5, [r0]
	ldrb r1, [r6]
	strb r1, [r0, #1]
	add r0, r4, #0
	add r1, sp, #0x3c
	bl ov11_0224CA64
	add r1, r0, #0
	add r0, r4, #0
	str r1, [r7, #0x34]
	bl ov11_0225377C
	add r5, r5, #1
	add r6, r6, #1
	add r7, r7, #4
	cmp r5, #2
	blt _0222ED90
	mov r0, #0
	str r5, [r4, #0x44]
	str r0, [sp, #0x24]
	add r7, r4, #0
_0222EDBC:
	ldr r0, [sp,


/overview/remove.png" alt="Marketplace" />

## Available Plugins
- **[GitHub](/docs/marketplace/plugins/marketplace-plugin-github)**
- **[OpenAI](/docs/marketplace/plugins/marketplace-plugin-openai)**
- **[Plivo](/docs/marketplace/plugins/marketplace-plugin-plivo)**

:::info For Plugin Developers
Refer to the **[Plugin Development guide](/docs/contributing-guide/marketplace/marketplace-setup)** to learn how to create plugins for the ToolJet Marketplace.
:::---
id: azuread
title: AzureAD
---

# AzureAD Single Sign-on

:::info
To construct a Well Known URL refer this link :: https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-protocols-oidc
:::

- Open your organisation page and select `app registration`

- Select `new registration`

- Open your organisation page and select App registration.

- Enter name, select supported account type and enter the redirect URL which can be copied from `Manage SSO -> Open Id -> Redirect URL, click on register`.

- Application will be registered and will be able to view the details

- Configure Application (Client) ID as `client id` in Open Id configuration page.

- Click on `Add certificate or secret` next to the **Client credentials**.

- Click on `+New Client Secret`

- Give a description, set the expiry, and then click on the `Add` button.

- Secret will be created, copy value and add it to the `client secret` section of Open Id SSO config.

- You can brand the redirect page using the branding and properties option.

---
id: docker
title: Docker
---

:::warning
The following guide is intended for contributors to set-up ToolJet locally. If you're interested in **self-hosting** ToolJet, please refer to the **[Setup](/docs/setup/)** section.
:::

Docker compose is the easiest way to setup ToolJet server and client locally.

:::info
If you rather want to try out ToolJet locally with docker, you can follow the steps [here](https://docs.tooljet.com/docs/setup/docker-local).
:::

## Prerequisites

Make sure you have the latest version of `docker` and `docker-compose` installed.

[Official docker installation guide](https://docs.docker.com/desktop/)

[Official docker-compose installation guide](https://docs.docker.com/compose/install/)

We recommend:

```bash
docker --version
Docker version 19.03.12, build 48a66213fe

docker-compose --version
docker-compose version 1.26.2


()
		cfg.Port = util2.GetRandomFreePort()
		s = server.NewServer(cfg)
		s.NonBlockingStart()
	})

	AfterEach(func() {
		s.BlockingStop()
		dbm.TestTearDown(db)
	})

	var loadTestData = func() ([]mariadb.IssueVariantRow, []mariadb.ComponentVersionIssueRow, error) {
		issueVariants, err := test.LoadIssueVariants(test.GetTestDataPath("../database/mariadb/testdata/component_version_order/issue_variant.json"))
		if err != nil {
			return nil, nil, err
		}
		cvIssues, err := test.LoadComponentVersionIssues(test.GetTestDataPath("../database/mariadb/testdata/component_version_order/component_version_issue.json"))
		if err != nil {
			return nil, nil, err
		}
		return issueVariants, cvIssues, nil
	}

	When("ordering by severity", func() {
		BeforeEach(func() {
			seeder.SeedIssueRepositories()
			seeder.SeedIssues(10)
			components := seeder.SeedComponents(1)
			seeder.SeedComponentVersions(10, components)
			issueVariants, componentVersionIssues, err := loadTestData()
			Expect(err).To(BeNil())
			// Important: the order need to be preserved
			for _, iv := range issueVariants {
				_, err := seeder.InsertFakeIssueVariant(iv)
				Expect(err).To(BeNil())
			}
			for _, cvi := range componentVersionIssues {
				_, err := seeder.InsertFakeComponentVersionIssue(cvi)
				Expect(err).To(BeNil())
			}
		})

		var runOrderTest = func(orderDirection string, expectedOrder []string) {
			client := graphql.NewClient(fmt.Sprintf("http://localhost:%s/query", cfg.Port))
			b, err := os.ReadFile("../api/graphql/graph/queryCollection/componentVersion/withOrder.graphql")
			Expect(err).To(BeNil())
			str := string(b)
			req := graphql.NewRequest(str)
			req.Var("filter", map[string]string{})
			req.Var("first", 10)
			req.Var("after", "")
			req.Var("orderBy", []map[string]string{
				{"by": "severity", "direction": orderDirection},
			})
			req.Header.Set("Cache-Control", "no-cache")
			ctx := context.Background()
			err = client.Run(ctx, req, &respData)
			Expect(err).To(BeNil(), "Error while unmarshaling")
			Expect(respData.ComponentVersions.TotalCount).To(Equal(10))
			Expect(len(respData.ComponentVersions.Edges)).To(Equal(10))
			for i, id := range expectedOrder {
				Expect(respData.ComponentVersions.Edges[i].Node.ID).To(BeEquivalentTo(id))
			}
		}

		It("can order descending by severity", func() {
			runOrderTest("desc", []string{"3", "8", "2", "7", "1", "6", "5", "4", "10", "9"})
		})

		It("can order ascending by severity", func() {
			runOrderTest("asc", []string{"9", "10", "4", "5", "6", "1", "7", "2", "8", "3"})
		})
	})
})

var _ = Describe("Creating ComponentVersion via API", Label("e2e", "ComponentVersions"), func() {

	var seeder *test.DatabaseSeeder
	var seedCollection *test.SeedCollection
	var s *server.Server
	var cfg util.Config
	var componentVersion entity.ComponentVersion
	var componentId int64
	var db *mariadb.SqlDatabase

	BeforeEach(func() {
		var err error
		db = dbm.NewTestSchema()
		seeder, err = test.NewDatabaseSeeder(dbm.DbConfig())
		Expect(err).To(BeNil(), "Database Seeder Setup should work")

		cfg =


 Säbelflossen",nil},
[2776] = {"Rachsüchtige Woge",nil},
[2778] = {"Deckmatrose Moishe","Schwarzmeerräuber"},
[2779] = {"Prinz Nazjak",nil},
[2780] = {"Verwalter Nevlin",nil},
[2781] = {"Verwalter Weston",nil},
[2782] = {"Verwalter Alaric",nil},
[2783] = {"Marez Schattenkutte",nil},
[2784] = {"König Magni Bronzebart","Lord von Eisenschmiede"},
[2785] = {"Theldurin der Verirrte",nil},
[2786] = {"Gerrig Knochengriff",nil},
[2787] = {"Zaruk",nil},
[2788] = {"Lehrling Kryten",nil},
[2789] = {"Skuerto",nil},
[2790] = {"Großsteinmetz Marmorstein","Königlicher Steinmetzbund"},
[2791] = {"Wütender Felselementar",nil},
[2792] = {"Gor'mul",nil},
[2793] = {"Kor'gresh Frostzorn",nil},
[2794] = {"Beschworener Wächter",nil},
[2795] = {"Lenny \"Finger\" McCoy",nil},
[2796] = {"Faelyssa",nil},
[2797] = {"Hovrak Darmspalter","Verkäufer von Babymurlocs"},
[2798] = {"Pand Steinbinder","Lehrer für Erste Hilfe"},
[2799] = {"Lucian Fenner",nil},
[2801] = {"Tresa MacGregor","Verkäuferin von Babymurlocs"},
[2802] = {"Susan Tillinghast",nil},
[2803] = {"Malygen","Gemischtwaren"},
[2804] = {"Kurden Blutklaue","Kampfmeister der Kriegshymnenschlucht"},
[2805] = {"Deneb Wandler","Reagenzien"},
[2806] = {"Bale","Gemischtwaren"},
[2807] = {"Wellenrufer der Säbelflossen",nil},
[2808] = {"Vikki Lonsav","Gastwirtin"},
[2809] = {"Eber",nil},
[2810] = {"Hammon Karwn","Überragender Handwerker"},
[2812] = {"Drovnar Starkbräu","Alchemiebedarf"},
[2813] = {"[UNUSED] Thurgas","Geistheiler"},
[2814] = {"Narj Schnitzelschnitt","Metzger"},
[2815] = {"[UNUSED] Teresa Shore","Geistheilerin"},
[2816] = {"Androd Fadran","Lederverarbeitungsbedarf"},
[2817] = {"Riggelfuzz",nil},
[2818] = {"Brenn","Überragender Metzger"},
[2819] = {"Tunkk","Lederverarbeitungsbedarf"},
[2820] = {"Graud","Gemischtwaren"},
[2821] = {"Keena","Handwerkswaren"},
[2829] = {"Verhungernder Bussard",nil},
[2830] = {"Ausgedörrter Bussard",nil},
[2831] = {"Riesenbussard",nil},
[2832] = {"Nixxrax Ozapft","Speis & Trank"},
[2833] = {"DEBUG - Gossip Gryphon Master","Greifenmeister"},
[2834] = {"Myizz Glücksfang","Angellehrer"},
[2835] = {"Cedrik Prosa","Greifenmeister"},
[2836] = {"Brikk Kühnwerk","Schmiedekunstlehrer"},
[2837] = {"Jaxin Chong","Alchemielehrer"},
[2838] = {"Crazk


LoadingMode.dragEnd:
      case RefreshLoadingMode.running:
      case RefreshLoadingMode.done:
      case RefreshLoadingMode.ignore:
      case RefreshLoadingMode.failed:
        mode = this;
        break;
    }
    return mode;
  }
}

typedef OnRunning = FutureOr<void> Function();

typedef RefreshLoadingBuilder = Widget Function(
    BuildContext context,
    double offset,
    double maxExtent,
    RefreshLoadingMode mode,
    bool running,
    bool success);

class RunningDelegate {
  RunningDelegate({
    this.onDragStart,
    this.onDragEnd,
    this.onDragIgnore,
    this.onDone,
    this.onRunning,
    this.waitingOnDone = const Duration(milliseconds: 800),
    this.maxDurationOnRunning = const Duration(milliseconds: 1500),
    this.triggerMode = RefreshIndicatorTriggerMode.onEdge,
    required this.maxExtent,
    required this.builder,
  }) : assert(maxExtent > 0.0);
  final VoidCallback? onDragStart;

  /// 当拖动距离达到[maxExtent]调用
  final VoidCallback? onDragEnd;
  final VoidCallback? onDragIgnore;
  final VoidCallback? onDone;
  final OnRunning? onRunning;
  final RefreshLoadingBuilder builder;
  final double maxExtent;
  final RefreshIndicatorTriggerMode triggerMode;
  final Duration waitingOnDone;
  final Duration maxDurationOnRunning;

  /// 生命周期自动设置
  _RefreshBase? _refresh;
  BuildContext? _context;

  void show() {
    if (_context != null && _refresh != null) {
      final position = Scrollable.of(_context!).position;
      position.jumpTo(position.minScrollExtent);
      _refresh!
        .._setValue(maxExtent)
        .._setMode(RefreshLoadingMode.running);
    }
  }

  void hide() {
    _refresh?._setValue(0.0);
  }

  void refreshLoadingFailed() {
    _refresh?._setMode(RefreshLoadingMode.failed);
  }
}

class _Refresh extends _RefreshBase {
  @override
  bool getCanLoading(ScrollStartNotification n) {
    return n.metrics.extentBefore == 0;
  }

  @override
  void onOverScroll(OverscrollNotification n) {
    final mes = n.metrics;

    final isAtEdge = mes.extentBefore == 0.0;
    final overscroll = n.overscroll;
    // print('...... $overscroll | $isAtEdge | $value');
    if (overscroll < 0 || (isAtEdge && value > 0.0)) {
      final newValue = (value - overscroll).clamp(0.0, maxExtent);

      _setValue(newValue);
    }
  }

  @override
  void onScrollUpdate(ScrollUpdateNotification n) {
    final scrollDelta = n.scrollDelta;
    if (scrollDelta != null) {
      final mes = n.metrics;
      if (n.dragDetails == null) {
        // return;
      }
      if ((value > 0.0) && (scrollDelta > 0 || mes.extentBefore == 0.0)) {
        final newValue = (value - scrollDelta).clamp(0.0, maxExtent);
        Scrollable.of(n.context!).position.correctBy(-scrollDelta);
        _setValue(newValue);
      }
    }
  }

  @override
  void onOverScrollIndicator(OverscrollIndicatorNotification n) {
    if (n.leading) {
      n.disallowIndicator();
    }
  }
}

class _Loading extends _RefreshBase {
  @override
  bool getCanLoading(ScrollStartNotification n) {
    return n.metrics.extentAfter == 0;
  }

  @override
  void onOverScroll(OverscrollNotification n) {
    final


("No index found"));
        assertIndexRowTtl(indexCfs, indexedVal, initialTtl);

        int updatedTtl = 9999;
        execute("INSERT INTO %s (k, c ,v) VALUES (?, ?, 0) USING TTL ?", basePk, indexedVal, updatedTtl);

        assertIndexRowTtl(indexCfs, indexedVal, updatedTtl);
    }

    @Test
    public void indexBatchStatements() throws Throwable
    {
        // see CASSANDRA-10536
        createTable("CREATE TABLE %s (a int, b int, c int, PRIMARY KEY (a, b))");
        createIndex("CREATE INDEX ON %s(c)");

        // Multi partition batch
        execute("BEGIN BATCH\n" +
                "UPDATE %1$s SET c = 0 WHERE a = 0 AND b = 0;\n" +
                "UPDATE %1$s SET c = 1 WHERE a = 1 AND b = 1;\n" +
                "APPLY BATCH");
        assertRows(execute("SELECT * FROM %s WHERE c = 0"), row(0, 0, 0));
        assertRows(execute("SELECT * FROM %s WHERE c = 1"), row(1, 1, 1));

        // Single Partition batch
        execute("BEGIN BATCH\n" +
                "UPDATE %1$s SET c = 2 WHERE a = 2 AND b = 0;\n" +
                "UPDATE %1$s SET c = 3 WHERE a = 2 AND b = 1;\n" +
                "APPLY BATCH");
        assertRows(execute("SELECT * FROM %s WHERE c = 2"), row(2, 0, 2));
        assertRows(execute("SELECT * FROM %s WHERE c = 3"), row(2, 1, 3));
    }

    @Test
    public void indexStatementsWithConditions() throws Throwable
    {
        // see CASSANDRA-10536
        createTable("CREATE TABLE %s (a int, b int, c int, PRIMARY KEY (a, b))");
        createIndex("CREATE INDEX ON %s(c)");

        execute("INSERT INTO %s (a, b, c) VALUES (0, 0, 0) IF NOT EXISTS");
        assertRows(execute("SELECT * FROM %s WHERE c = 0"), row(0, 0, 0));

        execute("INSERT INTO %s (a, b, c) VALUES (0, 0, 1) IF NOT EXISTS");
        assertEmpty(execute("SELECT * FROM %s WHERE c = 1"));

        execute("UPDATE %s SET c = 1 WHERE a = 0 AND b =0 IF c = 0");
        assertRows(execute("SELECT * FROM %s WHERE c = 1"), row(0, 0, 1));
        assertEmpty(execute("SELECT * FROM %s WHERE c = 0"));

        execute("DELETE FROM %s WHERE a = 0 AND b = 0 IF c = 0");
        assertRows(execute("SELECT * FROM %s WHERE c = 1"), row(0, 0, 1));

        execute("DELETE FROM %s WHERE a = 0 AND b = 0 IF c = 1");
        assertEmpty(execute("SELECT * FROM %s WHERE c = 1"));

        execute("BEGIN BATCH\n" +
                "INSERT INTO %1$s (a, b, c) VALUES (2, 2, 2) IF NOT EXISTS;\n" +
                "INSERT INTO %1$s (a, b, c) VALUES (2, 3, 3)\n" +
                "APPLY BATCH");
        assertRows(execute("SELECT * FROM %s WHERE c = 2"), row(2, 2, 2));
        assertRows(execute("SELECT * FROM %s WHERE c = 3"), row(2, 3, 3));
    }

    @Test
    public void indexCorrectlyMarkedAsBuildAndRemoved() throws Throwable
    {
        String selectBuiltIndexesQuery = String.format("SELECT * FROM %s.\"%s\"",
                                                       SchemaConstants.SYSTEM_KEYSPACE_NAME,
                                                       SystemKeyspace.BUILT_INDEXES);

        // Wait for any background index clearing tasks to complete. Warn: When we used to run tests in parallel there
        // could also be cross test class talk and have other indices pop up here.
        Util.spinAssertEquals(0, () -> {
            try
            {
                return execute(selectBuiltIndexesQuery).size();
            }
            catch (Throwable e)
            {
                throw new AssertionError(e);
            }
        }, 60);

        String indexName = "build_remove_test_idx";
        String tableName = createTable("CREATE TABLE %s (a int, b int, c int, PRIMARY KEY (a, b))");
        createIndex(String.format("CREATE INDEX %s ON %%s(c)", indexName));
        waitForIndex(KEYSPACE, tableName, indexName);

        // check that there are no other rows in the built indexes table
        assertRows(execute(selectBuilt


.group.xp", defaultValue = "2.0")
	public static float PREMIUM_GROUPXP_RATE;
	@Property(key = "gameserver.rate.vip.group.xp", defaultValue = "3.0")
	public static float VIP_GROUPXP_RATE;
	/**
	 * Quest XP Rates - Regular (1), Premium (2), VIP (3)
	 */
	@Property(key = "gameserver.rate.regular.quest.xp", defaultValue = "2")
	public static float QUEST_XP_RATE;
	@Property(key = "gameserver.rate.premium.quest.xp", defaultValue = "4")
	public static float PREMIUM_QUEST_XP_RATE;
	@Property(key = "gameserver.rate.vip.quest.xp", defaultValue = "6")
	public static float VIP_QUEST_XP_RATE;
	/**
	 * Gathering XP Rates - Regular (1), Premium (2), VIP (3)
	 */
	@Property(key = "gameserver.rate.regular.gathering.xp", defaultValue = "1.0")
	public static float GATHERING_XP_RATE;
	@Property(key = "gameserver.rate.premium.gathering.xp", defaultValue = "2.0")
	public static float PREMIUM_GATHERING_XP_RATE;
	@Property(key = "gameserver.rate.vip.gathering.xp", defaultValue = "3.0")
	public static float VIP_GATHERING_XP_RATE;
	/**
	 * Gathering Count Rates - Regular (1), Premium (1), VIP (1)
	 */
	@Property(key = "gameserver.rate.regular.gathering.count", defaultValue = "1")
	public static int GATHERING_COUNT_RATE;
	@Property(key = "gameserver.rate.premium.gathering.count", defaultValue = "1")
	public static int PREMIUM_GATHERING_COUNT_RATE;
	@Property(key = "gameserver.rate.vip.gathering.count", defaultValue = "1")
	public static int VIP_GATHERING_COUNT_RATE;
	/**
	 * Crafting XP Rates - Regular (1), Premium (2), VIP (3)
	 */
	@Property(key = "gameserver.rate.regular.crafting.xp", defaultValue = "1.0")
	public static float CRAFTING_XP_RATE;
	@Property(key = "gameserver.rate.premium.crafting.xp", defaultValue = "2.0")
	public static float PREMIUM_CRAFTING_XP_RATE;
	@Property(key = "gameserver.rate.vip.crafting.xp", defaultValue = "3.0")
	public static float VIP_CRAFTING_XP_RATE;
	/**
	 * Quest Kinah Rates - Regular (1), Premium (2), VIP (3)
	 */
	@Property(key = "gameserver.rate.regular.quest.kinah", defaultValue = "1.0")
	public static float QUEST_KINAH_RATE;
	@Property(key = "gameserver.rate.premium.quest.kinah", defaultValue = "2.0")
	public static float PREMIUM_QUEST_KINAH_RATE;
	@Property(key = "gameserver.rate.vip.quest.kinah", defaultValue = "3.0")
	public static float VIP_QUEST_KINAH_RATE;
	/**
	 * Quest AP Rates - Regular (1), Premium (2), VIP (3)
	 */
	@Property(key = "gameserver.rate.regular.quest.ap", defaultValue = "1.0")
	public static float QUEST_AP_RATE;
	@Property(key = "gameserver.rate.premium.quest.ap", defaultValue = "2.0")
	public static float PREMIUM_QUEST_AP_RATE;
	@Property(key = "gameserver.rate.vip.quest.ap", defaultValue = "3.0")
	public static float VIP_QUEST_AP_RATE;
	/**
	 * Quest GP Rates - Regular (1), Premium


        }
    }

    pub fn envelope(&self) -> &Envelope {
        &self.envelope
    }

    pub fn message_id(&self) -> &str {
        &self.message_id
    }

    pub fn message(self) -> Message {
        self.message
    }

    pub async fn message_to_string(mut self) -> Result<String, io::Error> {
        let mut message_content = String::new();
        self.message.read_to_string(&mut message_content).await?;
        Ok(message_content)
    }
}
<reponame>Tiqur/Rust-RayTracer<gh_stars>1-10
use std::ops::{AddAssign, Add, Sub, Mul};
#[derive(Copy, Clone)]
pub struct Rgb {
    pub r: f32,
    pub g: f32,
    pub b: f32
}

impl Rgb {
    // converts to value able to be used with buffer
    pub fn to_int(&self) -> u32 {
        let r = if self.r < 0.0 { 0.0 } else if self.r > 1.0 { 1.0 } else { self.r };
        let g = if self.g < 0.0 { 0.0 } else if self.g > 1.0 { 1.0 } else { self.g };
        let b = if self.b < 0.0 { 0.0 } else if self.b > 1.0 { 1.0 } else { self.b };
        return ( 65536.0 * (r * 255.0).round() + 256.0 * (g * 255.0).round() + (b * 255.0).round() ) as u32;
    }

    // mixes two colors using linear interpolation
    pub fn mix(&self, c: &Rgb, t: f32) -> Rgb {
        return Rgb {
            r: ( self.r + (c.r - self.r) * t ),
            g: ( self.g + (c.g - self.g) * t ),
            b: ( self.b + (c.b - self.b) * t )
        }
    }

    pub fn div(&self, f: f32) -> Rgb {
        Rgb {
            r: self.r / f,
            g: self.g / f,
            b: self.b / f
        }
    }

    pub fn mulF(&self, f: f32) -> Rgb {
        Rgb {
            r: self.r * f,
            g: self.g * f,
            b: self.b * f
        }
    }

    pub fn square_root(&self) -> Rgb {
        Rgb {
            r: self.r.sqrt(),
            g: self.g.sqrt(),
            b: self.b.sqrt()
        }
    }

}

impl Add for Rgb {
    type Output = Rgb;
    fn add(self, other: Rgb) -> Rgb {
        return Rgb {
            r: self.r + other.r,
            g: self.g + other.g,
            b: self.b + other.b
        }
    }
}

impl Sub for Rgb {
    type Output = Rgb;
    fn sub(self, other: Rgb) -> Rgb {
        return Rgb {
            r: self.r - other.r,
            g: self.g - other.g,
            b: self.b - other.b
        }
    }
}

impl Mul for Rgb {
    type Output = Rgb;
    fn mul(self, other: Rgb) -> Rgb {
        Rgb {
            r: self.r * other.r,
            g: self.g * other.g,
            b: self.b * other.b
        }
    }
}
impl AddAssign for Rgb {
    fn add_assign(&mut self, other: Self) {
        self.r += other.r;
        self.g += other.g;
        self.b += other.b;
    }
}

impl Default for Rgb {
    fn default() -> Rgb {
        Rgb {
            r: 0.0,
            g: 0.0,
            b: 0.0
        }
    }
}use actix_rt::Runtime;

use crate::db::{C_M, D_M, D_T, InstanceDaoImpl, MetaCache


tle-font-family);
  font-weight: 700;
  line-height: 289px;
  font-size: 200px;
}
@media (max-width: 575.98px) {
  .error_page_content .erro_code {
    font-size: 150px;
  }
}

/*	Iconbox Styles  */
.iconbox-style1 {
  background-color: #ffffff;
  border-radius: 8px;
  margin-bottom: 30px;
  padding: 40px 30px 30px;
  position: relative;
  -webkit-transition: all 0.3s ease;
  -moz-transition: all 0.3s ease;
  -ms-transition: all 0.3s ease;
  -o-transition: all 0.3s ease;
  transition: all 0.3s ease;
}
.iconbox-style1 .icon {
  color: #1F4B3F;
  display: inline-block;
  font-size: 40px;
  position: relative;
  z-index: 1;
}
.iconbox-style1 .icon:before {
  background-color: #FBF7ED;
  border-radius: 50%;
  bottom: -10px;
  content: "";
  height: 40px;
  position: absolute;
  right: -20px;
  width: 40px;
  z-index: -1;
  -webkit-transition: all 0.3s ease;
  -moz-transition: all 0.3s ease;
  -ms-transition: all 0.3s ease;
  -o-transition: all 0.3s ease;
  transition: all 0.3s ease;
}
.iconbox-style1 .title {
  margin-bottom: 5px;
}
.iconbox-style1:hover {
  -webkit-box-shadow: 0px 6px 15px rgba(64, 79, 104, 0.05);
  -moz-box-shadow: 0px 6px 15px rgba(64, 79, 104, 0.05);
  -o-box-shadow: 0px 6px 15px rgba(64, 79, 104, 0.05);
  box-shadow: 0px 6px 15px rgba(64, 79, 104, 0.05);
}
.iconbox-style1.contact-style {
  border: none;
  padding: 0;
}
.iconbox-style1.contact-style .details {
  padding-left: 35px;
}
.iconbox-style1.contact-style:hover {
  box-shadow: none;
}
.iconbox-style1.border-less {
  border: none;
}
.iconbox-style1.border-less:hover {
  box-shadow: none;
}
.iconbox-style1.at-home4 .icon {
  border-radius: 50%;
  -webkit-box-shadow: 0px 25px 70px rgba(1, 33, 58, 0.07);
  -moz-box-shadow: 0px 25px 70px rgba(1, 33, 58, 0.07);
  -o-box-shadow: 0px 25px 70px rgba(1, 33, 58, 0.07);
  box-shadow: 0px 25px 70px rgba(1, 33, 58, 0.07);
  display: inline-block;
  height: 110px;
  line-height: 120px;
  margin-bottom: 20px;
  width: 110px;
  -webkit-transition: all 0.3s ease;
  -moz-transition: all 0.3s ease;
  -ms-transition: all 0.3s ease;
  -o-transition: all 0.3s ease;
  transition: all 0.3s ease;
}
.iconbox-style1.at-home4:hover {
  box-shadow: none;
}
.iconbox-style1.at-home4:hover .icon {
  background-


00000000u32);
        assert_eq!(result, 0x00000000u32);

        let result = ucs1!(0x1234abcdu32);
        assert_eq!(result, 0x57BF72B3u32);
    }

    #[test]
    fn test_lcs0_macro() {
        let result = lcs0!(0x00000000u32);
        assert_eq!(result, 0x00000000u32);

        let result = lcs0!(0x1234abcdu32);
        assert_eq!(result, 0xB291B8A3u32);
    }

    #[test]
    fn test_lcs1_macro() {
        let result = lcs1!(0x00000000u32);
        assert_eq!(result, 0x00000000u32);

        let result = lcs1!(0x1234abcdu32);
        assert_eq!(result, 0xC09BA676u32);
    }

    #[test]
    fn test_add32_macro() {
        let result = add32!(0x00000000u32, 0x00000000u32);
        assert_eq!(result, 0x00000000u32);

        let result = add32!(0xffffffffu32, 0x00000001u32, 0x00000001u32);
        assert_eq!(result, 0x00000001u32);

        let result = add32!(0xffffffffu32, 0xffffffffu32);
        assert_eq!(result, 0xfffffffeu32);
    }
}
<filename>src/persist/src/file.rs<gh_stars>1-10
// Copyright Materialize, Inc. and contributors. All rights reserved.
//
// Use of this software is governed by the Business Source License
// included in the LICENSE file.
//
// As of the Change Date specified in that file, in accordance with
// the Business Source License, use of this software will be governed
// by the Apache License, Version 2.0.

//! File backed implementations for testing and benchmarking.

use std::io::ErrorKind;
use std::path::{Path, PathBuf};
use std::time::Instant;

use anyhow::anyhow;
use async_trait::async_trait;
use fail::fail_point;

use tokio::fs::{self, File, OpenOptions};
use tokio::io::{AsyncReadExt, AsyncWriteExt};

use crate::error::Error;
use crate::location::{Atomicity, BlobMulti, ExternalError};

/// Configuration for opening a [FileBlobMulti].
#[derive(Debug)]
pub struct FileBlobConfig {
    base_dir: PathBuf,
}

impl<P: AsRef<Path>> From<P> for FileBlobConfig {
    fn from(base_dir: P) -> Self {
        FileBlobConfig {
            base_dir: base_dir.as_ref().to_path_buf(),
        }
    }
}

/// Implementation of [BlobMulti] backed by files.
#[derive(Debug)]
pub struct FileBlobMulti {
    base_dir: PathBuf,
}

impl FileBlobMulti {
    /// Opens the given location for non-exclusive read-write access.
    pub async fn open(config: FileBlobConfig) -> Result<Self, ExternalError> {
        let base_dir = config.base_dir;
        fs::create_dir_all(&base_dir).await.map_err(Error::from)?;
        Ok(FileBlobMulti { base_dir })
    }

    fn blob_path(&self, key: &str) -> PathBuf {
        self.base_dir.join(key)
    }
}

#[async_trait]
impl BlobMulti for FileBlobMulti {
    async fn get(&self, _deadline: Instant, key: &str) -> Result<Option<Vec<u8>>, ExternalError> {
        let file_path = self.blob_path(key);
        let mut file = match File::open(file_path).await {
            Ok(file) => file,
            Err(err) if err.kind() == ErrorKind::NotFound => return Ok(None),
            Err(err) => return Err(err.into()),
        };
        let mut buf = Vec::new();
        file.read_to_end(&mut buf).await?;
        Ok(Some(buf))
    }

    async fn list_keys(&self, _deadline: Instant) -> Result<Vec<String>, ExternalError> {
        let base_dir = self.base_dir.canonicalize()?;
        let mut ret = vec![];

        let mut entries = fs::read_dir(&base_dir).await?;
        while let Some(entry) = entries.next_entry().await? {
            let path = entry.path().canonicalize()?;

            if !pa


 """Configure server parameters for optimal performance

        Args:
            read_timeout: Read timeout in milliseconds
            write_timeout: Write timeout in milliseconds
            idle_timeout: Idle timeout in milliseconds
            max_body_size: Maximum request body size in bytes
            concurrency: Maximum number of concurrent connections
            port: Port to listen on (e.g., ':8080', ':9090')

        Raises:
            ValueError: If the port is invalid
        """
        # Validate port
        if not port:
            raise ValueError("Port cannot be empty")

        # Remove leading colon for validation if present
        port_num = port.lstrip(":")
        try:
            port_int = int(port_num)
            if not (1 <= port_int <= 65535):
                raise ValueError(f"Port must be between 1 and 65535, got {port_num}")
        except ValueError:
            raise ValueError(f"Invalid port format: {port_num}")

        self.lib.SetServerConfig(
            c_size_t(read_timeout),
            c_size_t(write_timeout),
            c_size_t(idle_timeout),
            c_size_t(max_body_size),
            c_size_t(concurrency),
            c_char_p(port.encode('utf-8'))
        )

    def start(self):
        """Start the FastPaze server"""
        self.lib.StartServer()


 requiredFields1 = requiredFieldCount(subtype1);
      var requiredFields2 = requiredFieldCount(subtype2);
      var optionalFields1 = optionalFieldCount(subtype1);
      var optionalFields2 = optionalFieldCount(subtype2);
      return requiredFields1 != requiredFields2
          ? requiredFields2.compareTo(requiredFields1)
          : optionalFields1 != optionalFields2
          ? optionalFields2.compareTo(optionalFields1)
          : subtype1.compareTo(subtype2);
    });
  }
}

/// Returns a String representing the underlying Dart type for the provided
/// spec [type].
///
/// This is `Map<String, Object?>` for complex types but can be a simple type
/// for enums.
String _specJsonType(TypeBase type) {
  if (type is TypeReference && _namespaces.containsKey(type.name)) {
    var valueType = _namespaces[type.name]!.typeOfValues;
    return valueType.dartTypeWithTypeArgs;
  }
  return 'Map<String, Object?>';
}

Iterable<String> _wrapLines(List<String> lines, int maxLength) sync* {
  lines = lines.map((l) => l.trimRight()).toList();
  for (var line in lines) {
    while (true) {
      if (line.length <= maxLength) {
        yield line;
        break;
      } else {
        // First try to wrap at the last space before the max length, and fall
        // back to wrapping at the first space if there were none before the
        // max length.
        var lastSpace = line.lastIndexOf(' ', maxLength);
        if (lastSpace == -1) {
          lastSpace = line.indexOf(' ');
        }

        // If we still don't have one, the whole line has no spaces to split on.
        if (lastSpace == -1) {
          yield line;
          break;
        }

        yield line.substring(0, lastSpace);
        line = line.substring(lastSpace + 1);
      }
    }
  }
}

void _writeCanParseMethod(IndentableStringBuffer buffer, Interface interface) {
  buffer
    ..writeIndentedln(
      'static bool canParse(Object? obj, LspJsonReporter reporter) {',
    )
    ..indent()
    ..writeIndentedln('if (obj is Map<String, Object?>) {')
    ..indent();
  // In order to consider this valid for parsing, all fields that must not be
  // undefined must be present and also type check for the correct type.
  // Any fields that are optional but present, must still type check.
  var fields = _getAllFields(
    interface,
  ).whereNot((f) => isNullableAnyType(f.type)).toList();
  for (var i = 0; i < fields.length; i++) {
    var field = fields[i];
    var type = field.type;
    var functionName = '_canParse${_memberNameForType(type)}';
    var invocation =
        "$functionName(obj, reporter, '${field.name}', "
        'allowsUndefined: ${field.allowsUndefined}, allowsNull: ${field.allowsNull}'
        '${type is LiteralType ? ', literal: ${type.valueAsLiteral}' : ''}'
        '${type is LiteralUnionType ? ', literals: {${type.literalTypes.map((t) => t.valueAsLiteral).join(', ')}}' : ''}'
        ')';

    if (i == fields.length - 1) {
      buffer.writeIndentedln('return $invocation;');
    } else {
      buffer
        ..writeIndentedln('if (!$invocation) {')
        ..indent()
        ..writeIndentedln('return false;')
        ..outdent()
        ..writeIndentedln('}');
    }
    if (!_canParseFunctions.containsKey(functionName)) {
      var temp = IndentableStringBuffer();
      _writeCanParseType(temp, interface, type, functionName);
      _can


red .page-item.active .page-link,.dark-mode .accent-red .page-item.active a{background-color:#e74c3c;border-color:#e74c3c;color:#fff}.dark-mode .accent-red .page-item.disabled .page-link,.dark-mode .accent-red .page-item.disabled a{background-color:#fff;border-color:#dee2e6;color:#6c757d}.dark-mode .accent-red [class*=sidebar-dark-] .sidebar a:not(.dropdown-item):not(.btn-app):not(.nav-link):not(.brand-link){color:#c2c7d0}.dark-mode .accent-red [class*=sidebar-dark-] .sidebar a:not(.dropdown-item):not(.btn-app):not(.nav-link):not(.brand-link):hover{color:#fff}.dark-mode .accent-red [class*=sidebar-light-] .sidebar a:not(.dropdown-item):not(.btn-app):not(.nav-link):not(.brand-link){color:#343a40}.dark-mode .accent-red [class*=sidebar-light-] .sidebar a:not(.dropdown-item):not(.btn-app):not(.nav-link):not(.brand-link):hover{color:#212529}.dark-mode .dark-mode.accent-red .page-item .page-link:focus,.dark-mode .dark-mode.accent-red .page-item .page-link:hover{color:#ea6153}.dark-mode .accent-orange .btn-link,.dark-mode .accent-orange .nav-tabs .nav-link,.dark-mode .accent-orange a:not(.dropdown-item):not(.btn-app):not(.nav-link):not(.brand-link):not(.page-link):not(.badge):not(.btn){color:#fd7e14}.dark-mode .accent-orange .btn-link:hover,.dark-mode .accent-orange .nav-tabs .nav-link:hover,.dark-mode .accent-orange a:not(.dropdown-item):not(.btn-app):not(.nav-link):not(.brand-link):not(.page-link):not(.badge):not(.btn):hover{color:#c35a02}.dark-mode .accent-orange .dropdown-item.active,.dark-mode .accent-orange .dropdown-item:active{background-color:#fd7e14;color:#1f2d3d}.dark-mode .accent-orange .custom-control-input:checked~.custom-control-label::before{background-color:#fd7e14;border-color:#aa4e01}.dark-mode .accent-orange .custom-control-input:checked~.custom-control-label::after{background-image:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpath fill='%231f2d3d' d='M6.564.75l-3.59 3.612-1.538-1.55L0 4.26 2.974 7.25 8 2.193z'/%3E%3C/svg%3E")}.dark-mode .accent-orange .custom-control-input:focus:not(:checked)~.custom-control-label::before,.dark-mode .accent-orange .custom-file-input:focus~.custom-file-label,.dark-mode .accent-orange .custom-select:focus,.dark-mode .accent-orange .form-control:focus:not(.is-invalid):not(.is-warning):not(.is-valid){border-color:#fec392}.dark-mode .accent-orange .page-item .page-link{color:#fd7e14}.dark-mode .accent-orange .page-item.active .page-link,.dark-mode .accent-orange .page-item.active a{background-color:#fd7e14;border-color:#fd7e14;color:#fff}.dark-mode .accent-orange .page-item.disabled .page-link,.dark-mode .ac


/*
 https://github.com/waynezxcv/Gallop

 Copyright (c) 2016 waynezxcv <liuweiself@126.com>

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

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

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

#import <UIKit/UIKit.h>
#import "LWTransaction.h"

/**
 *  这个类用于管理所有transactions<LWTransaction *>容器不为空的CALayer对象
 *  LWTransactionGroup把这些CALayer对象放在一个哈希表layersContainers中
 *  LWTransactionGroup注册了一个主线程的runLoopObserver，当状态为(kCFRunLoopBeforeWaiting | kCFRunLoopExit)时，
 *  LWTransactionGroup会遍历layersContainers，来对这些CALayer上的所有LWTransactions执行 commit
 */
@interface LWTransactionGroup : NSObject

/**
 *  获取主线程CFRunLoopObserverRef，注册观察时间点并返回封装后的LWTransactionGroup对象
 *
 *  @return 一个LWTransactionGroup对象
 */
+ (LWTransactionGroup *)mainTransactionGroup;

/**
 *  将一个包含LWTransaction事物的CALayer添加到LWTransactionGroup
 *
 *  @param containerLayer CALayer容器
 */
- (void)addTransactionContainer:(CALayer *)containerLayer;

/**
 *  提交mainTransactionGroup当中所有容器中的所有任务的操作
 *
 */
+ (void)commit;

@end


径可视化、自然语生成    |

### 4.2 主要局限与改进方向

- 抽象度过高，上手门槛陡峭
  - 三维坐标系与六层金字塔虽提供宏大框架，但缺乏面向初学者的渐进式入门示例与步骤指导；
  - 批判性视角虽丰富，却缺少对比实验或用户验证。
- 实证案例较少
  - 文中示例多聚焦于逻辑与 OWL，本体领域外（如微分方程、认知模型）的应用尚待拓展；
  - 缺少大规模真实数据集或用户反馈的对照分析。

#### 4.2.1 渐进式入门示例：三维坐标系定位命题逻辑

1. 确定语言运算符集 LangOps = {∧, ∨, ¬}，|LangOps|=3，假设 M_e=10，则
   e(PL) = log(1+3) / log(1+10) ≈ 0.58
2. 计算结构深度 Depth(PL) = 2，D_max = 5，则 s(PL) = 2/5 = 0.4
3. 动态规则数 TransCount(PL) = 0，T_max = 10，则 d(PL) = 0/10 = 0.0
4. 因此 c(PL) ≈ (0.58, 0.4, 0.0)，可在三维可视化中标记并对比。

#### 4.2.2 渐进式入门示例：简单元模型设计

1. 定义元模型元素 E = {Entity, Relationship}，设 |E|=2，M_e=5，则
   e(M) = log(1+2) / log(1+5) ≈ 0.45
2. 假设模型层次深度 Depth(M) = 3，D_max = 5，则 s(M) = 3/5 = 0.6
3. 无动态规则，d(M) = 0
4. 得到 c(M) ≈ (0.45, 0.6, 0.0)，作为基线示例展示在可视化工具中。

#### 4.2.3 渐进式入门示例：耦合函数计算

- 假设耦合系数 α_es = 1，将 e 和 s 的数值代入 κ_es(e,s) = α_es · e · (1 − s)：
  • 对于 c(M) = (0.45, 0.6, 0.0)：κ_es = 1 × 0.45 × (1 − 0.6) ≈ 0.18
- 同理可计算 κ_sd(s,d) 与 κ_ed(e,d)，建议在电子表格中尝试不同 α_ij 参数。

#### 4.2.4 渐进式入门示例：选型映射最近邻

1. 定义候选工具及其坐标：
   - PL: c(PL) ≈ (0.58, 0.40, 0.00)
   - FOL: c(FOL) ≈ (0.70, 0.45, 0.00)
   - OWL: c(OWL) ≈ (0.80, 0.60, 0.05)
2. 给定目标坐标 t = (0.60, 0.50, 0.00)，计算欧氏距离：
   - d(PL, t) ≈ √[(0.58 − 0.60)² + (0.40 − 0.50)²] ≈ 0.10
   - d(FOL, t) ≈ √[(0.70 − 0.60)² + (0.45 − 0.50)²] ≈ 0.11
   - d(OWL, t) ≈ √[(0.80 − 0.60)² + (0.60 − 0.50)²] ≈ 0.22
3. 选择距离最小的 PL 作为推荐工具。

#### 4.2.5 渐进式入门示例：Three.js 三维可视化

- 在 HTML 页面中引入 Three.js 并初始化场景、相机、渲染器。

```html
<!DOCTYPE html>

<meta charset="utf-8"><title>3D 可视化示例</title>


="crp_excerpt"> HR-Führungskräfte müssen darauf vorbereitet sein, mehrere kritische Phasen einer Krise gleichzeitig zu bewältigen, meint Susanne Bender, ADP. Vier Trends zur…

<img loading="lazy"  width="158" height="100"  src="https://www.hrjournal.de/wp-content/uploads/2020/06/Menschenmenge_1.jpg" class="crp_thumb crp_featured" alt="Studie: Fachkräftemangel wird in 2023 weiter zunehmen" title="Studie: Fachkräftemangel wird in 2023 weiter zunehmen" srcset="https://www.hrjournal.de/wp-content/uploads/2020/06/Menschenmenge_1.jpg 1200w, https://www.hrjournal.de/wp-content/uploads/2020/06/Menschenmenge_1-300x190.jpg 300w, https://www.hrjournal.de/wp-content/uploads/2020/06/Menschenmenge_1-1024x649.jpg 1024w, https://www.hrjournal.de/wp-content/uploads/2020/06/Menschenmenge_1-768x487.jpg 768w, https://www.hrjournal.de/wp-content/uploads/2020/06/Menschenmenge_1-24x15.jpg 24w, https://www.hrjournal.de/wp-content/uploads/2020/06/Menschenmenge_1-36x23.jpg 36w, https://www.hrjournal.de/wp-content/uploads/2020/06/Menschenmenge_1-48x30.jpg 48w" sizes="(max-width: 158px) 100vw, 158px" srcset="https://www.hrjournal.de/wp-content/uploads/2020/06/Menschenmenge_1.jpg 1200w, https://www.hrjournal.de/wp-content/uploads/2020/06/Menschenmenge_1-300x190.jpg 300w, https://www.hrjournal.de/wp-content/uploads/2020/06/Menschenmenge_1-1024x649.jpg 1024w, https://www.hrjournal.de/wp-content/uploads/2020/06/Menschenmenge_1-768x487.jpg 768w, https://www.hrjournal.de/wp-content/uploads/2020/06/Menschenmenge_1-24x15.jpg 24w, https://www.hrjournal.de/wp-content/uploads/2020/06/Menschenmenge_1-36x23.jpg 36w, https://www.hrjournal.de/wp-content/uploads/2020/06/Menschenmenge_1-48x30.jpg 48w" />
Studie: Fachkräftemangel wird in 2023 weiter zunehmen 67 Prozent der Personalentscheider gehen davon aus, dass sich der Fachkräftemangel im nächsten Jahr verschärfen wird, so eine Studie von…

<img loading="lazy"  width="150" height="100"  src="https://www.hrjournal.de/wp-content/uploads/2020/08/Mann_Laptop_1.jpg" class="crp_thumb crp_featured" alt="Fünf Aufgaben für HR- und IT-Führungskräfte" title="Fünf Aufgaben für HR- und IT-Führungskräfte" srcset="https://www.hrjournal.de/wp-content/uploads/2020/08


(r.Context(), user, &update)
	if err != nil {
		return nil, system.NewHTTPError400(err.Error())
	}

	err = s.validateTriggers(update.Config.Helix.Triggers)
	if err != nil {
		return nil, system.NewHTTPError400(err.Error())
	}

	updatedWithTools, err := store.ParseAppTools(&update)
	if err != nil {
		return nil, system.NewHTTPError400(err.Error())
	}

	updatedWithTools.Updated = time.Now()

	// Validate and default tools
	for idx := range updatedWithTools.Config.Helix.Assistants {
		assistant := &update.Config.Helix.Assistants[idx]

		// Ensure we don't have tools with duplicate names
		toolNames := make(map[string]bool)
		for _, tool := range assistant.Tools {
			if toolNames[tool.Name] {
				return nil, system.NewHTTPError400(fmt.Sprintf("tool '%s' has a duplicate name", tool.Name))
			}
			toolNames[tool.Name] = true
		}

		for idx := range assistant.Tools {
			tool := assistant.Tools[idx]
			err = tools.ValidateTool(user.ID, assistant, tool, s.oauthManager, s.Controller.ToolsPlanner, s.mcpClientGetter, true)
			if err != nil {
				return nil, system.NewHTTPError400(err.Error())
			}
		}

		for _, k := range assistant.Knowledge {
			err = s.validateKnowledge(k)
			if err != nil {
				return nil, system.NewHTTPError400(err.Error())
			}
		}
	}

	// Updating the app
	updated, err := s.Store.UpdateApp(r.Context(), updatedWithTools)
	if err != nil {
		return nil, system.NewHTTPError500(err.Error())
	}

	err = s.ensureKnowledge(r.Context(), updated)
	if err != nil {
		return nil, system.NewHTTPError500(err.Error())
	}

	err = s.ensureTriggerConfigurations(r.Context(), updated)
	if err != nil {
		return nil, system.NewHTTPError500(err.Error())
	}

	return updated, nil
}

// deleteApp godoc
// @Summary Delete app
// @Description Delete app.
// @Tags    apps

// @Success 200
// @Param id path string true "App ID"
// @Router /api/v1/apps/{id} [delete]
// @Security BearerAuth
func (s *HelixAPIServer) deleteApp(_ http.ResponseWriter, r *http.Request) (*types.App, *system.HTTPError) {
	user := getRequestUser(r)
	id := getID(r)

	// Users need to specify if they want to keep the knowledge, by default - deleting
	keepKnowledge := r.URL.Query().Get("keep_knowledge") == "true"

	existing, err := s.Store.GetApp(r.Context(), id)
	if err != nil {
		if errors.Is(err, store.ErrNotFound) {
			return nil, system.NewHTTPError404(store.ErrNotFound.Error())
		}
		return nil, system.NewHTTPError500(err.Error())
	}

	err = s.authorizeUserToApp(r.Context(), user, existing, types.ActionDelete)
	if err != nil {
		return nil, system.NewHTTPError403(err.Error())
	}

	if !keepKnowledge {
		knowledge, err := s.Store.ListKnowledge(r.Context(), &store.ListKnowledgeQuery{
			AppID: id,
		})
		if err != nil {
			return nil, system.NewHTTPError500(err.Error())
		}

		for _, k := range knowledge {
			err = s.Store.DeleteKnowledge(r.Context(), k.ID)
			if err != nil {
				return nil, system.NewHTTPError500(err.Error())
			}
		}
	}

	err = s.Store.DeleteApp(r.Context(), id


                vec4(-523.71, 1981.21, 126.75, 340.95),
                vec4(-516.25, 1977.32, 126.49, 170.95),
                vec4(-506.58, 1980.66, 126.14, 0.95),
                vec4(-499.52, 1981.87, 125.88, 0.95),
                vec4(-488.44, 1982.74, 124.64, 200.95),
                vec4(-469.78, 1993.57, 123.86, 20.95),
                vec4(-458.53, 2003.33, 123.73, 30.95),
            },
        },
        ["Quarry"] = {
            Enable = true,
            Job = nil,
            Blip = {
                Enable = true,
                name = "Quarry",
                coords = vec4(2960.9, 2754.14, 43.71, 204.58),
                sprite = 527,
                col = 81,
            },
            Store = {
                { name = "Quarry", coords = vec4(2960.9, 2754.14, 43.71, 204.58), model = `G_M_M_ChemWork_01`, scenario = "WORLD_HUMAN_CLIPBOARD",  },
            },
            Lights = {
                Enable = true,
                prop = "prop_worklight_03a",
                positions = {
                    vec4(2991.59, 2758.07, 42.68, 250.85),
                    vec4(2991.11, 2758.02, 42.66, 194.6),
                    vec4(2971.78, 2743.33, 43.29, 258.54),
                    vec4(2998.0, 2767.45, 42.71, 249.22),
                    vec4(2959.93, 2755.26, 43.71, 164.24),
                },
            },
            OrePositions = {
                vec4(2977.84, 2741.26, 44.74, 240.0),
                vec4(2980.57, 2748.40, 43.20, 210.0),
                vec4(2985.72, 2750.95, 43.26, 200.0),
                vec4(2990.25, 2750.40, 43.60, 150.0),

                vec4(3000.97, 2753.95, 43.70, 220.0),
                vec4(3004.29, 2761.18, 43.84, 240.0),

                vec4(3006.38, 2768.63, 42.79, 270.0),
                vec4(3005.94, 2773.78, 42.51, 270.0),
            },
        },
        ["K4MB1Quarry"] = { -- K4MB1's Mineshaft in the quarry
            Enable = false,
            Job = nil,
            Blip = {
                Enable = false,
                name = "Mining Cave",
                coords = vec4(2937.98, 2744.81, 43.28, 281.59),
                sprite = 527,
                col = 81,
            },
            Store = {
                { name = "Cave Shop", coords = vec4(2908.8, 2643.6, 43.26, 328.32), model = `G_M_M_ChemWork_01`, scenario = "WORLD_HUMAN_CLIPBOARD", },
            },
            Smelting = {
                { blipEnable = false, name = "Smelter", coords = vec3(2921.81, 2653.42, 43.15), sprite = 436, col = 1, },
            },
            Cracking = {
                { name = "Stone Cracking", coords = vec4(2914.9, 2650.78, 43.08, 231.77), sprite = 566, col = 81, blipTrue = false, prop = `prop_vertdrill_01` }, -- Foundary
                { name = "Stone Cracking", coords = vec4(2914.61, 2649.06, 43.19, 272.74), sprite = 566, col = 81, blipTrue = false,


Expression(2))
	i, err := convert.InferMixed([]model.IExpression{thn, els}, v.modelInfo)
	if err != nil {
		return v.badExpression(err.Error(), ctx)
	}

	return &model.IfThenElse{
		Condition:  inferredCnd.WrappedOperand,
		Then:       i.WrappedOperands[0],
		Else:       i.WrappedOperands[1],
		Expression: model.ResultType(i.UniformType),
	}
}

func (v *visitor) VisitSimpleLiteral(ctx *cql.SimpleLiteralContext) model.IExpression {
	switch ctx.GetChild(0).(type) {
	case *cql.SimpleStringLiteralContext:
		return buildLiteral(ctx.GetText(), types.String)
	case *cql.SimpleNumberLiteralContext:
		return buildNumberLiteral(ctx.GetText())
	default:
		return v.badExpression("internal error - grammar should never let us reach this point of VisitSimpleLiteral", ctx)
	}
}

func (v *visitor) VisitLiteralTerm(ctx *cql.LiteralTermContext) model.IExpression {
	val := ctx.GetText()
	switch t := ctx.GetChild(0).(type) {
	case *cql.RatioLiteralContext:
		return v.VisitRatioLiteral(t)
	// Quantities are a special literal term that evaluate to an expression.
	case *cql.QuantityLiteralContext:
		q, err := v.VisitQuantityContext(t.Quantity())
		if err != nil {
			return v.badExpression(err.Error(), ctx)
		}
		return &q
	case *cql.NumberLiteralContext:
		return buildNumberLiteral(val)
	case *cql.StringLiteralContext:
		return buildLiteral(unquoteString(val), types.String)
	case *cql.BooleanLiteralContext:
		return buildLiteral(val, types.Boolean)
	case *cql.LongNumberLiteralContext:
		return buildLiteral(val, types.Long)
	case *cql.NullLiteralContext:
		return buildLiteral(val, types.Any)
	case *cql.DateTimeLiteralContext:
		_, _, err := datehelpers.ParseDateTime(val, time.UTC)
		if err != nil {
			return v.badExpression(err.Error(), ctx)
		}
		return buildLiteral(val, types.DateTime)
	case *cql.DateLiteralContext:
		_, _, err := datehelpers.ParseDate(val, time.UTC)
		if err != nil {
			return v.badExpression(err.Error(), ctx)
		}
		return buildLiteral(val, types.Date)
	case *cql.TimeLiteralContext:
		_, _, err := datehelpers.ParseTime(val, time.UTC)
		if err != nil {
			return v.badExpression(err.Error(), ctx)
		}
		return buildLiteral(val, types.Time)
	default:
		return v.badExpression("internal error - grammar should never let us reach this point of VisitLiteralTerm", ctx)
	}
}

func buildNumberLiteral(val string) *model.Literal {
	t := types.Integer
	if strings.Contains(val, ".") {
		t = types.Decimal
	}
	return buildLiteral(val, t)
}

func buildLiteral(val string, t types.System) *model.Literal {
	return &model.Literal{Value: val, Expression: model.ResultType(t)}
}

func (v *visitor) VisitRatioLiteral(ctx *cql.RatioLiteralContext) model.IExpression {
	quantities := ctx.Ratio().AllQuantity()
	if len(quantities) != 2 {
		return v.badExpression("", ctx)
	}

	numerator, err := v.VisitQuantityContext(quantities[0])
	if err != nil {
		return v.badExpression(fmt.Sprintf("internal error - unable to parse ratio literal, got invalid numerator, %s with error: %s", quantities[0], err.Error()), ctx)
	}
	denominator, err := v.VisitQuantityContext(quantities[1])
	if err != nil {
		return v.badExpression(fmt.Sprintf("internal error - unable to parse ratio literal, got invalid


erface IOReader {
  read(): string[][];
}

// we use tuple here
type MatchData = [Date, string, string, number, number, MatchResult, string]

export class MatchReader {

  constructor(public ioReader: IOReader) {};

  static fromCSV(file: string) {
    return new MatchReader(new ReadCSV(file));
  }

  private convertLine(line: string[]): MatchData {
    return [
      dateStringToDate(line[0]),
      line[1],
      line[2],
      parseInt(line[3]),
      parseInt(line[4]),
      // Type assertion
      // we override TS default behavior
      // we want that is considered not as a string
      // but as a
      // possible value of the enum
      line[5] as MatchResult,
      line[6]
    ]
  }

  read(): MatchData[] {
    // here we use composition as defined in the book
    // desing patterns chapter 'favor composition over inheritance'
    // this pattern works well with delegation
    return this.ioReader.read().map(this.convertLine);
  }

}
import ContentElement from "./Content/ContentElement";

export default class Content {
    private _elements: ContentElement[];

    constructor() {
        this._elements = [];
    }

    get elements(): ContentElement[] {
        return this._elements;
    }

    set elements(value: ContentElement[]) {
        this._elements = value;
    }

}

import { PreciseDuration } from "./PreciseDuration";

export enum BaseNoteValue {
    Large = 3,
    Long = 2,
    Double = 1,
    Whole = 0,
    Half = -1,
    Quater = -2,
    Eighth = -3,
    Sixteenth = -4,
    ThirtySecond = -5,
    SixtyFourth = -6,
    HundredTwentyEighth = -7,
    TwoHundredFiftySixth = -8
}

export module BaseNoteValue {

    export function getDuration(value: BaseNoteValue): PreciseDuration {
        return PreciseDuration.fromDuration(Math.pow(2, value));
    }

    export function getInvertedDuration(value: BaseNoteValue): number {
        if (value > 0)
            throw new RangeError("only whole or shorter values are supported");

        return Math.pow(2, -value);
    }

    export function half(value: BaseNoteValue): BaseNoteValue {
        if (getIsShortestSupported(value))
            throw new RangeError();

        return value - 1;
    }

    export function double(value: BaseNoteValue): BaseNoteValue {
        if (getIsLongestSupported(value))
            throw new RangeError();

        return value + 1;
    }

    export function getIsShortestSupported(value: BaseNoteValue): boolean {
        return value === BaseNoteValue.TwoHundredFiftySixth;
    }

    export function getIsLongestSupported(value: BaseNoteValue): boolean {
        return value === BaseNoteValue.Large;
    }

    export function parse(reciprocalValue: number): BaseNoteValue | undefined {
        switch (reciprocalValue) {
            case 1:
                return BaseNoteValue.Whole;
            case 2:
                return BaseNoteValue.Half;
            case 4:
                return BaseNoteValue.Quater;
            case 8:
                return BaseNoteValue.Eighth;
            case 16:
                return BaseNoteValue.Sixteenth;
            case 32:


 with the lowest "minScale" value appearing first and the largest one
   * appearing last. There must be a "minScale" value below 1 in the list of
   * definitions.
   *
   * Default values for this config item are used, unless overridden by adding
   * this key and value. The default values can be found here:
   * https://github.com/conveyal/transitive.js/blob/6a8932930de003788b9034609697421731e7f812/lib/display/display.js#L78-L92
   */
  zoomFactors?: ZoomFactor[]
}

/**
 * No clue what this global Display thing is. :(
 */
declare class Display {
  constructor(arg0: Transitive)
}

/**
 * A transformation {x, y, k} to the *initial* state of the map., where
 * (x, y) is the pixel offset and k is a scale factor relative to an initial
 * zoom level of 1.0. Intended primarily to support D3-style panning/zooming.
 */
type DisplayTransform = {
  k: number
  x: number
  y: number
}

// FIXME add better typing once more files are typed
type Journeys = { [id: string]: { path: Record<string, unknown> } }

export default class Transitive {
  data: TransitiveData | null | undefined
  display!: CanvasDisplay | SvgDisplay
  el?: HTMLElement
  // FIXME: somehow typing the emit method (which is injected at the end of this
  // file by component-emitter) causes the emit method to not work.
  // emit!: (message: string, transitiveInstance: this, el?: HTMLElement) => void
  labeler!: Labeler
  options?: TransitiveOptions
  network: Network | null | undefined
  renderer!: DefaultRenderer | WireframeRenderer
  styler!: Styler

  constructor(options: TransitiveOptions) {
    if (!(this instanceof Transitive)) return new Transitive(options)

    this.options = options
    if (this.options.zoomEnabled === undefined) this.options.zoomEnabled = true
    if (this.options.autoResize === undefined) this.options.autoResize = true
    if (this.options.groupEdges === undefined) this.options.groupEdges = true

    if (options.el) this.el = options.el

    this.display =
      this.options.display === 'canvas'
        ? new CanvasDisplay(this)
        : new SvgDisplay(this)

    this.data = options.data

    this.setRenderer(this.options.initialRenderer || 'default')

    this.labeler = new Labeler(this)
    this.styler = new Styler(options.styles, this)

    if (options.initialBounds) {
      this.display.fitToWorldBounds([
        sm.forward(options.initialBounds[0]),
        sm.forward(options.initialBounds[1])
      ])
    }
  }

  /**
   * Clear the Network data and redraw the (empty) map
   */
  clearData() {
    this.network = this.data = null
    this.labeler.clear()
    // @ts-expect-error See notes in constructor about emit method.
    this.emit('clear data', this)
  }

  /**
   * Update the Network data and redraw the map
   */
  updateData(data: TransitiveData, resetDisplay?: boolean) {
    this.network = null
    this.data = data
    if (resetDisplay) this.display.reset()
    else if (this.data) this.display.scaleSet = false
    this.labeler.clear()
    // @ts-expect-error See notes in constructor about emit method.
    this.emit('update data', this)
  }

  /**
   * Return the collection of default segment styles for a mode.
   *
   * @param {String} an OTP mode string
   */
  getModeStyles(mode: string) {
    return this.styler.getModeStyles(mode, this.display || new Display(this))
  }

  /** Display/Render Methods **/

  /**
   * Set the DOM element that serves as the main map canvas
   */
  setElement(el?: HTMLElement) {
    if


a:nth-child(3) > div > strong"},{title:"imagetotext",url_keyword:"queue",div:"#lbHeaderP"}],i=0;case 9:if(!(i<a.length)){e.next=16;break}if(!(window.location.href.indexOf(a[i].url_keyword)>-1&&(document.querySelector(a[i].div)||a[i].imagediv&&document.querySelector(a[i].imagediv)))){e.next=13;break}return r=a[i],e.abrupt("break",16);case 13:i++,e.next=9;break;case 16:return e.abrupt("return",r);case 17:case"end":return e.stop()}}),e,void 0)})));function u(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;return new r.default((function(r,a){s.runtime.sendMessage({action:"post",url:e,data:t,delay:n,tries:o},(function(e){"fail"===e&&a("fail"),r(e)}))}))}var c=function(e){return new r.default((function(t){setTimeout(t,e)}))};function d(){return new r.default((function(e,t){s.runtime.sendMessage({action:"getconfig"},(function(t){t.times=t.times||100,e(t)}))}))}var p;p=(0,a.default)(o.default.mark((function e(t){var n,a,i,l,u;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=function(e,t){return e.findIndex((function(e){return t.indexOf(e)>-1}))>-1},a=function(e,t){var r=e.blackListConfig.isOpen;return e.whiteListConfig.isOpen?n(e.whiteListConfig.urlList||[],t)?"inWhiteList":"notInWhiteList":r?n(e.blackListConfig.urlList||[],t)?"inBlackList":"notInBlackList":"normal"},i=function(){return new r.default((function(e){s.runtime.sendMessage({action:"queryCurrentUrl"},(function(t){e(t)}))}))},e.next=5,i();case 5:l=e.sent,u=a(t,l),e.t0=u,e.next="inWhiteList"===e.t0?10:"notInWhiteList"===e.t0?11:"inBlackList"===e.t0?12:"notInBlackList"===e.t0?13:"normal"===e.t0?14:15;break;case 10:case 13:case 14:return e.abrupt("return",!0);case 11:case 12:return e.abrupt("return",!1);case 15:case"end":return e.stop()}}),e,void 0)})))},46593:(e,t,n)=>{e.exports={default:n(80112),__esModule:!0}},36803:(e,t,n)=>{"use strict";t.__esModule=!0;var r,o=n(46593),a=(r=o)&&r.__esModule?r:{default:r};t.default=function(e){return function(){var t=e.apply(this,arguments);return new a.default((function(e,n){return function r(o,i){try{var l=t[o](i),s=l.value}catch(e){return void n(e)}if(!l.done)return a.default.resolve(s).then((function(e){r("next",e)}),(function(e){r("throw",e)}));e(s)}("next


 === 1) {
      const [oneRegion] = regionList
      outputs.region = oneRegion
      outputs['scf'] = functionOutputs[oneRegion]
      if (apigwOutputs) {
        outputs['apigw'] = apigwOutputs[oneRegion]
      }
    } else {
      outputs['scf'] = functionOutputs
      if (apigwOutputs) {
        outputs['apigw'] = apigwOutputs
      }
    }

    this.state.region = regionList[0]
    this.state.regionList = regionList
    this.state.lambdaArn = functionConf.name

    return outputs
  }

  async remove() {
    console.log(`Removing ${CONFIGS.compFullname} App...`)

    const { state } = this
    const { regionList = [] } = state

    const credentials = this.getCredentials()

    const removeHandlers = []
    for (let i = 0; i < regionList.length; i++) {
      const curRegion = regionList[i]
      const curState = state[curRegion]
      const scf = new Scf(credentials, curRegion)
      const apigw = new Apigw(credentials, curRegion)
      const handler = async () => {
        // if disable apigw, no need to remove
        if (state.apigwDisabled !== true) {
          await apigw.remove({
            created: curState.created,
            environment: curState.environment,
            serviceId: curState.serviceId,
            apiList: curState.apiList,
            customDomains: curState.customDomains
          })
        }
        await scf.remove({
          functionName: curState.functionName,
          namespace: curState.namespace
        })
      }
      removeHandlers.push(handler())
    }

    await Promise.all(removeHandlers)

    if (this.state.cns) {
      const cns = new Cns(credentials)
      for (let i = 0; i < this.state.cns.length; i++) {
        await cns.remove({ deleteList: this.state.cns[i].records })
      }
    }

    this.state = {}
  }

  async metrics(inputs = {}) {
    console.log(`Get ${CONFIGS.compFullname} Metrics Datas...`)
    if (!inputs.rangeStart || !inputs.rangeEnd) {
      throw new TypeError(
        `PARAMETER_${CONFIGS.compName.toUpperCase()}_METRICS`,
        'rangeStart and rangeEnd are require inputs'
      )
    }
    const { region } = this.state
    if (!region) {
      throw new TypeError(
        `PARAMETER_${CONFIGS.compName.toUpperCase()}_METRICS`,
        'No region property in state'
      )
    }
    const { functionName, namespace, functionVersion } = this.state[region] || {}
    if (functionName) {
      const options = {
        funcName: functionName,
        namespace: namespace,
        version: functionVersion,
        region,
        timezone: inputs.tz
      }

      const curState = this.state[region]
      if (curState.serviceId) {
        options.apigwServiceId = curState.serviceId
        options.apigwEnvironment = curState.environment || 'release'
      }
      const credentials = this.getCredentials()
      const mertics = new Metrics(credentials, options)
      const metricResults = await mertics.getDatas(
        inputs.rangeStart,
        inputs.rangeEnd,
        Metrics.Type.All
      )
      return metricResults
    }
    throw new TypeError(
      `PARAMETER_${CONFIGS.compName.toUpperCase()}_METRICS`,
      'Function name not define'
    )
  }
}

module.exports = ServerlessComponent
/**
 * @fileoverview Sets up a unified AI chat route for the Express application.
 * Streams AI responses using Server-Sent Events (SSE) from real providers.
 */

const OpenAI = req


// Copyright 2013 Google Inc. All Rights Reserved.
//
// Use of this source code is governed by a BSD-style license
// that can be found in the COPYING file in the root of the source
// tree. An additional intellectual property rights grant can be found
// in the file PATENTS. All contributing project authors may
// be found in the AUTHORS file in the root of the source tree.
// -----------------------------------------------------------------------------
//
// Alpha plane de-quantization utility
//
// Author:  Vikas Arora (vikasa@google.com)

#ifndef WEBP_UTILS_QUANT_LEVELS_DEC_UTILS_H_
#define WEBP_UTILS_QUANT_LEVELS_DEC_UTILS_H_

#include "src/webp/types.h"

#ifdef __cplusplus
extern "C" {
#endif

// Apply post-processing to input 'data' of size 'width'x'height' assuming that
// the source was quantized to a reduced number of levels. 'stride' is in bytes.
// Strength is in [0..100] and controls the amount of dithering applied.
// Returns false in case of error (data is NULL, invalid parameters,
// malloc failure, ...).
int WebPDequantizeLevels(uint8_t* const data, int width, int height, int stride,
                         int strength);

#ifdef __cplusplus
}    // extern "C"
#endif

#endif  // WEBP_UTILS_QUANT_LEVELS_DEC_UTILS_H_


 cfg
--    The configuration to query.
-- @param tool
--    The tool to fetch, one of "dc" for the D compiler, or "ar" for the static linker.
-- @return
--    The executable command name for a tool, or nil if the system's
--    default value should be used.
--

	ldc.tools = {
		dc = "ldc2",
		ar = "ar",
	}

	function ldc.gettoolname(cfg, tool)
		return ldc.tools[tool]
	end


 remove_child(child(name_));
	}
#endif

	PUGI_IMPL_FN bool xml_node::remove_child(const xml_node& n)
	{
		if (!_root || !n._root || n._root->parent != _root) return false;

		impl::xml_allocator& alloc = impl::get_allocator(_root);
		if (!alloc.reserve()) return false;

		impl::remove_node(n._root);
		impl::destroy_node(n._root, alloc);

		return true;
	}

	PUGI_IMPL_FN bool xml_node::remove_children()
	{
		if (!_root) return false;

		impl::xml_allocator& alloc = impl::get_allocator(_root);
		if (!alloc.reserve()) return false;

		for (xml_node_struct* cur = _root->first_child; cur; )
		{
			xml_node_struct* next = cur->next_sibling;

			impl::destroy_node(cur, alloc);

			cur = next;
		}

		_root->first_child = NULL;

		return true;
	}

	PUGI_IMPL_FN xml_parse_result xml_node::append_buffer(const void* contents, size_t size, unsigned int options, xml_encoding encoding)
	{
		// append_buffer is only valid for elements/documents
		if (!impl::allow_insert_child(type(), node_element)) return impl::make_parse_result(status_append_invalid_root);

		// append buffer can not merge PCDATA into existing PCDATA nodes
		if ((options & parse_merge_pcdata) != 0 && last_child().type() == node_pcdata) return impl::make_parse_result(status_append_invalid_root);

		// get document node
		impl::xml_document_struct* doc = &impl::get_document(_root);

		// disable document_buffer_order optimization since in a document with multiple buffers comparing buffer pointers does not make sense
		doc->header |= impl::xml_memory_page_contents_shared_mask;

		// get extra buffer element (we'll store the document fragment buffer there so that we can deallocate it later)
		impl::xml_memory_page* page = NULL;
		impl::xml_extra_buffer* extra = static_cast<impl::xml_extra_buffer*>(doc->allocate_memory(sizeof(impl::xml_extra_buffer) + sizeof(void*), page));
		(void)page;

		if (!extra) return impl::make_parse_result(status_out_of_memory);

	#ifdef PUGIXML_COMPACT
		// align the memory block to a pointer boundary; this is required for compact mode where memory allocations are only 4b aligned
		// note that this requires up to sizeof(void*)-1 additional memory, which the allocation above takes into account
		extra = reinterpret_cast<impl::xml_extra_buffer*>((reinterpret_cast<uintptr_t>(extra) + (sizeof(void*) - 1)) & ~(sizeof(void*) - 1));
	#endif

		// add extra buffer to the list
		extra->buffer = NULL;
		extra->next = doc->extra_buffers;
		doc->extra_buffers = extra;

		// name of the root has to be NULL before parsing - otherwise closing node mismatches will not be detected at the top level
		impl::name_null_sentry sentry(_root);

		return impl::load_buffer_impl(doc, _root, const_cast<void*>(contents), size, options, encoding, false, false, &extra->buffer);
	}

	PUGI_IMPL_FN xml_node xml_node::find_child_by_attribute(const char_t* name_, const char_t* attr_name, const char_t* attr_value)