9.0996 -70.1006 -49.0996h-70.0996
l18.7002 88.7998h67.7998zM88.7998 239.9c42.1006 0 53.7998 -23.4004 53.7998 -39.7002c0 -25.7002 -16.3994 -49.1006 -72.5 -49.1006h-70.0996l21 88.8008h67.7998zM268.9 239.9c42 0 53.6992 -23.4004 53.6992 -39.7002c0 -25.7002 -16.2998 -49.1006 -70.0996 -49.1006
h-70.0996l18.6992 88.8008h67.8008zM458.2 293.7c42.0996 0 53.7998 -23.4004 53.7002 -39.7002c0 -25.7002 -16.3008 -49.0996 -70.1006 -49.0996h-70.0996l18.7002 88.7998h67.7998zM430.2 155.8c42.0996 0 53.7002 -23.3994 53.7002 -39.7002
c0 -25.6992 -14 -49.0996 -70.1006 -49.0996h-70.0996l18.7002 88.7998h67.7998zM240.8 102c42.1006 0 53.7998 -23.4004 53.7002 -39.7002c0 -23.3994 -14 -49.0996 -70.0996 -49.0996h-70.1006l18.7002 88.7998h67.7998z" />
    <glyph glyph-name="blogger" unicode=""
d="M162.4 252c4.7998 4.90039 6.19922 5.09961 36.3994 5.09961c27.2002 0 28.1006 -0.0996094 32.1006 -2.09961c5.7998 -2.90039 8.2998 -7 8.2998 -13.5996c0 -5.90039 -2.40039 -10 -7.60059 -13.4004c-2.7998 -1.7998 -4.5 -1.90039 -31.0996 -2.09961
c-16.4004 -0.100586 -29.5 0.199219 -31.5 0.799805c-10.2998 2.89941 -14.0996 17.7002 -6.59961 25.2998zM223.8 157.5c55.4004 0 55.1006 0 60.4004 -4.7002c7.39941 -7 5.89941 -19.2998 -3.10059 -24.3994l-9.19922 -1.5l-47.9004 -0.600586
c-42.2002 -0.5 -54.0996 0.200195 -56.2998 1.2002c-4.40039 1.90039 -8.5 7.2998 -9.2002 12c-0.599609 4.5 1.59961 10.7998 5.09961 13.9004c4.40039 3.89941 6.30078 4.09961 60.2002 4.09961zM447.2 27.4004c-3.5 -28.4004 -23 -50.4004 -51.1006 -57.5
c-7.19922 -1.80078 -9.69922 -1.90039 -172.899 -1.80078c-157.8 0 -165.9 0.100586 -172 1.80078c-8.40039 2.19922 -15.6006 5.5 -22.2998 10c-5.60059 3.7998 -13.9004 11.7998 -17 16.3994c-3.80078 5.60059 -8.2002 15.2998 -10 22
c-1.80078 6.7002 -1.90039 9.40039 -1.90039 173.4c0 163.1 0 166.6 1.7998 173.7c6.2998 24.6992 25.9004 43.5996 51.2002


sp = tw.run_ihc_meddis2000(
                ihcrp=ihcrp[cf],
                fs=fs,
                syn_mode=syn_mode,
                **ihc_meddis2000_pars[anf_type]
            )
            psps[cf,anf_type] = psp

        elif (syn_mode == 'probability') and ((cf,anf_type) in psps):
            psp = psps[cf,anf_type]

        else:
            raise RuntimeError

        ### Spike generator (pars from Sumner et al. 2002)
        spikes = tw.run_an_sg_carney_holmberg2007(
            psp=psp,
            fs=fs,
            c0=0.5,
            c1=0.,
            s0=0.8e-3,
            s1=12.5e-3,
            refractory_period=0.75e-3,
        )

        trains.append({
            'spikes': spikes,
            'duration': duration,
            'cf': cf,
            'type': anf_type
        })

    spike_trains = pd.DataFrame(trains)
    return spike_trains


}
  }

  /// Displays a report of all of the previous and current dependencies and
  /// how they have changed.
  void _reportChanges() {
    _output.clear();

    // Show the new set of dependencies ordered by name.
    var names = _result.packages.map((id) => id.name).toList();
    names.remove(_root.name);
    names.sort();
    names.forEach(_reportPackage);

    // Show any removed ones.
    var removed = _previousLockFile.packages.keys.toSet();
    removed.removeAll(names);
    if (removed.isNotEmpty) {
      _output.writeln("These packages are no longer being depended on:");
      removed = removed.toList();
      removed.sort();
      removed.forEach((name) => _reportPackage(name, alwaysShow: true));
    }

    log.message(_output);
  }

  /// Displays a warning about the overrides currently in effect.
  void _reportOverrides() {
    _output.clear();

    if (_result.overrides.isNotEmpty) {
      _output.writeln("Warning: You are using these overridden dependencies:");
      var overrides = _result.overrides.map((dep) => dep.name).toList();
      overrides.sort((a, b) => a.compareTo(b));

      overrides.forEach(
          (name) => _reportPackage(name, alwaysShow: true,
              highlightOverride: false));

      log.warning(_output);
    }
  }

  /// Reports the results of the upgrade on the package named [name].
  ///
  /// If [alwaysShow] is true, the package is reported even if it didn't change,
  /// regardless of [_type]. If [highlightOverride] is true (or absent), writes
  /// "(override)" next to overridden packages.
  void _reportPackage(String name,
      {bool alwaysShow: false, bool highlightOverride: true}) {
    var newId = _dependencies[name];
    var oldId = _previousLockFile.packages[name];
    var id = newId != null ? newId : oldId;

    var isOverridden = _result.overrides.map(
        (dep) => dep.name).contains(id.name);

    // If the package was previously a dependency but the dependency has
    // changed in some way.
    var changed = false;

    // If the dependency was added or removed.
    var addedOrRemoved = false;

    // Show a one-character "icon" describing the change. They are:
    //
    //     ! The package is being overridden.
    //     - The package was removed.
    //     + The package was added.
    //     > The package was upgraded from a lower version.
    //     < The package was downgraded from a higher version.
    //     * Any other change between the old and new package.
    var icon;
    if (isOverridden) {
      icon = log.magenta("! ");
    } else if (newId == null) {
      icon = log.red("- ");
      addedOrRemoved = true;
    } else if (oldId == null) {
      icon = log.green("+ ");
      addedOrRemoved = true;
    } else if (!_sources.idDescriptionsEqual(oldId, newId)) {
      icon = log.cyan("* ");
      changed = true;
    } else if (oldId.version < newId.version) {
      icon = log.green("> ");
      changed = true;
    } else if (oldId.version > newId.version) {
      icon = log.cyan("< ");
      changed = true;
    } else {
      // Unchanged.
      icon = "  ";
    }

    if (_type == SolveType.GET && !(alwaysShow || changed || addedOrRemoved)) {
      return;
    }

    _output.write(icon);
    _output.write(log.bold(id.name));
    _output.write(" ");
    _writeId(id);

    // If the package was u


using GraphQL.Validation.Rules;
using GraphQLParser.AST;

namespace GraphQL.Tests.Validation;

public class KnownDirectivesTests : ValidationTestBase<KnownDirectivesInAllowedLocations, ValidationSchema>
{
    private void unknownDirective(ValidationTestConfig _, string name, int line, int column)
    {
        _.Error($"Unknown directive '{name}'.", line, column);
    }

    private void misplacedDirective(ValidationTestConfig _, string name, DirectiveLocation placement, int line, int column)
    {
        _.Error($"Directive '{name}' may not be used on {placement}.", line, column);
    }

    [Fact]
    public void with_no_directives()
    {
        ShouldPassRule("""
              query Foo {
                name
                ...Frag
              }
              fragment Frag on Dog {
                name
              }
            """);
    }

    [Fact]
    public void with_known_directives()
    {
        ShouldPassRule("""
              {
                dog @include(if: true) {
                  name
                }
                human @skip(if: false) {
                  name
                }
              }
            """);
    }

    [Fact]
    public void with_unknown_directives()
    {
        ShouldFailRule(_ =>
        {
            _.Query = """
                  {
                    dog @unknown(directive: "value") {
                      name
                    }
                  }
                """;
            unknownDirective(_, "unknown", 2, 9);
        });
    }

    [Fact]
    public void with_many_unknown_directives()
    {
        ShouldFailRule(_ =>
        {
            _.Query = """
                  {
                    dog @unknown(directive: "value") {
                      name
                    }
                    human @unknown(directive: "value") {
                      name
                      pets @unknown(directive: "value") {
                        name
                      }
                    }
                  }
                """;
            unknownDirective(_, "unknown", 2, 9);
            unknownDirective(_, "unknown", 5, 11);
            unknownDirective(_, "unknown", 7, 12);
        });
    }

    [Fact]
    public void with_well_placed_directives()
    {
        ShouldPassRule("""
              query Foo @onQuery {
                name @include(if: true)
                ...Frag @include(if: true)
                skippedField @skip(if: true)
                ...SkippedFrag @skip(if: true)
              }

              mutation Bar @onMut


  st.success("**测试成功！**", icon=":material/check:")
                        except Exception as e:
                            st.error(f"**测试失败：{e}**", icon=":material/error:")
                    if "save_success" in st.session_state:
                        st.success("**保存成功！**", icon=":material/check:")
                        del st.session_state["save_success"]
                local_setting(local_url, local_key, local_model)
        st.write("")

        with st.container(border=True):
            st.write("##### DeepSeek 深度求索")
            st.write("调用DeepSeek官方接口服务来作为项目的翻译引擎")
            if st.button("      **配置**      ", key="deepseek_button", type="primary"):
                @st.dialog('DEEPSEEK 深度求索')
                def deepseek_setting(url, key):
                    st.write("官方网址：**[www.deepseek.com](https://www.deepseek.com/zh)** \n\n DeepSeek是一家专注于研究世界领先的通用人工智能底层模型与技术的公司。该模型支持的调用并发量非常高，翻译效果中等偏上，较**推荐**！")
                    st.write("")
                    url = st.text_input("**API 地址**", url, placeholder="DeepSeek API 接口", help="默认值：`https://api.deepseek.com/v1`")
                    key = st.text_input("**API 密钥**", key, placeholder="DeepSeek API 密钥")
                    st.write("")
                    if st.button("**保存配置**", use_container_width=True, type="primary"):
                        with open(llms_path, 'w') as f:
                            llms["DeepSeek"]["url"] = url
                            llms["DeepSeek"]["key"] = key
                            toml.dump(llms, f)
                        st.session_state.save_success = True
                    if st.button("**接口测试**", use_container_width=True, type="primary"):
                        try:
                            client = OpenAI(api_key=key, base_url=url)
                            response = client.chat.completions.create(
                                model="deepseek-chat",
                                messages=[{"role": "user", "content": "测试"}])
                            answer = response.choices[0].message.content
                            st.success("**测试成功！**", icon=":material/check:")
                        except Exception as e:
                            st.error(f"**测试失败：{e}**", icon=":material/error:")
                    if "save_success" in st.session_state:
                        st.success("**保存成功！**", icon=":material/check:")
                        del st.session_state["save_success"]
                deepseek_setting(deepseek_url, deepseek_key)
        st.write("")

        with st.container(border=True):
            st.write("##### Gemini Google")
            st.write("调用 谷歌Gemini 官方接口服务作为项目的翻译引擎")
            if st.button("      **配置**      ", key="gemini_button", type="primary"):
                @st.dialog('GEMINI GOOGLE')
                def gemini_setting(url, key):
                    st.write("官方网址：**[deepmind.google](https://deepmind.google/technologies/gemini/)** \n\nGemini是Google Deepmind最新、最强大的AI模型。它原生支持多模态，具备跨模态推理能力，包括文本，图像，视频，音频和代码。Gemini在32个基准测试中的30个上取得了领先，涵盖了语言、编码、推理和多模态推理等任务。")
                    st.write("")
                    url = st.text_input("**API 地址**", url, placeholder="Gemini API 接口", help="除非您使用代理URL，否者无需配置，调用时会自动填写！")
                    key = st.text_input("**API 密钥**", key, placeholder="Gemini API 密钥")
                    st.write("")
                    if st.button("**保存配置**", use_container_width=True, type="primary"):
                        with open(llms_path, 'w') as f:
                            llms["Gemini"]["url"] = url
                            llms["Gemini"]["key"] = key
                            toml.dump(llms, f)
                            st.session_state.save_success = True
                    if st.button("**接口测试**", use_container_width=True, type="primary"):
                        try:
                            genai.configure(client_options={"api_key": key})
                            model = genai.GenerativeModel("gemini-1.5-flash")
                            answer = model.generate_content("测试")
                            st.success("**测试成功！**", icon=":material/check:")
                        except Exception as e:
                            st.error(f"**测试失败：{e}**", icon=":material/error:")
                    if "save_success" in st.session_state:
                        st.success("**保存成功！**", icon=":mater


import numpy as np
import matplotlib.pyplot as plt
from matplotlib.lines import Line2D
import matplotlib.cm as cm

np.random.seed(42)

S0 = 100
r = 0.05
sigma = 0.2
T = 1.0
dt = 1/252
n_steps = int(T / dt)
n_paths = 15
time = np.linspace(0, T, n_steps+1)

def simulate_gbm(S0, r, sigma, T, dt, n_steps, n_paths):
    # Initialize arrays
    S = np.zeros((n_paths, n_steps+1))
    S[:, 0] = S0

    Z = np.random.normal(0, 1, size=(n_paths, n_steps))
    for t in range(1, n_steps+1):
        S[:, t] = S[:, t-1] * np.exp((r - 0.5 * sigma**2) * dt + sigma * np.sqrt(dt) * Z[:, t-1])

    return S

def calculate_average(S):
    S_avg = np.zeros_like(S)

    for t in range(1, S.shape[1]):
        S_avg[:, t] = np.mean(S[:, 1:t+1], axis=1)

    return S_avg

spot_paths = simulate_gbm(S0, r, sigma, T, dt, n_steps, n_paths)
avg_paths = calculate_average(spot_paths)
colors = cm.viridis(np.linspace(0, 0.8, n_paths))
plt.figure(figsize=(12, 8))

for i in range(n_paths):
    plt.plot(time, spot_paths[i], color=colors[i], alpha=0.4, linewidth=1)

    plt.plot(time, avg_paths[i], color=colors[i], alpha=0.8, linewidth=1.5, linestyle='--')

plt.title('Monte Carlo Simulation: Evolution of Spot vs Average Price', fontsize=16)
plt.xlabel('Time (years)', fontsize=12)
plt.ylabel('Price', fontsize=12)
plt.grid(True, alpha=0.3)

legend_elements = [
    Line2D([0], [0], color='gray', alpha=0.4, linewidth=1.5, label='Spot Price (S_t)'),
    Line2D([0], [0], color='gray', alpha=0.8, linewidth=2, linestyle='--', label='Cumulative Average Price (S̄_t)')
]
plt.legend(handles=legend_elements, loc='upper left', fontsize=12)

plt.annotate('Average price smooths out\nspikes in spot price',
             xy=(0.5, spot_paths.mean() * 0.85),
             xytext=(0.5, spot_paths.mean() * 0.7),
             arrowprops=dict(arrowstyle='->'),
             fontsize=10, ha='center')

plt.annotate('Average price lags\nbehind fast movements',
             xy=(0.2, spot_paths.mean() * 1.1),
             xytext=(0.2, spot_paths.mean() * 1.25),
             arrowprops=dict(arrowstyle='->'),
             fontsize=10, ha='center')

plt.annotate('Average converges\nover time',
             xy=(0.85, spot_paths.mean() * 0.95),
             xytext=(0.8, spot_paths.mean() * 0.6),
             arrowprops=dict(arrowstyle='->'),
             fontsize=10, ha='center')

plt.tight_layout()
plt.savefig('spot_vs_average_price.png', dpi=300)
plt.show()


s.y.YawgmothDemon.class, RETRO_ART));
        cards.add(new SetCardInfo("Yotian Soldier", 79, Rarity.COMMON, mage.cards.y.YotianSoldier.class, RETRO_ART));
    }
}
package mage.sets;

import mage.cards.ExpansionSet;
import mage.constants.Rarity;
import mage.constants.SetType;

/**
 * https://scryfall.com/sets/pw25
 */
public class WizardsPlayNetwork2025 extends ExpansionSet {

    private static final WizardsPlayNetwork2025 instance = new WizardsPlayNetwork2025();

    public static WizardsPlayNetwork2025 getInstance() {
        return instance;
    }

    private WizardsPlayNetwork2025() {
        super("Wizards Play Network 2025", "PW25", ExpansionSet.buildDate(2025, 1, 1), SetType.PROMOTIONAL);
        this.hasBoosters = false;
        this.hasBasicLands = false;

        cards.add(new SetCardInfo("Culling Ritual", 4, Rarity.RARE, mage.cards.c.CullingRitual.class));
        cards.add(new SetCardInfo("Despark", 2, Rarity.UNCOMMON, mage.cards.d.Despark.class));
        cards.add(new SetCardInfo("Dragon's Hoard", "1p", Rarity.RARE, mage.cards.d.DragonsHoard.class, RETRO_ART));
        cards.add(new SetCardInfo("Dragonspeaker Shaman", 3, Rarity.RARE, mage.cards.d.DragonspeakerShaman.class));
        cards.add(new SetCardInfo("Monstrous Rage", 9, Rarity.RARE, mage.cards.m.MonstrousRage.class, RETRO_ART));
        cards.add(new SetCardInfo("Palladium Myr", 6, Rarity.RARE, mage.cards.p.PalladiumMyr.class, RETRO_ART));
        cards.add(new SetCardInfo("Rishkar's Expertise", 1, Rarity.RARE, mage.cards.r.RishkarsExpertise.class, RETRO_ART));
        cards.add(new SetCardInfo("Spectacular Spider-Man", 7, Rarity.RARE, mage.cards.s.SpectacularSpiderMan.class));
        cards.add(new SetCardInfo("Trinket Mage", 8, Rarity.RARE, mage.cards.t.TrinketMage.class, RETRO_ART));
        cards.add(new SetCardInfo("Zidane, Tantalus Thief", 5, Rarity.RARE, mage.cards.z.ZidaneTantalusThief.class));
    }
}

package mage.sets;

import mage.cards.Card;
import mage.cards.ExpansionSet;
import mage.cards.repository.CardInfo;
import mage.cards.repository.CardRepository;
import mage.collation.BoosterCollator;
import mage.collation.BoosterStructure;
import mage.collation.CardRun;
import mage.collation.RarityConfiguration;
import mage.constants.Rarity;
import mage.constants.SetType;
import mage.util.RandomUtil;

import java.util.ArrayList;
import java.util.List;

/**
 *
 * @author North
 */
public final class DarkAscension extends ExpansionSet {

    private static final DarkAscension instance = new DarkAscension();

    public static DarkAscension getInstance() {
        return instance;
    }

    private DarkAscension() {
        super("Dark Ascension", "DKA", ExpansionSet.buildDate(2012, 1,


olumns .column-screen-inset-right table{background:#121212}.page-columns .column-screen{grid-column:page-start/page-end;z-index:998;opacity:.999}.page-columns .column-screen table{background:#121212}.page-columns .column-screen-left{grid-column:page-start/body-content-end;z-index:998;opacity:.999}.page-columns .column-screen-left table{background:#121212}.page-columns .column-screen-right{grid-column:body-content-start/page-end;z-index:998;opacity:.999}.page-columns .column-screen-right table{background:#121212}.page-columns .column-screen-inset-shaded{grid-column:page-start-inset/page-end-inset;padding:1em;background:#fdf6e3;z-index:998;opacity:.999;margin-bottom:1em}}.quarto-video{margin-bottom:1em}.table{border-top:1px solid #313334;border-bottom:1px solid #313334}.table>thead{border-top-width:0;border-bottom:1px solid #606468}.table a{word-break:break-word}.table>:not(caption)>*>*{background-color:unset;color:unset}#quarto-document-content .crosstalk-input .checkbox input[type=checkbox],#quarto-document-content .crosstalk-input .checkbox-inline input[type=checkbox]{position:unset;margin-top:unset;margin-left:unset}#quarto-document-content .row{margin-left:unset;margin-right:unset}.quarto-xref{white-space:nowrap}#quarto-draft-alert{margin-top:0px;margin-bottom:0px;padding:.3em;text-align:center;font-size:.9em}#quarto-draft-alert i{margin-right:.3em}#quarto-back-to-top{z-index:1000}pre{font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;font-size:0.875em;font-weight:400}pre code{font-family:inherit;font-size:inherit;font-weight:inherit}code{font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;font-size:0.875em;font-weight:400}a{background-color:rgba(0,0,0,0);font-weight:400;text-decoration:underline}a.external:after{content:"";background-image:url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="rgb(251, 238, 5)" class="bi bi-box-arrow-up-right" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M8.636 3.5a.5.5 0 0 0-.5-.5H1.5A1.5 1.5 0 0 0 0 4.5v10A1.5 1.5 0 0 0 1.5 16h10a1.5 1.5 0 0 0 1.5-1.5V7.864a.5.5 0 0 0-1 0V14.5a.5.5 0 0 1-.5.5h-10a.5.5 0 0 1-.5-.5v-10a.5.5 0 0 1 .5-.5h6.636a.5.5 0 0 0 .5-.5z"/><path fill-rule="evenodd" d="M16 .5a.5.5 0 0 0-.5-.5h-5a.5.5 0 0 0 0 1h3.793L6.146 9.146a.5.5 0 1 0 .708.708L15 1.707V5.5a.5.5 0 0 0 1 0v-5z"/></svg>');background-size:contain;background-repeat:no-repeat;background-position:center center;margin-left:.2em;padding-right:.75em}div.sourceCode code a.external:after{content:none}a.external:after:hover{cursor:pointer}.quarto-ext-icon{display:inline-block;font-size:.75em;padding-left:.3em


using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.XR.iOS;

public class GenerateImageAnchor : MonoBehaviour {

	[SerializeField]
	private ARReferenceImage referenceImage;

	[SerializeField]
	private GameObject prefabToGenerate;

	private GameObject imageAnchorGO;

	// Use this for initialization
	void Start () {
		UnityARSessionNativeInterface.ARImageAnchorAddedEvent += AddImageAnchor;
		UnityARSessionNativeInterface.ARImageAnchorUpdatedEvent += UpdateImageAnchor;
		UnityARSessionNativeInterface.ARImageAnchorRemovedEvent += RemoveImageAnchor;

	}

	void AddImageAnchor(ARImageAnchor arImageAnchor)
	{
		Debug.LogFormat("image anchor added[{0}] : tracked => {1}", arImageAnchor.identifier, arImageAnchor.isTracked);
		if (arImageAnchor.referenceImageName == referenceImage.imageName) {
			Vector3 position = UnityARMatrixOps.GetPosition (arImageAnchor.transform);
			Quaternion rotation = UnityARMatrixOps.GetRotation (arImageAnchor.transform);

			imageAnchorGO = Instantiate<GameObject> (prefabToGenerate, position, rotation);
		}
	}

	void UpdateImageAnchor(ARImageAnchor arImageAnchor)
	{
		Debug.LogFormat("image anchor updated[{0}] : tracked => {1}", arImageAnchor.


2AC5', '\u0338'},
		"nsucceq;":                 {'\u2AB0', '\u0338'},
		"nsupE;":                   {'\u2AC6', '\u0338'},
		"nsupset;":                 {'\u2283', '\u20D2'},
		"nsupseteqq;":              {'\u2AC6', '\u0338'},
		"nvap;":                    {'\u224D', '\u20D2'},
		"nvge;":                    {'\u2265', '\u20D2'},
		"nvgt;":                    {'\u003E', '\u20D2'},
		"nvle;":                    {'\u2264', '\u20D2'},
		"nvlt;":                    {'\u003C', '\u20D2'},
		"nvltrie;":                 {'\u22B4', '\u20D2'},
		"nvrtrie;":                 {'\u22B5', '\u20D2'},
		"nvsim;":                   {'\u223C', '\u20D2'},
		"race;":                    {'\u223D', '\u0331'},
		"smtes;":                   {'\u2AAC', '\uFE00'},
		"sqcaps;":                  {'\u2293', '\uFE00'},
		"sqcups;":                  {'\u2294', '\uFE00'},
		"varsubsetneq;":            {'\u228A', '\uFE00'},
		"varsubsetneqq;":           {'\u2ACB', '\uFE00'},
		"varsupsetneq;":            {'\u228B', '\uFE00'},
		"varsupsetneqq;":           {'\u2ACC', '\uFE00'},
		"vnsub;":                   {'\u2282', '\u20D2'},
		"vnsup;":                   {'\u2283', '\u20D2'},
		"vsubnE;":                  {'\u2ACB', '\uFE00'},
		"vsubne;":                  {'\u228A', '\uFE00'},
		"vsupnE;":                  {'\u2ACC', '\uFE00'},
		"vsupne;":                  {'\u228B', '\uFE00'},
	}
}
// Copyright 2011 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package template

import (
	"fmt"
	"os"
	"testing"

	"rsc.io/xstd/go1.13.15/bytes"
	"rsc.io/xstd/go1.13.15/encoding/json"
	"rsc.io/xstd/go1.13.15/strings"
	"rsc.io/xstd/go1.13.15/text/template"
	"rsc.io/xstd/go1.13.15/text/template/parse"
)

type badMarshaler struct{}

func (x *badMarshaler) MarshalJSON() ([]byte, error) {
	// Keys in valid JSON must be double quoted as must all strings.
	return []byte("{ foo: 'not quite valid JSON' }"), nil
}

type goodMarshaler struct{}

func (x *goodMarshaler) MarshalJSON() ([]byte, error) {
	return []byte(`{ "<foo>": "O'Reilly" }`), nil
}

func TestEscape(t *testing.T) {
	data := struct {
		F, T    bool
		C, G, H string
		A, E    []string
		B, M    json.Marshaler
		N       int
		U       interface{}


",
	"com.uy",
	"edu.uy",
	"gub.uy",
	"mil.uy",
	"net.uy",
	"org.uy",
	"uz",
	"co.uz",
	"com.uz",
	"net.uz",
	"org.uz",
	"va",
	"vc",
	"com.vc",
	"net.vc",
	"org.vc",
	"gov.vc",
	"mil.vc",
	"edu.vc",
	"ve",
	"co.ve",
	"com.ve",
	"e12.ve",
	"edu.ve",
	"gov.ve",
	"info.ve",
	"mil.ve",
	"net.ve",
	"org.ve",
	"web.ve",
	"vg",
	"vi",
	"co.vi",
	"com.vi",
	"k12.vi",
	"net.vi",
	"org.vi",
	"vn",
	"com.vn",
	"net.vn",
	"org.vn",
	"edu.vn",
	"gov.vn",
	"int.vn",
	"ac.vn",
	"biz.vn",
	"info.vn",
	"name.vn",
	"pro.vn",
	"health.vn",
	"vu",
	"wf",
	"ws",
	"com.ws",
	"net.ws",
	"org.ws",
	"gov.ws",
	"edu.ws",
	"yt",
	"xn--mgbaam7a8h",
	"xn--54b7fta0cc",
	"xn--fiqs8s",
	"xn--fiqz9s",
	"xn--lgbbat1ad8j",
	"xn--wgbh1c",
	"xn--node",
	"xn--j6w193g",
	"xn--h2brj9c",
	"xn--mgbbh1a71e",
	"xn--fpcrj9c3d",
	"xn--gecrj9c",
	"xn--s9brj9c",
	"xn--45brj9c",
	"xn--xkc2dl3a5ee0h",
	"xn--mgba3a4f16a",
	"xn--mgba3a4fra",
	"xn--mgbayh7gpa",
	"xn--3e0b707e",
	"xn--80ao21a",
	"xn--fzc2c9e2c",
	"xn--xkc2al3hye2a",
	"xn--mgbc0a9azcg",
	"xn--l1acc",
	"xn--mgbx4cd0ab",
	"xn--mgb9awbf",
	"xn--ygbi2ammx",
	"xn--90a3ac",
	"xn--p1ai",
	"xn--wgbl6a",
	"xn--mgberp4a5d4ar",
	"xn--mgberp4a5d4a87g",
	"xn--mgbqly7c0a67fbc",
	"xn--mgbqly7cvafr",
	"xn--ogbpf8fl",
	"xn--mgbtf8fl",
	"xn--yfro4i67o",
	"xn--clchc0ea0b2g2a9gcd",
	"xn--o3cw4h",
	"xn--pgbs0dh",
	"xn--kpry57d",
	"xn--kprw13d",
	"xn--nnx388a",
	"xn--j1amh",
	"xn--mgb2ddes",
	"xxx",
	"*.ye",
	"*.za",
	"*.zm",
	"*.zw",
	"xn--80asehdb",
	"xn--80aswg",
	"xn--ngbc5azd",
	"xn--unup4y",
	"xn--vhquv",
	"camera",
	"clothing",
	"lighting",
	"singles",
	"ventures",


/panel) instance.
* [#965](https://github.com/ckeditor/ckeditor4/issues/965) Fixed: The [`config.forceSimpleAmpersand`](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_config.html#cfg-forceSimpleAmpersand) option does not work. Thanks to [Alex Maris](https://github.com/alexmaris)!
* [#2448](https://github.com/ckeditor/ckeditor4/issues/2448): Fixed: The [`Escape HTML Entities`] plugin with custom [additional entities](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_config.html#cfg-entities_additional) configuration breaks HTML escaping.
* [#898](https://github.com/ckeditor/ckeditor4/issues/898): Fixed: [Enhanced Image](https://ckeditor.com/cke4/addon/image2) long alternative text protrudes into the editor when the image is selected.
* [#1113](https://github.com/ckeditor/ckeditor4/issues/1113): [Firefox] Fixed: Nested contenteditable elements path is not updated on focus with the [Div Editing Area](https://ckeditor.com/cke4/addon/divarea) plugin.
* [#1682](https://github.com/ckeditor/ckeditor4/issues/1682) Fixed: Hovering the [Balloon Toolbar](https://ckeditor.com/cke4/addon/balloontoolbar) panel changes its size, causing flickering.
* [#421](https://github.com/ckeditor/ckeditor4/issues/421) Fixed: Expandable [Button](https://ckeditor.com/cke4/addon/button) puts the `(Selected)` text at the end of the label when clicked.
* [#1454](https://github.com/ckeditor/ckeditor4/issues/1454): Fixed: The [`onAbort`](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_fileTools_uploadWidgetDefinition.html#property-onAbort) method of the [Upload Widget](https://ckeditor.com/cke4/addon/uploadwidget) is not called when the loader is aborted.
* [#1451](https://github.com/ckeditor/ckeditor4/issues/1451): Fixed: The context menu is incorrectly positioned when opened with Shift+F10.
* [#1722](https://github.com/ckeditor/ckeditor4/issues/1722): [`CKEDITOR.filter.instances`](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_filter.html#static-property-instances) is causing memory leaks.
* [#2491](https://github.com/ckeditor/ckeditor4/issues/2491): Fixed: The [Mentions](https://ckeditor.com/cke4/addon/mentions) plugin is not matching diacritic characters.
* [#2519](https://github.com/ckeditor/ckeditor4/issues/2519): Fixed: The [Accessibility Help](https://ckeditor.com/cke4/addon/a11yhelp) dialog should display all available keystrokes for a single command.

API Changes:

* [#2453](https://github.com/ckeditor/ckeditor4/issues/2453): The [`CKEDITOR.ui.panel.block.getItems`](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_ui_panel_block.html#method-getItems) method now also returns `input` elements in addition to links.
* [#2224](https://github.com/ckeditor/ckeditor4/issues/2224):  The [`CKEDITOR.tools.convertToPx`](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_tools.html#method-convertToPx) function now converts negative values.
* [#2253](https://github.com/ckeditor/ckeditor4/issues/2253): The widget definition [`insert`](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_plugins_widget_definit


osition, `is`(Point2D(144.0, 16.0)))
        assertThat(objects.find { it.getInt("id") == 18 }!!.position, `is`(Point2D(16.0, 0.0)))

        // Tiled y is up, our y is down hence the height subtraction
        assertThat(objects.find { it.getInt("id") == 28 }!!.position, `is`(Point2D(47.0, 80.0 - 16)))
        assertThat(objects.find { it.getInt("id") == 31 }!!.position, `is`(Point2D(111.0, 128.0 - 16)))
        assertThat(objects.find { it.getInt("id") == 33 }!!.position, `is`(Point2D(32.0, 47.0 - 16)))

        // check whether gid tiled objects have been parsed
        assertTrue(objects.find { it.getInt("id") == 28 }!!.viewComponent.children.isNotEmpty())
        assertTrue(objects.find { it.getInt("id") == 31 }!!.viewComponent.children.isNotEmpty())
        assertTrue(objects.find { it.getInt("id") == 33 }!!.viewComponent.children.isNotEmpty())

        // check that IDComponent was automatically added
        intArrayOf(14, 15, 17, 18, 28, 31, 33).forEach { id ->
            assertThat(objects.find { it.getInt("id") == id }!!.getComponent(IDComponent::class.java).id, `is`(id))
        }

        assertThat(level.properties.keys().size, `is`(1))
        assertThat(level.properties.getInt("testInt"), `is`(33))
    }

    @Test
    fun `Load tmx level with incorrect image paths`() {
        val world = GameWorld()
        world.addEntityFactory(MyEntityFactory())

        val level = TMXLevelLoader().load(javaClass.getResource("map_incorrect_image_path.tmx"), world)

        assertThat(level.width, `is`(16*10))
        assertThat(level.height, `is`(16*10))

        // 1 bg + 7 entities
        assertThat(level.entities.size, `is`(1 + 7))
    }

    @Test
    fun `Load tmx level with separate tile images`() {
        val world = GameWorld()

        val level = TMXLevelLoader().load(javaClass.getResource("tile_images/map_with_separate_tile_images.tmx"), world)

        val layerEntity = level.entities[0]

        val view = layerEntity.viewComponent.children[0] as ImageView

        assertThat(view.image.width, `is`(64 * 22.0))
        assertThat(view.image.height, `is`(64 * 22.0))

        assertThat(view.image.pixelReader.getColor(64*0 + 32, 32), `is`(not(Color.TRANSPARENT)))
        assertThat(view.image.pixelReader.getColor(64*1 + 32, 32), `is`(not(Color.TRANSPARENT)))
        assertThat(view.image.pixelReader.getColor(64*2 + 32, 32), `is`(not(Color.TRANSPARENT)))
        assertThat(view.image.pixelReader.getColor(64*3 + 32, 32), `is`(not(Color.TRANSPARENT)))

        assertThat(view.image.pixelReader.getColor(64*4 + 32, 32), `is`(Color.TRANSPARENT))
    }

    @Test
    fun `Load tmx level with different tileset sizes`() {
        val world = GameWorld()
        world.addEntityFactory(MyEntityFactory())

        val level = TMXLevelLoader().load(javaClass.getResource("complex/test_map.tmx"), world)

        val portal = level.entities.find { it.type == "portal" }!!

        val view = portal.viewComponent.children[0] as Image


幸福的跨栏降低

很多自以为理所当然的事情，其实都是从奇迹般的关联维系中产生的。所以人不要傲慢自大，不要认为别人为你做的一切都是理所当然的…… c:760

### 谁都有消沉时

即便是勉强自己想尽量处好关系，结果往往是合不来的人终归还是合不来。我最近学会了一个解决方法，那就是这种时候要懂得放弃。即便你勉为其难地为了把关系处好，而把真实的自己隐藏起来，也不能真正解决问题。与其那样，倒不如偶尔告诉自己“没办法，算了”，适时地放手。 c:636

### 想做的事情一定要说出来

想做的事情一定要说出来 c:105

我喜欢这首曲子，我喜欢这幅画。把这些话都说出来，就会自然而然地结交到有同样喜好的朋友……也许那只是微不足道的喜欢，但我也想好好地守护它们。 c:480

### 后记

我想，有缘的人百转千回总会在某一处产生交集的。 c:455

我想在后半生本着为他人着想的原则，有益于他人的事能多做一件就多做一件。 c:173
## 耕种 食物 爱情

克里斯汀·金博尔  -  文学榜-随笔文集

>     本书的作者克里斯汀是个环游世界的旅行作家，一次采访中，她遇见了农夫马克，并被马克以及他的生活方式深深吸引。她决定放弃城市里的一切，和马克在爱瑟农场安下了家。这本书是克里斯汀·金博尔和马克两人在爱瑟农场第一年的生动记录。由冬到春，由夏到秋，他们一点点地为这个农场注入生命，最后以在第二年秋季丰收时节，两人在谷仓阁楼里的爆笑婚礼作结，金博尔以细致诗意又幽默生动的笔触，写出了人与人、人与食物、人与土地之间最本真动人又深沉的联结。同时，它也是一个女人成长蜕变的旅程。她从一开始的满腔热情，经历了焦虑、怀疑甚至是恐慌，慢慢变得坚定。如今，她已深深扎根于那片土地，和马克在农场生活了14年。

### 序言

这些年，我的人生发生了翻天覆地的变化，在耕食生活中我学到了很多。我学会了开枪，杀鸡，躲开飞奔而来的


onster Emoji = "\U0001f47e" // alien monster
	Robot        Emoji = "\U0001f916" // robot
	// SUBGROUP: cat-face
	GrinningCat                Emoji = "\U0001f63a" // grinning cat
	GrinningCatWithSmilingEyes Emoji = "\U0001f638" // grinning cat with smiling eyes
	CatWithTearsOfJoy          Emoji = "\U0001f639" // cat with tears of joy
	SmilingCatWithHeartEyes    Emoji = "\U0001f63b" // smiling cat with heart-eyes
	CatWithWrySmile            Emoji = "\U0001f63c" // cat with wry smile
	KissingCat                 Emoji = "\U0001f63d" // kissing cat
	WearyCat                   Emoji = "\U0001f640" // weary cat
	CryingCat                  Emoji = "\U0001f63f" // crying cat
	PoutingCat                 Emoji = "\U0001f63e" // pouting cat
	// SUBGROUP: monkey-face
	SeeNoEvilMonkey   Emoji = "\U0001f648" // see-no-evil monkey
	HearNoEvilMonkey  Emoji = "\U0001f649" // hear-no-evil monkey
	SpeakNoEvilMonkey Emoji = "\U0001f64a" // speak-no-evil monkey
	// SUBGROUP: emotion
	KissMark          Emoji = "\U0001f48b"                             // kiss mark
	LoveLetter        Emoji = "\U0001f48c"                             // love letter
	HeartWithArrow    Emoji = "\U0001f498"                             // heart with arrow
	HeartWithRibbon   Emoji = "\U0001f49d"                             // heart with ribbon
	SparklingHeart    Emoji = "\U0001f496"                             // sparkling heart
	GrowingHeart      Emoji = "\U0001f497"                             // growing heart
	BeatingHeart      Emoji = "\U0001f493"                             // beating heart
	RevolvingHearts   Emoji = "\U0001f49e"                             // revolving hearts
	TwoHearts         Emoji = "\U0001f495"                             // two hearts
	HeartDecoration   Emoji = "\U0001f49f"                             // heart decoration
	HeartExclamation  Emoji = "\u2763\ufe0f"                           // heart exclamation
	BrokenHeart       Emoji = "\U0001f494"                             // broken heart
	RedHeart          Emoji = "\u2764\ufe0f"                           // red heart
	OrangeHeart       Emoji = "\U0001f9e1"                             // orange heart
	YellowHeart       Emoji = "\U0001f49b"                             // yellow heart
	GreenHeart        Emoji = "\U0001f49a"                             // green heart
	BlueHeart         Emoji = "\U0001f499"                             // blue heart
	PurpleHeart       Emoji = "\U0001f49c"                             // purple heart
	BrownHeart        Emoji = "\U0001f90e"                             // brown heart
	BlackHeart        Emoji = "\U0001f5a4"                             // black heart
	WhiteHeart        Emoji = "\U0001f90d"                             // white heart
	HundredPoints     Emoji = "\U0001f4af"                             // hundred points
	AngerSymbol       Emoji = "\U0001f4a2"                             // anger symbol
	Collision         Emoji = "\U0001f4a5"                             // collision
	Dizzy             Emoji = "\U0001f4ab"                             // dizzy
	SweatDroplets     Emoji = "\U


#include <stdio.h>
#include <omp.h>

int main()
{
  int N = 100;

  double a[N], b[N];

  for (int i=0; i<N; i++)
    a[i]=i;

  double sum1 = 0;

#pragma omp target teams distribute parallel for map(tofrom:sum1) reduction(+:sum1) collapse(2)
  for (int j = 0; j< N; j=j+1)
    for (int i = 0; i < N; ++i)
      sum1 += a[i];

#pragma omp target teams distribute parallel for map(tofrom:sum1) reduction(+:sum1) collapse(2)
  for (int j = 0; j< N; j=j+2)
    for (int i = j; i < N; i=i+3)
      sum1 += a[i];

#pragma omp target teams distribute parallel for map(tofrom:sum1) reduction(+:sum1) collapse(2)
  for (int j = 0; j< N; j=j+1)
    for (int i = 0; i < N; ++i) {
      sum1 += a[i];
      b[i] = a[i];
    }

  printf("sum1 = %f\n", sum1);

  int rc = sum1 <= 1046796.99 || sum1 > 1046797.01;

  for (int j = 0; j < N; ++j)
    if (a[j] != b[j]) {
      printf("Wrong value: b[%d]=%f\n", j, b[j]);
      ++rc;
    }

  if (!rc)
    printf("Success\n");

  return rc;
}

/// CHECK: DEVID:[[S:[ ]*]][[DEVID:[0-9]+]] SGN:8
/// CHECK: DEVID:[[S:[ ]*]][[DEVID:[0-9]+]] SGN:8
/// CHECK: DEVID:[[S:[ ]*]][[DEVID:[0-9]+]] SGN:8


 transaction which is being referenced

### CTxIn

Bitcoin Input https://bitcoin.org/en/glossary/input

| Field Size | Field Name | Data type | Description |
| ---------- | ----------- | --------- | -------- |
| 36 | prevout | COutPoint | The previous output from an existing transaction, in the form of an unspent output
| 1+ | script length | var_int | The length of the signature script
| ? | script | CScript | The script which is validated for this input to be spent
| 4 | nSequence | uint_32t | Transaction version as defined by the sender. Intended for "replacement" of transactions when information is updated before inclusion into a block.

### CTxOut

Bitcoin Output https://bitcoin.org/en/glossary/output

| Field Size | Field Name | Data type | Description |
| ---------- | ----------- | --------- | -------- |
| 8 | nValue | int64_t | Transfered value
| ? | scriptPubKey | CScript | The script for indicating what conditions must be fulfilled for this output to be further spent

### CPubKey

Bitcoin Public Key https://bitcoin.org/en/glossary/public-key

| Field Size | Field Name | Data type | Description |
| ---------- | ----------- | --------- | -------- |
| 33-65 | vch | char[] | The public portion of a keypair which can be used to verify signatures made with the private portion of the keypair.

## Message Types

### DNANNOUNCE - "dnb"

CDynodeBroadcast

Whenever a Dynode comes online or a client is syncing, they will send this message which describes the Dynode entry and how to validate messages from it.

| Field Size | Field Name | Data type | Description |
| ---------- | ----------- | --------- | -------- |
| 41 | vin | CTxIn | The unspent output which is holding 1000 Dynamic
| # | addr | CService | IPv4 address of the Dynode
| 33-65 | pubKeyCollateralAddress | CPubKey | CPubKey of the main 1000 Dynamic unspent output
| 33-65 | pubKeyDynode | CPubKey | CPubKey of the secondary signing key (For all other messaging other than announce message)
| 71-73 | sig | char[] | Signature of this message (verifiable via pubKeyCollateralAddress)
| 8 | sigTime | int64_t | Time which the signature was created
| 4 | nProtocolVersion | int | The protocol version of the Dynode
| # | lastPing | CDynodePing | The last known ping of the Dynode
| 8 | nLastPsq | int64_t | The last time the Dynode sent a PSQ message (for mixing)

### DNPING - "dnp"

CDynodePing

Every few minutes, Dynodes ping the network with a message that propagates the whole network.

| Field Size | Field Name | Data type | Description |
| ---------- | ----------- | --------- | -------- |
| 41 | vin | CTxIn | The unspent output of the Dynode which is signing the message
| 32 | blockHash | uint256 | Current chaintip blockhash minus 12
| 8 | sigTime | int64_t | Signature time for this ping
| 71-73 | vchSig | char[] | Signature of this message by Dynode (verifiable via pubKeyDynode)

### DynodePAYMENTVOTE - "dnw"

CDynodePaymentVote

When a new block is found on the network, a Dynode quorum will be determined and those 10 selected Dynodes will issue a Dynode payment vote message to pick the next winning node.

| Field Size | Field Name | Data type | Description |
| ---------- | ----------- | --------- | -------- |
| 41 | vinDynode | CTxIn | The unspent output of the Dynode which is signing the message
| 4 | nBlockHeight | int | The blockheight which the payee should be paid
| ? | payeeAddress | CScript | The address to pay to
| 71-73 | sig | char[] | Signature of the Dynode which is signing the message

### PSTX - "pstx"

CPrivateSendBroadcastTx

Dynodes can broadcast subsidised transactions without fees for the sake of security in mi


onfigSecurity
* WLANConfiguration
* Time
* ParentalControl
* AdvancedQoS
* UserOptionsTC
* END_OF_FILE

When (if) it finds a match, it will set the *soap_service_type* variable to the number of the service.

The next relevant snippet of *sa_method_check()* is shown below:

```cpp
(...)
  ret2 = check_src_ip_in_arp_table_mb(mac_addr,remote_addr);
                    /* if src IP is not in ARP table, return */
  if (ret2 != 0) goto return_response_code;
  __s = (char *)stristr(http_request,"Cookie:");
  __s_00 = (char *)stristr(http_request,"SOAPAction:");
  __cp = strchr(__s_00,0xd);
  *__cp = '\0';
  ret = stristr(__s_00,"service:DeviceConfig:1#SOAPLogin");
  ret2 = 1 - ret;
  if (1 < ret) {
    ret2 = 0;
  }
  if (__s == NULL) {
    ret2 = 0;
  }
  *__cp = '\r';
  if ((ret2 == 0) ||
     (__s_00 = strchr(__s,0xd), __s_00 == NULL
                    /* if no SOAPLogin or Cookie header it goes here */)) {
check_soap_login:
    strncpy(&DAT_000d9050,"",0x13);
    __s = inet_ntoa(remote_addr);
    strncpy(&DAT_000d9050,__s,0x13);
    __s = inet_ntoa(remote_addr);
    __s_00 = (char *)acosNvramConfig_get("lan_ipaddr");
    ret2 = strcmp(__s,__s_00);
    if (((((ret2 != 0) &&
          (ret2 = strncmp(__s1," urn:NETGEAR-ROUTER:service:ParentalControl:1#Authenticate",0x3a),
          ret2 != 0)) &&
         (ret2 = strncmp(__s1," \"urn:NETGEAR-ROUTER:service:ParentalControl:1#Authenticate\"",0x3c)
         , ret2 != 0)) &&
        ((ret2 = strncmp(__s1," urn:NETGEAR-ROUTER:service:DeviceConfig:1#SOAPLogin",0x34),
         ret2 != 0 &&
         (ret2 = strncmp(__s1," \"urn:NETGEAR-ROUTER:service:DeviceConfig:1#SOAPLogin\"",0x36),
         ret2 != 0)))) &&
       (ret2 = strncmp(__s1," urn:NETGEAR-ROUTER:service:DeviceInfo:1#GetInfo",0x30), ret2 != 0)) {
      memset(acStack104,0,0x20);
      memset(opendns_auth_contents,0,0x80);
      arp_popen = fopen("/tmp/opendns_auth.tbl","r");
      if (arp_popen == NULL) goto return_response_code;
      check_arp_table_stuff(acStack104);
      do {
        __s = fgets(opendns_auth_contents,0x80,arp_popen);
        if (__s == NULL) {
          fclose(arp_popen);
          goto return_response_code;
        }
        __s = strstr(opendns_auth_contents,acStack104);
      } while (__s == NULL);
      fclose(arp_popen);
    }
  }
  else {
cookie_parsing:
    *__s_00 = '\0';
    __s = strstr(__s,"sess_id=");
    if (__s == NULL) {
      *__s_00 = '\r';
      goto check_soap_login;
    }
    __s = __s + 8;
    __cp = strchr(__s,';');
    if (__cp == NULL) {
      ret2 = check_cookie_auth(__s,mac_addr,remote_addr);
    }
    else {
      *__cp = '\0';
      ret2 = check_cookie_auth(__s,mac_addr,remote_addr);
      *__


tures.favorites.presentation.dispatchers.FavoriteRecipeEventDispatcher

class FavoriteRecipeViewHolder(
    private val binding: ViewFavoriteRecipeBinding,
    private val eventDispatcher: FavoriteRecipeEventDispatcher
) : RecyclerView.ViewHolder(binding.root) {

    companion object {
        fun from(
            parent: ViewGroup,
            eventDispatcher: FavoriteRecipeEventDispatcher
        ): FavoriteRecipeViewHolder {
            val inflater = LayoutInflater.from(parent.context)
            val binding = ViewFavoriteRecipeBinding.inflate(inflater, parent, false)
            return FavoriteRecipeViewHolder(binding, eventDispatcher)
        }
    }

    fun bind(recipe: FavoriteRecipe, isSelecting: Boolean) {
        binding.cardView.transitionName = recipe.id.toString()
        binding.tvName.text = recipe.data.title
        bindNetworkImage(binding.ivRecipe, recipe.data.imageUrl)

        binding.checkbox.isVisible = isSelecting
        binding.selectingOverlay.isVisible = isSelecting

        binding.checkbox.isChecked = recipe.isSelected && isSelecting

        binding.overlayView.setOnClickListener {
            eventDispatcher.onFavoriteRecipePressed(recipe, binding.cardView)
        }
        binding.overlayView.setOnLongClickListener {
            eventDispatcher.onFavoriteRecipeLongPressed(recipe)
            true
        }
    }

    object FavoriteRecipeComparator : DiffUtil.ItemCallback<FavoriteRecipe>() {
        override fun areItemsTheSame(oldItem: FavoriteRecipe, newItem: FavoriteRecipe): Boolean {
            return oldItem.id == newItem.id
        }

        override fun areContentsTheSame(oldItem: FavoriteRecipe, newItem: FavoriteRecipe): Boolean {
            return oldItem == newItem
        }
    }
}import kotlin.math.min

java {
    toolchain {
        languageVersion = JavaLanguageVersion.of(17)
    }
    withSourcesJar()
}

tasks["sourcesJar"].apply {
    this as Jar
    exclude("**/*.so")
    exclude("**/*.sha1")
}

tasks.register<Exec>("generateNativeProjectLinux") {
    group = "native build"
    workingDir = File("$rootDir/PhysX/physx")
    commandLine = listOf("$rootDir/PhysX/physx/generate_projects.sh", "jni-linux")

    doFirst {
        delete("$rootDir/PhysX/physx/compiler/jni-linux-checked")
        delete("$rootDir/PhysX/physx/compiler/jni-linux-debug")
        delete("$rootDir/PhysX/physx/compiler/jni-linux-profile")
        delete("$rootDir/PhysX/physx/compiler/jni-linux-release")
    }
}

// builds the linux platform native libraries
tasks.register<Exec>("buildNativeProjectLinux") {
    val makeWorkers = min(32, Runtime.getRuntime().availableProcessors())

    group = "native build"
    workingDir = File("$rootDir/PhysX/physx/compiler/jni-linux-${NativeBuildSettings.buildType}/")
    commandLine = listOf("make", "-j${makeWorkers}")

    val nativeProjectDir = File("$rootDir/PhysX/physx/compiler/jni-linux-${NativeBuildSettings.buildType}")
    if (!nativeProjectDir.exists()) {
        dependsOn(":generateNativeProject")
    }

    val resourcesDir = "${rootDir}/physx-jni-natives-linux/src/main/resources/de/fabmax/physxjni/linux/"
    val resourcesCudaDir = "${rootDir}/physx-jni-natives-linux-cuda/src/main/resources/de/fabmax/physxjni/linux/"

    doFirst {
        delete(resourcesDir)
        delete(resourcesCudaDir)
    }

    doLast {
        // copy non-cuda libs to regular linux natives subproject
        copy {
            from("$rootDir/PhysX/phys


ter group DM And no. Don't submit a PR changing "Twitter" to "X", I'll ban you.
    }

    public void SetItems(IEnumerable<Texture2D?> source)
    {
        textures.SetItems(source);
    }

    protected override TypingIndicatorAvatarViewHolder CreateViewHolder(int itemIndex, Box rootWidget)
    {
        return new TypingIndicatorAvatarViewHolder(itemIndex, rootWidget);
    }

    protected override void UpdateView(TypingIndicatorAvatarViewHolder viewHolder)
    {
        viewHolder.AvatarTexture = textures[viewHolder.ItemIndex];
    }
}


/*
 * nf_asm.s - GCC NatFeats ASM detection code
 *
 * Copyright (c) 2014 by Eero Tamminen
 *
 * Mostly based on code from EmuTOS,
 * Copyright (c) 2001-2013 by the EmuTOS development team
 *
 * This file is distributed under the GPL, version 2 or at your
 * option any later version.
 */

/*
 * public interface
 */
        .globl  _nf_id
        .globl  _nf_call
        .globl  _detect_nf

/* illegal exception vector */
        .equ vec_illegal, 0x10

/*
 * code
 */
        .text

/*
 * NatFeats test
 *
 * Needs to be called from Supervisor mode,
 * otherwise exception handler change bombs
 */
_detect_nf:
        clr.l   d0               /* assume no NatFeats available */
        move.l  sp,a1
        move.l  vec_illegal,a0


* function draw() {
   *   background(c);
   *   image(img, 25, 25, 50, 50);
   * }
   *

   */

  /**
   * The setup() function is called once when the program starts. It's used to
   * define initial environment properties such as screen size and background
   * color and to load media such as images and fonts as the program starts.
   * There can only be one setup() function for each program and it shouldn't
   * be called again after its initial execution.
   *

   * Note: Variables declared within setup() are not accessible within other
   * functions, including draw().
   *
   * @method setup
   * @example
   *

   * var a = 0;
   *
   * function setup() {
   *   background(0);
   *   noStroke();
   *   fill(102);
   * }
   *
   * function draw() {
   *   rect(a++%width, 10, 2, 80);
   * }
   *

   */

  /**
   * Called directly after setup(), the draw() function continuously executes
   * the lines of code contained inside its block until the program is stopped
   * or noLoop() is called. Note if noLoop() is called in setup(), draw() will
   * still be executed once before stopping. draw() is called automatically and
   * should never be called explicitly.
   *

   * It should always be controlled with noLoop(), redraw() and loop(). After
   * noLoop() stops the code in draw() from executing, redraw() causes the
   * code inside draw() to execute once, and loop() will cause the code
   * inside draw() to resume executing continuously.
   *

   * The number of times draw() executes in each second may be controlled with
   * the frameRate() function.
   *

   * There can only be one draw() function for each sketch, and draw() must
   * exist if you want the code to run continuously, or to process events such
   * as mousePressed(). Sometimes, you might have an empty call to draw() in
   * your program, as shown in the above example.
   *

   * It is important to note that the drawing coordinate system will be reset
   * at the beginning of each draw() call. If any transformations are performed
   * within draw() (ex: scale, rotate, translate, their effects will be
   * undone at the beginning of draw(), so transformations will not accumulate
   * over time. On the other hand, styling applied (ex: fill, stroke, etc) will
   * remain in effect.
   *
   * @method draw
   * @example
   *

   * var yPos = 0;
   * function setup() {  // setup() runs once
   *   frameRate(30);
   * }
   * function draw() {  // draw() loops forever, until stopped
   *   background(204);
   *   yPos = yPos - 1;
   *   if (yPos < 0) {
   *     yPos = height;
   *   }
   *   line(0, yPos, width, yPos);
   * }
   *

   */

  //////////////////////////////////////////////
  // PRIVATE p5 PROPERTIES AND METHODS
  //////////////////////////////////////////////

  this._setupDone = false;
  // for handling hidpi
  this._pixelDensity = Math.ceil(window.devicePixelRatio) || 1;
  this._userNode = node;
  this._curElement = null;
  this._elements = [];
  this._requestAnimId = 0;
  this._preloadCount = 0;
  this._isGlobal = false;
  this._loop = true;
  this._styles = [];
  this._defaultCanvasSize = {
    width: 100,
    height: 100
  };
  this


manager.max_pool_size = 5
            manager.create_pool_instance = AsyncMock(side_effect=lambda: setattr(manager, "pool_size", manager.pool_size + 1))

            await manager.create_pool_instance()

            assert manager.pool_size == 1
            manager.create_pool_instance.assert_called_once()

    @pytest.mark.asyncio
    async def test_pool_warm_instances(self) -> None:
        """Test pool warm instances logic."""
        with patch("browser.backend.core.management.manager.ChromeManager") as mock_manager:
            manager = mock_manager()
            manager.warm_pool_size = 2
            manager.warm_instances = []
            manager.warm_instance = AsyncMock(side_effect=lambda: manager.warm_instances.append("instance"))

            # Warm the pool
            for _ in range(manager.warm_pool_size):
                await manager.warm_instance()

            expected_warm = 2
            assert len(manager.warm_instances) == expected_warm
            expected_calls = 2
            assert manager.warm_instance.call_count == expected_calls

class TestScriptInjection:
    """Test script injection logic."""

    @pytest.mark.asyncio
    async def test_inject_script_logic(self) -> None:
        """Test script injection logic."""
        with patch("browser.backend.core.browser.instance.BrowserInstance") as mock_instance:
            instance = mock_instance()
            instance.inject_script = AsyncMock(return_value={"injected": True})

            script = "window.customVar = 'test';"
            result = await instance.inject_script(script)

            assert result["injected"] is True
            instance.inject_script.assert_called_once_with(script)

    @pytest.mark.asyncio
    async def test_modify_dom_logic(self) -> None:
        """Test DOM modification logic."""
        with patch("browser.backend.core.browser.instance.BrowserInstance") as mock_instance:
            instance = mock_instance()
            instance.execute_script = AsyncMock(return_value={"modified": True})

            script = "document.body.innerHTML = '
Modified
';"
            result = await instance.execute_script(script)

            assert result["modified"] is True
            instance.execute_script.assert_called_once_with(script)


s.miaosha.now_time++;
            page.setData({
                goods: page.data.goods,
                miaosha_end_time_over: secondToTime(time_over),
            });
        }

        _init();
        setInterval(function () {
            _init();
        }, 1000);

        function secondToTime(second) {
            var _h = parseInt(second / 3600);
            var _m = parseInt((second % 3600) / 60);
            var _s = second % 60;
            var type = 0;
            if (_h >= 1) {
                _h -= 1,
                type = 1
            }
            return {
                h: _h < 10 ? ("0" + _h) : ("" + _h),
                m: _m < 10 ? ("0" + _m) : ("" + _m),
                s: _s < 10 ? ("0" + _s) : ("" + _s),
                type: type
            };
        }
    },
    to_dial: function (e) {
        var contact_tel = this.data.store.contact_tel;
        wx.makePhoneCall({
            phoneNumber: contact_tel
        })
    },

});import { GradeSchool } from './grade-school';

describe('School', () => {
  let school;

  beforeEach(() => {
    school = new GradeSchool();
  });

  test('a new school has an empty roster', () => {
    expect(school.roster()).toEqual({});
  });

  test('adding a student adds them to the roster for the given grade', () => {
    school.add('Aimee', 2);

    const expectedDb = { 2: ['Aimee'] };
    expect(school.roster()).toEqual(expectedDb);
  });

  test('adding more students to the same grade adds them to the roster', () => {
    school.add('Blair', 2);
    school.add('James', 2);
    school.add('Paul', 2);

    const expectedDb = { 2: ['Blair', 'James', 'Paul'] };
    expect(school.roster()).toEqual(expectedDb);
  });

  test('adding students to different grades adds them to the roster', () => {
    school.add('Chelsea', 3);
    school.add('Logan', 7);

    const expectedDb = { 3: ['Chelsea'], 7: ['Logan'] };
    expect(school.roster()).toEqual(expectedDb);
  });

  test('grade returns the students in that grade in alphabetical order', () => {
    school.add('Franklin', 5);
    school.add('Bradley', 5);
    school.add('Jeff', 1);

    const expectedStudents = ['Bradley', 'Franklin'];
    expect(school.grade(5)).toEqual(expectedStudents);
  });

  test('grade returns an empty array if there are no students in that grade', () => {
    expect(school.grade(1)).toEqual([]);
  });

  test('the students names in each grade in the roster are sorted', () => {
    school.add('Jennifer', 4);
    school.add('Kareem', 6);
    school.add('Christopher', 4);
    school.add('Kyle', 3);

    const expectedSortedStudents = {
      3: ['Kyle'],
      4: ['Christopher', 'Jennifer'],
      6: ['Kareem'],
    };
    expect(school.roster()).toEqual(expectedSortedStudents);
  });

  test('roster cannot be modified outside of module', () => {
    school.add('Aimee', 2);
    const roster = school.roster();
    roster[2].push('Oops.');
    const expectedDb = { 2: ['Aimee'] };
    expect(school.roster()).toEqual(expectedDb);
  });

  test('roster cannot be modified outside of module using grade()', () => {
    school.add('Aimee', 2);
    school.grade(2).push('Oops.');
    const expectedDb = { 2: ['Aimee'] };
    expect(school.roster()).toEqual(expectedDb);
  });

  test("a student can't be in two different grades", () => {
    school.add('Aim


HlsaW5lIGlkPSJSZWN0YW5nbGUtNC1Db3B5LTE2
XzFfIiBjbGFzcz0ic3QxIiBwb2ludHM9IjE0LjMsMjIuMyAxNC4zLDE5LjggMTIuMSwxOS44IDEyLjEs
MjIuMyAiLz4KPHJlY3QgaWQ9IlJlY3RhbmdsZS00LUNvcHktMTlfMV8iIHg9IjE4LjUiIHk9IjE0LjQi
IGNsYXNzPSJzdDEiIHdpZHRoPSIyLjQiIGhlaWdodD0iMi40Ii8+CjxwYXRoIGNsYXNzPSJzdDgiIGQ9
Ik00Mi41LDIwLjFjLTAuOC0yLjUtMi4zLTQuNy00LjQtNi4zYy00LjktMy41LTExLjYtMi40LTE1Ljks
Mi40YzMuOC0xLjgsOC4yLTEuOCwxMS43LDAuNwoJYzEuNiwxLjEsMi44LDIuNiwzLjcsNC40bC0zLjks
MC45bDcsNS43bDQuOC04LjdMNDIuNSwyMC4xeiIvPgo8cGF0aCBjbGFzcz0ic3Q5IiBkPSJNMTIuNiwz
MC4xaDYuMmMwLjcsMCwxLjMsMC40LDEuNSwxbDAuMywxLjJjMC4yLDAuNCwwLjYsMC43LDEuMSwwLjdo
MTguNWMwLjcsMCwxLjMsMC40LDEuNSwxbDMuNiwxMS4zSDE2LjcKCWMtMC41LDAtMS0wLjMtMS4xLTAu
N2wtNC0xMy4yIi8+CjxsaW5lIGlkPSJYTUxJRF82XyIgY2xhc3M9InN0NSIgeDE9IjU2LjYiIHkxPSI0
OCIgeDI9IjU3LjgiIHkyPSI0OCIvPgo8L3N2Zz4K
`,
	},

	"/definitions/images/filetransfer_receive_send.svg": {
		local:   "definitions/images/filetransfer_receive_send.svg",
		size:    2786,
		modtime: 1489449600,
		compressed: `
PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2Jl
IElsbHVzdHJhdG9yIDIyLjAuMSwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAg
QnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8v
d3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxp
bmsiIHg9IjBweCIgeT0iMHB4IgoJIHZpZXdCb3g9IjAgMCA2MCA2Mi4yIiBzdHlsZT0iZW5hYmxlLWJh
Y2tncm91bmQ6bmV3IDAgMCA2MCA2Mi4yOyIgeG


fromExternalLibrary;

  @override
  Future<void> executeRustInitializers() async {
    await api.initApp();
  }

  @override
  ExternalLibraryLoaderConfig get defaultExternalLibraryLoaderConfig =>
      kDefaultExternalLibraryLoaderConfig;

  @override
  String get codegenVersion => '2.0.0-dev.22';

  static const kDefaultExternalLibraryLoaderConfig =
      ExternalLibraryLoaderConfig(
    stem: 'rust_lib',
    ioDirectory: 'rust/target/release/',
    webPrefix: 'pkg/',
  );
}

abstract class RustLibApi extends BaseApi {
  String greet({required String name, dynamic hint});

  Future<void> initApp({dynamic hint});
}

class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
  RustLibApiImpl({
    required super.handler,
    required super.wire,
    required super.generalizedFrbRustBinding,
    required super.portManager,
  });

  @override
  String greet({required String name, dynamic hint}) {
    return handler.executeSync(SyncTask(
      callFfi: () {
        final serializer = SseSerializer(generalizedFrbRustBinding);
        sse_encode_String(name, serializer);
        return pdeCallFfi(generalizedFrbRustBinding, serializer, funcId: 1)!;
      },
      codec: SseCodec(
        decodeSuccessData: sse_decode_String,
        decodeErrorData: null,
      ),
      constMeta: kGreetConstMeta,
      argValues: [name],
      apiImpl: this,
      hint: hint,
    ));
  }

  TaskConstMeta get kGreetConstMeta => const TaskConstMeta(
        debugName: "greet",
        argNames: ["name"],
      );

  @override
  Future<void> initApp({dynamic hint}) {
    return handler.executeNormal(NormalTask(
      callFfi: (port_) {
        final serializer = SseSerializer(generalizedFrbRustBinding);
        pdeCallFfi(generalizedFrbRustBinding, serializer,
            funcId: 2, port: port_);
      },
      codec: SseCodec(
        decodeSuccessData: sse_decode_unit,
        decodeErrorData: null,
      ),
      constMeta: kInitAppConstMeta,
      argValues: [],
      apiImpl: this,
      hint: hint,
    ));
  }

  TaskConstMeta get kInitAppConstMeta => const TaskConstMeta(
        debugName: "init_app",
        argNames: [],
      );

  @protected
  String dco_decode_String(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return raw as String;
  }

  @protected
  Uint8List dco_decode_list_prim_u_8_strict(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return raw as Uint8List;
  }

  @protected
  int dco_decode_u_8(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return raw as int;
  }

  @protected
  void dco_decode_unit(dynamic raw) {
    // Codec=Dco (DartCObject based), see doc to use other codecs
    return;
  }

  @protected
  String sse_decode_String(SseDeserializer deserializer) {
    // Codec=Sse (Serialization based), see doc to use other codecs
    var inner = sse_decode_list_prim_u_8_strict(deserialize


from pydantic import BaseModel

TEMPLATE = """### System information ###
You are a master chef chatbot that uses the source material below to give advice on recipes.
You provide detailed cooking instructions, ingredient substitutions, and tips for improving recipes.
You also offer suggestions for pairing dishes and creating balanced meals.

### Source material ###
{context_str}

### Instruction ###
Given the 'Source material', the 'Chat History' below,
answer the 'Question' from a user. Make sure to break down your answers into as many
paragraphs as possible so it is easy to read in the chat.

### Chat History ###
{history_str}

"""

class Message(BaseModel):
    role: str
    content: str

def get_history_str(messages: list[Message]) -> str:
    return "\n".join(f"{msg.role}: {msg.content}" for msg in messages) if messages else "No chat history yet."

def construct_source_material(db_material: dict) -> str:
    source_material = "\n ".join(db_material["documents"][0])
    return source_material


-eighties .CodeMirror-gutters { background: #000000; border-right: 0px; }
.cm-s-tomorrow-night-eighties .CodeMirror-guttermarker { color: #f2777a; }
.cm-s-tomorrow-night-eighties .CodeMirror-guttermarker-subtle { color: #777; }
.cm-s-tomorrow-night-eighties .CodeMirror-linenumber { color: #515151; }
.cm-s-tomorrow-night-eighties .CodeMirror-cursor { border-left: 1px solid #6A6A6A; }

.cm-s-tomorrow-night-eighties span.cm-comment { color: #d27b53; }
.cm-s-tomorrow-night-eighties span.cm-atom { color: #a16a94; }
.cm-s-tomorrow-night-eighties span.cm-number { color: #a16a94; }

.cm-s-tomorrow-night-eighties span.cm-property, .cm-s-tomorrow-night-eighties span.cm-attribute { color: #99cc99; }
.cm-s-tomorrow-night-eighties span.cm-keyword { color: #f2777a; }
.cm-s-tomorrow-night-eighties span.cm-string { color: #ffcc66; }

.cm-s-tomorrow-night-eighties span.cm-variable { color: #99cc99; }
.cm-s-tomorrow-night-eighties span.cm-variable-2 { color: #6699cc; }
.cm-s-tomorrow-night-eighties span.cm-def { color: #f99157; }
.cm-s-tomorrow-night-eighties span.cm-bracket { color: #CCCCCC; }
.cm-s-tomorrow-night-eighties span.cm-tag { color: #f2777a; }
.cm-s-tomorrow-night-eighties span.cm-link { color: #a16a94; }
.cm-s-tomorrow-night-eighties span.cm-error { background: #f2777a; color: #6A6A6A; }

.cm-s-tomorrow-night-eighties .CodeMirror-activeline-background { background: #343600; }
.cm-s-tomorrow-night-eighties .CodeMirror-matchingbracket { text-decoration: underline; color: white !important; }
/* Based on the theme at http://bonsaiden.github.com/JavaScript-Garden */

/*<!--activeline-->*/
.cm-s-midnight .CodeMirror-activeline-background { background: #253540; }

.cm-s-midnight.CodeMirror {
    background: #0F192A;
    color: #D1EDFF;
}

.cm-s-midnight div.CodeMirror-selected { background: #314D67; }
.cm-s-midnight .CodeMirror-line::selection, .cm-s-midnight .CodeMirror-line > span::selection, .cm-s-midnight .CodeMirror-line > span > span::selection { background: rgba(49, 77, 103, .99); }
.cm-s-midnight .CodeMirror-line::-moz-selection, .cm-s-midnight .CodeMirror-line > span


ition==0){
			clif_guild_allianceack(sd,0);
			return 0;
		}
	}

	tsd->guild_alliance=sd->status.guild_id;
	tsd->guild_alliance_account=sd->status.account_id;

	clif_guild_reqalliance(tsd,sd->status.account_id,g[0]->name);
	return 0;
}
// MhUւ̕ԓ
int guild_reply_reqalliance(struct map_session_data *sd,int account_id,int flag)
{
	struct map_session_data *tsd;

	nullpo_retr(0, sd);
	nullpo_retr(0, tsd= map_id2sd( account_id ));

	if(sd->guild_alliance!=tsd->status.guild_id)	// UƃMhIDႤ
		return 0;

	if(flag==1){	//
		int i;

		struct guild *g;	// ĊmF
		if( (g=guild_search(sd->status.guild_id))==NULL ||
			guild_get_alliance_count(g,0)>3 ){
			clif_guild_allianceack(sd,4);
			clif_guild_allianceack(tsd,3);
			return 0;
		}
		if( (g=guild_search(tsd->status.guild_id))==NULL ||
			guild_get_alliance_count(g,0)>3 ){
			clif_guild_allianceack(sd,3);
			clif_guild_allianceack(tsd,4);
			return 0;
		}

		// GΊ֌WȂG΂~߂
		if((g=guild_search(sd->status.guild_id)) == NULL)
			return 0;
		for(i=0;i<MAX_GUILDALLIANCE;i++){
			if(	g->alliance[i].guild_id==tsd->status.guild_id &&
				g->alliance[i].opposition==1)
				intif_guild_alliance( sd->status.guild_id,tsd->status.guild_id,
					sd->status.account_id,tsd->status.account_id,9 );
		}
		if((g=guild_search(tsd->status.guild_id)) == NULL)
			return 0;
		for(i=0;i<MAX_GUILDALLIANCE;i++){
			if(	g->alliance[i].guild_id==sd->status.guild_id &&
				g->alliance[i].opposition==1)
				intif_guild_alliance( tsd->status.guild_id,sd->status.guild_id,
					tsd->status.account_id,sd->status.account_id,9 );
		}

		// interI֓v
		intif_guild_alliance( sd->status.guild_id,tsd->status.guild_id,
			sd->status.account_id,tsd->status.account_id,0 );
		return 0;
	}else{		//
		sd->guild_alliance=0;
		sd->guild_alliance_account=0;
		if(tsd!=NULL)
			clif_guild_allianceack(tsd,3);
	}
	return 0;
}
// Mh֌W
int guild_delalliance(struct map_session_data *sd,int guild_id,int flag)
{
	nullpo_retr(0, sd);

	intif_guild_alliance( sd->status.guild_id,guild_id,
		sd->status.account_id,0,flag|8 );
	return 0;
}
// MhG
int guild_opposition(struct map_session_data *sd,int char_id)
{
	struct map_session_data *tsd=map_id2sd(char_id);
	struct guild *g;
	int i;

	nullpo_retr(0, sd);

	g=guild_search(sd->status.guild_id);
	if(g==NULL || tsd==NULL)
		return 0;

	if( guild_get_alliance_count(g,1)>3 )	// GΐmF
		clif_guild_oppositionack(sd,1);

	for(i=0;i<MAX_GUILDALLIANCE;i++){	// łɊ֌WĂ邩mF
		if(g->alliance[i].guild_id==tsd->status.guild_id){
			if(g->alliance[i].opposition==1){	// łɓG
				clif_guild_oppositionack(sd,2);
				return 0;
			}else	// j
				intif_guild_alliance( sd->status.guild_id,tsd->status.guild_id,
					sd->status.account_id,tsd->status.account_id,8 );
		}
	}

	// interIɓGΗv
	intif_guild_alliance( sd->status.guild_id,tsd->status.guild_id,
			sd->status.account_id,tsd->status.account_id,1 );
	return 0;
}
// Mh/GΒʒm
int guild_allianceack(int guild_id1,int guild_id2,int account_id1,int account_id2,
	int flag,const char *name1,const char *name2)
{
	struct guild *g[2];
	int guild_id[2];
	const char *guild_name[2];
	struct map_session_data *sd[2];
	int j,i;

	guild_id[0] = guild_id1;
	guild_id[1] = guild_id2;
	guild_name[0] = name1;
	guild_name[1] = name2;
	sd[0] = map_id2sd(account_id1);
	sd[1] = map_id2sd(account_id2);

	g[0]=guild_search(guild_id1);
	g[1]=guild_search(guild_id2);

	if(sd[0]!=NULL && (flag&0x0f)==0){
		sd[0]->guild_alliance=0;
		sd[0]->guild_alliance_account=0;
	}

	if(flag&0x70){	// s
		for(i=0;i<2-(flag&1);i++)
			if( sd[i]!=NULL )
				clif_guild_allianceack(sd[i],((flag>>4)==i+1)?3:4);
		return 0;
	}
//	if(battle_config.etc_log)
//		printf("guild alliance_ack %d %d %d %d %d %s %s\n",guild_id1,guild_id2,account_id1,account_id2,flag,name1,name2);

	if(!(flag&0x08)){	// ֌Wǉ
		for(i=0;i<2-(flag&1);i++)
			if(g[i]!=NULL)
				for(j=0;j<MAX_GUILDALLIANCE;j++)
					if(g[i]->alliance[j].guild_id==0){
						g[i]->alliance[j].guild_id=guild_id[1-i];
						memcpy(g[i]->alliance[j].name,guild_name[1-i],24);
						g[i]->alliance[j].opposition=flag&1;
						break;
					}
	}else{				// ֌W
		for(i=0;i<2-(flag&1);i++){
			if(g[i]!=NULL)
				for(j=0;j<MAX_GUILDALLIANCE;j++)
					if(	g[i]->alliance[j].guild_id==guild_id[1-i] &&
						g[i]->alliance[j].opposition==(flag&1)){
						g[i]->alliance[j].guild_id=0;
						break;
					}
			if( sd[i]!=NULL )	// ʒm
				clif_guild_delalliance(sd[i],guild_id[1-i],(flag&1));
		}
	}

	if((flag&0x0f)==0){			// ʒm
		if( sd[1]!=NULL )
			clif_guild_allianceack(sd[1],2);


"3-4-0_1-2",
            "2-0_1-4-3",
            "0-2-3-4",
            "1-2-3-4",
            "4-3-2-0_1",
            "0-1-0-1",
            "4-3-4-3",
            "0.4-2-0.4-2",
            "4-3-2-0_1"
        ),
        "5.5" to listOf(
            "1-2-3-2-0",
            "0-2-3-2-1",
            "3_4-3_4-2-1-0",
            "1-2-0-2-1",
            "0.4-2-0.4-4-2",
            "0-1-2-3-4",
            "4-3-2-0-1",
            "0-1-4-1-0",
            "3-2-2_4-2.4-0.4"
        ),

        // p2
        "11.3" to listOf(
            "0-0_1-0.2",
            "0_1_9_10-0_2_9_10-2_9_10",
            "9-9_10-0_1_2_9_10",
        ),
        "11.4" to listOf(
            "0.5-6.10-0.2-9_10-0.10",
            "0.5-6.10-3.8-0_1_2_9_10",
            "9_10-5_6_9_10-9_10-7.10",
        ),
        "11.5" to listOf(
            "2-0.2-0_1_9_10-9_10-2_9_10",
            "0_1_2_9_10-0_2_10-0_1_2_9_10-1_2_10-9",
            "0.5-6.10-0.2-9_10-0.10",
        )
    )

    /**
     * Converts the array of beats into a delta array where timestamp are expressed in terms of the
     * delta with the previous timestamp, then performs Kmeans and returns the cluster indexes of each
     * beat
     * @param beats: beats array
     * @return array of cluster indexes
     * */
    fun clusterizeData(beats: List<Pair<Int, Int>>): IntArray {
        // represent each beat's timestamp as the delta w.r.t. the previous one
        val deltaBeats = ArrayList<Array<Double>>()
        var prev = beats[0].first
        for (elem in beats) {
            deltaBeats.add(arrayOf((elem.first - prev).toDouble(), elem.second.toDouble()))
            prev = elem.first
        }

        // convert to 2D array to be used in kmeans
        val deltaBeats2D = deltaBeats.map { it.toDoubleArray() }.toTypedArray()
        val kmeans = KMeans.fit(deltaBeats2D, 10, 1000, 0.0001)

        return kmeans.y // return indexes
    }

    /**
     * Extracts all non overlapping and repeating (>1) patterns from an array of int values
     * @param data: int array to analyze
     * @return a map containing all the repeating overlapping patterns of length 3 to 5
     * */
    fun findPatterns(data: IntArray): Map<Int, MutableSet<Pair<IntArray, IntArray>>> {
        val patterns = mutableMapOf<List<Int>, MutableMap<String, Any>>()
        for (i in 3..5) {  // search for overlapping patterns of length 3 to 5
            for (j in 0 until data.size - i + 1) {
                val pattern = data.slice(j until j+i)
                if (pattern !in patterns) {
                    patterns[pattern] = mutableMapOf("count" to 0, "indexes" to mutableListOf<Int>())
                }
                val patternInfo = patterns[pattern]!!
                patternInfo["count"] = patternInfo["count"] as Int + 1
                (patternInfo["indexes"] as MutableList<Int>).add(j)
            }
        }

        val patternsByLength = mutableMapOf<Int, MutableSet<Pair<IntArray, IntArray>>>()
        for ((pattern, patternInfo) in patterns) {
            val length = pattern.size
            if (length !in patternsByLength) {
                patternsByLength[length] = mutabl


t,
    vararg highlightedText: String,
): SpannableString {
    val color = context.getColor(colorResId)
    val spannable = SpannableString(this)

    highlightedText.forEach { target ->
        val startIndex = this.indexOf(target)
        if (startIndex != -1) {
            spannable.setSpan(
                ForegroundColorSpan(color),
                startIndex,
                startIndex + target.length,
                Spanned.SPAN_EXCLUSIVE_EXCLUSIVE,
            )
        }
    }

    return spannable
}

fun SpannableString.getColoredSpannable(
    context: Context,
    @ColorRes colorResId: Int,
    vararg highlightedText: String,
): SpannableString {
    val color = context.getColor(colorResId)

    highlightedText.forEach { target ->
        val startIndex = this.indexOf(target)
        if (startIndex != -1) {
            this.setSpan(
                ForegroundColorSpan(color),
                startIndex,
                startIndex + target.length,
                Spanned.SPAN_EXCLUSIVE_EXCLUSIVE,
            )
        }
    }

    return this
}

fun String.sanitizeLeadingZeros(): String =
    if (length > 1 && startsWith("0")) {
        this.trimStart('0').ifEmpty { "0" }
    } else {
        this
    }
import com.android.build.gradle.internal.cxx.configure.gradleLocalProperties
import com.android.build.gradle.internal.dsl.SigningConfig
import java.io.FileInputStream
import java.util.Properties

plugins {
    alias(libs.plugins.android.application)
    alias(libs.plugins.kotlin.android)
    alias(libs.plugins.kotlinx.serialization)
    alias(libs.plugins.kotlin.kapt)
    alias(libs.plugins.google.services)
    alias(libs.plugins.firebase.crashlytics)
    alias(libs.plugins.kotlin.parcelize)
    alias(libs.plugins.google.oss.licenses.plugin)
    alias(libs.plugins.compose.compiler)
}

android {
    namespace = "com.yagubogu"
    compileSdk = 36

    defaultConfig {
        applicationId = "com.yagubogu"
        minSdk = 29
        targetSdk = 36
        versionCode = 1_01_01
        versionName = "1.1.1"

        testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"

        buildConfigField(
            "String",
            "BASE_URL_DEBUG",
            "\"${gradleLocalProperties(rootDir, providers).getProperty("BASE_URL_DEBUG")}\"",
        )
        buildConfigField(
            "String",
            "BASE_URL_RELEASE",
            "\"${gradleLocalProperties(rootDir, providers).getProperty("BASE_URL_RELEASE")}\"",
        )
        buildConfigField(
            type = "String",
            "WEB_CLIENT_ID",
            "\"${gradleLocalProperties(rootDir, providers).getProperty("WEB_CLIENT_ID")}\"",
        )
    }

    val signingFile = rootProject.file("keystore.properties")
    val releaseSigningConfig: SigningConfig? =
        if (signingFile.exists()) {
            val keystoreProperties =
                Properties().apply {
                    load(FileInputStream(signingFile))
                }

            signingConfigs.create("release") {
                storeFile = file("yagubogu-keystore")
                keyAlias = "${keystoreProperties["KEY_ALIAS"]}"
                keyPassword = "${keystoreProperties["KEY_PASSWORD"]}"
                storePassword = "${keystoreProperties["KEYSTORE_PASSWORD"]}"
            }
        } else {
            null
        }

    buildTypes {
        debug {
            isMinifyEnabled = false
            isDebuggable = true
            applicationIdSuffix = ".debug"
            versionNameSuffix = ".debug"
            manifestPlaceholders["appName"] = "야구보구.debug"
        }

        release {
            isMinifyEnabled = true
            is


    gameType:   GameTypes.standard,
    fen:        null,
    debug:      true,
    hideOutput: true
}

describe('ChessState config handling', () => {
    it('Handles null config', () => {
        const game = new ChessState(null)
        const expectedStatus = {
            gameOver:   false,
            turn:       null,
            winner:     null
        } as GameStatus

        assert.strictEqual(JSON.stringify(expectedStatus),
            JSON.stringify(game.getStatus()))
    })
})

describe('ChessState squareIsSafeForKing function', function () {
    it(`Indicates that the square 0, 0 (A8) is safe from white's pieces on turn 1`, () => {
        const game = new ChessState(config)
        let squareOfInterest: BoardLoaction = {
            row:    0,
            column: 0
        }
        assert.equal(true, game.squareIsSafeForKing(squareOfInterest, StandardTurns.white, GameTypes.standard))
    })

    it(`Indicates that the square 5, 2 (C3) is not safe from white's pieces on turn 1`, () => {
        const game = new ChessState(config)
        // C3
        let squareOfInterest: BoardLoaction = {
            row:    5,
            column: 2
        }

        // Should return false because a knight can move to C3 on the first turn.
        assert.equal(false, game.squareIsSafeForKing(squareOfInterest, StandardTurns.white, GameTypes.standard, 0, true))
    })

    it(`Indicates that the square 0, 0 (A8) is safe from black's pieces on turn 1`, () => {
        const game = new ChessState(config)
        let squareOfInterest: BoardLoaction = {
            row:    0,
            column: 0
        }
        assert.equal(true, game.squareIsSafeForKing(squareOfInterest, StandardTurns.black, GameTypes.standard))
    })
})

describe('ChessState games', () => {
    it(`Properly handles the '4 Move Checkmate'`, () => {
        const game = new ChessState(config)
        for (let move of TestGames["4 Move Checkmate"]) {
            game.move(move)
        }
        let expectedStatus = {
            gameOver: true,
            turn: null,
            winner: "white"
        } as GameStatus

        assert.strictEqual(JSON.stringify(expectedStatus),
            JSON.stringify(game.getStatus()))
    })

    it(`Properly handles the 'The Immortal Game'`, () => {
        const game = new ChessState(config)
        for (let move of TestGames["The Immortal Game"]) {
            game.move(move)
        }
        let expectedStatus = {
            gameOver: true,
            turn: null,
            winner: "white"
        } as GameStatus

        assert.strictEqual(JSON.stringify(expectedStatus),
            JSON.stringify(game.getStatus()))
    })
})
import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
import { Document } from 'mongoose';

@Schema() // El decorador @Schema() marca una clase como definición de esquema.
export class Brand extends Document {
  // Product extiende de document

  @Prop({ required: true, unique: true }) // Indicamos que la variable sera una propiedad y sera requerida, tabien sera unica
  name: string;

  @Prop() // Indicamos que la variable sera una propiedad
  image: string;
}

export const BrandSchema = SchemaFactory.createForClass(Brand); // Exportamos un esquema apartir de la clase Brand
import {assertStrictEquals} from "../../deps.ts";
import {countBaggageVariants, countIndividualBagsRequired} from "../src/handy_haversacks.ts";

Deno.test("HandyHaversacks: Example test from introduction (Part one)", () => {
  const input = (
      "light red bags contain 1 bright white bag,


gle: number = 90;
        private _maxDistance: number = 5000;
        private _minDistance: number = -5000;
        private _steps: number = 8;
        private _yFactor: number = 2;
        private _wrapPanAngle: boolean = false;
        private _lookAtPosition: Vector3D = new Vector3D(0.0, 0.0, 0.0);
        private _mouseDown: boolean = false;
        private _mouseRightDown: boolean = false;
        private _keyArray: Array<boolean> = new Array<boolean>();

        /**
        * @language zh_CN
        * @param targetObject 控制的目标相机，目标对象
        * @param lookAtObject 相机看向的对象
        * @param panAngle y轴旋转
        * @param tiltAngle x轴旋转
        * @param distance 相机距离
        * @param minTiltAngle 最小x轴旋转
        * @param maxTiltAngle 最大x轴旋转
        * @param minPanAngle 最小y轴旋转
        * @param maxPanAngle 最大y轴旋转
        * @param steps 平滑时分为几步
        * @param yFactor 旋转时Y轴的一个相对变化值
        * @param wrapPanAngle 是否开启 PanAngle 角度限制
        * @version Egret 3.0
        * @platform Web,Native
        */
        constructor(targetObject: Object3D = null, lookAtObject: Object3D = null,
            panAngle: number = 0, tiltAngle: number = 90, distance: number = 100,
            minTiltAngle: number = -90, maxTiltAngle: number = 90, minPanAngle: number = NaN,
            maxPanAngle: number = NaN, steps: number = 8, yFactor: number = 2, wrapPanAngle: boolean = false) {
            super(targetObject, lookAtObject);

            this.distance = distance;
            this.panAngle = panAngle;
            this.tiltAngle = tiltAngle;
            this.minPanAngle = minPanAngle || -Infinity;
            this.maxPanAngle = maxPanAngle || Infinity;
            this.minTiltAngle = minTiltAngle;
            this.maxTiltAngle = maxTiltAngle;
            this.steps = steps;
            this.yFactor = yFactor;
            this.wrapPanAngle = wrapPanAngle;

            //values passed in contrustor are applied immediately
            this._currentPanAngle = this._panAngle;
            this._currentTiltAngle = this._tiltAngle;

            Input.addEventListener(MouseEvent3D.MOUSE_MOVE, this.mouseMove, this);
            Input.addEventListener(MouseEvent3D.MOUSE_WHEEL, this.mouseWheel, this);
            Input.addEventListener(MouseEvent3D.MOUSE_UP, this.mouseUp, this);
            Input.addEventListener(MouseEvent3D.MOUSE_DOWN, this.mouseDown, this);

            Input.addEventListener(KeyEvent3D.KEY_UP, this.keyUp, this);
            Input.addEventListener(KeyEvent3D.KEY_DOWN, this.keyDown, this);

            Input.addEventListener(TouchEvent3D.TOUCH_END, this.touchUp, this);
            Input.addEventListener(TouchEvent3D.TOUCH_START, this.touchDown, this);
            Input.addEventListener(TouchEvent3D.TOUCH_MOVE, this.touchMove, this);
        }

        private mouseMove(m: MouseEvent3D) {
            if (this._mouseDown) {
                this._tiltAngle += Input.mouseOffsetY * 0.1;
                this._til


/* Generated by RuntimeBrowser
   Image: /System/Library/PrivateFrameworks/GeoServices.framework/GeoServices
 */

@interface GEORouteMatcher : NSObject {
    GEOComposedRoute * _route;
    bool  _useStrictInitialOnRouteCriteria;
}

@property (nonatomic) bool useStrictInitialOnRouteCriteria;

- (id)_candidateForSegment:(id)arg1 location:(id)arg2 previousRouteMatch:(id)arg3;
- (void)_considerCandidateMatch:(id)arg1;
- (void)_finishRouteMatch:(id)arg1 previousRouteMatch:(id)arg2 forLocation:(id)arg3;
- (void)_forEachSegmentNearLocation:(id)arg1 previousRouteMatch:(id)arg2 handler:(id /* block */)arg3;
- (double)_scoreModifierForStep:(id)arg1 previousStep:(id)arg2;
- (bool)_shouldConsiderCourseForLocation:(id)arg1;
- (void)_startRouteMatch;
- (id)_startStepForPreviousRouteMatch:(id)arg1;
- (id)_stepForPointIndex:(unsigned int)arg1 previousStep:(id)arg2;
- (void)dealloc;
- (double)distanceToRouteFrom:(struct { double x1; double x2; })arg1;
- (double)distanceToRouteFrom:(struct { double x1; double x2; })arg1 startDistance:(double)arg2 endDistance:(double)arg3;
- (id)initWithRoute:(id)arg1;
- (id)matchToClosestPointOnRouteWithLocation:(id)arg1;
- (id)matchToRouteWithLocation:(id)arg1;
- (id)matchToRouteWithLocation:(id)arg1 previousRouteMatch:(id)arg2;
- (void)setUseStrictInitialOnRouteCriteria:(bool)arg1;
- (bool)useStrictInitialOnRouteCriteria;

@end


ltTimeout.toLong(), TimeUnit.SECONDS)

            // 拦截器
            interceptors.forEach { interceptor ->
                interceptor?.let {
                    httpClientBuilder.addInterceptor(it)
                }
            }

            // 日志拦截器，是否打印由 LogUtil 控制
            httpClientBuilder
                .addInterceptor(
                    LoggingInterceptor
                        .Builder()
                        // 打印的等级
                        .setLevel(Level.BASIC)
                        // 打印类型
                        .log(Platform.INFO)
                        // request 的 Tag
                        .request("Request")
                        // Response 的 Tag
                        .response("Response")
                        .build()
                )

            val client = httpClientBuilder.build()
            val builder = Retrofit.Builder().client(client)
                // 基础url
                .baseUrl(host)
                // JSON解析
                .addConverterFactory(GsonConverterFactory.create())

            if (GlobalConfig.gIsNeedChangeBaseUrl) {
                if (!this::mBaseUrlMap.isInitialized) {
                    mBaseUrlMap = ArrayMap()
                }
                // 将 url 缓存起来
                val sp = SPUtils.getInstance(mSpName)
                if (sp.getBoolean(mKeyIsSave)) {
                    mBaseUrlMap[host] = sp.getString(host)
                } else {
                    mBaseUrlMap[host] = ""
                }

                builder.callFactory {
                    LogUtil.i("HttpRequest", "getService: old ${it.url()}")
                    mBaseUrlMap.forEach { entry ->
                        val key = entry.key
                        var value = entry.value
                        // 找到 url 并且需要更改
                        val url = it.url().toString()
                        if (url.startsWith(key) && value.isNotEmpty()) {
                            // 防止尾缀有问题
                            if (key.endsWith("/") && !value.endsWith("/")) {
                                value += "/"
                            } else if (!key.endsWith("/") && value.endsWith("/")) {
                                value = value.substring(0, value.length - 1)
                            }
                            // 替换 url 并创建新的 call
                            val newRequest: Request =
                                it.newBuilder()
                                    .url(HttpUrl.get(url.replaceFirst(key, value)))
                                    .build()
                            LogUtil.i("HttpRequest", "getService: new ${newRequest.url()}")
                            return@callFactory client.newCall(newRequest)
                        }
                    }
                    client.newCall(it)
                }
            }
            // Kotlin 使用协程，Java 使用 rx
            val adapter = getRxJavaAdapter()
            adapter?.let {
                builder.addCallAdapterFactory(it as CallAdapter.Factory) // 回调处理，可以设置Rx作为回调的处理
            }
            obj = builder.build().create(cls)
            mServiceMap[name] = obj
        }
        @Suppress("UNCHECKED_CAST")
        return obj as T
    }


/*

 Package: dyncall
 Library: dyncallback
 File: dyncallback/dyncall_callback_mips_gas.S
 Description: auto-select (via C preprocessor) mips abi callback implementation
 License:

   Copyright (c) 2016 Tassilo Philipp <tphilipp@potion-studios.com>

   Permission to use, copy, modify, and distribute this software for any
   purpose with or without fee is hereby granted, provided that the above
   copyright notice and this permission notice appear in all copies.

   THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
   WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
   MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL TH


_esmtp_listener {
    listen = '0.0.0.0:2025',
    -- Override the hostname reported in the banner and other
    -- SMTP responses:
    -- hostname="mail.example.com",

    -- override the default set of relay hosts
    relay_hosts = { '127.0.0.1', '192.168.1.0/24' },

    -- Customize the banner.
    -- The configured hostname will be automatically
    -- prepended to this text.
    banner = 'Welcome to KumoMTA!',

    -- Unsafe! When set to true, don't save to spool
    -- at reception time.
    -- Saves IO but may cause you to lose messages
    -- if something happens to this server before
    -- the message is spooled.
    -- deferred_spool = true,

    -- max_recipients_per_message = 1024
    -- max_messages_per_connection = 10000,

    peer = {
      ['127.0.0.1'] = {
        banner = 'Welcome to loopback!',
        allow_xclient = true,
      },
      ['192.168.1.0/24'] = {
        banner = 'Welcome to lan!',
      },
    },
  }

  local do_logging = true
  if do_logging then
    kumo.configure_local_logs {
      log_dir = '/var/tmp/kumo-logs',
      max_segment_duration = '1s',
      back_pressure = 512 * 1024,
    }
  end

  kumo.start_http_listener {
    listen = '0.0.0.0:8000',
    -- allowed to access any http endpoint without additional auth
    trusted_hosts = { '127.0.0.1', '::1', '192.168.1.0/24', '10.0.0.0/8' },
  }
  kumo.start_http_listener {
    use_tls = true,
    listen = '0.0.0.0:8001',
    -- allowed to access any http endpoint without additional auth
    trusted_hosts = { '127.0.0.1', '::1' },
  }

  -- Define the default "data" spool location; this is where
  -- message bodies will be stored
  --
  -- 'flush' can be set to true to cause fdatasync to be
  -- triggered after each store to the spool.
  -- The increased durability comes at the cost of throughput.
  --
  -- kind can be 'LocalDisk' (currently the default) or 'RocksDB'.
  --
  -- LocalDisk stores one file per message in a filesystem hierarchy.
  -- RocksDB is a key-value datastore.
  --
  -- RocksDB has >4x the throughput of LocalDisk, and enabling
  -- flush has a marginal (<10%) impact in early testing.
  kumo.define_spool {
    name = 'data',
    path = '/var/tmp/kumo-spool/data',
    flush = false,
    kind = 'RocksDB',
  }

  -- Define the default "meta" spool location; this is where
  -- message envelope and metadata will be stored
  kumo.define_spool {
    name = 'meta',
    path = '/var/tmp/kumo-spool/meta',
    flush = false,
    kind = 'RocksDB',
  }

  -- Use shared throttles rather than in-process throttles
  -- kumo.configure_redis_throttles { node = 'redis://127.0.0.1/' }
end)

--[[

-- Called to validate the helo and/or ehlo domain
kumo.on('smtp_server_ehlo', function(domain)
  -- print('ehlo domain is', domain)
  -- Use kumo.reject to return an error to the EHLO command
  -- kumo.reject(420, 'wooooo!')
end)

-- Called to validate the sender


-link i{color:#fff}.sidebar-dark #sidebarToggle{background-color:rgba(255,255,255,.2)}.sidebar-dark #sidebarToggle::after{color:rgba(255,255,255,.5)}.sidebar-dark #sidebarToggle:hover{background-color:rgba(255,255,255,.25)}.sidebar-dark.toggled #sidebarToggle::after{color:rgba(255,255,255,.5)}.btn-circle{border-radius:100%;height:2.5rem;width:2.5rem;font-size:1rem;display:inline-flex;align-items:center;justify-content:center}.btn-circle.btn-sm,.btn-group-sm>.btn-circle.btn{height:1.8rem;width:1.8rem;font-size:.75rem}.btn-circle.btn-lg,.btn-group-lg>.btn-circle.btn{height:3.5rem;width:3.5rem;font-size:1.35rem}.btn-icon-split{padding:0;overflow:hidden;display:inline-flex;align-items:stretch;justify-content:center}.btn-icon-split .icon{background:rgba(0,0,0,.15);display:inline-block;padding:.375rem .75rem}.btn-icon-split .text{display:inline-block;padding:.375rem .75rem}.btn-group-sm>.btn-icon-split.btn .icon,.btn-icon-split.btn-sm .icon{padding:.25rem .5rem}.btn-group-sm>.btn-icon-split.btn .text,.btn-icon-split.btn-sm .text{padding:.25rem .5rem}.btn-group-lg>.btn-icon-split.btn .icon,.btn-icon-split.btn-lg .icon{padding:.5rem 1rem}.btn-group-lg>.btn-icon-split.btn .text,.btn-icon-split.btn-lg .text{padding:.5rem 1rem}.card .card-header .dropdown{line-height:1}.card .card-header .dropdown .dropdown-menu{line-height:1.5}.card .card-header[data-toggle=collapse]{text-decoration:none;position:relative;padding:.75rem 3.25rem .75rem 1.25rem}.card .card-header[data-toggle=collapse]::after{position:absolute;right:0;top:0;padding-right:1.725rem;line-height:51px;font-weight:900;content:'\f107';font-family:'Font Awesome 5 Free';color:#d1d3e2}.card .card-header[data-toggle=collapse].collapsed{border-radius:.35rem}.card .card-header[data-toggle=collapse].collapsed::after{content:'\f105'}.chart-area{position:relative;height:10rem;width:100%}@media (min-width:768px){.chart-area{height:20rem}}.chart-bar{position:relative;height:10rem;width:100%}@media (min-width:768px){.chart-bar{height:20rem}}.chart-pie{position:relative;height:15rem;width:100%}@media (min-width:768px){.chart-pie{height:calc(20rem - 43px)!important}}.bg-login-image{background:url(https://source.unsplash.com/K4mSJ7kc0As/600x800);background-position:center;background-size:cover}.bg-register-image{background:url(https://source.unsplash.com/Mv9hjnEUHR4/600x800);background-position:center;background-size:cover}.bg-password-image{background:url(https://source.unsplash.com/oWTW-jNGl9I/600x800);background-position:center;background-size:cover}form.user .custom-checkbox.small label{line-height:1.5rem}form.user .form-co


()

		jestExpect(tag1RemovedMock).toHaveBeenCalledWith(ref.current)
		jestExpect(CollectionService:GetTagged("tag1")).toEqual({})
	end)

	it("should remove one tag in a list when updated", function()
		local ref = React.createRef()
		root:render(React.createElement("TextLabel", {
			ref = ref,
			[Tag] = "tag1 tag2",
		}))
		Scheduler.unstable_flushAllWithoutAsserting()
		waitForEvents()

		jestExpect(CollectionService:GetTagged("tag1")).toEqual({ ref.current })
		jestExpect(CollectionService:GetTagged("tag2")).toEqual({ ref.current })

		root:render(React.createElement("TextLabel", {
			ref = ref,
			[Tag] = "tag2",
		}))
		Scheduler.unstable_flushAllWithoutAsserting()
		waitForEvents()

		jestExpect(tag1RemovedMock).toHaveBeenCalledWith(ref.current)
		jestExpect(tag2RemovedMock).never.toHaveBeenCalled()
		jestExpect(CollectionService:GetTagged("tag1")).toEqual({})
		jestExpect(CollectionService:GetTagged("tag2")).toEqual({ ref.current })
	end)

	it("should remove several tags when updated", function()
		local ref = React.createRef()
		root:render(React.createElement("TextLabel", {
			ref = ref,
			[Tag] = "tag1 tag2",
		}))
		Scheduler.unstable_flushAllWithoutAsserting()
		waitForEvents()

		jestExpect(CollectionService:GetTagged("tag1")).toEqual({ ref.current })
		jestExpect(CollectionService:GetTagged("tag2")).toEqual({ ref.current })

		root:render(React.createElement("TextLabel", {
			ref = ref,
		}))
		Scheduler.unstable_flushAllWithoutAsserting()
		waitForEvents()

		jestExpect(tag1RemovedMock).toHaveBeenCalledWith(ref.current)
		jestExpect(tag2RemovedMock).toHaveBeenCalledWith(ref.current)
		jestExpect(CollectionService:GetTagged("tag1")).toEqual({})
		jestExpect(CollectionService:GetTagged("tag2")).toEqual({})
	end)

	it("should remove tags on unmount", function()
		local ref = React.createRef()
		root:render(React.createElement("TextLabel", {
			ref = ref,
			[Tag] = "tag1 tag2",
		}))
		Scheduler.unstable_flushAllWithoutAsserting()
		waitForEvents()

		jestExpect(CollectionService:GetTagged("tag1")).toEqual({ ref.current })
		jestExpect(CollectionService:GetTagged("tag2")).toEqual({ ref.current })

		root:render(nil)
		Scheduler.unstable_flushAllWithoutAsserting()
		waitForEvents()

		jestExpect(tag1RemovedMock).toHaveBeenCalledTimes(1)
		jestExpect(tag2RemovedMock).toHaveBeenCalledTimes(1)
		jestExpect(CollectionService:GetTagged("tag1")).toEqual({})
		jestExpect(CollectionService:GetTagged("tag2")).toEqual({})
	end)

	it("should


es {
  --fa: "\f15c"; }

.fa-file-alt {
  --fa: "\f15c"; }

.fa-file-text {
  --fa: "\f15c"; }

.fa-wave-square {
  --fa: "\f83e"; }

.fa-ring {
  --fa: "\f70b"; }

.fa-building-un {
  --fa: "\e4d9"; }

.fa-dice-three {
  --fa: "\f527"; }

.fa-calendar-days {
  --fa: "\f073"; }

.fa-calendar-alt {
  --fa: "\f073"; }

.fa-anchor-circle-check {
  --fa: "\e4aa"; }

.fa-building-circle-arrow-right {
  --fa: "\e4d1"; }

.fa-volleyball {
  --fa: "\f45f"; }

.fa-volleyball-ball {
  --fa: "\f45f"; }

.fa-arrows-up-to-line {
  --fa: "\e4c2"; }

.fa-sort-down {
  --fa: "\f0dd"; }

.fa-sort-desc {
  --fa: "\f0dd"; }

.fa-circle-minus {
  --fa: "\f056"; }

.fa-minus-circle {
  --fa: "\f056"; }

.fa-door-open {
  --fa: "\f52b"; }

.fa-right-from-bracket {
  --fa: "\f2f5"; }

.fa-sign-out-alt {
  --fa: "\f2f5"; }

.fa-atom {
  --fa: "\f5d2"; }

.fa-soap {
  --fa: "\e06e"; }

.fa-icons {
  --fa: "\f86d"; }

.fa-heart-music-camera-bolt {
  --fa: "\f86d"; }

.fa-microphone-lines-slash {
  --fa: "\f539"; }

.fa-microphone-alt-slash {
  --fa: "\f539"; }

.fa-bridge-circle-check {
  --fa: "\e4c9"; }

.fa-pump-medical {
  --fa: "\e06a"; }

.fa-fingerprint {
  --fa: "\f577"; }

.fa-hand-point-right {
  --fa: "\f0a4"; }

.fa-magnifying-glass-location {
  --fa: "\f689"; }

.fa-search-location {
  --fa: "\f689"; }

.fa-forward-step {
  --fa: "\f051"; }

.fa-step-forward {
  --fa: "\f051"; }

.fa-face-smile-beam {
  --fa: "\f5b8"; }

.fa-smile-beam {
  --fa: "\f5b8"; }

.fa-flag-checkered {
  --fa: "\f11e"; }

.fa-football {
  --fa: "\f44e"; }

.fa-football-ball {
  --fa: "\f44e"; }

.fa-school-circle-exclamation {
  --fa: "\e56c"; }

.fa-crop {
  --fa: "\f125"; }

.fa-angles-down {
  --fa: "\f103"; }

.fa-angle-double-down {
  --fa: "\f103"; }

.fa-users-rectangle {
  --fa: "\e594"; }

.fa-people-roof {
  --fa: "\e537"; }

.fa-people-line {
  --fa: "\e534"; }

.fa-beer-mug-empty {
  --fa: "\f0fc"; }

.fa-beer {
  --fa: "\f0fc"; }

.fa-diagram-predecessor {
  --fa: "\e477"; }

.fa-arrow-up-long {
  --fa: "\f176"; }

.fa-long-arrow


 123, 6, 2, 128,
➥ 8, 15, 5, 6, 2, 147, 114, 2, 17, 65, 52]

Original: chapter i. down the rabbit-hole alice was beginnin
n-grams: ['ch', 'ap', 'te', 'r ', 'i.', ' d', 'ow', 'n ', 'th', 'e ', 'ra',
➥ 'bb', 'it', '-h', 'ol', 'e ', 'al', 'ic', 'e ', 'wa', 's ', 'be', 'gi',
➥ 'nn', 'in']
Word ID sequence: [93, 207, 57, 19, 545, 47, 84, 18, 6, 2, 126, 344,
➥ 38, 400, 136, 2, 70, 142, 2, 66, 9, 71, 218, 251, 17]

Original: a patent medicine testimonial `` you might as well
n-grams: ['a ', 'pa', 'te', 'nt', ' m', 'ed', 'ic', 'in', 'e ', 'te', 'st',
➥ 'im', 'on', 'ia', 'l ', '``', ' y', 'ou', ' m', 'ig', 'ht', ' a', 's ',
➥ 'we', 'll']
Word ID sequence: [60, 179, 57, 78, 33, 31, 142, 17, 2, 57, 50, 125, 43,
➥ 266, 56, 122, 92, 29, 33, 152, 149, 7, 9, 103, 54]
```

### 10.1.5 定义一个 tf.data pipeline

现在预处理已经完成，我们将文本转换为单词 ID 序列。我们可以定义 tf.data pipeline，该 pipeline 将提供最终处理好的数据，准备好被模型使用。流程中涉及的主要步骤如图 10.1 所示。

![10-01](img/10-01.png)

图 10.1 数据 pipeline 的高级步骤。首先将单个故事分解为固定长度的序列（或窗口）。然后，从窗口化的序列中生成输入和目标。

与之前一样，让我们将单词 ID 语料库定义为 tf.RaggedTensor 对象，因为语料库中的句子具有可变的序列长度：

```py
text_ds = tf.data.Dataset.from_tensor_slices(tf.ragged.constant(data_seq))
```

请记住，不规则张量是具有可变大小维度的张量。然后，如果 shuffle 设置为 True（例如，训练时间），我们将对数据进行洗牌，以便故事以随机顺序出现：

```py
if shuffle:
    text_ds = text_ds.shuffle(buffer_size=len(data_seq)//2)
```

现在来看棘手的部分。在本节中，我们将看到如何从任意长的文本中生成固定大小的窗口化序列。我们将通过一系列步骤来实现这一点。与 pipeline 的其余部分相比，本节可能略微复杂。这是因为将会有中间步骤导致三级嵌套的数据集。让我们尽可能详细地了解一下这一点。

首先，让我们清楚我们需要实现什么。我们需要为每个单独的故