m16.22 4.2a1.5 1.5 0 0 0-2.12 2.12L29.88 29l-2.44 2.44a1.5 1.5 0 0 0 2.12 2.12L32 31.12l2.44 2.44a1.5 1.5 0 0 0 2.12-2.12L34.12 29l2.44-2.44a1.5 1.5 0 0 0-2.12-2.12L32 26.88l-2.44-2.44Z\"/>") { } }
    public class Multiplier5x : Icon { public Multiplier5x() : base("Multiplier5x", IconVariant.Filled, IconSize.Size48, "<path d=\"M14.52 15.29A1.5 1.5 0 0 1 16 14h9a1.5 1.5 0 0 1 0 3h-7.7l-.55 3.83 3.13-.28a6.99 6.99 0 1 1 .63 13.95h-.56c-2.15 0-4.19-.9-5.62-2.5l-.44-.5a1.5 1.5 0 1 1 2.22-2l.45.5c.86.95 2.1 1.5 3.39 1.5h.56a3.99 3.99 0 1 0-.36-7.96l-5.01.45a1.5 1.5 0 0 1-1.62-1.7l1-7Zm14.92 9.15a1.5 1.5 0 0 1 2.12 0L34 26.88l2.44-2.44a1.5 1.5 0 0 1 2.12 2.12L36.12 29l2.44 2.44a1.5 1.5 0 0 1-2.12 2.12L34 31.12l-2.44 2.44a1.5 1.5 0 0 1-2.12-2.12L31.88 29l-2.44-2.44a1.5 1.5 0 0 1 0-2.12ZM10.25 34a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5Z\"/>") { } }
    public class Navigation : Icon { public Navigation() : base("Navigation", IconVariant.Filled, IconSize.Size48, "<path d=\"M4 11.5c0-.83.67-1.5 1.5-1.5h37a1.5 1.5 0 0 1 0 3h-37A1.5 1.5 0 0 1 4 11.5Zm0 13c0-.83.67-1.5 1.5-1.5h37a1.5 1.5 0 0 1 0 3h-37A1.5 1.5 0 0 1 4 24.5ZM5.5 36a1.5 1.5 0 0 0 0 3h37a1.5 1.5 0 0 0 0-3h-37Z\"/>") { } }
    public class Next : Icon { public Next() : base("Next", IconVariant.Filled, IconSize.Size48, "<path d=\"M40.75 6c-.69 0-1.25.56-1.25 1.25v33.5a1.25 1.25 0 0 0 2.5 0V7.25C42 6.56 41.44 6 40.75 6ZM6 9.26a3.25 3.25 0 0 1 5.09-2.68l21.5 14.74a3.25 3.25 0 0 1 0 5.36L11.1 41.42A3.25 3.25 0 0 1 6 38.74V9.26Z\"/>") { } }
    public class Note : Icon { public Note() : base("Note", IconVariant.Filled, IconSize.Size48, "<path d=\"M12.25 6A6.25 6.25 0 0 0 6 12.25v23.5C6 39.2 8.8 42 12.


mg","name longdesc align border hspace vspace"),i("iframe","longdesc frameborder marginwidth marginheight scrolling align"),i("font basefont","size color face"),i("input","usemap align"),i("select"),i("textarea"),i("h1 h2 h3 h4 h5 h6 div p legend caption","align"),i("ul","type compact"),i("li","type"),i("ol dl menu dir","compact"),i("pre","width xml:space"),i("hr","align noshade size width"),i("isindex","prompt"),i("table","summary width frame rules cellspacing cellpadding align bgcolor"),i("col","width align char charoff valign"),i("colgroup","width align char charoff valign"),i("thead","align char charoff valign"),i("tr","align char charoff valign bgcolor"),i("th","axis align char charoff valign nowrap bgcolor width height"),i("form","accept"),i("td","abbr axis scope align char charoff valign nowrap bgcolor width height"),i("tfoot","align char charoff valign"),i("tbody","align char charoff valign"),i("area","nohref"),i("body","background bgcolor text link vlink alink")),"html4"!==e&&(i("input button select textarea","autofocus"),i("input textarea","placeholder"),i("a","download"),i("link script img","crossorigin"),i("img","loading"),i("iframe","sandbox seamless allow allowfullscreen loading")),"html4"!==e&&q([r.video,r.audio],(e=>{delete e.children.audio,delete e.children.video})),q(xs("a form meter progress dfn"),(e=>{r[e]&&delete r[e].children[e]})),delete r.caption.children.table,delete r.script,r})(l);!1===e.verify_html&&(e.valid_elements="*[*]");const c=Is(e.valid_styles),u=Is(e.invalid_styles,"map"),g=Is(e.valid_classes,"map"),h=i("whitespace_elements","pre script noscript style textarea video audio iframe object code"),v=i("self_closing_elements","colgroup dd dt li option p td tfoot th thead tr"),y=i("void_elements","area base basefont br col frame hr img input isindex link meta param embed source wbr track"),C=i("boolean_attributes","checked compact declare defer disabled ismap multiple nohref noresize noshade nowrap readonly selected autoplay loop controls allowfullscreen"),w="td th iframe video audio object script code",x=i("non_empty_elements",w+" pre svg textarea summary",y),E=i("move_caret_before_on_enter_elements",w+" table",y),k="h1 h2 h3 h4 h5 h6",_=i("text_block_elements",k+" p div address pre form blockquote center dir fieldset header footer article section hgroup aside main nav figure"),S=i("block_elements","hr table tbody thead tfoot th tr td li ol ul caption dl dt dd noscript menu isindex option datalist select optgroup figcaption details summary html body multicol listing",_),R=i("text_inline_elements","span strong b em i font s strike u var cite dfn code mark q sup sub samp"),A=i("transparent_elements","a ins del canvas map"),T=i("wrap_block_elements","pre "+k);Bs("script noscript iframe noframes noembed title style textarea xmp plaintext".split(" "),(e=>{a[e]=new RegExp("</"+e+"[^>]*>","gi")}));const O=e=>{const t=I.from(n["@"]),o=/[*?+]/;q(((e,t)=>{const n=/^([#+\-])?([^\[!\/]+)(?:\/([^\[!]+))?(?:(!?)\[([^\]]+)])?$/;return te(xs(t,","),(t=>{const o=n.exec(t);if(o){const t=o[1],n=o[2],r=o[3],s=o[4],a=o[5],i={attributes:{},attributesOrder:[]};if(e.each((e=>((e,t)=>{pe(e.attributes,((e,n)=>{t.attributes[n]=e})),t.attributesOrder.push(...e.attributesOrder)})(


# personalized_recommend.py
import json
import random
import os

# 定义文件路径
project_dict_filename = "./1/project_dictionary.json"
click_history_filename = "./1/click_history.json"

# 保存数据至 JSON 文件
def save_to_json(data, filename):
    try:
        with open(filename, "w", encoding="utf-8") as file:
            json.dump(data, file, ensure_ascii=False, indent=4)
    except Exception as e:
        print(f"将数据保存到 {filename}: {e} 时出错")

# 加载 JSON 文件数据
def load_from_json(filename):
    try:
        if os.path.isfile(filename):
            with open(filename, "r", encoding="utf-8") as file:
                return json.load(file)
    except Exception as e:
        print(f"加载数据 {filename}: {e} 时出错")
    return {}

# 初始化点击历史和非遗项目字典
click_history = load_from_json(click_history_filename)
if not isinstance(click_history, list):
    click_history = []
    save_to_json(click_history, click_history_filename)

project_dictionary = load_from_json(project_dict_filename)

# 记录点击历史（最多保留10条）
def record_click(item_dict):
    click_history.append(item_dict)
    if len(click_history) > 10:
        click_history.pop(0)
    save_to_json(click_history, click_history_filename)

# 推荐算法：推荐4个项目，如果没有点击历史则推荐前四个
def recommend_based_on_history_or_category():
    if click_history:
        current_item = click_history[-1]
        current_category = current_item["类别"]

        recommendations = [
            proj
            for proj in project_dictionary.values()
            if proj["类别"] == current_category and proj["名称"] != current_item["名称"]
        ]

        if len(recommendations) < 4:
            additional_recommendations = [
                proj
                for proj in project_dictionary.values()
                if proj not in recommendations and proj["名称"] != current_item["名称"]
            ]
            recommendations.extend(
                random.sample(
                    additional_recommendations,
                    min(4 - len(recommendations), len(additional_recommendations)),
                )
            )

    else:
        recommendations = list(project_dictionary.values())[:4]

    return [proj["名称"] for proj in recommendations]

# 主程序
def main():
    sample_click = {"名称": "京剧", "类别": "传统戏剧", "地区": "北京"}
    record_click(sample_click)
    print("推荐项目：", recommend_based_on_history_or_category())

# 数据初始化并保存到 JSON
if not os.path.isfile(project_dict_filename):
    save_to_json({}, project_dict_filename)

if __name__ == "__main__":
    main()


type == "shield" then
		sound:play(sound.effects["shield"])
		self.score = self.score + pickup.score
		self.hasshield = true
	elseif pickup.type == "star" then
		sound:play(sound.effects["lifeup"])
		self.score = self.score + pickup.score
		player:invincibility()
	end
end

function player:invincibility()
	if not self.invincible then
		sound:playbgm(6)
		self.invincible = true
		self.particles.invincible:start()
	end

	self.invincible_timer = 15
	console:print("invincibility started")
end

function player:attack(enemy)
	-- increase score when attacking an enemy
	self.score = self.score + enemy.score
end

function player:jump()
	if self.alive and self.canjump and not self.jumping or cheats.jetpack then
		sound:play(sound.effects["jump"])
		self.jumping = true
		self.sliding = fa


, gardencorev1beta1.LastOperationStateProcessing),
					Entry("error", gardencorev1beta1.LastOperationStateError),
					Entry("failed", gardencorev1beta1.LastOperationStateFailed),
					Entry("pending", gardencorev1beta1.LastOperationStatePending),
					Entry("aborted", gardencorev1beta1.LastOperationStateAborted),
				)

				It("should return true when the last operation is not yet set", func() {
					Expect(pred.Create(event.CreateEvent{Object: obj})).To(BeTrue())
				})

				It("should return false when operation annotation is not present, object has no deletion timestamp and last operation has not succeeded", func() {
					obj.Status.LastOperation = &gardencorev1beta1.LastOperation{State: gardencorev1beta1.LastOperationStateSucceeded}
					Expect(pred.Create(event.CreateEvent{Object: obj})).To(BeFalse())
				})
			})

			Describe("#Update", func() {
				DescribeTable("return true when operation annotation is set",
					func(operation string) {
						obj.SetAnnotations(map[string]string{"gardener.cloud/operation": operation})
						Expect(pred.Update(event.UpdateEvent{ObjectNew: obj})).To(BeTrue())
					},

					Entry("reconcile", "reconcile"),
					Entry("migrate", "migrate"),
					Entry("restore", "restore"),
				)

				It("should return true when the deletion timestamp is set and the status is equal", func() {
					obj.SetDeletionTimestamp(&metav1.Time{})
					oldObj := obj.DeepCopy()
					Expect(pred.Update(event.UpdateEvent{ObjectNew: obj, ObjectOld: oldObj})).To(BeTrue())
				})

				It("should return false when the deletion timestamp is set and the status changed", func() {
					obj.SetDeletionTimestamp(&metav1.Time{})
					oldObj := obj.DeepCopy()
					obj.Status.ObservedGeneration = 3
					Expect(pred.Update(event.UpdateEvent{ObjectNew: obj, ObjectOld: oldObj})).To(BeFalse())
				})
			})

			Describe("#Delete", func() {
				It("should return false", func() {
					Expect(pred.Delete(event.DeleteEvent{})).To(BeFalse())
				})
			})

			Describe("#Generic", func() {
				It("should return false", func() {
					Expect(pred.Generic(event.GenericEvent{})).To(BeFalse())
				})
			})
		})
	})
})
// SPDX-FileCopyrightText: SAP SE or an SAP affiliate company and Gardener contributors
//
// SPDX-License-Identifier: Apache-2.0

package util

import (
	"errors"

	"k8s.io/apimachinery/pkg/util/sets"

	gardencorev1beta1 "github.com/gardener/gardener/pkg/apis/core/v1beta1"
	v1beta1helper "github.com/gardener/gardener/pkg/apis/core/v1beta1/helper"
)

// DetermineError determines the Gardener error codes for the given error and returns an ErrorWithCodes with the error and codes.
func DetermineError(err error, knownCodes map[gardencorev1beta1.ErrorCode]func(string) bool) error {
	if err == nil {
		return nil
	}

	// try to re-use codes from error
	var coder v1beta1helper.Coder
	if errors.As(err, &coder) {
		return err
	}

	codes := DetermineErrorCodes(err, knownCodes)
	if len(codes) == 0 {
		return err
	}

	return v1beta1helper.NewErrorWithCodes(err, codes...)
}

// DetermineErrorCodes determines error codes based on the given error.
func DetermineErrorCodes(err error, knownCodes map[gardencorev1beta1.ErrorCode]


" in neuron else "attribution_score"
            layer = neuron.get("layer")
            neuron_idx = neuron.get("neuron")
            score = neuron.get(score_key, 0)
            if layer is None or neuron_idx is None:
                continue
            if ignore_layer is not None and int(layer) in ignore_layer:
                continue
            all_neurons.append({"layer": layer, "neuron": neuron_idx, "score": score})
        # Sort all neurons (all layers mixed)
        all_neurons_sorted = sorted(all_neurons, key=lambda x: x["score"], reverse=True)
        top_neurons = all_neurons_sorted[:top_k]
        for neuron in top_neurons:
            neuron_set.add((neuron["layer"], neuron["neuron"]))
        if not neuron_set_all:
            neuron_set_all = neuron_set
        else:
            neuron_set_all = neuron_set_all | neuron_set if union else neuron_set_all & neuron_set
    return neuron_set_all

# Given a neuron set, zero these neurons' weights/bias in one model copy,
# and also zero random neurons in another copy for control comparison.
def zero_neurons_and_random(model, neuron_set, random_seed=None):
    model_zero_specified = copy.deepcopy(model)
    model_zero_random = copy.deepcopy(model)
    if random_seed is not None:
        random.seed(random_seed)
        torch.manual_seed(random_seed)
    all_neurons = []
    num_layers = len(model.model.layers)
    for layer_idx in range(num_layers):
        up_proj = model.model.layers[layer_idx].mlp.up_proj
        num_neurons = up_proj.weight.size(0)
        for neuron_idx in range(num_neurons):
            all_neurons.append((layer_idx, neuron_idx))
    num_zero = len(neuron_set)
    available_neurons = list(set(all_neurons))
    if num_zero > len(available_neurons):
        raise ValueError("Not enough neurons to sample from.")
    random_neurons = random.sample(available_neurons, num_zero)
    def zero_specific_neurons(model_copy, neurons):
        for layer, neuron in neurons:
            try:
                up_proj = model_copy.model.layers[layer].mlp.up_proj
                up_proj.weight.data[neuron].zero_()
                if up_proj.bias is not None:
                    up_proj.bias.data[neuron].zero_()
            except (IndexError, AttributeError):
                print(f"Invalid layer {layer} or neuron {neuron}.")
    zero_specific_neurons(model_zero_specified, neuron_set)
    zero_specific_neurons(model_zero_random, random_neurons)
    return model_zero_specified, model_zero_random


morphic-fetch'
import * as env from '../env'
import { encode } from '../utils/base64'

export class SpotifyApi {
  private readonly baseUrl = 'https://api.spotify.com'

  constructor(private accessToken: string, private refreshToken: string) {

  }

  get headers() {
    return {
      'Accept': 'application/json',
      'Authorization': `Bearer ${this.accessToken}`
    }
  }

  async initialize(): Promise<{ accessToken: string, changed: boolean }> {
    const url = `${this.baseUrl}/v1/me`
    const res = await fetch(url, { headers: this.headers })
    if (!res.ok) {
      console.log('Token expired, refreshing...')
      this.accessToken = await this.handleTokenRefresh()
      console.log('Token refreshed')
      return { accessToken: this.accessToken, changed: true }
    }

    return { accessToken: this.accessToken, changed: false }
  }

  private async handleTokenRefresh() {
    const url = 'https://accounts.spotify.com/api/token'
    const body = `grant_type=refresh_token&refresh_token=${encodeURIComponent(this.refreshToken)}`
    const auth = encode(env.spotifyClientId + ':' + env.spotifyClientSecret)
    const res = await fetch(url, {
      method: 'POST',
      headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': `Basic ${auth}`
      },
      body
    })
    const { access_token: accessToken } = await res.json()
    return accessToken
  }

  async getMe(): Promise<SpotifyUser> {
    const url = `${this.baseUrl}/v1/me`
    const res = await fetch(url, { headers: this.headers })
    return res.json()
  }

  async search(query: string): Promise<SearchResponse> {
    const q = encodeURIComponent(query)
    const url = `${this.baseUrl}/v1/search?type=track&market=US&limit=1&q=${q}`
    const res = await fetch(url, { headers: this.headers })
    return res.json()
  }

  async getPlaylist(playlistId: string): Promise<Playlist | null> {
    const url = `${this.baseUrl}/v1/playlists/${playlistId}`
    const res = await fetch(url, { headers: this.headers })
    if (!res.ok) {
      throw new Error(`No playlist for id ${playlistId}`)
    }
    try {
      return res.json()
    } catch (e) {
      console.error(e)
      console.log(await res.text())
      return null
    }
  }

  async getPlaylistTracks(playlist: Playlist): Promise<Track[]> {
    const url = `${this.baseUrl}/v1/playlists/${playlist.id}/tracks`
    const res = await fetch(url, { headers: this.headers })
    const json = await res.json()
    return json.items.map(item => item.track)
  }

  async addSongsToPlaylist(playlist: Playlist, songUris: string[]) {
    const uris = songUris.join(',')
    const url = `${this.baseUrl}/v1/playlists/${playlist.id}/tracks?uris=${uris}`
    const res = await fetch(url, { method: 'POST', headers: this.headers })
    console.log(await res.text())
  }

  async createPlaylist(name: string, description: string, isPublic: boolean): Promise<Playlist> {
    const url = `${this.baseUrl}/v1/me/playlists`
    const body = JSON.stringify({
      name,
      description,
      'public': isPublic
    })
    const res = await fetch(url, { method: 'POST', body, headers: this.headers })
    return res.json()
  }
}
export class MemoryFifo<T> {
  private


 *testing.T) {
		err := invoke(&models.Account{
			ID:                1234,
			PasswordChangedAt: time.Now(),
		})
		assert.NoError(t, err)
	})

	t.Run("with locked account", func(t *testing.T) {
		err := invoke(&models.Account{
			ID:                1234,
			PasswordChangedAt: time.Now(),
			Locked:            true,
		})
		assert.NoError(t, err)
	})

	t.Run("with no account", func(t *testing.T) {
		err := invoke(nil)
		assert.NoError(t, err)
	})
}
package services_test

import (
	"net/url"
	"testing"
	"time"

	"github.com/keratin/authn-server/app"
	"github.com/keratin/authn-server/app/data/mock"
	"github.com/keratin/authn-server/app/services"
	"github.com/keratin/authn-server/app/tokens/resets"
	"github.com/keratin/authn-server/ops"
	"github.com/pquerna/otp/totp"
	"github.com/sirupsen/logrus"
	"github.com/stretchr/testify/assert"
	"github.com/stretchr/testify/require"
)

func TestPasswordResetter(t *testing.T) {
	accountStore := mock.NewAccountStore()
	cfg := &app.Config{
		AuthNURL:              &url.URL{Scheme: "http", Host: "authn.example.com"},
		BcryptCost:            4,
		PasswordMinComplexity: 1,
		ResetSigningKey:       []byte("reset-a-reno"),
	}

	newToken := func(id int, lock time.Time) string {
		claims, err := resets.New(cfg, id, lock)
		require.NoError(t, err)
		token, err := claims.Sign(cfg.ResetSigningKey)
		require.NoError(t, err)
		return token
	}

	invoke := func(token string, password string) error {
		_, err := services.PasswordResetter(accountStore, &ops.LogReporter{FieldLogger: logrus.New()}, cfg, token, password, "")
		return err
	}

	account, err := accountStore.Create("existing@keratin.tech", []byte("old"))
	require.NoError(t, err)

	t.Run("sets new password", func(t *testing.T) {
		expired, err := accountStore.Create("expired@keratin.tech", []byte("old"))
		require.NoError(t, err)
		_, err = accountStore.RequireNewPassword(expired.ID)
		require.NoError(t, err)

		err = invoke(newToken(expired.ID, expired.PasswordChangedAt), "0a0b0c0d0e0f")
		assert.NoError(t, err)

		account, err := accountStore.Find(expired.ID)
		require.NoError(t, err)
		assert.NotEqual(t, expired.Password, account.Password)
		assert.False(t, account.RequireNewPassword)
	})

	t.Run("when token is invalid", func(t *testing.T) {
		// nolint: gosec
		token := "not.valid.jwt"

		err := invoke(token, "0a0b0c0d0e0f")
		assert.Equal(t, services.FieldErrors{{"token", services.ErrInvalidOrExpired}}, err)
	})

	t.Run("after a password change", func(t *testing.T) {
		previousPasswordChange := account.PasswordChangedAt.Add(time.Duration(-1) * time.Hour)
		token := newToken(account.ID, previousPasswordChange)

		err := invoke(token, "0a0b0c0d0e0f")
		assert.Equal(t, services.FieldErrors


t_logging (struct interp *interp, int start_log,
		struct ui_file *out, struct ui_file *logfile)
{
  struct mi_interp *mi = interp_data (interp);

  if (!mi)
    return 0;

  if (start_log)
    {
      /* The tee created already is based on gdb_stdout, which for MI
	 is a console and so we end up in an infinite loop of console
	 writing to ui_file writing to console etc.  So discard the
	 existing tee (it hasn't been used yet, and MI won't ever use
	 it), and create one based on raw_stdout instead.  */
      if (logfile)
	{
	  ui_file_delete (out);
	  out = tee_file_new (raw_stdout, 0, logfile, 0);
	}

      saved_raw_stdout = raw_stdout;
      raw_stdout = out;
    }
  else
    {
      raw_stdout = saved_raw_stdout;
      saved_raw_stdout = NULL;
    }

  mi_console_set_raw (mi->out, raw_stdout);
  mi_console_set_raw (mi->err, raw_stdout);
  mi_console_set_raw (mi->log, raw_stdout);
  mi_console_set_raw (mi->targ, raw_stdout);
  mi_console_set_raw (mi->event_channel, raw_stdout);

  return 1;
}

extern initialize_file_ftype _initialize_mi_interp; /* -Wmissing-prototypes */

void
_initialize_mi_interp (void)
{
  static const struct interp_procs procs =
    {
      mi_interpreter_init,	/* init_proc */
      mi_interpreter_resume,	/* resume_proc */
      mi_interpreter_suspend,	/* suspend_proc */
      mi_interpreter_exec,	/* exec_proc */
      mi_interpreter_prompt_p,	/* prompt_proc_p */
      mi_ui_out, 		/* ui_out_proc */
      mi_set_logging		/* set_logging_proc */
    };

  /* The various interpreter levels.  */
  interp_add (interp_new (INTERP_MI1, &procs));
  interp_add (interp_new (INTERP_MI2, &procs));
  interp_add (interp_new (INTERP_MI3, &procs));
  interp_add (interp_new (INTERP_MI, &procs));
}


a background
image as an alternative.

<!doctype html>

    <title>CodeMirror: CoffeeScript mode</title>
    <link rel="stylesheet" href="../../lib/codemirror.css">

    <link rel="stylesheet" href="../../doc/docs.css">

CodeMirror: CoffeeScript mode

    <form><textarea id="code" name="code">
# CoffeeScript mode for CodeMirror
# Copyright (c) 2011 Jeff Pickhardt, released under
# the MIT License.
#
# Modified from the Python CodeMirror mode, which also is
# under the MIT License Copyright (c) 2010 Timothy Farrell.
#
# The following script, Underscore.coffee, is used to
# demonstrate CoffeeScript mode for CodeMirror.
#
# To download CoffeeScript mode for CodeMirror, go to:
# https://github.com/pickhardt/coffeescript-codemirror-mode

# **Underscore.coffee
# (c) 2011 Jeremy Ashkenas, DocumentCloud Inc.**
# Underscore is freely distributable under the terms of the
# [MIT license](http://en.wikipedia.org/wiki/MIT_License).
# Portions of Underscore are inspired by or borrowed from
# [Prototype.js](http://prototypejs.org/api), Oliver Steele's
# [Functional](http://osteele.com), and John Resig's
# [Micro-Templating](http://ejohn.org).
# For all details and documentation:
# http://documentcloud.github.com/underscore/

# Baseline setup
# --------------

# Establish the root object, `window` in the browser, or `global` on the server.
root = this

# Save the previous value of the `_` variable.
previousUnderscore = root._

### Multiline
    comment
###

# Establish the object that gets thrown to break out of a loop iteration.
# `StopIteration` is SOP on Mozilla.
breaker = if typeof(StopIteration) is 'undefined' then '__break__' else StopIteration

#### Docco style single line comment (title)

# Helper function to escape **RegExp** contents, because JS doesn't have one.
escapeRegExp = (string) -> string.replace(/([.*+?^${}()|[\]\/\\])/g, '\\$1')

# Save bytes in the minified (but not gzipped) version:
ArrayProto = Array.prototype
ObjProto = Object.prototype

# Create quick reference variables for speed access to core prototypes.
slice = ArrayProto.slice
unshift = ArrayProto.unshift
toString = ObjProto.toString
hasOwnProperty = ObjProto.hasOwnProperty
propertyIsEnumerable = ObjProto.propertyIsEnumerable

# All **ECMA5** native implementations we hope to use are declared here.
nativeForEach = ArrayProto.forEach
nativeMap = ArrayProto.map
nativeReduce = ArrayProto.reduce
nativeReduceRight = ArrayProto.reduceRight
nativeFilter = ArrayProto.filter
nativeEvery = ArrayProto.every
nativeSome = ArrayProto.some
nativeIndexOf = ArrayProto.indexOf
nativeLastIndexOf = ArrayProto.lastIndexOf
nativeIsArray = Array.isArray
nativeKeys = Object.keys

# Create a safe reference to the Underscore object for use below


ip_r_toebase",
]

VROID_KEYPOINTS_2 = [
    "hips",
    "left leg",
    "left knee",
    "left ankle",
    "left toe",
    "right leg",
    "right knee",
    "right ankle",
    "right toe",
    "spine",
    "chest",
    "left shoulder",
    "left arm",
    "left elbow",
    "left wrist",
    "right shoulder",
    "right arm",
    "right elbow",
    "right wrist",
    "neck",
    "head",
]

VROID_KEYPOINTS_3 = [
    "hips",
    "leftupleg",
    "leftleg",
    "leftfoot",
    "lefttoebase",
    "rightupleg",
    "rightleg",
    "rightfoot",
    "righttoebase",
    "spine",
    "chest",
    "spine1",
    "leftshoulder",
    "leftarm",
    "leftforearm",
    "lefthand",
    "neck",
    "head",
    "rightshoulder",
    "rightarm",
    "rightforearm",
    "righthand",
]

VROID_KEYPOINTS_4 = [
    "hips",
    "spine",
    "chest",
    "neck",
    "head",
    "shoulder_l",
    "upperarm_l",
    "lowerarm_l",
    "left hand",
    "shoulder_r",
    "upperarm_r",
    "lowerarm_r",
    "right hand",
    "upperleg_l",
    "lowerleg_l",
    "foot_l",
    "upperleg_r",
    "lowerleg_r",
    "foot_r",
]

VROID_KEYPOINTS_5 = [
    "hips",
    "spine",
    "chest",
    "upper_chest",
    "neck",
    "head",
    "shoulder.l",
    "upper_arm.l",
    "forearm.l",
    "hand.l",
    "shoulder.r",
    "upper_arm.r",
    "forearm.r",
    "hand.r",
    "thigh.l",
    "shin.l",
    "foot.l",
    "toe.l",
    "thigh.r",
    "shin.r",
    "foot.r",
    "toe.r",
]

VROID_KEYPOINTS_6 = [
    "hips",
    "spine",
    "spine1",
    "spine2",
    "neck",
    "head",
    "shoulder_l",
    "arm_l",
    "forearm_l",
    "hand_l",
    "shoulder_r",
    "arm_r",
    "forearm_r",
    "hand_r",
    "upleg_l",
    "leg_l",
    "foot_l",
    "toe_l",
    "upleg_r",
    "leg_r",
    "foot_r",
    "toe_r",
]

VROID_KEYPOINT_MAPS = {
    "j_bip_l_upperarm": VROID_KEYPOINTS,
    "left arm": VROID_KEYPOINTS_2,
    "leftarm": VROID_KEYPOINTS_3,
    "upperarm_l": VROID_KEYPOINTS_4,
    "upper_arm.l": VROID_KEYPOINTS_5,
    "arm_l": VROID_KEYPOINTS_6,
}


", ith)
		if rs != nil {
			tk.ResultSetToResultWithCtx(ctx, rs, comment)
		}
		require.Equal(t, c.visited, visited, comment)
	}
}

func TestSQLVariableAccelerateUserCreationUpdate(t *testing.T) {
	store := createStoreAndPrepareDB(t)
	tk := testkit.NewTestKit(t, store)
	dom := domain.GetDomain(tk.Session())
	// 1. check the default variable value
	tk.MustQuery("select @@global.tidb_accelerate_user_creation_update").Check(testkit.Rows("0"))
	// trigger priv reload
	tk.MustExec("create user aaa")
	handle := dom.PrivilegeHandle()
	handle.CheckFullData(t, true)
	priv := handle.Get()
	require.False(t, priv.RequestVerification(nil, "bbb", "%", "test", "", "", mysql.SelectPriv))

	// 2. change the variable and check
	tk.MustExec("set @@global.tidb_accelerate_user_creation_update = on")
	tk.MustQuery("select @@global.tidb_accelerate_user_creation_update").Check(testkit.Rows("1"))
	require.True(t, vardef.AccelerateUserCreationUpdate.Load())
	tk.MustExec("create user bbb")
	handle.CheckFullData(t, false)
	// trigger priv reload, but data for bbb is not really loaded
	tk.MustExec("grant select on test.* to bbb")
	priv = handle.Get()
	// data for bbb is not loaded, because that user is not active
	// So this is **counterintuitive**, but it's still the expected behavior.
	require.False(t, priv.RequestVerification(nil, "bbb", "%", "test", "", "", mysql.SelectPriv))
	tk1 := testkit.NewTestKit(t, store)
	// if user bbb login, everything works as expected
	require.NoError(t, tk1.Session().Auth(&auth.UserIdentity{Username: "bbb", Hostname: "localhost"}, nil, nil, nil))
	priv = handle.Get()
	require.True(t, priv.RequestVerification(nil, "bbb", "%", "test", "", "", mysql.SelectPriv))

	// 3. change the variable and check again
	tk.MustExec("set @@global.tidb_accelerate_user_creation_update = off")
	tk.MustQuery("select @@global.tidb_accelerate_user_creation_update").Check(testkit.Rows("0"))
	tk.MustExec("drop user aaa")
	handle.CheckFullData(t, true)
	priv = handle.Get()
	require.True(t, priv.RequestVerification(nil, "bbb", "%", "test", "", "", mysql.SelectPriv))
}

func TestGrantOptionWithSEMv2(t *testing.T) {
	store := createStoreAndPrepareDB(t)

	rootTk := testkit.NewTestKit(t, store)
	rootTk.MustExec("CREATE USER varuser1")
	rootTk.MustExec("CREATE USER varuser2")
	rootTk.MustExec("CREATE USER varuser3")
	rootTk.MustExec("CREATE USER varuser4")
	rootTk.MustExec("CREATE USER grantee")

	rootTk.MustExec("GRANT SYSTEM_VARIABLES_ADMIN, FILE ON *.* TO varuser1")
	rootTk.MustExec("GRANT SYSTEM_VARIABLES_ADMIN, FILE ON *.* TO varuser2 WITH GRANT OPTION")
	rootTk.MustExec("GRANT RESTRICTED_PRIV_ADMIN ON *.* TO varuser3")
	rootTk.MustExec("GRANT RESTRICTED_PRIV_ADMIN ON *.* TO varuser4")
	rootTk.MustExec("GRANT SYSTEM_VARIABLES_ADMIN, FILE ON *.* TO varuser4 WITH GRANT OPTION")

	// SYSTEM_VARIABLES_ADMIN is not restricted, FILE is restricted.
	def


const
  { return (Arr_parameter_space(m_ps_x)); }

  inline Arr_parameter_space parameter_space_in_y() const
  { return (Arr_parameter_space(m_ps_y)); }
  //@}

  /*! Replace the set of left subcurves. */
  template <typename InputIterator>
  void replace_left_curves(InputIterator begin, InputIterator end)
  {
    Subcurve_iterator left_iter = m_leftCurves.begin();
    for (InputIterator iter = begin; iter != end; ++iter, ++left_iter)
      *left_iter = static_cast<Subcurve*>(*iter);
    m_leftCurves.erase(left_iter, m_leftCurves.end());
  }

  bool is_right_curve_bigger(Subcurve* c1, Subcurve* c2)
  {
    Subcurve_iterator   iter;
    for (iter = m_rightCurves.begin(); iter != m_rightCurves.end(); ++iter) {
      if ((*iter == c1) ||
          (static_cast<Subcurve*>((*iter)->originating_subcurve1()) == c1) ||
          (static_cast<Subcurve*>((*iter)->originating_subcurve2()) == c1))
        return false;

      if ((*iter == c2) ||
          (static_cast<Subcurve*>((*iter)->originating_subcurve1()) == c2) ||
          (static_cast<Subcurve*>((*iter)->originating_subcurve2()) == c2))
        return true;
    }

    return true;
  }

  /*! Check if the two curves are negihbors to the left of the event. */
  bool are_left_neighbours(Subcurve* c1, Subcurve* c2)
  {
    Subcurve_iterator left_iter = m_leftCurves.begin();
    for (; left_iter != m_leftCurves.end(); ++left_iter) {
      if (*left_iter == c1) {
        Subcurve_iterator temp = left_iter;
        ++temp;
        if (temp != m_leftCurves.end()) return (*temp == c2);
        return false;
      }

      if (*left_iter == c2) {
        Subcurve_iterator temp = left_iter;
        ++temp;
        if (temp!=m_leftCurves.end()) return (*temp == c1);
        return false;
      }
    }

    return false;
  }

#ifdef CGAL_SL_VERBOSE
  void Print();
#endif
};

#ifdef CGAL_SL_VERBOSE
  template<typename Traits, typename Subcurve>
  void Sweep_line_event<Traits, Subcurve>::Print()
  {
    std::cout << "\tEvent info: "  << "\n" ;
    if (this->is_closed())
      std::cout << "\t" << m_point << "\n" ;
    else {
      std::cout << "\t";
      Arr_parameter_space ps_x = this->parameter_space_in_x();
      Arr_parameter_space ps_y = this->parameter_space_in_y();

      switch (ps_x) {
       case ARR_LEFT_BOUNDARY:  std::cout << "left boundary"; break;
       case ARR_RIGHT_BOUNDARY: std::cout << "right boundary"; break;
       case ARR_INTERIOR:
       default:
        switch (ps_y) {
         case ARR_BOTTOM_BOUNDARY: std::cout << "bottom boundary"; break;
         case ARR_TOP_BOUNDARY:    std::cout << "top boundary"; break;
         case ARR_INTERIOR:
         default:
          CGAL_error();
        }
      }
    }
    std::cout << "\n";

    std::cout << "\tLeft curves: \n" ;
    Subcurve_iterator iter;
    for (iter = m_leftCurves.begin(); iter != m_leftCurves.end(); ++iter) {
      std::cout << "\t";
      (*iter)->Print();
      std::cout << "\n";
    }
    std::cout << std::endl;
    std::cout << "\tRight curves: \n" ;
    for (iter = m_rightCurves.begin(); iter != m_rightCurves.end(); ++iter) {
      std::cout << "\t";
      (*iter)->Print();
      std::cout << "\n";
    }

    std::cout << std::endl;
  }
#endif // CGAL_SL_VERBOSE

} //namespace CGAL

#endif


 BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

import 'package:test/test.dart';
import 'package:chunked_stream/chunked_stream.dart';

void main() {
  for (var i = 1; i < 6; i++) {
    test('bufferChunkedStream (bufferSize: $i)', () async {
      final s = (() async* {
        yield ['a'];
        yield ['b'];
        yield ['c'];
      })();

      final bs = bufferChunkedStream(s, bufferSize: i);
      final result = await readChunkedStream(bs);
      expect(result, equals(['a', 'b', 'c']));
    });
  }
}
// Copyright 2019 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

import 'dart:async';
import 'dart:typed_data';

import 'package:meta/meta.dart' show sealed;
import 'package:chunked_stream/src/read_chunked_stream.dart';

/// Auxiliary class for iterating over the items in a chunked stream.
///
/// A _chunked stream_ is a stream in which items arrives in chunks with each
/// event from the stream. A common example is a byte stream with the type
/// `Stream<List<int>>`. In such a byte stream bytes arrives in chunks
/// `List<int>` for each event.
///
/// Note. methods on this class may not be called concurrently.
@sealed
@Deprecated('Use ChunkedStreamReader from package:async instead.')
abstract class ChunkedStreamIterator<T> {
  factory ChunkedStreamIterator(Stream<List<T>> stream) {
    return _ChunkedStreamIterator<T>(stream);
  }

  /// Returns a list of the next [size] elements.
  ///
  /// Returns a list with less than [size] elements if the end of stream is
  /// encountered before [size] elements are read.
  ///
  /// If an error is encountered before reading [size] elements, the error
  /// will be thrown.
  Future<List<T>> read(int size);

  /// Cancels the stream iterator (and the underlying stream subscription)
  /// early.
  ///
  /// Users should call [cancel] to ensure that the stream is properly closed
  /// if they need to stop listening earlier than the end of the stream.
  Future<void> cancel();

  /// Returns a sub-[Stream] with the next [size] elements.
  ///
  /// A sub-[Stream] is a [Stream] consisting of the next [size] elements
  /// in the same order they occur in the stream used to create this iterator.
  ///
  /// If [read] is called before the sub-[Stream] is fully read, a [StateError]
  /// will be thrown.
  ///
  /// ```dart
  /// final s = ChunkedStreamIterator(_chunkedStream([
  ///   ['a', 'b', 'c'],
  ///   ['1', '2'],
  /// ]));
  /// expect(await s.read(1), equals(['a']));
  ///
  /// // creates a substream from the chunks holding the
  /// // next three elements (['b', 'c'], ['1'])
  /// final i = StreamIterator(s.substream(3));
  /// expect(await i.moveNext(), isTrue);
  /// expect(await i.current, equals(['b', 'c']));
  /// expect(await i.moveNext(), isTrue);
  /// expect(await i.current, equals(['1']));
  ///
  /// // Since the su


enCLDebugInfo100_DebugScope,
			"DebugNoScope": OpenCLDebugInfo100_DebugNoScope,
			"DebugInlinedAt": OpenCLDebugInfo100_DebugInlinedAt,
			"DebugLocalVariable": OpenCLDebugInfo100_DebugLocalVariable,
			"DebugInlinedVariable": OpenCLDebugInfo100_DebugInlinedVariable,
			"DebugDeclare": OpenCLDebugInfo100_DebugDeclare,
			"DebugValue": OpenCLDebugInfo100_DebugValue,
			"DebugOperation": OpenCLDebugInfo100_DebugOperation,
			"DebugExpression": OpenCLDebugInfo100_DebugExpression,
			"DebugMacroDef": OpenCLDebugInfo100_DebugMacroDef,
			"DebugMacroUndef": OpenCLDebugInfo100_DebugMacroUndef,
			"DebugImportedEntity": OpenCLDebugInfo100_DebugImportedEntity,
			"DebugSource": OpenCLDebugInfo100_DebugSource,
			"DebugModuleINTEL": OpenCLDebugInfo100_DebugModuleINTEL,
		},
	}

	OpNop = &Opcode {
		Opname:   "OpNop",
		Class:    "Miscellaneous",
		Opcode:   0,
		Operands: []Operand {
		},
	}
	OpUndef = &Opcode {
		Opname:   "OpUndef",
		Class:    "Miscellaneous",
		Opcode:   1,
		Operands: []Operand {
			Operand {
				Kind:       OperandKindIdResultType,
				Name:       "",
				Quantifier: "",
			},
			Operand {
				Kind:       OperandKindIdResult,
				Name:       "",
				Quantifier: "",
			},
		},
	}
	OpSourceContinued = &Opcode {
		Opname:   "OpSourceContinued",
		Class:    "Debug",
		Opcode:   2,
		Operands: []Operand {
			Operand {
				Kind:       OperandKindLiteralString,
				Name:       "'Continued Source'",
				Quantifier: "",
			},
		},
	}
	OpSource = &Opcode {
		Opname:   "OpSource",
		Class:    "Debug",
		Opcode:   3,
		Operands: []Operand {
			Operand {
				Kind:       OperandKindSourceLanguage,
				Name:       "",
				Quantifier: "",
			},
			Operand {
				Kind:       OperandKindLiteralInteger,
				Name:       "'Version'",
				Quantifier: "",
			},
			Operand {
				Kind:       OperandKindIdRef,
				Name:       "'File'",
				Quantifier: "?",
			},
			Operand {
				Kind:       OperandKindLiteralString,
				Name:       "'Source'",
				Quantifier: "?",
			},
		},
	}
	OpSourceExtension = &Opcode {
		Opname:   "OpSourceExtension",
		Class:    "Debug",
		Opcode:   4,
		Operands: []Operand {
			Operand {
				Kind:       OperandKindLiteralString,
				Name:       "'Extension'",
				Quantifier: "",
			},
		},
	}
	OpName = &Opcode {
		Opname:   "OpName",
		Class:    "Debug",
		Opcode:   5,
		Operands: []Operand {
			Operand {
				Kind:       OperandKindIdRef,
				Name:       "'Target'",
				Quantifier: "",
			},
			Operand {
				Kind:       OperandKindLiteralString,
				Name:       "'Name'",
				Quantifier: "",
			},
		},
	}
	OpMemberName = &Opcode {
		Opname:   "OpMemberName",
		Class:    "Debug",
		Opcode:   6,
		Operands: []Operand {
			Operand {
				Kind:       OperandKindIdRef,
				Name:       "'Type'",
				Quantifier: "",
			},
			Operand {
				Kind:       OperandKindLiteralInteger,
				Name:       "'Member'",


 http

import (
	json "encoding/json"
	uuid "github.com/google/uuid"
	easyjson "github.com/mailru/easyjson"
	jlexer "github.com/mailru/easyjson/jlexer"
	jwriter "github.com/mailru/easyjson/jwriter"
	collar "github.com/masseelch/elk/internal/simple/ent/collar"
)

// suppress unused package warning
var (
	_ *json.RawMessage
	_ *jlexer.Lexer
	_ *jwriter.Writer
	_ easyjson.Marshaler
)

func easyjsonC5a4559bDecodeGithubComMasseelchElkInternalSimpleEntHttp(in *jlexer.Lexer, out *PetUpdateRequest) {
	isTopLevel := in.IsStart()
	if in.IsNull() {
		if isTopLevel {
			in.Consumed()
		}
		in.Skip()
		return
	}
	in.Delim('{')
	for !in.IsDelim('}') {
		key := in.UnsafeFieldName(false)
		in.WantColon()
		if in.IsNull() {
			in.Skip()
			in.WantComma()
			continue
		}
		switch key {
		case "name":
			if in.IsNull() {
				in.Skip()
				out.Name = nil
			} else {
				if out.Name == nil {
					out.Name = new(string)
				}
				*out.Name = string(in.String())
			}
		case "age":
			if in.IsNull() {
				in.Skip()
				out.Age = nil
			} else {
				if out.Age == nil {
					out.Age = new(int)
				}
				*out.Age = int(in.Int())
			}
		case "collar":
			if in.IsNull() {
				in.Skip()
				out.Collar = nil
			} else {
				if out.Collar == nil {
					out.Collar = new(int)
				}
				*out.Collar = int(in.Int())
			}
		case "categories":
			if in.IsNull() {
				in.Skip()
				out.Categories = nil
			} else {
				in.Delim('[')
				if out.Categories == nil {
					if !in.IsDelim(']') {
						out.Categories = make([]uint64, 0, 8)
					} else {
						out.Categories = []uint64{}
					}
				} else {
					out.Categories = (out.Categories)[:0]
				}
				for !in.IsDelim(']') {
					var v1 uint64
					v1 = uint64(in.Uint64())
					out.Categories = append(out.Categories, v1)
					in.WantComma()
				}
				in.Delim(']')
			}
		case "owner":
			if in.IsNull() {
				in.Skip()
				out.Owner = nil
			} else {
				if out.Owner == nil {
					out.Owner = new(uuid.UUID)
				}
				if data := in.UnsafeBytes(); in.Ok() {
					in.AddError((*out.Owner).UnmarshalText(data))
				}
			}
		case "friends":
			if in.IsNull() {
				in.Skip()
				out.Friends = nil
			} else {
				in.Delim('[')
				if out.Friends == nil {
					if !in.IsDelim(']') {
						out.Friends = make([]string, 0, 4)
					} else {
						out.Friends = []string{}
					}
				} else {
					out.Friends = (out.Friends)[:0]
				}
				for !in.IsDelim(']') {
					var v2 string
					v2 = string(in.String())
					out.Friends = append(out.Friends, v2)


.fn[Ui]=Ki,Zi._jQueryInterface},function(){if("undefined"==typeof p)throw new TypeError("Bootstrap's JavaScript requires jQuery. jQuery must be included before Bootstrap's JavaScript.");var t=p.fn.jquery.split(" ")[0].split(".");if(t[0]<2&&t[1]<9||1===t[0]&&9===t[1]&&t[2]<1||4<=t[0])throw new Error("Bootstrap's JavaScript requires at least jQuery v1.9.1 but less than v4.0.0")}(),t.Util=m,t.Alert=g,t.Button=k,t.Carousel=at,t.Collapse=Ct,t.Dropdown=Xe,t.Modal=gn,t.Popover=ii,t.Scrollspy=Ci,t.Tab=Wi,t.Toast=Zi,t.Tooltip=qn,Object.defineProperty(t,"__esModule",{value:!0})});
//# sourceMappingURL=bootstrap.bundle.min.js.map!function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=19)}([function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},,,,,,,,,,,,,,,,,,function(t,e,n){n(20),n(21),t.exports=n(22)},function(t,e,n){"use strict";Object.defineProperty(window.__firefox__,"searchQueryForField",{enumerable:!1,configurable:!1,writable:!1,value:function(){var t=document.activeElement;if("input"!==t.tagName.toLowerCase())return null;var e=t.form;if(!e||"get"!=e.method.toLowerCase())return null;var n=e.getElementsByTagName("input"),r=(n=Array.prototype.slice.call(n,0)).map(function(e){return e.name==t.name?[e.name,"{searchTerms}"].join("="):[e.name,e.value].map(encodeURIComponent).join("=")}),o=e.getElementsByTagName("select"),i=(o=Array.


't have it already):

Pip install it.

```bash
pip install -U nltk
```

Download WordNet.
```bash
python
>>> import nltk; nltk.download('wordnet')
```

### Run EDA

You can easily write your own implementation, but this one takes input files in the format `label\tsentence` (note the `\t`). So for instance, your input file should look like this (example from stanford sentiment treebank):

```
1   neil burger here succeeded in making the mystery of four decades back the springboard for a more immediate mystery in the present
0   it is a visual rorschach test and i must have failed
0   the only way to tolerate this insipid brutally clueless film might be with a large dose of painkillers
...
```

Now place this input file into the `data` folder. Run

```bash
python code/augment.py --input=<insert input filename>
```

The default output filename will append `eda_` to the front of the input filename, but you can specify your own with `--output`. You can also specify the number of generated augmented sentences per original sentence using `--num_aug` (default is 9). Furthermore, you can specify different alpha parameters, which approximately means the percent of words in the sentence that will be changed according to that rule (default is `0.1` or `10%`). So for example, if your input file is `sst2_train.txt` and you want to output to `sst2_augmented.txt` with `16` augmented sentences per original sentence and replace 5% of words by synonyms (`alpha_sr=0.05`), delete 10% of words (`alpha_rd=0.1`, or leave as the default) and do not apply random insertion (`alpha_ri=0.0`) and random swap (`alpha_rs=0.0`), you would do:

```bash
python code/augment.py --input=sst2_train.txt --output=sst2_augmented.txt --num_aug=16 --alpha_sr=0.05 --alpha_rd=0.1 --alpha_ri=0.0 --alpha_rs=0.0
```

Note that at least one augmentation operation is applied per augmented sentence regardless of alpha (if greater than zero). So if you do `alpha_sr=0.001` and your sentence only has four words, one augmentation operation will still be performed. Of course, if one particular alpha is zero, nothing will be done. Best of luck!

# Citation
If you use EDA in your paper, please cite us:
```
@inproceedings{wei-zou-2019-eda,
    title = "{EDA}: Easy Data Augmentation Techniques for Boosting Performance on Text Classification Tasks",
    author = "Wei, Jason  and
      Zou, Kai",
    booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP)",
    month = nov,
    year = "2019",
    address = "Hong Kong, China",
    publisher = "Association for Computational Linguistics",
    url = "https://www.aclweb.org/anthology/D19-1670",
    pages = "6383--6389",
}
```

# Experiments

The code is not documented, but is [here](https://github.com/jasonwei20/eda_nlp/tree/master/experiments) for all experiments used in the paper. See [this issue](https://github.com/jasonwei20/eda_nlp/issues/10) for limited guidance.

*This file is generated by [Template Studio for WinUI](https://github.com/microsoft/TemplateStudio).*

----------

*Recommended Markdown Viewer: [Markdown Editor](https://marketplace.visualstudio.com/items?itemName=MadsKristensen.MarkdownEditor2)*

## Getting Started

Browse and address `TODO:` comments in `View -> Task List` to learn the codebase and understand next steps for turning the generated code into production code.

Explore the [WinUI Gallery](https://apps.microsoft.com/detail/9P3JFPWWDZRC) to


      val authCode = "test_auth_code"
      val mockTokenResponse =
        mockk<IWxpaWebClient.WxpaWebsiteAuthGetAccessTokenResp> {
          every { isError } returns true
          every { errorCode } returns 40001
          every { errorMessage } returns "invalid credential"
        }

      every { apiClient.getWebsiteAccessToken("test_app_id", "test_app_secret", authCode) } returns mockTokenResponse

      // When
      val userInfo = userInfoService.getUserInfoByAuthCode(authCode)

      // Then
      assertNull(userInfo)
    }

    @Test
    fun `当 access token 为空时应该返回 null`() {
      // Given
      val authCode = "test_auth_code"
      val mockTokenResponse =
        mockk<IWxpaWebClient.WxpaWebsiteAuthGetAccessTokenResp> {
          every { isError } returns false
          every { accessToken } returns null
          every { openId } returns "test_open_id"
        }

      every { apiClient.getWebsiteAccessToken("test_app_id", "test_app_secret", authCode) } returns mockTokenResponse

      // When
      val userInfo = userInfoService.getUserInfoByAuthCode(authCode)

      // Then
      assertNull(userInfo)
    }

    @Test
    fun `当 openId 为空时应该返回 null`() {
      // Given
      val authCode = "test_auth_code"
      val mockTokenResponse =
        mockk<IWxpaWebClient.WxpaWebsiteAuthGetAccessTokenResp> {
          every { isError } returns false
          every { accessToken } returns "test_access_token"
          every { openId } returns null
        }

      every { apiClient.getWebsiteAccessToken("test_app_id", "test_app_secret", authCode) } returns mockTokenResponse

      // When
      val userInfo = userInfoService.getUserInfoByAuthCode(authCode)

      // Then
      assertNull(userInfo)
    }

    @Test
    fun `当获取用户信息失败时应该返回 null`() {
      // Given
      val authCode = "test_auth_code"
      val mockTokenResponse =
        mockk<IWxpaWebClient.WxpaWebsiteAuthGetAccessTokenResp> {
          every { isError } returns false
          every { accessToken } returns "test_access_token"
          every { openId } returns "test_open_id"
        }

      every { apiClient.getWebsiteAccessToken("test_app_id", "test_app_secret", authCode) } returns mockTokenResponse

      every { apiClient.getUserInfoByAccessToken("test_access_token", "test_open_id") } returns null

      // When
      val userInfo = userInfoService.getUserInfoByAuthCode(authCode)

      // Then
      assertNull(userInfo)
    }

    @Test
    fun `当用户信息中 openId 为空时应该返回 null`() {
      // Given
      val authCode = "test_auth_code"
      val mockTokenResponse =
        mockk<IWxpaWebClient.WxpaWebsiteAuthGetAccessTokenResp> {
          every { isError } returns false
          every { accessToken } returns "test_access_token"
          every { openId } returns "test_open_id"
        }
      val mockUserInfoResponse = mockk<IWxpaWebClient.WxpaWebsiteUserInfoResp> { every { openId } returns null }

      every { apiClient.getWebsiteAccessToken("test_app_id", "test_app_secret", authCode) } returns mockTokenResponse

      every { apiClient.getUserInfoByAccessToken("test_access_token", "test_open_id") } retur


pen(path, "rb") as f:
            cache_file(path, base64.b64encode(f.read()).decode("utf-8"))
    name, ext = os.path.splitext(os.path.basename(path))
    compiled = fcache[path]
    id = f"{name}-{mdhash(path,6)}"
    fname = f"{id}.{mdhash(compiled,6)}{ext}"
    asset_cache[path] = (fname, compiled)
    for file in glob(str(assets_dir / f"{id}.*{ext}")):
        if os.path.exists(str(file)):
            os.remove(str(file))
    with open(assets_dir / fname, "wb") as f:
        f.write(base64.b64decode(compiled))
    save_asset_cache()
    return id

def compile_tailwind(layout: str) -> None:
    source_id = twlayouts[layout]
    picomet_engine = engines["picomet"].engine
    input_css = picomet_engine.find_template(f"{source_id}.tailwind.css")[1].name
    tailwind_conf = picomet_engine.find_template(f"{source_id}.tailwind.js")[1].name
    postcss_conf = picomet_engine.find_template(f"{source_id}.postcss.js")[1].name

    content = []

    def find_depending(f: str) -> None:
        if f not in content:
            content.append(f)
        for d1 in dgraph:
            for d2 in dgraph[d1]:
                if d2 == f:
                    find_depending(d1)

    def find_depended(f: str) -> None:
        if f not in content:
            content.append(f)
        for d in dgraph.get(f, []):
            find_depended(d)
            find_depending(d)

    find_depending(layout)
    find_depended(layout)

    from javascript import require

    css, fname, compiled = require("./tailwind.js").compile(
        input_css,
        tailwind_conf,
        postcss_conf,
        assets_dir.as_posix(),
        f"{os.path.basename(source_id)}-{mdhash(layout,6)}",
        content,
        DEBUG,
    )
    from picomet.loaders import cache_file

    cache_file(input_css, css)
    asset_cache[layout] = (fname, compiled)
    save_asset_cache()

def find_in_comets(name: str | DQES) -> str | None:
    comet_dirs = list(
        chain.from_iterable(
            [
                [str(d) for d in loader.get_dirs()]
                for loader in engines["picomet"].engine.template_loaders
            ]
        )
    )
    return find_in_dirs(name, comet_dirs)

def find_in_assets(name: str | DQES) -> str | None:
    asset_dirs = [
        *[str(d) for d in ASSETFILES_DIRS],
        *[os.path.join(app.path, "assets") for app in apps.get_app_configs()],
    ]
    return find_in_dirs(name, asset_dirs)

def find_in_dirs(name: str, dirs: list[str]) -> str | None:
    for d in dirs:
        directory = Path(d)
        if directory.is_dir():
            file = directory / name
            if file.exists():
                return file.as_posix()
    return None


        upload_to='project/share-img/'
    )
    fb_app_id = models.CharField(
        max_length=100,
        default='359857967960662',
        blank=True,
        help_text='Facebook App ID'
    )

    class Meta:
        verbose_name_plural = 'SEO'
        verbose_name = 'SEO'

    def __str__(self):
        return self.title

class Performance(models.Model):
    feed_3_days = models.BooleanField(
        default=True,
        help_text='Hauptfeed zeigt nur Content der letzten 3 Tage'
    )

    class Meta:
        verbose_name_plural = 'Performance Settings'
        verbose_name = 'Performance Settings'

class Snippet(models.Model):
    name = models.CharField(
        max_length=50
    )
    embed_code = models.TextField()
    is_active = models.BooleanField(default=True)

    class Meta:
        verbose_name_plural = 'Code Snippets (e.g. Google Analytics)'
        verbose_name = 'Code Snippets (e.g. Google Analytics)'

    def __str__(self):
        return self.name


 || {
            let collector = PyClassImplCollector::<Self>::new();
            build_pyclass_doc(<MyClass as pyo3::PyTypeInfo>::NAME, pyo3::ffi::c_str!(""), collector.new_text_signature())
        }).map(::std::ops::Deref::deref)
    }
}

# Python::with_gil(|py| {
#     let cls = py.get_type::<MyClass>();
#     pyo3::py_run!(py, cls, "assert cls.__name__ == 'MyClass'")
# });
# }
```

[`PyTypeInfo`]: {{#PYO3_DOCS_URL}}/pyo3/type_object/trait.PyTypeInfo.html

[`Py`]: {{#PYO3_DOCS_URL}}/pyo3/struct.Py.html
[`Bound<'_, T>`]: {{#PYO3_DOCS_URL}}/pyo3/struct.Bound.html
[`PyClass`]: {{#PYO3_DOCS_URL}}/pyo3/pyclass/trait.PyClass.html
[`PyRef`]: {{#PYO3_DOCS_URL}}/pyo3/pycell/struct.PyRef.html
[`PyRefMut`]: {{#PYO3_DOCS_URL}}/pyo3/pycell/struct.PyRefMut.html
[`PyClassInitializer<T>`]: {{#PYO3_DOCS_URL}}/pyo3/pyclass_init/struct.PyClassInitializer.html

[`Arc`]: https://doc.rust-lang.org/std/sync/struct.Arc.html
[`RefCell`]: https://doc.rust-lang.org/std/cell/struct.RefCell.html

[classattr]: https://docs.python.org/3/tutorial/classes.html#class-and-instance-variables

[`multiple-pymethods`]: features.md#multiple-pymethods

[lifetime-elision]: https://doc.rust-lang.org/reference/lifetime-elision.html
[compiler-error-e0106]: https://doc.rust-lang.org/error_codes/E0106.html
# Light Controlling Using Hand Gestures

![Intro Image](./img/intro_img.jpeg)

The "Light Controlling Using Hand Gestures" project develops a system that allows users to control lights through hand gestures. This project combines Google's gesture recognition technology (MediaPipe Gesture Recognizer) with a Deep Learning Model to create a system that recognizes hand gestures and executes commands corresponding to predefined gestures. The system can control lights in a simulated environment or real lighting devices via a Modbus RTU RS485 relay module.

## Key Features

*   **Real-time Hand Gesture Recognition**: Utilizes MediaPipe Gesture Recognizer to detect and extract hand landmarks from a webcam feed.
*   **Deep Learning Model**: An MLP (Multi-Layer Perceptron) model is trained to classify hand gestures into specific light control actions.
*   **Flexible Light Control**: Supports light control in simulated environments and physical lighting devices via a 4-channel Modbus RTU RS485 relay module.
*   **Easy Extensibility**: Gesture and corresponding action configurations are defined in the `hand_gesture.yaml` file, allowing for easy addition or modification of new gestures.
*   **Automated Data Collection**: The `generate_landmark_data.py` tool helps efficiently collect hand gesture landmark data for model training.

## Project Structure

The project is organized with the following main directories and files:

```
Light-Controlling-Using-Hand-Gestures/
├── data/                       # Contains CSV files for landmark data (train, val, test)
├── img/                        # Contains illustrative images for README
├── models/                     # Contains the trained deep learning model
├── sign_imgs/                  # Contains sample images of gestures
├── .gitignore                  # Files and directories to ignore in Git commits
├── Light Controlling Using Hand Gestures.pdf # Detailed project guide document
├── README.md                   # Project README file
├── controller.py               # Handles light control logic (interacts with relay)
├── detect_simulation.py        # Simulates gesture recognition and light control
├── generate_landmark_data.py   # Script for collecting hand landmark data from gestures


*
     *

     *
{@link #JNI_OK OK} - success

     *
{@link #JNI_ERR ERR} - unknown error

     *
{@link #JNI_EDETACHED EDETACHED} - thread detached from the VM

     *
{@link #JNI_EVERSION EVERSION} - JNI version error

     *
{@link #JNI_ENOMEM ENOMEM} - not enough memory

     *
{@link #JNI_EEXIST EEXIST} - VM already created

     *
{@link #JNI_EINVAL EINVAL} - invalid arguments

     *

     */
    public static final int
        JNI_OK        = 0,
        JNI_ERR       = (-1),
        JNI_EDETACHED = (-2),
        JNI_EVERSION  = (-3),
        JNI_ENOMEM    = (-4),
        JNI_EEXIST    = (-5),
        JNI_EINVAL    = (-6);

    /** Used in {@code ReleaseScalarArrayElements}. */
    public static final int
        JNI_COMMIT = 1,
        JNI_ABORT  = 2;

    protected JNINativeInterface() {
        throw new UnsupportedOperationException();
    }

    // --- [ GetVersion ] ---

    /**
     * Returns the version of the native method interface.
     *
     * @return the major version number in the higher 16 bits and the minor version number in the lower 16 bits
     */
    @NativeType("jint")
    public static native int GetVersion();

    // --- [ FromReflectedMethod ] ---

    /** Converts a {@link Method} or {@link Constructor} object to a method ID. */
    @NativeType("jmethodID")
    public static native long FromReflectedMethod(@NativeType("jobject") Method method);

    // --- [ FromReflectedField ] ---

    /** Converts a {@link Field} to a field ID. */
    @NativeType("jfieldID")
    public static native long FromReflectedField(@NativeType("jobject") Field field);

    // --- [ ToReflectedMethod ] ---

    /** Unsafe version of: {@link #ToReflectedMethod} */
    @Nullable
    public static native Method nToReflectedMethod(Class<?> cls, long methodID, boolean isStatic);

    /**
     * Converts a method ID derived from {@code cls} to a {@link Method} or {@link Constructor} object.
     *
     * @param isStatic must be set to {@link #JNI_TRUE TRUE} if the method ID refers to a static field, and # FALSE otherwise
     */
    @Nullable
    @NativeType("jobject")
    public static Method ToReflectedMethod(@NativeType("jclass") Class<?> cls, @NativeType("jmethodID") long methodID, @NativeType("jboolean") boolean isStatic) {
        if (CHECKS) {
            check(methodID);
        }
        return nToReflectedMethod(cls, methodID, isStatic);
    }

    // --- [ ToReflectedField ] ---

    /** Unsafe version of: {@link #ToReflectedField} */
    @Nullable
    public static native Field nToReflectedField(Class<?> cls, long fieldID, boolean isStatic);

    /**
     * Converts a field ID derived from {@code cls} to a {@link Field} object.
     *
     * @param isStatic must be set to {@link #JNI_TRUE TRUE} if {@code fieldID} refers to a static field, and {@link #JNI_FALSE FALSE} otherwise
     */
    @Nullable
    @NativeType("jobject")
    public static Field ToReflectedField(@NativeType("jclass") Class<?> cls, @NativeType("jfieldID") long fieldID, @NativeType("jboolean") boolean isStatic) {
        if (CHECKS) {
            check(fieldID);
        }
        return nToReflectedField(


Res;

/// Response error
pub use bindings::rd_kafka_resp_err_t as RDKafkaRespErr;

/// Admin operation
pub use bindings::rd_kafka_admin_op_t as RDKafkaAdminOp;

/// Config resource type
pub use bindings::rd_kafka_ResourceType_t as RDKafkaResourceType;

/// Config source
pub use bindings::rd_kafka_ConfigSource_t as RDKafkaConfigSource;

/// Errors enum

/// Error from the underlying rdkafka library.
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum RDKafkaError {
    #[doc(hidden)]
    Begin = -200,
    /// Received message is incorrect
    BadMessage = -199,
    /// Bad/unknown compression
    BadCompression = -198,
    /// Broker is going away
    BrokerDestroy = -197,
    /// Generic failure
    Fail = -196,
    /// Broker transport failure
    BrokerTransportFailure = -195,
    /// Critical system resource
    CriticalSystemResource = -194,
    /// Failed to resolve broker
    Resolve = -193,
    /// Produced message timed out
    MessageTimedOut = -192,
    /// Reached the end of the topic+partition queue on the broker. Not really an error.
    PartitionEOF = -191,
    /// Permanent: Partition does not exist in cluster.
    UnknownPartition = -190,
    /// File or filesystem error
    FileSystem = -189,
    /// Permanent: Topic does not exist in cluster.
    UnknownTopic = -188,
    /// All broker connections are down.
    AllBrokersDown = -187,
    /// Invalid argument, or invalid configuration
    InvalidArgument = -186,
    /// Operation timed out
    OperationTimedOut = -185,
    /// Queue is full
    QueueFull = -184,
    /// ISR count < required.acks
    ISRInsufficient = -183,
    /// Broker node update
    NodeUpdate = -182,
    /// SSL error
    SSL = -181,
    /// Waiting for coordinator to become available.
    WaitingForCoordinator = -180,
    /// Unknown client group
    UnknownGroup = -179,
    /// Operation in progress
    InProgress = -178,
    /// Previous operation in progress, wait for it to finish.
    PreviousInProgress = -177,
    /// This operation would interfere with an existing subscription
    ExistingSubscription = -176,
    /// Assigned partitions (rebalance_cb)
    AssignPartitions = -175,
    /// Revoked partitions (rebalance_cb)
    RevokePartitions = -174,
    /// Conflicting use
    Conflict = -173,
    /// Wrong state
    State = -172,
    /// Unknown protocol
    UnknownProtocol = -171,
    /// Not implemented
    NotImplemented = -170,
    /// Authentication failure
    Authentication = -169,
    /// No stored offset
    NoOffset = -168,
    /// Outdated
    Outdated = -167,
    /// Timed out in queue
    TimedOutQueue = -166,
    /// Feature not supported by broker
    UnsupportedFeature = -165,
    /// Awaiting cache update
    WaitCache = -164,
    /// Operation interrupted (e.g., due to yield))
    Interrupted = -163,
    /// Key serialization error
    KeySerialization = -162,
    /// Value serialization error
    ValueSerialization = -161,
    /// Key deserialization error
    KeyDeserialization = -160,
    /// Value deserialization error
    ValueDeserialization = -159,
    /// Partial response
    Partial = -158,
    /// Modification attempted on read-only object
    ReadOnly = -157,
    /// No such entry or item not found
    NoEnt = -156,
    /// Read underflow
    Underflow = -155,
    /// Invalid type
    InvalidType = -154,
    /// Retry operation
    Retry = -153,
    /// Purged in queue
    PurgeQueue = -152,
    /// Purged in flight
    PurgeInflight = -151,
    /// Fatal error: see rd_kafka_fatal_error()
    Fatal = -150,
    /// Inconsistent state
    Inconsistent = -149,
    /// Gap-less ordering would not be guaranteed if proceeding
    GaplessGuarantee = -148,
    /// Maximum poll interval exceeded
    PollExceeded


           (byte)(value >> 16),
                (byte)(value >> 8),
                (byte)value
            };
        }

        // IntToBytes version that doesn't allocate a new byte[4] each time.
        // -> important for MMO scale networking performance.
        public static void IntToBytesBigEndianNonAlloc(int value, byte[] bytes)
        {
            bytes[0] = (byte)(value >> 24);
            bytes[1] = (byte)(value >> 16);
            bytes[2] = (byte)(value >> 8);
            bytes[3] = (byte)value;
        }

        public static int BytesToIntBigEndian(byte[] bytes)
        {
            return
                (bytes[0] << 24) |
                (bytes[1] << 16) |
                (bytes[2] << 8) |
                bytes[3];
        }
    }
}


e.Stages) == 0 {
		out.SyncStrategy = model.SyncStrategy_QUICK_SYNC
		out.Stages = buildQuickSyncPipeline(autoRollback, time.Now())
		out.Summary = "Quick sync by applying all manifests (no pipeline was configured)"
		return
	}

	// Force to use pipeline when the alwaysUsePipeline field was configured.
	if cfg.Planner.AlwaysUsePipeline {
		out.SyncStrategy = model.SyncStrategy_PIPELINE
		out.Stages = buildProgressivePipeline(cfg.Pipeline, autoRollback, time.Now())
		out.Summary = "Sync with the specified pipeline (alwaysUsePipeline was set)"
		return
	}

	// This deployment is triggered by a commit with the intent to perform pipeline.
	// Commit Matcher will be ignored when triggered by a command.
	if p := cfg.CommitMatcher.Pipeline; p != "" && in.Trigger.Commander == "" {
		pipelineRegex, err := in.RegexPool.Get(p)
		if err != nil {
			err = fmt.Errorf("failed to compile commitMatcher.pipeline(%s): %w", p, err)
			return out, err
		}
		if pipelineRegex.MatchString(in.Trigger.Commit.Message) {
			out.SyncStrategy = model.SyncStrategy_PIPELINE
			out.Stages = buildProgressivePipeline(cfg.Pipeline, autoRollback, time.Now())
			out.Summary = fmt.Sprintf("Sync progressively because the commit message was matching %q", p)
			return out, err
		}
	}

	// This deployment is triggered by a commit with the intent to synchronize.
	// Commit Matcher will be ignored when triggered by a command.
	if s := cfg.CommitMatcher.QuickSync; s != "" && in.Trigger.Commander == "" {
		syncRegex, err := in.RegexPool.Get(s)
		if err != nil {
			err = fmt.Errorf("failed to compile commitMatcher.sync(%s): %w", s, err)
			return out, err
		}
		if syncRegex.MatchString(in.Trigger.Commit.Message) {
			out.SyncStrategy = model.SyncStrategy_QUICK_SYNC
			out.Stages = buildQuickSyncPipeline(autoRollback, time.Now())
			out.Summary = fmt.Sprintf("Quick sync by applying all manifests because the commit message was matching %q", s)
			return out, err
		}
	}

	// This is the first time to deploy this application
	// or it was unable to retrieve that value.
	// We just apply all manifests.
	if in.MostRecentSuccessfulCommitHash == "" {
		out.SyncStrategy = model.SyncStrategy_QUICK_SYNC
		out.Stages = buildQuickSyncPipeline(autoRollback, time.Now())
		out.Summary = "Quick sync by applying all manifests because it seems this is the first deployment"
		return
	}

	// Load manifests of the previously applied commit.
	oldManifests, ok := manifestCache.Get(in.MostRecentSuccessfulCommitHash)
	if !ok {
		// When the manifests were not in the cache we have to load them.
		var runningDs *deploysource.DeploySource
		runningDs, err = in.RunningDSP.Get(ctx, io.Discard)
		if err != nil {
			err = fmt.Errorf("failed to prepare the running deploy source data (%v)", err)
			return
		}

		runningCfg := runningDs.ApplicationConfig.KubernetesApplicationSpec
		if runningCfg == nil {
			err = fmt.Errorf("unable to find the running configuration (%v)", err)
			return
		}
		loader := provider.NewLoader(in.ApplicationName, runningDs.AppDir, runningDs.RepoDir, in.GitPath.ConfigFilename, runningCfg.Input, in.GitClient, in.Logger)
		oldManifests, err = loader.LoadManifests(ctx)
		if err != nil {
			err = fmt.Errorf("failed to load previously deployed manifests: %


moveTo(0, 0);
		this.shape.graphics.lineTo(65, 0);
		this.shape.graphics.drawArc(0, 0, 65, -75*Math.PI/180, this.angle * Math.PI / 180, false);
		this.shape.graphics.lineTo(0, 0);
		this.shape.graphics.endFill();
	}
}import Discord from "discord.js";

import config from "../config";
import {
	FirebaseGuildRepository,
	FirebaseWalletRepository,
} from "../repositories";
import { Logger } from "../loaders";
import { IBotCommand } from "./IBotCommand";
import { CommandErrorsEmbed } from "../templates";

export default class SetCommand implements IBotCommand {
	name: string;
	syntax: string;
	arguments: boolean;
	guildOnly: boolean;
	description: string;
	aliases?: string[];
	cooldown?: number;

	constructor() {
		this.name = "set";
		this.syntax = "set {opção} {opcional: argumentos extras}";
		this.arguments = true;
		this.guildOnly = true;
		this.description = "Sincroniza o servidor com o banco de dados.";
		this.cooldown = 7000;
	}

	async command(message: Discord.Message, args: string[]) {
		message.channel.startTyping();

		if (
			!message.guild
				.member(message.author)
				.permissions.has(Discord.Permissions.FLAGS.ADMINISTRATOR)
		) {
			const errorEmbed = new CommandErrorsEmbed()
				.generate(message)
				.addField(
					"Causa do erro:",
					"Você não tem permissões para isso."
				);
			message.channel.stopTyping(true);
			await message.reply(errorEmbed);
		}

		const firstEmbed = new Discord.MessageEmbed()
			.setColor(config.primaryColor)
			.setTitle("Sincronizando")
			.addField("Carregando...", "Carregando...");
		const messageSended = await message.reply(firstEmbed);

		const embed = new Discord.MessageEmbed()
			.setColor(config.primaryColor)
			.setTitle("Sincronização")
			.setFooter(
				`Comando executado por: ${message.author.tag}`,
				message.author.avatarURL()
			);

		const firebaseWalletRepository = new FirebaseWalletRepository();

		try {
			const guildRepository = new FirebaseGuildRepository();
			switch (args[0]) {
				default:
					message.channel.stopTyping(true);
					const errorEmbed = new CommandErrorsEmbed()
						.generate(message)
						.addField("Causa do erro:", "Parâmetro inválido.")
						.addField("Uso do comando:", `${config.globalPrefix}${this.syntax}`);
					await messageSended.edit(errorEmbed);
					return;

				case "dev":
					if (!args[1]) {
						message.channel.stopTyping(true);
						const errorEmbed = new CommandErrorsEmbed()
							.generate(message)
							.addField("Causa do erro:", "Opção inválida.")
							.addField("Uso do comando:", `${config.globalPrefix}${this.syntax}`);
						await messageSended.edit(errorEmbed);
						return;
					}
					if (!config.dev) {
						message.channel.stopTyping(true);
						const errorEmbed = new CommandErrorsEmbed()
							.generate(message)
							.addField("Causa do erro:", "Ambiente inválido.");
						await messageSended.edit(errorEmbed);
						return;
					}
					if (args[1] === "database") {
						return guildRepository
							.createGuild({
								id: "695379320167989258",
								dbPublicChannelId: "854768086023667782",
								dbAdminChannelId: "854768111667249212",
								adminRoleId: "",
							})
							.then(async ()


�化循环的技术。

上面这句属于书上的官方说法，我们来看看例子，不止并行算法可以展开，传统串行代码展开后效率也能一定程度的提高，因为省去了判断和分支预测失败所带来的迟滞。

```C
for (itn i = 0; i < tid; i++) {
    a[i] = b[i] + c[i];
}
```

这个是最传统的写法，如果进行循环展开呢？

```C
for (int i = 0; i < 100; i += 4) {
    a[i + 0] = b[i + 0] + c[i + 0];
    a[i + 1] = b[i + 1] + c[i + 1];
    a[i + 2] = b[i + 2] + c[i + 2];
    a[i + 3] = b[i + 3] + c[i + 3];
}
```

我们可以通过手动展开循环来提高性能，将原本由循环完成的任务提前列出。具体而言，我们可以使循环每次增加 4，并在每次迭代中处理 4 个元素。这样做的好处是从串行执行的角度来看，可以**减少条件判断的次数，从而提升性能**。然而，如果将这段代码在机器上运行，可能并不会显著体现出性能差异，因为现代编译器通常会将这两种不同的写法编译为相似的机器代码，也就是说，即使我们不手动展开循环，编译器也可能会进行相应的优化。

不过需要注意的是，**当前的 CUDA 编译器尚未实现这种优化，因此手动展开内核中的循环可以显著提升内核的性能**。

在 CUDA 中展开循环的主要目的是：

1.  **减少指令消耗**
2.  **增加更多的独立调度指令**

如果以下指令被添加到 CUDA 流水线上：

```C
a[i + 0] = b[i + 0] + c[i + 0];
a[i + 1] = b[i + 1] + c[i + 1];
a[i + 2] = b[i + 2] + c[i + 2];
a[i + 3] = b[i + 3] + c[i + 3];
```

这样做是非常受欢迎的，因为它能够**最大限度地提高指令的执行效率和内存带宽的利用率**。通过同时操作多个元素，这种方式能够有效减少内存访问的延迟，同时增加计算的并行性，确保 GPU 资源得到充分利用，从而提升整体性能。

#### 5.1. 展开的归约 Reducing with Unrolling

在 [4. 避免分支分化 Avoiding Branch Divergence](#4.%20避免分支分化%20Avoiding%20Branch%20Divergence) 中，核函数 `reduceInterleaved` 每个线程块通常只处理对应的数据片段。我们有一个新的想法：**是否可以让一个线程块处理多块数据？** 这实际上是可行的。在对这部分数据进行求和之前，我们可以让每个线程执行一次加法操作，将来自其他线程块的数据相加，这相当于先进行一次向量加法，然后再进行归约操作。通过这种方式，我们能够在一条指令中完成之前通常需要多次计算的工作，这样的性价比确实非常诱人。

```C
__global__ void reduceUnroll2(int* g_idata, int* g_odata, unsigned int n) {
    // set thread ID
    unsigned int tid = threadIdx.x;
    unsigned int idx = blockDim.x * blockIdx.x * 2 + threadIdx.x;
    // boundary check
    if (tid >= n)


y, it erodes away the boundaries of
foreground object (Always try to keep foreground in white). So what it does? The kernel slides
through the image (as in 2D convolution). A pixel in the original image (either 1 or 0) will be
considered 1 only if all the pixels under the kernel is 1, otherwise it is eroded (made to zero).

So what happends is that, all the pixels near boundary will be discarded depending upon the size of
kernel. So the thickness or size of the foreground object decreases or simply white region decreases
in the image. It is useful for removing small white noises (as we have seen in colorspace chapter),
detach two connected objects etc.

Here, as an example, I would use a 5x5 kernel with full of ones. Let's see it how it works:
@code{.py}
import cv2 as cv
import numpy as np

img = cv.imread('j.png',0)
kernel = np.ones((5,5),np.uint8)
erosion = cv.erode(img,kernel,iterations = 1)
@endcode
Result:

![image](images/erosion.png)

### 2. Dilation

It is just opposite of erosion. Here, a pixel element is '1' if atleast one pixel under the kernel
is '1'. So it increases the white region in the image or size of foreground object increases.
Normally, in cases like noise removal, erosion is followed by dilation. Because, erosion removes
white noises, but it also shrinks our object. So we dilate it. Since noise is gone, they won't come
back, but our object area increases. It is also useful in joining broken parts of an object.
@code{.py}
dilation = cv.dilate(img,kernel,iterations = 1)
@endcode
Result:

![image](images/dilation.png)

### 3. Opening

Opening is just another name of **erosion followed by dilation**. It is useful in removing noise, as
we explained above. Here we use the function, **cv.morphologyEx()**
@code{.py}
opening = cv.morphologyEx(img, cv.MORPH_OPEN, kernel)
@endcode
Result:

![image](images/opening.png)

### 4. Closing

Closing is reverse of Opening, **Dilation followed by Erosion**. It is useful in closing small holes
inside the foreground objects, or small black points on the object.
@code{.py}
closing = cv.morphologyEx(img, cv.MORPH_CLOSE, kernel)
@endcode
Result:

![image](images/closing.png)

### 5. Morphological Gradient

It is the difference between dilation and erosion of an image.

The result will look like the outline of the object.
@code{.py}
gradient = cv.morphologyEx(img, cv.MORPH_GRADIENT, kernel)
@endcode
Result:

![image](images/gradient.png)

### 6. Top Hat

It is the difference between input image and Opening of the image. Below example is done for a 9x9
kernel.
@code{.py}
tophat = cv.morphologyEx(img, cv.MORPH_TOPHAT, kernel)
@endcode
Result:

![image](images/tophat.png)

### 7. Black Hat

It is the difference between the closing of the input image and input image.
@code{.py}
blackhat = cv.morphologyEx(img, cv.MORPH_BLACKHAT, kernel)
@endcode
Result:

![image](images/blackhat.png)

Structuring Element
-------------------

We manually created a structuring elements in the previous examples with help of Numpy. It is
rectangular shape. But in some cases, you may need elliptical/circular shaped kernels. So for this
purpose, OpenCV has a function, **cv.getStructuringElement()**. You just pass the shape and size of
the kernel, you get the desired kernel.
@code{.py}
# Rectangular Kernel
>>> cv.getStructuringElement(cv.MORPH_RECT,(5,5))
array([[1, 1, 1, 1, 1],
       [1, 1, 1, 1, 1],
       [1, 1, 1, 1, 1],
       [1, 1, 1, 1,


 Candidate received votes as a write-in. The exact numbers of write-in votes for Sanders have been published for three states: California, Vermont, and New Hampshire.[383] It was possible to vote Sanders as a write-in candidate in 14 states.[384]

^ a b c Two faithless electors from Texas cast their presidential votes for Ron Paul and John Kasich, respectively. Chris Suprun stated that he cast his presidential vote for John Kasich and his vice presidential vote for Carly Fiorina. The other faithless elector in Texas, Bill Greene, cast his presidential vote for Ron Paul but cast his vice presidential vote for Mike Pence, as pledged. John Kasich received recorded write-in votes in Alabama, Georgia, Illinois, New Hampshire, North Carolina, Pennsylvania, and Vermont.

↓

48.18%

3.28%

1.07%

0.54%

0.84%

46.09%

Clinton

<


    math: RenderConfig(AtomType.ord, mainrm), // \u0393 \Gamma
  ), // Γ
  '\u0394': SymbolRenderConfig(
    math: RenderConfig(AtomType.ord, mainrm), // \u0394 \Delta
  ), // Δ
  '\u0398': SymbolRenderConfig(
    math: RenderConfig(AtomType.ord, mainrm), // \u0398 \Theta
  ), // Θ
  '\u039B': SymbolRenderConfig(
    math: RenderConfig(AtomType.ord, mainrm), // \u039B \Lambda
  ), // Λ
  '\u039E': SymbolRenderConfig(
    math: RenderConfig(AtomType.ord, mainrm), // \u039E \Xi
  ), // Ξ
  '\u03A0': SymbolRenderConfig(
    math: RenderConfig(AtomType.ord, mainrm), // \u03A0 \Pi
  ), // Π
  '\u03A3': SymbolRenderConfig(
    math: RenderConfig(AtomType.ord, mainrm), // \u03A3 \Sigma
  ), // Σ
  '\u03A5': SymbolRenderConfig(
    math: RenderConfig(AtomType.ord, mainrm), // \u03A5 \Upsilon
  ), // Υ
  '\u03A6': SymbolRenderConfig(
    math: RenderConfig(AtomType.ord, mainrm), // \u03A6 \Phi
  ), // Φ
  '\u03A8': SymbolRenderConfig(
    math: RenderConfig(AtomType.ord, mainrm), // \u03A8 \Psi
  ), // Ψ
  '\u03A9': SymbolRenderConfig(
    math: RenderConfig(AtomType.ord, mainrm), // \u03A9 \Omega
  ), // Ω
  '\u0391': SymbolRenderConfig(
    math: RenderConfig(AtomType.ord, mainrm, 'A'), // \u0391
  ), // Α
  '\u0392': SymbolRenderConfig(
    math: RenderConfig(AtomType.ord, mainrm, 'B'), // \u0392
  ), // Β
  '\u0395': SymbolRenderConfig(
    math: RenderConfig(AtomType.ord, mainrm, 'E'), // \u0395
  ), // Ε
  '\u0396': SymbolRenderConfig(
    math: RenderConfig(AtomType.ord, mainrm, 'Z'), // \u0396
  ), // Ζ
  '\u0397': SymbolRenderConfig(
    math: RenderConfig(AtomType.ord, mainrm, 'H'), // \u0397
  ), // Η
  '\u0399': SymbolRenderConfig(
    math: RenderConfig(AtomType.ord, mainrm, 'I'), // \u0399
  ), // Ι
  '\u039A': SymbolRenderConfig(
    math: RenderConfig(AtomType.ord, mainrm, 'K'), // \u039A
  ), // Κ
  '\u039C': SymbolRenderConfig(
    math: RenderConfig(AtomType.ord, mainrm, 'M'), // \u039C
  ), // Μ
  '\u039D': SymbolRenderConfig(
    math: RenderConfig(AtomType.ord, mainrm, 'N'), // \u039D
  ), // Ν
  '\u039F': SymbolRenderConfig(
    math: RenderConfig(AtomType.ord, mainrm, 'O'), // \u039F
  ), // Ο
  '\u03A1': SymbolRenderConfig(
    math: RenderConfig(AtomType.ord, mainrm, 'P'), // \u03A1
  ), // Ρ
  '\u03A4': SymbolRenderConfig(
    math: RenderConfig(AtomType.ord, mainrm, 'T'), // \u03A4
  ), // Τ
  '\u03A7': SymbolRenderConfig(
    math: RenderConfig(AtomType.ord, mainrm, 'X'), // \u03A7
  ), // Χ
  '\u00AC': SymbolRenderConfig(
    math: RenderConfig(AtomType.ord, mainrm),


, b'G', b'B', b'G', b'C', b'G', b'D', b'G', b'E', b'G', b'F',
    b'G', b'G', b'G', b'H', b'G', b'I', b'G', b'J', b'H', b'0', b'H', b'1', b'H', b'2', b'H', b'3',
    b'H', b'4', b'H', b'5', b'H', b'6', b'H', b'7', b'H', b'8', b'H', b'9', b'H', b'A', b'H', b'B',
    b'H', b'C', b'H', b'D', b'H', b'E', b'H', b'F', b'H', b'G', b'H', b'H', b'H', b'I', b'H', b'J',
    b'I', b'0', b'I', b'1', b'I', b'2', b'I', b'3', b'I', b'4', b'I', b'5', b'I', b'6', b'I', b'7',
    b'I', b'8', b'I', b'9', b'I', b'A', b'I', b'B', b'I', b'C', b'I', b'D', b'I', b'E', b'I', b'F',
    b'I', b'G', b'I', b'H', b'I', b'I', b'I', b'J', b'J', b'0', b'J', b'1', b'J', b'2', b'J', b'3',
    b'J', b'4', b'J', b'5', b'J', b'6', b'J', b'7', b'J', b'8', b'J', b'9', b'J', b'A', b'J', b'B',
    b'J', b'C', b'J', b'D', b'J', b'E', b'J', b'F', b'J', b'G', b'J', b'H', b'J', b'I', b'J', b'J',
];
pub(crate) const DIGIT_TO_BASE21_SQUARED: [u8; 882] = [
    b'0', b'0', b'0', b'1', b'0', b'2', b'0', b'3', b'0', b'4', b'0', b'5', b'0', b'6', b'0', b'7',
    b'0', b'8', b'0', b'9', b'0', b'A', b'0', b'B', b'0', b'C', b'0', b'D', b'0', b'E', b'0', b'F',
    b'0', b'G', b'0', b'H', b'0', b'I', b'0', b'J', b'0', b'K', b'1', b'0', b'1', b'1', b'1', b'2',
    b'1', b'3', b'1', b'4', b'1', b'5', b'1', b'6', b'1', b'7', b'1', b'8', b'1', b'9', b'1', b'A',
    b'1', b'B', b'1', b'C', b'1', b'D', b'1', b'E', b'1', b'F', b'1', b'G', b'1', b'H', b'1', b'I',
    b'1', b'J', b'1', b'K', b'2', b'0', b'2', b'1', b'2', b'2', b'2', b'3', b'2', b'4', b'2', b'5',


32N = "UTM Zone 32N"
private const val COORDS_SYSTEM_ETRS89_UTM33N = "UTM Zone 33N"
private const val COORDS_SYSTEM_ETRS89_UTM32N_NE = "UTM Zone 32N (N-E)"
private const val COORDS_SYSTEM_ETRS89_UTM33N_NE = "UTM Zone 33N (N-E)"
private const val COORDS_SYSTEM_ETRS89_UTM32N_ZE = "UTM Zone 32N (zE-N)"
private const val COORDS_SYSTEM_ETRS89_UTM33N_ZE = "UTM Zone 33N (zE-N)"
private const val COORDS_SYSTEM_ETRS89_UTM34N = "UTM Zone 34N"
private const val COORDS_SYSTEM_ETRS89_LCC = "LCC Europa"
private const val COORDS_SYSTEM_ETRS89_LCC_DE = "LCC Deutschland (N-E)"
private const val COORDS_SYSTEM_ETRS89_LAEA = "LAEA Europa"
private const val COORDS_SYSTEM_CRS84 = "CRS 84"
private const val COORDS_SYSTEM_WGS84_PM = "WGS 84 Pseudo-Mercator"
private const val COORDS_SYSTEM_WGS84 = "WGS 84"

fun getUnionOfBoundingBoxes(boundingBoxesFromLayers: List<LocationBean>): LocationBean {
    val unionLocation = LocationBean()
    unionLocation.type = "free"
    for (location in boundingBoxesFromLayers) {
        if (unionLocation.latitude1 == null) {
            if (location.latitude1 == null) continue
            unionLocation.latitude1 = location.latitude1
        }
        if (unionLocation.latitude1!! > location.latitude1!!) unionLocation.latitude1 = location.latitude1
        if (unionLocation.longitude1 == null) unionLocation.longitude1 = location.longitude1
        if (unionLocation.longitude1!! > location.longitude1!!) unionLocation.longitude1 = location.longitude1
        if (unionLocation.latitude2 == null) unionLocation.latitude2 = location.latitude2
        if (unionLocation.latitude2!! < location.latitude2!!) unionLocation.latitude2 = location.latitude2
        if (unionLocation.longitude2 == null) unionLocation.longitude2 = location.longitude2
        if (unionLocation.longitude2!! < location.longitude2!!) unionLocation.longitude2 = location.longitude2
    }
    return unionLocation
}

/**
 * Get CoordType by EPSG Code
 *
 * @param epsgCode
 * @return CoordType
 */
fun getCoordTypeByEPSGCode(epsgCode: String): CoordType? = when (epsgCode) {
    COORDS_EPSG_WGS84 -> CoordType.COORDS_WGS84
    COORDS_EPSG_CRS84 -> CoordType.COORDS_CRS84
    COORDS_EPSG_WGS84_PM -> CoordType.COORDS_WGS84_PM
    COORDS_EPSG_ETRS89_UTM31N -> CoordType.COORDS_ETRS89_UTM31N
    COORDS_EPSG_ETRS89_UTM32N -> CoordType.COORDS_ETRS89_UTM32N
    COORDS_EPSG_ETRS89_UTM33N -> CoordType.CO


& pTime=FBXSDK_TIME_INFINITE);
	//@}

/*****************************************************************************************************************************
** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
*****************************************************************************************************************************/
#ifndef DOXYGEN_SHOULD_SKIP_THIS
	void ConvertNurbsSurfaceToNurbs();
	void ConvertMeshNormals();
	void ConvertNurbsCurvesToNulls();
	void ConnectTextures();
	void BuildTextureLayersDirectArray();
	void FixInheritType(FbxNode *pNode);

	void UpdateScaleCompensate(FbxNode *pNode, FbxIOSettings& pIOS);

	FbxClassId ConvertAttributeTypeToClassID(FbxNodeAttribute::EType pAttributeType);

	// These data structures are only used for legacy FBX files (version 6.x and earlier). The
	// validity of their content is not guaranteed with the most recent versions.
	FbxGlobalLightSettings&  GlobalLightSettings()  { return *mGlobalLightSettings; }
	FbxGlobalCameraSettings& GlobalCameraSettings() { return *mGlobalCameraSettings; }

	//  Clone this scene object (and everything else it contains if clone type is eDeepClone)
    FbxObject* Clone(FbxObject::ECloneType pCloneType=eDeepClone, FbxObject* pContainer=NULL, void* pSet = NULL) const override;
    FbxObject& Copy(const FbxObject& pObject) override;

	void ConnectMaterials();

	void BuildMaterialLayersDirectArray();
	void ReindexMaterialConnections(); // called to make sure that eIndex is remapped to eIndexToDirect

	FbxMultiMap* AddTakeTimeWarpSet(const char *pTakeName);
	FbxMultiMap* GetTakeTimeWarpSet(const char *pTakeName);

	// This function will destroy the scene (and all the objects directly connected to it) without sending
	// the Connect notifications nor trying to disconnect the objects first. This is a bypass of the intended
	// workflow and should be used with care.
	void ForceKill();

private:
	void Construct(const FbxObject* pFrom) override;
	void Destruct(bool pRecursive) override;

	void ConnectTextureLayerElement(FbxLayerContainer* pLayerContainer, FbxLayerElement::EType pLayerType, FbxNode* pParentNode);
	void BuildTextureLayersDirectArrayForLayerType(FbxLayerContainer* pLayerContainer, FbxLayerElement::EType pLayerType);

	FbxNode*					mRootNode;
	FbxGlobalLightSettings*		mGlobalLightSettings;
	FbxGlobalCameraSettings*	mGlobalCameraSettings;
	FbxAnimEvaluator*			mAnimationEvaluator;
	FbxAnimStack*				mCurrentAnimationStack;
	FbxCharPtrSet				mTakeTimeWarpSet;
#endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
};

#include <fbxsdk/fbxsdk_nsend.h>

#endif /* _FBXSDK_SCENE_H_ */


else if ( typeof exports === 'object' ) {
		// CommonJS
		module.exports = function (root, $) {
			if ( ! root ) {
				root = window;
			}

			if ( ! $ || ! $.fn.dataTable ) {
				$ = require('datatables.net')(root, $).$;
			}

			return factory( $, root, root.document );
		};
	}
	else {
		// Browser
		factory( jQuery, window, document );
	}
}(function( $, window, document, undefined ) {
'use strict';
var DataTable = $.fn.dataTable;

// Used for namespacing events added to the document by each instance, so they
// can be removed on destroy
var _instCounter = 0;

// Button namespacing counter for namespacing events on individual buttons
var _buttonCounter = 0;

var _dtButtons = DataTable.ext.buttons;

// Allow for jQuery slim
function _fadeIn(el, duration, fn) {
	if ($.fn.animate) {
		el
			.stop()
			.fadeIn( duration, fn );
	}
	else {
		el.css('display', 'block');

		if (fn) {
			fn.call(el);
		}
	}
}

function _fadeOut(el, duration, fn) {
	if ($.fn.animate) {
		el
			.stop()
			.fadeOut( duration, fn );
	}
	else {
		el.css('display', 'none');

		if (fn) {
			fn.call(el);
		}
	}
}

/**
 * [Buttons description]
 * @param {[type]}
 * @param {[type]}
 */
var Buttons = function( dt, config )
{
	// If not created with a `new` keyword then we return a wrapper function that
	// will take the settings object for a DT. This allows easy use of new instances
	// with the `layout` option - e.g. `topLeft: $.fn.dataTable.Buttons( ... )`.
	if ( !(this instanceof Buttons) ) {
		return function (settings) {
			return new Buttons( settings, dt ).container();
		};
	}

	// If there is no config set it to an empty object
	if ( typeof( config ) === 'undefined' ) {
		config = {};
	}

	// Allow a boolean true for defaults
	if ( config === true ) {
		config = {};
	}

	// For easy configuration of buttons an array can be given
	if ( $.isArray( config ) ) {
		config = { buttons: config };
	}

	this.c = $.extend( true, {}, Buttons.defaults, config );

	// Don't want a deep copy for the buttons
	if ( config.buttons ) {
		this.c.buttons = config.buttons;
	}

	this.s = {
		dt: new DataTable.Api( dt ),
		buttons: [],
		listenKeys: '',
		namespace: 'dtb'+(_instCounter++)
	};

	this.dom = {
		container: $('<'+this.c.dom.container.tag+'/>')
			.addClass( this.c.dom.container.className )
	};

	this._constructor();
};

$.extend( Buttons.prototype, {
	/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
	 * Public methods
	 */

	/**
	 * Get the action of a button
	 * @param  {int|string} Button index
	 * @return {function}
	 *//**
	 * Set the action of a button
	 * @param  {node} node Button element
	 * @param  {function} action Function to set
	 * @return {Buttons} Self for chaining
	 */
	action: function ( node, action )
	{
		var button = this._nodeToButton( node );

		if ( action === undefined ) {
			return button.conf.action;
		}

		button.conf.action = action;

		return this;
	},

	/**
	 * Add an active class to the button to make to look


ex-item-align: center;
      -ms-grid-row-align: center;
      align-self: center;
  color: #0654ba;
  fill: currentColor;
  -ms-flex-negative: 0;
      flex-shrink: 0;
  height: 100%;
  stroke: currentColor;
  stroke-width: 0;
  visibility: hidden;
}
.menu__status:first-child,
.fake-menu__status:first-child {
  margin-right: 8px;
}
.menu__status:last-child,
.fake-menu__status:last-child {
  margin-left: 8px;
}
svg.menu__status,
svg.fake-menu__status {
  width: 8px;
}
span.menu__icon,
span.fake-menu__icon {
  background-image: url('data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%20width%3D%2732%27%20height%3D%2732%27%3E%3Cpath%20fill%3D%22%230654ba%22%20d%3D%22M15.94%2025.294l-15.473-17.229h30.953l-7.742%208.616z%22%3E%3C/path%3E%3C/svg%3E');
  background-position: left center;
  background-repeat: no-repeat;
  background-size: contain;
  -ms-flex-negative: 0;
      flex-shrink: 0;
  height: 8px;
  width: 8px;
}
span.menu__status,
span.fake-menu__status {
  background-image: url('data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%20width%3D%2732%27%20height%3D%2732%27%3E%3Cpath%20fill%3D%22%230654ba%22%20d%3D%22M27.813%204.037l-17.008%2017.159-6.923-6.924-3.308%203.613%2010.232%209.934%2020.621-20.466-3.613-3.314z%22%3E%3C/path%3E%3C/svg%3E');
  background-position: left center;
  background-repeat: no-repeat;
  background-size: contain;
  height: 8px;
  width: 8px;
}
.menu__items--scroll[role="menu"] {
  overflow-y: scroll;
}
.menu__items--grow[role="menu"],
.menu__items--grow-reverse[role="menu"],
.fake-menu__items--grow,
.fake-menu__items--grow-reverse {
  max-width: calc(150%);
  min-width: calc(100%);
  width: auto;
}
.menu__items--grow-reverse[role="menu"],
.fake-menu__items--grow-reverse {
  right: 0;
}
.expand-btn ~ .menu__items--static[role="menu"],
.expand_btn ~ .fake-menu__items--static {
  position: static;
}
button.expand-btn--primary span.expand-btn__icon {
  background-image: url('data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%20width%3D%2732%27%20height%3D%2732%27%3E%3Cpath%20fill%3D%22%23ffffff%22%20d%3D%22M15.94%2025.294l-15.473-17.229h30.953l-7.742%208.616z%22%3E%3C/path%3E%3C/svg%3E');
}
button.expand-btn--secondary span.expand-btn__icon {
  background-image: url('data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%20width%3D%2732%27%20height%


my(): Enemy {
        // TODO
        return EnemySeeds.enemies[EnemySeeds.getRandomArbitrary(0, EnemySeeds.enemies.length)];
    }

    private static getRandomArbitrary(min: number, max: number) {
        return Math.floor(Math.random() * (max - min) + min);
    }
}import { ITreasure } from "../models";

const regexp = /^T - (\d+) - (\d+) - (\d+)$/;

export const parseTreasure: (input: string) => ITreasure | null = (input) => {
    const regResult = regexp.exec(input);
    if (regResult) {
        return {
            type: "Treasure",
            traversable: true,
            location: {x: parseInt(regResult[1]), y: parseInt(regResult[2])},
            quantity: parseInt(regResult[3]),
        };
    }
    return null;
};
import { createConnection } from 'typeorm';
import { Todo } from '../app/entities';

export const schema = {
  additionalProperties: false,
  properties: {
    text: { type: 'string' }
  },
  required: ['text'],
  type: 'object',
};

export async function main(args: any) {
  const connection = await createConnection();

  try {
    // Create a new task with the text given in the command line.
    const todo = new Todo();
    todo.text = args.text;

    console.log(await todo.save());
  } catch (error) {
    console.error(error);
  } finally {
    await connection.close();
  }
}
/**
 * @description 建立axios相關模組用做共用
 * @author frenkie
 * @date 2020-08-26
 */
import axios, { AxiosInstance, Method } from 'axios';

class AxiosItem {
  static axios: AxiosInstance = axios.create();
  static axiosInit() {
    this.axios.interceptors.request.use(
      function (config) {
        return config;
      },
      function (error) {
        //请求错误时做些事
        console.log('Axios請求發生錯誤:');
        console.log(error);
        return Promise.reject(error);
      }
    )
    this.axios.interceptors.response.use(
      function (config) {
        return config;
      },
      function (error) {
        console.log('Axios接收發生錯誤');
        console.log(error);
        return Promise.reject(error);
      }
    )
  }
  private static axiosMain(url: string, method: Method, data : object | null = null, header : object = {}){
    return this.axios.request({
      url: url,
      method: method,
      headers: header,
      data: data,
      timeout: 30 * 1000
    });
  }
  static get(url: string, data : object | null = null, header : object = {}) {
    return this.axiosMain(url, 'get', data, header)
  }
  static delete(url: string, data : object | null = null, header : object = {}) {
    return this.axiosMain(url, 'delete', data, header)
  }
}

AxiosItem.axiosInit();

export default AxiosItem;import type {
  APIApplicationCommand,
  Client,
  ContextMenuCommandBuilder,
  SlashCommandBuilder,
} from "discord.js";
import { InteractionType, Routes } from "discord.js";

import { REST } from "discord.js";

import {
  MessageContextCommand,
  SlashCommand,
  UserContextCommand,
  isMessageContextCommand,
  isSlashCommand,


final Offset localAnchor =
        globalToLocal(isAbove ? _anchorAbove : _anchorBelow);
    final double arrowTipX = clampDouble(
      localAnchor.dx,
      _kToolbarBorderRadius.x + _kToolbarArrowSize.width / 2,
      size.width - _kToolbarArrowSize.width / 2 - _kToolbarBorderRadius.x,
    );

    // Draw the path clockwise, starting from the beginning side of the arrow.
    if (isAbove) {
      final double arrowBaseY = child.size.height - _kToolbarArrowSize.height;
      final double arrowTipY = child.size.height;
      path
        ..moveTo(arrowTipX + _kToolbarArrowSize.width / 2,
            arrowBaseY) // right side of the arrow triangle
        ..lineTo(arrowTipX, arrowTipY) // The tip of the arrow
        ..lineTo(arrowTipX - _kToolbarArrowSize.width / 2,
            arrowBaseY); // left side of the arrow triangle
    } else {
      final double arrowBaseY = _kToolbarArrowSize.height;
      const double arrowTipY = 0.0;
      path
        ..moveTo(arrowTipX - _kToolbarArrowSize.width / 2,
            arrowBaseY) // right side of the arrow triangle
        ..lineTo(arrowTipX, arrowTipY) // The tip of the arrow
        ..lineTo(arrowTipX + _kToolbarArrowSize.width / 2,
            arrowBaseY); // left side of the arrow triangle
    }
    final double startAngle = isAbove ? math.pi / 2 : -math.pi / 2;
    return _addRRectToPath(path, rrect, startAngle: startAngle)..close();
  }

  @override
  void paint(PaintingContext context, Offset offset) {
    final RenderBox? child = this.child;
    if (child == null) {
      return;
    }

    final BoxParentData childParentData = child.parentData! as BoxParentData;

    final RRect rrect = _shapeRRect(child);
    final Path clipPath = _clipPath(child, rrect);

    // If configured, paint the shadow beneath the shape.
    if (_shadowColor != null) {
      final BoxShadow boxShadow = BoxShadow(
        color: shadowColor!,
        offset: const Offset(0, 4),
        blurRadius: 10,
        spreadRadius: 1,
      ).scale(2);
      final RRect shadowRRect = RRect.fromLTRBR(
        rrect.left,
        rrect.top,
        rrect.right,
        rrect.bottom + _kToolbarArrowSize.height,
        _kToolbarBorderRadius,
      ).shift(offset + childParentData.offset + boxShadow.offset);
      context.canvas.drawRRect(shadowRRect, boxShadow.toPaint());
    }

    _clipPathLayer.layer = context.pushClipPath(
      needsCompositing,
      offset + childParentData.offset,
      Offset.zero & child.size,
      clipPath,
      (PaintingContext innerContext, Offset innerOffset) =>
          innerContext.paintChild(child, innerOffset),
      oldLayer: _clipPathLayer.layer,
    );
  }

  final LayerHandle<ClipPathLayer> _clipPathLayer =
      LayerHandle<ClipPathLayer>();
  Paint? _debugPaint;

  @override
  void dispose() {
    _clipPathLayer.layer = null;
    super.dispose();
  }

  @override
  void debugPaintSize(PaintingContext context, Offset offset) {
    assert(() {
      final RenderBox? child = this.child;
      if (child == null) {
        return true;
      }

      final ui.Paint debugPaint = _debugPaint ??= Paint()
        ..shader = ui.Gradient.linear(
          Offset.zero,
          const Offset(10.0, 10.0),
          const <Color>[
            Color(0x00000000),
            Color(0xFFFF00FF),
            Color(0xFFFF00FF),
            Color(0x00000000)
          ],
          const <double>[0.25, 0.25, 0.75, 0.75],
          TileMode.repeated,
        )