     Assert.fail("result not constant: " + ret.result());
        } else {
            int expected = s0.equals(s1) ? 1 : 0;
            Assert.assertEquals("result", expected, result.asInt());
        }
    }

    @Test
    public void testSameString() {
        String s = "equal-string";
        testStringEquals(s, s);
    }

    @Test
    public void testEqualString() {
        String s = "equal-string";
        testStringEquals(s, new String(s.toCharArray()));
    }

    @Test
    public void testDifferentString() {
        testStringEquals("some-string", "different-string");
    }

    @Test
    public void testSameLengthString() {
        testStringEquals("string-1", "string-2");
    }

    public static boolean stringEquals(String a, String b) {
        return a.equals(b);
    }
}
/*
 * Copyright (c) 2015, 2025, Oracle and/or its affiliates. All rights reserved.
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 *
 * This code is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License version 2 only, as
 * published by the Free Software Foundation.  Oracle designates this
 * particular file as subject to the "Classpath" exception as provided
 * by Oracle in the LICENSE file that accompanied this code.
 *
 * This code is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 * version 2 for more details (a copy is included in the LICENSE file that
 * accompanied this code).
 *
 * You should have received a copy of the GNU General Public License version
 * 2 along with this work; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 *
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 * or visit www.oracle.com if you need additional information or have any
 * questions.
 */
package jdk.graal.compiler.replacements.test;

import org.junit.Assume;
import org.junit.Before;
import org.junit.Test;

import jdk.graal.compiler.api.directives.GraalDirectives;
import jdk.graal.compiler.api.test.Graal;
import jdk.graal.compiler.debug.DebugCloseable;
import jdk.graal.compiler.debug.DebugContext;
import jdk.graal.compiler.debug.GraalError;
import jdk.graal.compiler.hotspot.HotSpotGraalRuntime;
import jdk.graal.compiler.nodes.ValueNode;
import jdk.graal.compiler.nodes.graphbuilderconf.GraphBuilderContext;
import jdk.graal.compiler.nodes.graphbuilderconf.InvocationPlugin;
import jdk.graal.compiler.nodes.graphbuilderconf.InvocationPlugins;
import jdk.graal.compiler.nodes.graphbuilderconf.InvocationPlugins.Registration;
import jdk.graal.compiler.replacements.Snippets;
import jdk.graal.compiler.runtime.RuntimeProvider;
import jdk.graal.compiler.word.WordCastNode;
import jdk.vm.ci.meta.JavaKind;
import jdk.vm.ci.meta.ResolvedJavaMethod;

public class PointerTrackingTest extends ReplacementsTest implements Snippets {
    @Before
    public void before() {
        HotSpotGraalRuntime runtime = (HotSpotGraalRuntime) Graal.getRequiredCapability(RuntimeProvider.class);
        Assume.assumeTrue("doesn't aggressively move objects", runtime.getGarbageCollector() != HotSpotGraalRuntime.HotSpotGC.Shenandoah);
    }

    @Test
    public void testTracking() {
        Result result = executeActual(getResolvedJavaMethod("trackingSnippet"), null);
        assertEquals(new Result("OK", null), result);
    }

    public static String trackingSnippet() {
        for (int i = 0; i < 1000; i++) {
            // generate a lot of garbage, trying to get a fresh TLAB
            GraalDirectives.blackhole(new Object());
        }

        //


"
  },
  String = {
    bg = "NONE",
    fg = "#84A860"
  },
  Structure = {
    bg = "NONE",
    fg = "#C3963D"
  },
  Substitute = {
    bg = "#E77777",
    bold = true,
    fg = "#1E1517"
  },
  TSRainbowBlue = {
    fg = "#4FA9C6"
  },
  TSRainbowCyan = {
    fg = "#4FAD97"
  },
  TSRainbowGreen = {
    fg = "#84A860"
  },
  TSRainbowOrange = {
    fg = "#EF9474"
  },
  TSRainbowRed = {
    fg = "#DF8489"
  },
  TSRainbowViolet = {
    fg = "#CD87BA"
  },
  TSRainbowYellow = {
    fg = "#C3963D"
  },
  TabLine = {
    bg = "#281E22",
    fg = "#68545B"
  },
  TabLineFill = {
    bg = "#281E22",
    fg = "NONE"
  },
  TabLineSel = {
    bg = "#1E1517",
    bold = true,
    fg = "#A5B2BC",
    italic = true
  },
  Tag = {
    bg = "NONE",
    fg = "#4FA9C6"
  },
  TelescopeMatching = {
    bold = true,
    fg = "#ffeeee"
  },
  TelescopeMultiIcon = {
    fg = "#9CBDC9"
  },
  TelescopeMultiSelection = {
    fg = "#4FA9C6"
  },
  TelescopePreviewBorder = {
    link = "FloatBorder"
  },
  TelescopePreviewNormal = {
    link = "NormalFloat"
  },
  TelescopePreviewTitle = {
    link = "FloatTitle"
  },
  TelescopePromptBorder = {
    bg = "#1A1113",
    fg = "#736468"
  },
  TelescopePromptNormal = {
    bg = "#1A1113",
    fg = "#8B7079"
  },
  TelescopePromptPrefix = {
    fg = "#9CBDC9"
  },
  TelescopePromptTitle = {
    bg = "#1A1113",
    bold = true,
    fg = "#9CBDC9"
  },
  TelescopeResultsBorder = {
    link = "FloatBorder"
  },
  TelescopeResultsNormal = {
    link = "NormalFloat"
  },
  TelescopeResultsTitle = {
    link = "FloatTitle"
  },
  TelescopeSelection = "PmenuSel",
  TelescopeSelectionCaret = {
    fg = "#9CBDC9"
  },
  Terminal = {
    bg = "#1E1517",
    fg = "#8B7079"
  },
  Title = {
    bg = "#1A1113",
    bold = true,
    fg = "#9CBDC9"
  },
  Todo = {
    bg = "NONE",
    fg = "#FFA31A"
  },
  TodoBgBUG = {
    bg = "#E77777",
    bold = true,
    fg = "#1E1517"
  },
  TodoBgHACK = {
    bg = "#FFA31A",
    bold = true,
    fg = "#1E1517"
  },
  TodoBgNOTE = {
    bg = "#88C3AB",
    bold = true,
    fg = "#1E1517"
  },
  TodoBgTODO = {
    bg = "#9CBDC9",
    bold = true,
    fg = "#1E1517"
  },
  TodoBgWARNING = {
    bg = "#FFA31A",
    bold = true,
    fg = "#1E1517"
  },
  Type = {


0
    options:
        -
            label: "–"
            value: fontmod-0
        -
            label: "𝚨-1"
            value: fontmod-1
        -
            label: "𝚨-2"
            value: fontmod-2
        -
            label: "𝚨-3"
            value: fontmod-3
  -
    id: font-modern
    title: 1 - Modern
    type: heading
    level: 3
    collapsed: true
  -
    id: modern-font-h
    title: Header Font
    title.de: Überschriften
    type: variable-text
    default: '"Louis George Cafe", "DejaVu Serif", sans-serif'
  -
    id: modern-font-c
    title: Character Font
    title.de: Charakterschrift
    type: variable-text
    default: '"Louis George Cafe", "Liberation Serif", sans-serif'
  -
    id: custom-fsz-1
    title: Font size
    title.de: Schriftgröße
    type: variable-number-slider
    format: px
    default: 16
    min: 12
    max: 24
    step: 1
  -
    id: poetry-font-chars
    title: 2 - Poetry
    title.de: 2 - Poesie
    type: heading
    level: 3
    collapsed: true
  -
    id: poetry-font-h
    title: Header Font
    description: (default = Manuskript Gothisch)
    title.de: Überschriften
    description.de: (Standard = Manuskript Gothisch)
    type: variable-text
    default: '"Manuskript Gothisch", Pecita, Mumsies, sans-serif'
  -
    id: poetry-font-c
    title: Character Font
    title.de: Charakterschrift
    type: variable-text
    default: 'cursive, Pecita, Mumsies, sans-serif'
  -
    id: custom-fsz-2
    title: Font size
    title.de: Schriftgröße
    type: variable-number-slider
    format: px
    default: 16
    min: 12
    max: 24
    step: 1
  -
    id: custom-font-chars
    title: 3 - Dashboard
    title.de: 3 - Startseite
    type: heading
    level: 3
    collapsed: true
  -
    id: custom-font-h
    title: Header Font
    title.de: Überschriften
    type: variable-text
    default: 'Helvetica, Sengoa, Optima-Regular, GillSans'
  -
    id: custom-font-c
    title: Character Font
    title.de: Charakterschrift
    type: variable-text
    default: 'Helvetica, Sengoa, Optima-Regular, GillSans'
  -
    id: custom-fsz-3
    title: Font size
    title.de: Schriftgröße
    type: variable-number-slider
    format: px
    default: 16
    min: 12
    max: 24
    step: 1
  -
    id: general-spacing
    title: Text layout
    title.de: Schriftgestaltung
    description: change spacing of lines
    description.de: Ändere den Abstand von Zeilen
    type: heading
    level: 2
    collapsed: true
  -
    id: indent-l
    title: Indent line
    title.de: Zeileneinzug
    description: indent paragraphs "#indent ==first word=="
    description.de: Zeileneinzug Paragrafen "#einzug ==erstes Wort=="
    type: variable-number-slider
    format: em
    default: 4
    min: 2
    max: 10
    step: 1
  -
    id: prg-break
    title: Linebreak - blank
    description: ignore blank lines
    title.de: Umbruch - Leerzeile
    description.de: ignoriere Leerzeilen
    type: class-tog


Date((BIRTH_DATE||BIRTH_DATE), '19400101')", true},  //  single value match, pre-epoch
                {"filter:afterDate((BIRTH_DATE||BIRTH_DATE), '19200101')", true},  //  multi value match, pre-epoch

                //  with a pattern
                {"filter:afterDate((BIRTH_DATE||BIRTH_DATE), '19400101', 'yyyyMMdd')", true},  //  single value match, pre-epoch
                {"filter:afterDate((BIRTH_DATE||BIRTH_DATE), '19200101', 'yyyyMMdd')", true},  //  multi value match, pre-epoch

                //  DEATH_DATE is post-epoch
                {"filter:afterDate(DEATH_DATE, '20010101')", true},    //  single value match, post-epoch
                {"filter:afterDate(DEATH_DATE, '20000101')", true},    //  multi value match, post-epoch
                {"filter:afterDate(DEATH_DATE, '19500101')", true},    //  multi value match, pre-epoch

                //  single field with pattern
                {"filter:afterDate(DEATH_DATE, '20010101', 'yyyyMMdd')", true},    //  single value match, post-epoch
                {"filter:afterDate(DEATH_DATE, '20000101', 'yyyyMMdd')", true},    //  multi value match, post-epoch
                {"filter:afterDate(DEATH_DATE, '19500101', 'yyyyMMdd')", true},    //  multi value match, pre-epoch

                //  multi field
                {"filter:afterDate((DEATH_DATE||DEATH_DATE), '20010101')", true},    //  single value match, post-epoch
                {"filter:afterDate((DEATH_DATE||DEATH_DATE), '20000101')", true},    //  multi value match, post-epoch
                {"filter:afterDate((DEATH_DATE||DEATH_DATE), '19500101')", true},    //  multi value match, pre-epoch

                //  multi field with pattern
                {"filter:afterDate((DEATH_DATE||DEATH_DATE), '20010101', 'yyyyMMdd')", true},    //  single value match, post-epoch
                {"filter:afterDate((DEATH_DATE||DEATH_DATE), '20000101', 'yyyyMMdd')", true},    //  multi value match, post-epoch
                {"filter:afterDate((DEATH_DATE||DEATH_DATE), '19500101', 'yyyyMMdd')", true},    //  multi value match, pre-epoch
        };
        //  @formatter:on

        testInputs(array);
    }

    @Test
    public void testDateEquality() {
        String query = "BIRTH_DATE == '1910-12-28T00:00:05.000Z'";
        testInput(query, true);
    }

    @Test
    public void testMultipleTimeFunctions() {
        // long value is 80+ years
        String query = "FOO == 'bar' && filter:getMaxTime(DEATH_DATE) - filter:getMinTime(BIRTH_DATE) > 2522880000000L";
        testInput(query, true);

        query = "BIRTH_DATE.min() < '1920-12-28T00:00:05.000Z'";
        testInput(query, true);

        query = "DEATH_DATE.max() - BIRTH_DATE.min() > 1000 * 60 * 60 * 24"; // one day
        testInput(query, true);

        query = "DEATH_DATE.max() - BIRTH_DATE.min() > 1000 * 60 * 60 * 24 * 5 + 1000 * 60 * 60 * 24 * 7"; // 5 plus 7 days for the calculator-deprived
        testInput(query, true);

        query = "DEATH_DATE.min() < '20160301120000'";
        testInput(query, true);
    }

    /**
     * taken from {@link datawave.query.CompositeFunctionsTest}
     */
    @Test
    public void testFilterFunctionIsNull() {
        //  @formatter:off
        Object[][] array = {
                {"filter:isNull(


只能转进先全盘承认苹果的商业成功是来自产品以及营销（而不论这些成绩的取得有何历史背景以及是否涉及滥用市场地位的不正当性——那实在太跑题了）。

　　（作为对比，这些年吃 B 端饭战略的微软，对这种问题就有底气完全冷眼不管了。虽然 HoloLens 是失败品，但不靠这些改善业绩，甚至砍了也不影响整体营收和调性，自然完全没必要下场掺和。）

　　不过这里更大的槽点是：既然扯历史那就别隐含多数票保证讨好“多数”人口嫌体正直呗？

　　注意这里没有群众史观和英雄史观的对立。无论是苹果还是 Meta ，都是吃的 C 端消费者这样的“大众”的饭。苹果的创新程度在此也远达不到算是英雄的程度，也是泯然众人之一（就是 iPhone 去掉伪装的钦点“智能”的面纱，也不过如此——从历史的角度看，普及不成熟的电容屏支棱不起多大的变革）。

　　关键是，一个特定时代的大众，相对历史的行程中全体群众的存在感，有多大的代表性呢？

　　已有的历史不能说明这个问题。历史上多数人还不识字呢。历史谁书写的？

　　这里的主要教益是：不能把关于对现在和未来几乎所有人都能有深远影响的问题的话语权拱手让给特定时代的从众者。除了让少数人赚得盆满钵满和满足个别人的自满（被卖了还帮数钱），这对谁都没好处。

　　马克·扎克伯格可能是不得不出来发表意见刷新存在感；在舆论上先发制人或许比被逼得出来发表观点还是好得多。但只是这种程度，就免不了很大的酸葡萄嫌疑了，丝毫无法以退为进，殊为不智。须知，即便是 Quest ，也远没有便宜到足以向多数用户普及类似的设备（至是不是值这个价，见仁见智）；不论如何划分目标用户群体，都缺乏决定性的竞争优势，并没什么吸引大众改变舆论导向的可能。

## 4.10 其它的影响

　　如先前说过，一些细分领域也有类似问题：

* 手游市场对传统视频游戏也多少是一样的套路，欺负原本根本不是游戏目标用户的小白成为手游


// SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later

#pragma once

#include <optional>
#include <string>

#include "common/common_types.h"

namespace Network {

/// Address families
enum class Domain : u8 {
    Unspecified, ///< Represents 0, used in getaddrinfo hints
    INET,        ///< Address family for IPv4
};

/// Socket types
enum class Type {
    Unspecified, ///< Represents 0, used in getaddrinfo hints
    STREAM,
    DGRAM,
    RAW,
    SEQPACKET,
};

/// Protocol values for sockets
enum class Protocol : u8 {
    Unspecified, ///< Represents 0, usable in various places
    ICMP,
    TCP,
    UDP,
};

/// Shutdown mode
enum class ShutdownHow {
    RD,
    WR,
    RDWR,
};

/// Array of IPv4 address
using IPv4Address = std::array<u8, 4>;

/// Cross-platform sockaddr structure
struct SockAddrIn {
    Domain family;
    IPv4Address ip;
    u16 portno;
};

constexpr u32 FLAG_MSG_PEEK = 0x2;
constexpr u32 FLAG_MSG_DONTWAIT = 0x80;
constexpr u32 FLAG_O_NONBLOCK = 0x800;

/// Cross-platform addrinfo structure
struct AddrInfo {
    Domain family;
    Type socket_type;
    Protocol protocol;
    SockAddrIn addr;
    std::optional<std::string> canon_name;
};

} // namespace Network


})(Polymer);

(function(scope) {

/**
 * @class Polymer
 */

var whenReady = scope.whenReady;

/**
 * Loads the set of HTMLImports contained in `node`. Notifies when all
 * the imports have loaded by calling the `callback` function argument.
 * This method can be used to lazily load imports. For example, given a
 * template:
 *
 *     <template>
 *       <link rel="import" href="my-import1.html">
 *       <link rel="import" href="my-import2.html">
 *     </template>
 *
 *     Polymer.importElements(template.content, function() {
 *       console.log('imports lazily loaded');
 *     });
 *
 * @method importElements
 * @param {Node} node Node containing the HTMLImports to load.
 * @param {Function} callback Callback called when all imports have loaded.
 */
function importElements(node, callback) {
  if (node) {
    document.head.appendChild(node);
    whenReady(callback);
  } else if (callback) {
    callback();
  }
}

/**
 * Loads an HTMLImport for each url specified in the `urls` array.
 * Notifies when all the imports have loaded by calling the `callback`
 * function argument. This method can be used to lazily load imports.
 * For example,
 *
 *     Polymer.import(['my-import1.html', 'my-import2.html'], function() {
 *       console.log('imports lazily loaded');
 *     });
 *
 * @method import
 * @param {Array} urls Array of urls to load as HTMLImports.
 * @param {Function} callback Callback called when all imports have loaded.
 */
function _import(urls, callback) {
  if (urls && urls.length) {
      var frag = document.createDocumentFragment();
      for (var i=0, l=urls.length, url, link; (i<l) && (url=urls[i]); i++) {
        link = document.createElement('link');
        link.rel = 'import';
        link.href = url;
        frag.appendChild(link);
      }
      importElements(frag, callback);
  } else if (callback) {
    callback();
  }
}

// exports
scope.import = _import;
scope.importElements = importElements;

})(Polymer);

/**
 * The `auto-binding` element extends the template element. It provides a quick
 * and easy way to do data binding without the need to setup a model.
 * The `auto-binding` element itself serves as the model and controller for the
 * elements it contains. Both data and event handlers can be bound.
 *
 * The `auto-binding` element acts just like a template that is bound to
 * a model. It stamps its content in the dom adjacent to itself. When the
 * content is stamped, the `template-bound` event is fired.
 *
 * Example:
 *
 *     <template is="auto-binding">
 *
Say something: <input value="{{value}}">

 *
You said: {{value}}

 *       <button on-tap="{{buttonTap}}">Tap me!</button>
 *     </template>
 *
 *
 * @module Polymer
 * @status stable
*/

(function() {

  var element = document.createElement('polymer-element');
  element.setAttribute('name', 'auto-binding');
  element.setAttribute('extends', 'template');
  element.init();

  Polymer('auto-binding', {

    createdCallback: function() {
      this.syntax = this.bindingDelegate = this.makeSyntax();
      // delay stamping until polymer-ready so that auto-binding is not
      // required to load last.
      Polymer.whenPolymerReady(function() {
        this.model = this;
        this.setAttribute('bind', '');
        // w


  }
  return cleanClassName && cleanClassName.length ? `pf-v5-c-chart ${cleanClassName}` : 'pf-v5-c-chart';
};
import * as fs from 'fs';
import { promisify } from 'util';
import * as _glob from 'glob';

export const readFile = promisify(fs.readFile);
export const writeFile = promisify(fs.writeFile);
export const readDir = promisify(fs.readdir);
export const removeFile = async (path: string) =>
  new Promise((resolve, reject) => {
    fs.unlink(path, err => {
      if (err) {
        reject(err);
      } else {
        resolve();
      }
    });
  });

export const glob = async (pattern: string, options: _glob.IOptions = {}) => {
  return new Promise<string[]>((resolve, reject) => {
    _glob(pattern, options, (error, result) => {
      if (error) {
        reject(error);
      } else {
        resolve(result);
      }
    });
  });
};

export const readJsonFile = async <T = any>(file: string) =>
  readFile(file, 'utf8').then(JSON.parse) as Promise<T>;

export function replaceSmartQuotes(str: string) {
  // prettier-ignore
  return str.replace(/[‘’]/g, '\'').replace(/[“”]/g, '"');
}

export function getImageFilename(slug: string, thumbUrl: string) {
  const ext = thumbUrl.match(/\.[a-z]{3,4}$/gi);
  let filename = slug;
  if (ext && ext[0]) {
    filename += ext[0].toLowerCase();
  }

  return filename;
}
import {Subject} from "rxjs";
import ProjectionMatrix from "./ProjectionMatrix";
import Vertex from "./Vertex";
import ViewMatrix from "./ViewMatrix";
import {cos, matrix, sin, unit} from "mathjs";

export default class Camera {
    private _near: number = 0.1;
    private _far: number = 100;
    private _angleOfView: number = 160;
    private _pitch: number = 0;
    private _yaw: number = 0;
    private readonly _projectionMatrix: ProjectionMatrix;
    private readonly _viewMatrix: ViewMatrix;
    private readonly _position: Vertex;
    private readonly _cameraUpdate: any;
    static STEP =  2;
    static DEGREE_STEP = 0.4;

    constructor() {
        this._cameraUpdate = new Subject();
        this._position = new Vertex(0, 0, -75);
        this._projectionMatrix = new ProjectionMatrix(this);
        this._viewMatrix = new ViewMatrix(this);
    }

    get pitch(): number {
        return this._pitch;
    }

    set pitch(value: number) {
        if (value > 90) {
            value = -90;
        } else if (value < -90) {
            value = 90;
        }
        this._pitch = value;
    }

    get yaw(): number {
        return this._yaw;
    }

    set yaw(value: number) {
        if (value > 360) {
            value = 0;
        } else if (value < 0) {
            value = 360;
        }
        this._yaw = value;
    }

    tickPitch(step: number = Camera.DEGREE_STEP) {
        this.pitch += step;


alp=input("Enter any alphabet:")
if (alp=='a'or alp=='A'or
   alp=='e'or alp=='E'or
   alp=='i'or alp=='I'or
   alp=='o'or alp=='O'or
   alp=='u'or alp=='U'):
    print(alp,"is a vowel.")
elif ( alp == 'a' or  alp == 'A'
     or  alp == 'b' or  alp == 'B'
     or  alp == 'c' or  alp == 'C'
     or  alp == 'd' or  alp == 'D'
     or  alp == 'e' or  alp == 'E'
     or  alp == 'f' or  alp == 'F'
     or  alp == 'g' or  alp == 'G'
     or  alp == 'h' or  alp == 'H'
     or  alp == 'i' or  alp == 'I'
     or  alp == 'j' or  alp == 'J'
     or  alp == 'k' or  alp == 'K'
     or  alp == 'l' or  alp == 'L'
     or  alp == 'm' or  alp == 'M'
     or  alp == 'n' or  alp == 'N'
     or  alp == 'o' or  alp == 'O'
     or  alp == 'p' or  alp == 'P'
     or  alp == 'q' or  alp == 'Q'
     or  alp == 'r' or  alp == 'R'
     or  alp == 's' or  alp == 'S'
     or  alp == 't' or  alp == 'T'
     or  alp == 'u' or  alp == 'U'
     or  alp == 'v' or  alp == 'V'
     or  alp == 'w' or  alp == 'W'
     or  alp == 'x' or  alp == 'X'
     or  alp == 'y' or  alp == 'Y'
     or  alp == 'z' or  alp == 'Z'):
    print(alp,"is a consonant.")
else:
    print("please enter a single alphabet.")


fvalue() - b.fvalue()) / fwin);
                    rolling_var = ((b.fvalue() - a.fvalue()) * (b.fvalue() - rolling_avg + a.fvalue() - oav ) / fwinmo) + var;
                    (rolling_avg, oav, rolling_var, rolling_var.sqrt())
                }).3
            })
        ).collect()
    }
}

impl CalculateRollingStdDev for IntegerType {
    fn rolling_stddev(columns : &Vec<DataTypes>, window : usize) -> Vec<DataTypes> {
        let iwin : i64 = window as i64;
        let iwinmo : i64 = iwin - 1;

        let mut rolling_avg : i64 = 0;
        let mut rolling_var : i64 = 0;

        columns.windows(window).zip(columns.windows(window).skip(1)).map(
            |(x, y)| DataTypes::IntegerType(
                IntegerType{ value : x.iter().zip(y).fold((0, rolling_avg, rolling_var, 0), |(nav, oav, var, stdev), (a, b)| {
                    rolling_avg = oav + ((a.ivalue() - b.ivalue()) / iwin);
                    rolling_var = ((b.ivalue() - a.ivalue()) * (b.ivalue() - rolling_avg + a.ivalue() - oav ) / iwinmo) + var;
                    (rolling_avg, oav, rolling_var, (rolling_var as f64).sqrt() as i64)
                }).3
            })
        ).collect()
    }
}

impl CalculateRollingStdDev for StringType {
    fn rolling_stddev(columns: &Vec<DataTypes>, window : usize) -> Vec<DataTypes> {
        vec![DataTypes::StringType(StringType{value : String::from("NAN")});1]
    }
}

trait CalculateRollingVariance {
    fn rolling_variance(column : & Vec<DataTypes>, window : usize) -> Vec<DataTypes>;
}

impl CalculateRollingVariance for FloatType {
    fn rolling_variance(columns : &Vec<DataTypes>, window : usize) -> Vec<DataTypes> {
        let fwin : f64 = window as f64;
        let fwinmo : f64 = fwin - 1.0;

        let mut rolling_avg : f64 = 0.0;
        let mut rolling_var : f64 = 0.0;

        columns.windows(window).zip(columns.windows(window).skip(1)).map(
            |(x, y)| DataTypes::FloatType(
                FloatType{ value : x.iter().zip(y).fold((0.0, rolling_avg, rolling_var), |(nav, oav, var), (a, b)| {
                    rolling_avg = oav + ((a.fvalue() - b.fvalue()) / fwin);
                    rolling_var = ((b.fvalue() - a.fvalue()) * (b.fvalue() - rolling_avg + a.fvalue() - oav ) / fwinmo) + var;
                    (rolling_avg, oav, rolling_var)
                }).2
            })
        ).collect()
    }
}

impl CalculateRollingVariance for IntegerType {
    fn rolling_variance(columns : &Vec<DataTypes>, window : usize) -> Vec<DataTypes> {
        let iwin : i64 = window as i64;
        let iwinmo : i64 = iwin - 1;

        let mut rolling_avg : i64 = 0;
        let mut rolling_var : i64 = 0;

        columns.windows(window).zip(columns.windows(window).skip(1)).map(
            |(x, y)| DataTypes::IntegerType(
                IntegerType{ value : x.iter().zip(y).fold((0, rolling_avg, rolling_var), |(nav, oav, var), (a, b)| {
                    rolling_avg = oav + ((a.ivalue() - b.ivalue())


IZON_COL].map(horizon_mapper).fillna(-1).astype(int)\\n\\n    # Store the final column order from training data to ensure consistency during prediction.\\n    # This should be based on \`X_train_lgbm\` as it ensures all columns are captured.\\n    X_train_model_cols = X_train_lgbm.columns.tolist()\\n\\n\\n    # --- 4. Model Training (Ensemble of LightGBM and XGBoost models) ---\\n    models = {q: {} for q in QUANTILES}\\n\\n    for q in QUANTILES:\\n        # Train LightGBM models\\n        if 'lgbm' in ensemble_model_types and n_lgbm_ensemble_members > 0:\\n            models[q]['lgbm'] = []\\n            for i in range(n_lgbm_ensemble_members):\\n                lgbm_model_params_i = lgbm_params.copy()\\n                lgbm_model_params_i['alpha'] = q\\n                lgbm_model_params_i['random_state'] = lgbm_params['random_state'] + i\\n\\n                lgbm_model = LGBMRegressor(**lgbm_model_params_i)\\n                lgbm_model.fit(X_train_lgbm, y_train_model,\\n                               categorical_feature=categorical_feature_names_lgbm)\\n                models[q]['lgbm'].append(lgbm_model)\\n        \\n        # Train XGBoost models\\n        if 'xgb' in ensemble_model_types and n_xgb_ensemble_members > 0:\\n            models[q]['xgb'] = []\\n            for i in range(n_xgb_ensemble_members):\\n                xgb_model_params_i = xgb_params.copy()\\n                xgb_model_params_i['alpha'] = q\\n                xgb_model_params_i['random_state'] = xgb_params['random_state'] + i\\n\\n                xgb_model = xgb.XGBRegressor(**xgb_model_params_i)\\n                # X_train_xgb passed here, which has integer-encoded categorical columns\\n                xgb_model.fit(X_train_xgb, y_train_model)\\n                models[q]['xgb'].append(xgb_model)\\n\\n    # --- 5. Iterative Feature Generation and Prediction for Test Data ---\\n    # Initialize history for each location using full training data's transformed target values.\\n    location_history_data = df_train_full.set_index(LOCATION_COL)[TRANSFORMED_TARGET_COL].groupby(level=0).apply(list).to_dict()\\n\\n    # Store original test_x index for mapping back predictions.\\n    original_test_x_index = test_x.index\\n\\n    # Prepare test data for sequential processing, keeping original index and sorting.\\n    test_x_processed['original_index'] = test_x_processed.index\\n    test_x_processed[DATE_COL] = pd.to_datetime(test_x_processed[DATE_COL])\\n    test_x_processed = test_x_processed.sort_values(by=[LOCATION_COL, DATE_COL]).reset_index(drop=True)\\n\\n    # Initialize prediction DataFrame with the original test_x index and quantile columns.\\n    predictions_df = pd.DataFrame(index=original_test_x_index, columns=[f'quantile_{q}' for q in QUANTILES])\\n\\n    # Loop through each row of the sorted test_x_processed to predict sequentially.\\n    for idx, row in test_x_processed.iterrows():\\n        current_loc = row[LOCATION_COL]\\n        original_idx = row['original_index']\\n\\n        current_loc_hist = location_history


= range;
			this.dateRange = new DateRange(from, to);
		}

		public Range getRange() {
			return range;
		}

		public DateRange getDateRange() {
			return dateRange;
		}

		public boolean isRowsAvailable() {
			return rowsAvailable;
		}

		public void setRowsAvailable(boolean rowsAvailable) {
			this.rowsAvailable = rowsAvailable;
		}

		public boolean isShow() {
			return show;
		}

		public void setShow(boolean show) {
			this.show = show;
		}

	}

	private final class TimelineRowFilter implements Predicate<ProjTimelineRow> {

		private String searchString;
		private Long identityKey;
		private Set<Long> selectedIdentityKeys;
		private List<ActionTarget> targets;

		public TimelineRowFilter () {
			searchString = tableEl.getQuickSearchString().toLowerCase();

			if (tableEl.getSelectedFilterTab() != null && tableEl.getSelectedFilterTab() == tabMy) {
				identityKey = getIdentity().getKey();
			}

			List<FlexiTableFilter> filters = tableEl.getFilters();
			if (filters == null || filters.isEmpty()) return;

			for (FlexiTableFilter filter : filters) {
				if (FILTER_USER.equals(filter.getFilter())) {
					List<String> values = ((FlexiTableMultiSelectionFilter)filter).getValues();
					if (values != null && !values.isEmpty()) {
						selectedIdentityKeys = values.stream().map(Long::valueOf).collect(Collectors.toSet());
					}
				}
				if (FILTER_TYPE.equals(filter.getFilter())) {
					List<String> values = ((FlexiTableMultiSelectionFilter)filter).getValues();
					if (values != null && !values.isEmpty()) {
						targets = values.stream().filter(ActionTarget::isValid).map(ActionTarget::valueOf).collect(Collectors.toList());
					}
				}
			}
		}

		@Override
		public boolean test(ProjTimelineRow row) {
			if (StringHelper.containsNonWhitespace(searchString)) {
				if (row.getMessage() != null && row.getMessage().toLowerCase().indexOf(searchString) < 0) {
					return false;
				}
			}
			if (identityKey != null) {
				if (row.getIdentityKeys() != null && !row.getIdentityKeys().contains(identityKey)) {
					return false;
				}
			}
			if (selectedIdentityKeys != null) {
				if (row.getIdentityKeys() != null && !row.getIdentityKeys().stream().anyMatch(key -> selectedIdentityKeys.contains(key))) {
					return false;
				}
			}

			if (targets != null) {
				if (row.getActionTarget() != null && !targets.contains(row.getActionTarget())) {
					return false;
				}
			}

			return true;
		}

	}

}
/**
 *
 * OpenOLAT - Online Learning and Training

 *

 * Licensed under the Apache License, Version 2.0 (the "License");

 * you may not use this file except in compliance with the License.

 * You may obtain a copy of the License at the
 * Apache homepage
 *

 * Unless required by applicable law or agreed to in writing,

 * software distributed under the License is distributed on an "AS IS" BASIS,

 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

 * See the License for the specific language governing permissions and

 * limitations under the License.
 *

 * Initial code contributed and copyrighted by

 * frentix GmbH


;
import org.springframework.stereotype.Repository;

import com.jshop.dao.MsgtextTDao;
import com.jshop.entity.MsgtextT;

/**
 * A data access object (DAO) providing persistence and search support for
 * MsgtextT entities. Transaction control of the save(), update() and delete()
 * operations can directly support Spring container-managed transactions or they
 * can be augmented to handle user-managed Spring transactions. Each of these
 * methods provides additional information for how to configure it for the
 * desired type of transaction control.
 *
 * @see com.jshop.entity.MsgtextT
 * @author MyEclipse Persistence Tools
 */
@Repository("msgtextTDao")
public class MsgtextTDaoImpl extends BaseTDaoImpl<MsgtextT> implements MsgtextTDao {

	private static final Log log = LogFactory.getLog(MsgtextTDaoImpl.class);

	public int countfindAllMsgtext() {
		log.debug("count all countfindAllMsgtext");
		try {
			String queryString = "select count(*) from MsgtextT";
			List<MsgtextT> list =  this.getHibernateTemplate().find(queryString);
			if (list.size() > 0) {
				Object o = list.get(0);
				long l = (Long) o;
				return (int) l;
			}
			return 0;
		} catch (RuntimeException re) {
			log.error("count all MsgtextT error", re);
			throw re;
		}
	}

	public int delMsgtext(final String[] list) {
		log.debug("del DelMsgtext");
		try {

			final String queryString = "delete from MsgtextT as mt where mt.msgtextid=:msgtextid";
			this.getHibernateTemplate().execute(new HibernateCallback() {

				public Object doInHibernate(Session session) throws HibernateException, SQLException {
					Query query = session.createQuery(queryString);
					int i = 0;
					for (String s : list) {
						query.setParameter("msgtextid", s);
						i = query.executeUpdate();
						i++;
					}
					if (list.length == i) {
						return i;
					} else {
						return 0;
					}
				}
			});
		} catch (RuntimeException re) {
			log.error("del DelMsgtext failed", re);
			throw re;
		}
		return 0;
	}

	public List<MsgtextT> findAllMsgtext(final int currentPage, final int lineSize) {
		log.debug("find all MsgtextT");
		try {
			List<MsgtextT> list = this.getHibernateTemplate().executeFind(new HibernateCallback() {

				String queryString = "from MsgtextT as mt  order by sendTime desc";

				public Object doInHibernate(Session session) throws HibernateException, SQLException {
					Query query = session.createQuery(queryString);
					query.setFirstResult((currentPage - 1) * lineSize);
					query.setMaxResults(lineSize);
					List list = query.list();
					return list;
				}
			});
			if (list.size() > 0) {
				return list;
			}
			return null;
		} catch (RuntimeException re) {
			log.error("find all MsgtextT ", re);
			throw re;
		}
	}

	public MsgtextT findMsgtextById(String id) {
		log.debug("getting findMsgtextById instance with id: " + id);
		try {
			MsgtextT list = (MsgtextT) this.getHibernateTemplate().get("com.jshop.entity.MsgtextT", id);
			return list;
		} catch (RuntimeException re) {
			log.error("get failed", re);
			throw re;
		}


//
// Binocle
// Copyright (c) 2015-2019 Valerio Santinelli
// All rights reserved.
//

#include "binocle_log.h"
#include <SDL3/SDL.h>
#include <stdio.h>
#include <stdarg.h>

#ifdef __EMSCRIPTEN__
#include <emscripten.h>
#endif

#define BINOCLE_LOG_BUFFER_SIZE 65535

/// the temporary buffer used to print the log messages
static char *log_buffer = NULL;

void binocle_log_error(const char *msg, ...) {
  binocle_log_ensure_buffer_is_set();
  va_list args;
  va_start(args, msg);
  vsnprintf(log_buffer, BINOCLE_LOG_BUFFER_SIZE, msg, args);
#ifdef __EMSCRIPTEN__
  emscripten_log(EM_LOG_ERROR, "%s", log_buffer);
#else
  SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "%s", log_buffer);
#endif
  va_end(args);
}

void binocle_log_warning(const char *msg, ...) {
  binocle_log_ensure_buffer_is_set();
  va_list args;
  va_start(args, msg);
  vsnprintf(log_buffer, BINOCLE_LOG_BUFFER_SIZE, msg, args);
#ifdef __EMSCRIPTEN__
  emscripten_log(EM_LOG_WARN, "%s", log_buffer);
#else
  SDL_LogWarn(SDL_LOG_CATEGORY_APPLICATION, "%s", log_buffer);
#endif
  va_end(args);
}

void binocle_log_info(const char *msg, ...) {
  binocle_log_ensure_buffer_is_set();
  va_list args;
  va_start(args, msg);
  vsnprintf(log_buffer, BINOCLE_LOG_BUFFER_SIZE, msg, args);
#ifdef __EMSCRIPTEN__
  emscripten_log(EM_LOG_CONSOLE, "%s", log_buffer);
#else
  SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION, "%s", log_buffer);
#endif
  va_end(args);
}

void binocle_log_debug(const char *msg, ...) {
  binocle_log_ensure_buffer_is_set();
  va_list args;
  va_start(args, msg);
  vsnprintf(log_buffer, BINOCLE_LOG_BUFFER_SIZE, msg, args);
#ifdef __EMSCRIPTEN__
  emscripten_log(EM_LOG_CONSOLE, "%s", log_buffer);
#else
  SDL_LogDebug(SDL_LOG_CATEGORY_APPLICATION, "%s", log_buffer);
#endif
  va_end(args);
}

void binocle_log_ensure_buffer_is_set() {
  if (log_buffer == NULL) {
    log_buffer = SDL_malloc(BINOCLE_LOG_BUFFER_SIZE);
  }
}


px;width:15px;margin-right:3px;vertical-align:middle}.kint-rich dt.kint-parent:hover>nav,.kint-rich>footer>nav:hover{background-position:0 25%}.kint-rich dt.kint-parent.kint-show>nav,.kint-rich>footer.kint-show>nav{background-position:0 50%}.kint-rich dt.kint-parent.kint-show:hover>nav,.kint-rich>footer.kint-show>nav:hover{background-position:0 75%}.kint-rich dt.kint-parent.kint-locked>nav{background-position:0 100%}.kint-rich dt.kint-parent+dd{display:none;border-left:1px dashed #93a1a1}.kint-rich dt.kint-parent.kint-show+dd{display:block}.kint-rich var,.kint-rich var a{color:#268bd2;font-style:normal}.kint-rich dt:hover var,.kint-rich dt:hover var a{color:#2aa198}.kint-rich dfn{font-style:normal;font-family:monospace;color:#586e75}.kint-rich pre{color:#657b83;margin:0 0 0 15px;padding:5px;overflow-y:hidden;border-top:0;border:1px solid #93a1a1;background:#fdf6e3;display:block;word-break:normal}.kint-rich .kint-popup-trigger,.kint-rich .kint-access-path-trigger,.kint-rich .kint-search-trigger{background:rgba(101,123,131,0.8);border-radius:3px;height:16px;font-size:16px;margin-left:5px;font-weight:bold;width:16px;text-align:center;float:right !important;cursor:pointer;color:#fdf6e3;position:relative;overflow:hidden;line-height:17.6px}.kint-rich .kint-popup-trigger:hover,.kint-rich .kint-access-path-trigger:hover,.kint-rich .kint-search-trigger:hover{color:#657b83;background:#fdf6e3}.kint-rich dt.kint-parent>.kint-popup-trigger{line-height:19.2px}.kint-rich .kint-search-trigger{font-size:20px}.kint-rich input.kint-search{display:none;border:1px solid #93a1a1;border-top-width:0;border-bottom-width:0;padding:5px;float:right !important;margin:-5px 0;color:#586e75;background:#eee8d5;height:26px;width:160px;position:relative;z-index:100}.kint-rich input.kint-search.kint-show{display:block}.kint-rich .kint-search-root ul.kint-tabs>li:not(.kint-search-match){background:#e2e2e2;opacity:0.5}.kint-rich .kint-search-root dl:not(.kint-search-match){opacity:0.5}.kint-rich .kint-search-root dl:not(.kint-search-match)>dt{background:#f0f0f0}.kint-rich .kint-search-root dl:not(.kint-search-match) dl,.kint-rich .kint-search-root dl:not(.kint-search-match) ul.kint-tabs>li:not(.kint-search-match){


': 'xapk_version', '3': 1, '4': 1, '5': 13, '7': '1', '10': 'xapkVersion'},
    const {'1': 'package_name', '3': 2, '4': 1, '5': 9, '10': 'packageName'},
    const {'1': 'name', '3': 3, '4': 1, '5': 9, '10': 'name'},
    const {'1': 'locales_name', '3': 4, '4': 3, '5': 11, '6': '.proto.ManifestXapk.LocalesNameEntry', '10': 'localesName'},
    const {'1': 'version_code', '3': 5, '4': 1, '5': 13, '10': 'versionCode'},
    const {'1': 'version_name', '3': 6, '4': 1, '5': 9, '10': 'versionName'},
    const {'1': 'min_sdk_version', '3': 7, '4': 1, '5': 13, '10': 'minSdkVersion'},
    const {'1': 'target_sdk_version', '3': 8, '4': 1, '5': 13, '10': 'targetSdkVersion'},
    const {'1': 'permissions', '3': 9, '4': 3, '5': 9, '10': 'permissions'},
    const {'1': 'split_configs', '3': 10, '4': 3, '5': 9, '10': 'splitConfigs'},
    const {'1': 'total_size', '3': 11, '4': 1, '5': 13, '10': 'totalSize'},
    const {'1': 'icon', '3': 12, '4': 1, '5': 9, '10': 'icon'},
    const {'1': 'split_apks', '3': 13, '4': 3, '5': 11, '6': '.proto.ManifestXapk.ApkFile', '10': 'splitApks'},
    const {'1': 'expansions', '3': 14, '4': 3, '5': 11, '6': '.proto.ManifestXapk.ApkExpansion', '10': 'expansions'},
  ],
  '3': const [ManifestXapk_LocalesNameEntry$json, ManifestXapk_ApkFile$json, ManifestXapk_ApkExpansion$json],
  '4': const [ManifestXapk_InstallDir$json],
};

@$core.Deprecated('Use manifestXapkDescriptor instead')
const ManifestXapk_LocalesNameEntry$json = const {
  '1': 'LocalesNameEntry',
  '2': const [
    const {'1': 'key', '3': 1, '4': 1, '5': 9, '10': 'key'},
    const {'1': 'value', '3': 2, '4': 1, '5': 9, '10': 'value'},
  ],
  '7': const {'7': true},
};

@$core.Deprecated('Use manifestXapkDescriptor instead')
const ManifestXapk_ApkFile$json = const {
  '1': 'ApkFile',
  '2': const [
    const {'1': 'id', '3': 1, '4': 1, '5': 9, '10': 'id'},
    const {'1': 'file', '3': 2, '4': 1, '5': 9, '10': 'file'},
  ],
};

@$core.Deprecated('Use manifestXapkDescriptor instead')
const ManifestXapk_ApkExpansion$json


dress elements such as business names and unit, suite or floor numbers should be avoided.
     */
    address?: string | undefined;
    /**
     * The bounding box of the viewport within which to bias geocode results more prominently.
     * This parameter will only influence, not fully restrict, results from the geocoder.
     */
    bounds?: LatLngBounds | undefined;
    /**
     * The language in which to return results.
     *  - If `language` is not supplied, the geocoder attempts to use the preferred language as specified in the `Accept-Language` header,
     *    or the native language of the domain from which the request is sent.
     *  - The geocoder does its best to provide a street address that is readable for both the user and locals.
     *    To achieve that goal, it returns street addresses in the local language, transliterated to a script readable
     *    by the user if necessary, observing the preferred language. All other addresses are returned in the preferred language.
     *    Address components are all returned in the same language, which is chosen from the first component.
     *  - If a name is not available in the preferred language, the geocoder uses the closest match.
     *  - The preferred language has a small influence on the set of results that the API chooses to return,
     *    and the order in which they are returned. The geocoder interprets abbreviations differently depending on language,
     *    such as the abbreviations for street types, or synonyms that may be valid in one language but not in another.
     *    For example, utca and tér are synonyms for street in Hungarian.
     */
    language?: string | undefined;
    /**
     * The region code, specified as a ccTLD ("top-level domain") two-character value.
     * This parameter will only influence, not fully restrict, results from the geocoder.
     */
    region?: string | undefined;
    /**
     * A components filter with elements separated by a pipe (`|`).
     * The components filter is *required* if the request doesn't include an `address`.
     * Each element in the components filter consists of a `component:value` pair, and fully restricts the results from the geocoder.
     */
    components?: GeocodingComponents | undefined;
}

/**
 * Notes about component filtering:
 *
 *  - If the request contains multiple component filters, the API evaluates them as an AND, not an OR.
 *    For example, if the request includes multiple countries `components=country:GB|country:AU`,
 *    the API looks for locations where country=GB AND country=AU, and returns `ZERO_RESULTS`.
 *  - Results are consistent with Google Maps, which occasionally yields unexpected `ZERO_RESULTS` responses.
 *    Using Place Autocomplete may provide better results in some use cases.
 *    To learn more, see [this FAQ](https://developers.google.com/maps/documentation/geocoding/faq#trbl_component_filtering).
 *  - For each address component, either specify it in the `address` parameter or in a `components` filter, but not both.
 *    Specifying the same values in both may result in `ZERO_RESULTS`.
 *
 * A geocode for "High St, Hastings" with `components=country:GB` returns a result


(((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) * z + a[7]) * z + a[8]) / ((((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]) * z + b[7]) * z + b[8]));
   }
}

template <class T, class U, class V>
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<10>*)
{
   if(x <= 1)
     return static_cast<V>((((((((((a[9] * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / (((((((((b[9] * x + b[8]) * x + b[7]) * x + b[6]) * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
   else
   {
      V z = 1 / x;
      return static_cast<V>((((((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) * z + a[7]) * z + a[8]) * z + a[9]) / (((((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]) * z + b[7]) * z + b[8]) * z + b[9]));
   }
}

template <class T, class U, class V>
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<11>*)
{
   if(x <= 1)
     return static_cast<V>(((((((((((a[10] * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]) / ((((((((((b[10] * x + b[9]) * x + b[8]) * x + b[7]) * x + b[6]) * x + b[5]) * x + b[4]) * x + b[3]) * x + b[2]) * x + b[1]) * x + b[0]));
   else
   {
      V z = 1 / x;
      return static_cast<V>(((((((((((a[0] * z + a[1]) * z + a[2]) * z + a[3]) * z + a[4]) * z + a[5]) * z + a[6]) * z + a[7]) * z + a[8]) * z + a[9]) * z + a[10]) / ((((((((((b[0] * z + b[1]) * z + b[2]) * z + b[3]) * z + b[4]) * z + b[5]) * z + b[6]) * z + b[7]) * z + b[8]) * z + b[9]) * z + b[10]));
   }
}

template <class T, class U, class V>
inline V evaluate_rational_c_imp(const T* a, const U* b, const V& x, const mpl::int_<12>*)
{
   if(x <= 1)
     return


false, 30%); }
      &.small { @include reveal-modal-base(false, 40%); }
      &.medium  { @include reveal-modal-base(false, 60%); }
      &.large { @include reveal-modal-base(false, 70%); }
      &.xlarge { @include reveal-modal-base(false, 95%); }
      &.full {
        @include reveal-modal-base(false, 100vw);
        top:0;
        left:0;
        height:100%;
        height: 100vh;
        min-height:100vh;
        max-width: none !important;
        margin-left: 0 !important;
      }

      .#{$close-reveal-modal-class} { @include reveal-close; }
    }

    dialog {
      @extend .#{$reveal-modal-class};
      display: none;

      &::backdrop, & + .backdrop {
        @include reveal-bg(false);
      }

      &[open]{
        display: block;
      }
    }

    // Reveal Print Styles: It should be invisible, adds no value being printed.
    @media print {
      dialog, .#{$reveal-modal-class} {
        display: none;
        background: $white !important;
      }
    }
  }
}
// Foundation by ZURB
// foundation.zurb.com
// Licensed under MIT Open Source

@import "global";

//
// @variables
//
$include-html-dropdown-classes: $include-html-classes !default;

// We use these to controls height and width styles.
$f-dropdown-max-width: 200px !default;
$f-dropdown-height: auto !default;
$f-dropdown-max-height: none !default;

// Used for bottom position
$f-dropdown-margin-top: 2px !default;

// Used for right position
$f-dropdown-margin-left: $f-dropdown-margin-top !default;

// Used for left position
$f-dropdown-margin-right: $f-dropdown-margin-top !default;

// Used for top position
$f-dropdown-margin-bottom: $f-dropdown-margin-top !default;

// We use this to control the background color
$f-dropdown-bg: $white !default;

// We use this to set the border styles for dropdowns.
$f-dropdown-border-style: solid !default;
$f-dropdown-border-width: 1px !default;
$f-dropdown-border-color: scale-color($white, $lightness: -20%) !default;

// We use these to style the triangle pip.
$f-dropdown-triangle-size: 6px !default;
$f-dropdown-triangle-color: $white !default;
$f-dropdown-triangle-side-offset: 10px !default;

// We use these to control styles for the list elements.
$f-dropdown-list-style: none !default;
$f-dropdown-font-color: $charcoal !default;
$f-dropdown-font-size: rem-calc(14) !default;
$f-dropdown-list-padding: rem-calc(5, 10) !default;
$f-dropdown-line-height: rem-calc(18) !default;
$f-dropdown-list-hover-bg: $smoke !default;
$dropdown-mobile-default-float: 0 !default;

// We use this to control the styles for when the dropdown has custom content.
$f-dropdown-content-padding: rem-calc(20) !default;

// Default radius for dropdown.
$f-dropdown-radius: $global-radius !default;

//
// @mixins
//
//
// NOTE: Make default max-width change between list and content types. Can add more width with classes, maybe .small, .medium, .large, etc.;
// We use this to style the dropdown container element.
// $content-list - Sets list-style. Default: list. Options: [list, content]
// $triangle - Sets


ParseCertificate(certDER)
	require.NoError(t, err)
	return cert
}

func x5c(cert *x509.Certificate) string {
	return base64.StdEncoding.EncodeToString(cert.Raw)
}
package bundleutil

import (
	"math"
	"time"

	"github.com/spiffe/go-spiffe/v2/bundle/spiffebundle"
)

const (
	refreshHintLeewayFactor = 10

	// MinimumRefreshHint is the smallest refresh hint the client allows.
	// Anything smaller than the minimum will be reset to the minimum.
	MinimumRefreshHint = time.Minute
)

// CalculateRefreshHint is used to calculate the refresh hint for a given
// bundle. If the bundle already contains a refresh hint, then that is used,
// Otherwise, it looks at the lifetimes of the bundle contents and returns a
// fraction of the smallest. It is fairly aggressive but ensures clients don't
// miss a rotation period and lose their ability to fetch.
// TODO: reevaluate our strategy here when we rework the TTL story inside SPIRE.
func CalculateRefreshHint(bundle *spiffebundle.Bundle) time.Duration {
	if r, ok := bundle.RefreshHint(); ok && r > 0 {
		return safeRefreshHint(r)
	}

	const maxDuration time.Duration = math.MaxInt64

	smallestLifetime := maxDuration
	for _, rootCA := range bundle.X509Authorities() {
		lifetime := rootCA.NotAfter.Sub(rootCA.NotBefore)
		if lifetime < smallestLifetime {
			smallestLifetime = lifetime
		}
	}

	// TODO: look at JWT key lifetimes... requires us to track issued_at dates
	// which we currently do not do.

	// Set the refresh hint to a fraction of the smallest lifetime, if found.
	var refreshHint time.Duration
	if smallestLifetime != maxDuration {
		refreshHint = smallestLifetime / refreshHintLeewayFactor
	}
	return safeRefreshHint(refreshHint)
}

func safeRefreshHint(refreshHint time.Duration) time.Duration {
	if refreshHint < MinimumRefreshHint {
		return MinimumRefreshHint
	}
	return refreshHint
}
package diskcertmanager

import (
	"context"
	"crypto/tls"
	"crypto/x509"
	"crypto/x509/pkix"
	"encoding/pem"
	"fmt"
	"math/big"
	"os"
	"path/filepath"
	"reflect"
	"runtime"
	"strings"
	"testing"
	"time"

	"github.com/sirupsen/logrus"
	"github.com/sirupsen/logrus/hooks/test"
	"github.com/spiffe/spire/pkg/common/x509util"
	"github.com/spiffe/spire/test/clock"
	"github.com/spiffe/spire/test/testkey"
	"github.com/stretchr/testify/require"
)

var (
	oidcServerKey    = testkey.MustEC256()
	oidcServerKeyNew = testkey.MustEC256()

	fileDontExistMessage = "no such file or directory"
)

func TestTLSConfig(t *testing.T) {
	if runtime.GOOS == "windows" {
		// Skip this test on Windows for now
		// https://github.com/spiffe/spire/issues/4324
		t.Skip()
	}
	logger, logHook := test.NewNullLogger()

	clk := clock.NewMock(t)

	oidcServerKeyDer, err := x509.MarshalECPrivateKey(oidcServerKey)
	require.NoError(t, err)

	certTmpl := &x509.Certificate{
		SerialNumber: big.NewInt(0),
		NotAfter:     time.Now().Add(time.Hour),
		Subject: pkix.Name{
			Country:    []string{"BR"},
			CommonName: "oidc-pro


.PushReturn(0.8, nil)       // check
	migrator.ProgressFunc.PushReturn(0.9, nil)       // after up
	migrator.ProgressFunc.SetDefaultReturn(1.0, nil) // after up

	runMigratorWrapped(store, migrator, logger, ticker, func(migrations chan<- Migration) {
		migrations <- Migration{ID: 1, Progress: 0.8}
		tickN(ticker, 5)
	})

	if callCount := len(migrator.UpFunc.History()); callCount != 2 {
		t.Errorf("unexpected number of calls to Up. want=%d have=%d", 2, callCount)
	}
	if callCount := len(migrator.DownFunc.History()); callCount != 0 {
		t.Errorf("unexpected number of calls to Down. want=%d have=%d", 0, callCount)
	}
}

func TestRunMigratorMigrationFinishesDown(t *testing.T) {
	store := NewMockStoreIface()
	logger := logtest.Scoped(t)
	ticker := glock.NewMockTicker(time.Second)

	migrator := NewMockMigrator()
	migrator.ProgressFunc.PushReturn(0.2, nil)       // check
	migrator.ProgressFunc.PushReturn(0.1, nil)       // after down
	migrator.ProgressFunc.SetDefaultReturn(0.0, nil) // after down

	runMigratorWrapped(store, migrator, logger, ticker, func(migrations chan<- Migration) {
		migrations <- Migration{ID: 1, Progress: 0.2, ApplyReverse: true}
		tickN(ticker, 5)
	})

	if callCount := len(migrator.UpFunc.History()); callCount != 0 {
		t.Errorf("unexpected number of calls to Up. want=%d have=%d", 0, callCount)
	}
	if callCount := len(migrator.DownFunc.History()); callCount != 2 {
		t.Errorf("unexpected number of calls to Down. want=%d have=%d", 2, callCount)
	}
}

func TestRunMigratorMigrationChangesDirection(t *testing.T) {
	store := NewMockStoreIface()
	logger := logtest.Scoped(t)
	ticker := glock.NewMockTicker(time.Second)

	migrator := NewMockMigrator()
	migrator.ProgressFunc.PushReturn(0.2, nil) // check
	migrator.ProgressFunc.PushReturn(0.1, nil) // after down
	migrator.ProgressFunc.PushReturn(0.0, nil) // after down
	migrator.ProgressFunc.PushReturn(0.0, nil) // re-check
	migrator.ProgressFunc.PushReturn(0.1, nil) // after up
	migrator.ProgressFunc.PushReturn(0.2, nil) // after up

	runMigratorWrapped(store, migrator, logger, ticker, func(migrations chan<- Migration) {
		migrations <- Migration{ID: 1, Progress: 0.2, ApplyReverse: true}
		tickN(ticker, 5)
		migrations <- Migration{ID: 1, Progress: 0.0, ApplyReverse: false}
		tickN(ticker, 5)
	})

	if callCount := len(migrator.UpFunc.History()); callCount != 5 {
		t.Errorf("unexpected number of calls to Up. want=%d have=%d", 5, callCount)
	}
	if callCount := len(migrator.DownFunc.History()); callCount != 2 {
		t.Errorf("unexpected number of calls to Down. want=%d have=%d", 2, callCount)
	}
}

func TestRunMigratorMigrationDesyncedFromData(t *testing.T) {
	store := NewMockStoreIface()
	logger := logtest.Scoped(t)
	ticker := glock.NewMockTicker(time


lid: {
				style.alpha = (style.color & 0xff) / 0xff;
				style.color = this.rgbaToArgb(style.color);

				fillStyle = new SolidFillStyle(style.color, style.alpha);
				break;
			}
			case FillType.LinearGradient:
			case FillType.RadialGradient:
			case FillType.FocalRadialGradient: {
				const gradientType = style.type === FillType.LinearGradient
					? GradientType.LINEAR
					: GradientType.RADIAL;

				const alphas: number[] = [];
				for (let i = 0; i < style.colors.length; i++) {
					alphas[i] = (style.colors[i] & 0xff) / 0xff;
					style.colors[i] = this.rgbaToArgb(style.colors[i]);
				}

				const awayMatrix = new Matrix(
					style.transform.a,
					style.transform.b,
					style.transform.c,
					style.transform.d,
					style.transform.tx,
					style.transform.ty);

				fillStyle = new GradientFillStyle(
					gradientType,
					style.colors,
					alphas,
					style.ratios,
					awayMatrix,
					style.spreadMethod,
					style.interpolationMode,
					style.focalPoint / 2 | 0);
				break;
			}
			case FillType.ClippedBitmap:
			case FillType.RepeatingBitmap:
			case FillType.NonsmoothedClippedBitmap:
			case FillType.NonsmoothedRepeatingBitmap: {
				const awayMatrix = new Matrix(
					style.transform.a,
					style.transform.b,
					style.transform.c,
					style.transform.d,
					style.transform.tx,
					style.transform.ty);

				fillStyle = new BitmapFillStyle(
					style.material,
					awayMatrix,
					style.repeat,
					style.smooth
				);
				break;
			}
			default: {
				console.error('Unknown style type:', style.type);
			}
		}

		if (isFill) {
			awayStyle = new GraphicsFillStyle(fillStyle);
		} else {
			// TODO: Figure out how to handle startCapsStyle
			const thickness =  (clamp(style.width, 0, 0xff * 20) | 0) / 20;
			const scaleModeAWJ = thickness <= 0.05
				? LineScaleMode.HAIRLINE
				: LineScaleMode.NORMAL;

			if (style.startCapsStyle != style.endCapsStyle) {
				console.log('Warning: different end vs start capstyle');
			}

			style.startCapsStyle = CapsStyle.ROUND;
			style.jointStyle = 0;

			awayStyle = new GraphicsStrokeStyle<IFillStyle>(
				fillStyle,
				thickness,
				style.jointStyle,
				style.startCapsStyle,
				style.miterLimit,
				scaleModeAWJ
			);
		}

		shape.style = awayStyle;
	}

	serializeAJS(shape: GraphicsPath, morphShape: GraphicsPath) {
		//console.log("serializeAJS");
		let segment1 = this.head();

		if (!segment1) {
			// Path is empty.
			return;
		}

		const isFill = !!this.fillStyle;
		const mainStyle = isFill ? this.fillStyle : this.lineStyle;
		const morphStyle = mainStyle.morph;

		this.applyStyle (shape, mainStyle, isFill);

		if (morphStyle && morphShape) {
			this.applyStyle (morphShape, morphStyle, isFill);
		}

		while (segment1) {
			segment1.storeStartAndEnd();
			segment1 = segment1.prev;
		}

		let start = this.head();
		let end = start;

		let finalRoot: PathSegment = null;
		let finalHead: PathSegment = null;

		// Path segments for one style can appear in arbitrary order in the tag's list


final DateTime naive;

  const FeatureChronoTwinSyncSse({
    required this.utc,
    required this.local,
    required this.duration,
    required this.naive,
  });

  @override
  int get hashCode =>
      utc.hashCode ^ local.hashCode ^ duration.hashCode ^ naive.hashCode;

  @override
  bool operator ==(Object other) =>
      identical(this, other) ||
      other is FeatureChronoTwinSyncSse &&
          runtimeType == other.runtimeType &&
          utc == other.utc &&
          local == other.local &&
          duration == other.duration &&
          naive == other.naive;
}

class TestChronoTwinSyncSse {
  final DateTime? dt;
  final DateTime? dt2;
  final Duration? du;

  const TestChronoTwinSyncSse({
    this.dt,
    this.dt2,
    this.du,
  });

  @override
  int get hashCode => dt.hashCode ^ dt2.hashCode ^ du.hashCode;

  @override
  bool operator ==(Object other) =>
      identical(this, other) ||
      other is TestChronoTwinSyncSse &&
          runtimeType == other.runtimeType &&
          dt == other.dt &&
          dt2 == other.dt2 &&
          du == other.du;
}
// This file is automatically generated, so please do not edit it.
// @generated by `flutter_rust_bridge`@ 2.11.1.

import 'dart:io';

// ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import

import '../../frb_generated.dart';
import 'package:collection/collection.dart';
import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart';
import 'package:freezed_annotation/freezed_annotation.dart' hide protected;
import 'rust_opaque_twin_rust_async.dart';
part 'rust_opaque_twin_sync_sse.freezed.dart';

HideDataTwinSyncSse createOpaqueTwinSyncSse() => RustLib.instance.api
    .crateApiPseudoManualRustOpaqueTwinSyncSseCreateOpaqueTwinSyncSse();

HideDataTwinSyncSse? createOptionOpaqueTwinSyncSse(
        {HideDataTwinSyncSse? opaque}) =>
    RustLib.instance.api
        .crateApiPseudoManualRustOpaqueTwinSyncSseCreateOptionOpaqueTwinSyncSse(
            opaque: opaque);

EnumOpaqueTwinSyncSseArray5 createArrayOpaqueEnumTwinSyncSse() => RustLib
    .instance.api
    .crateApiPseudoManualRustOpaqueTwinSyncSseCreateArrayOpaqueEnumTwinSyncSse();

String runEnumOpaqueTwinSyncSse({required EnumOpaqueTwinSyncSse opaque}) =>
    RustLib.instance.api
        .crateApiPseudoManualRustOpaqueTwinSyncSseRunEnumOpaqueTwinSyncSse(
            opaque: opaque);

String runOpaqueTwinSyncSse({required HideDataTwinSyncSse opaque}) =>
    RustLib.instance.api
        .crateApiPseudoManualRustOpaqueTwinSyncSseRunOpaqueTwinSyncSse(
            opaque: opaque);

String runOpaqueWithDelayTwinSyncSse({required HideDataTwinSyncSse opaque}) =>
    RustLib.instance.api
        .crateApiPseudoManualRustOpaqueTwinSyncSseRunOpaqueWithDelayTwinSyncSse(
            opaque: opaque);

HideDataTwinSyncSseArray2 opaqueArrayTwinSyncSse() => RustLib.instance.api
    .crateApiPseudoManualRustOpaque


�가 속도 부스트 (더 역동적인 움직임)
          if (!sameGroup) {
            final random = math.Random();
            final boostFactor =
                0.5 + random.nextDouble() * 0.5; // 0.5-1.0 랜덤 부스트

            velocityX *= boostFactor;
            velocityY *= boostFactor;
            other.velocityX *= boostFactor;
            other.velocityY *= boostFactor;
          }
        }
      } else if (!isDragging()) {
        // 내 노드만 자유롭게 움직이는 경우
        // 다른 그룹이면서 관통 설정이 켜져있으면 약한 충돌
        if (!sameGroup && canPierceOtherGroups && other.canPierceOtherGroups) {
          x += adjustX * 0.3;
          // 속도는 적게 영향받음
          if (overlapWidth < overlapHeight) {
            velocityX *= -0.3;
          } else {
            velocityY *= -0.3;
          }
        } else {
          // 일반 충돌
          x += adjustX;
          y += adjustY;

          // 속도 반전
          if (overlapWidth < overlapHeight) {
            velocityX *= -velocityRestitution;
          } else {
            velocityY *= -velocityRestitution;
          }
        }
      } else if (!other.isDragging()) {
        // 상대 노드만 자유롭게 움직이는 경우
        // 다른 그룹이면서 관통 설정이 켜져있으면 약한 충돌
        if (!sameGroup && canPierceOtherGroups && other.canPierceOtherGroups) {
          other.x -= adjustX * 0.3;
          other.y -= adjustY * 0.3;
          // 속도는 적게 영향받음
          if (overlapWidth < overlapHeight) {
            other.velocityX *= -0.3;
          } else {
            other.velocityY *= -0.3;
          }
        } else {
          // 일반 충돌
          other.x -= adjustX;
          other.y -= adjustY;

          // 상대 속도 반전
          if (overlapWidth < overlapHeight) {
            other.velocityX *= -velocityRestitution;
          } else {
            other.velocityY *= -velocityRestitution;
          }
        }
      }

      // 속도 제한
      limitVelocity();
      other.limitVelocity();
    }
  }

  // 드래그 중인지 확인
  bool isDragging() {
    return !isDraggable;
  }

  // 속도 제한 및 감쇠 메서드 (진동 방지)
  void limitVelocity() {
    // 매우 느린 속도는 0으로 설정 (미세 진동 방지)
    if (velocityX.abs() < 0.05) velocityX = 0;
    if (velocityY.abs() < 0.05) velocityY = 0;

    // 속도 제한
    final speed = math.sqrt(velocityX * velocityX + velocityY * velocityY);
    if (speed > maxVelocity) {
      velocityX = (velocityX / speed) * maxVelocity;
      velocityY = (velocityY / speed) * maxVelocity;
    }
  }
}

import 'bal_consts.dart';

/// ConfiguracoesBalanca é uma classe que representa as configurações de uma balança
///
class ConfiguracoesBalanca {
  late Parity _parity;
  late Handshake _handshake;
  late BaudRate _baudRate;
  late DataBits _dataBits;
  late StopBits _stopBits;
  late ModeloBalanca _modeloBalanc


 "H5", `=PIVOT.VALUE(1,"probability:avg","#foo", 5)`);
    expect(getCellValue(model, "H1")).toBe(11);
    expect(getCellValue(model, "H2")).toBe(15);
    expect(getCellValue(model, "H3")).toBe(10);
    expect(getCellValue(model, "H4")).toBe(95);
    expect(getCellValue(model, "H5")).toBe("");

    // Rows
    setCellContent(model, "I1", `=PIVOT.VALUE(1,"probability:avg","#bar", 1)`);
    setCellContent(model, "I2", `=PIVOT.VALUE(1,"probability:avg","#bar", 2)`);
    setCellContent(model, "I3", `=PIVOT.VALUE(1,"probability:avg","#bar", 3)`);
    expect(getCellValue(model, "I1")).toBe(15);
    expect(getCellValue(model, "I2")).toBe(116);
    expect(getCellValue(model, "I3")).toBe("");
});

test("Can have positional args in pivot headers formula", async function () {
    const { model } = await createSpreadsheetWithPivot();
    // Columns
    setCellContent(model, "H1", `=PIVOT.HEADER(1,"#foo",1)`);
    setCellContent(model, "H2", `=PIVOT.HEADER(1,"#foo",2)`);
    setCellContent(model, "H3", `=PIVOT.HEADER(1,"#foo",3)`);
    setCellContent(model, "H4", `=PIVOT.HEADER(1,"#foo",4)`);
    setCellContent(model, "H5", `=PIVOT.HEADER(1,"#foo",5)`);
    setCellContent(model, "H6", `=PIVOT.HEADER(1,"#foo",5, "measure", "probability:avg")`);
    expect(getCellValue(model, "H1")).toBe(1);
    expect(getCellValue(model, "H2")).toBe(2);
    expect(getCellValue(model, "H3")).toBe(12);
    expect(getCellValue(model, "H4")).toBe(17);
    expect(getCellValue(model, "H5")).toBe("");
    expect(getCellValue(model, "H6")).toBe("Probability");

    // Rows
    setCellContent(model, "I1", `=PIVOT.HEADER(1,"#bar",1)`);
    setCellContent(model, "I2", `=PIVOT.HEADER(1,"#bar",2)`);
    setCellContent(model, "I3", `=PIVOT.HEADER(1,"#bar",3)`);
    setCellContent(model, "I4", `=PIVOT.HEADER(1,"#bar",3, "measure", "probability:avg")`);
    expect(getCellValue(model, "I1")).toBe("No");
    expect(getCellValue(model, "I2")).toBe("Yes");
    expect(getCellValue(model, "I3")).toBe("");
    expect(getCellValue(model, "I4")).toBe("Probability");
});

test("pivot positional with two levels of group bys in rows", async () => {
    const { model } = await createSpreadsheetWithPivot({
        arch: /*xml*/ `
                <pivot>
                    <field name="bar" type="row"/>
                    <field name="product_id" type="row"/>
                    <field name="foo" type="col"/>
                    <field name="probability" type="measure"/>
                </pivot>`,
    });
    // Rows Headers
    setCellContent(model, "H1", `=PIVOT.HEADER(1,"bar","false","#product_id",1)`);
    setCellContent(model, "H2", `=PIVOT.HEADER(1,"bar","true","#product_id",1)`);
    setCellContent(model, "H3", `=PIVOT


swap');
@import url('https://fonts.googleapis.com/css2?family=Source+Code+Pro:wght@300;400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Inconsolata:wght@300;400;500;600;700&display=swap');

/* Pixel & Retro Fonts */
@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Silkscreen:wght@400;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;500;600;700;800&display=swap');

/* Display & Creative Fonts */
@import url('https://fonts.googleapis.com/css2?family=Comfortaa:wght@300;400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Raleway:wght@300;400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@300;400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Quicksand:wght@300;400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&display=swap');

/* Custom Pixel Fonts (fallback to available alternatives) */
@font-face {
    font-family: 'Pixel Operator';
    src: url('data:font/woff2;base64,') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
    /* Fallback to Press Start 2P for pixel fonts */
}

@font-face {
    font-family: 'VCR OSD Mono';
    src: url('data:font/woff2;base64,') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
    /* Fallback to monospace */
}

@font-face {
    font-family: 'Pixel Millennium';
    src: url('data:font/woff2;base64,') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
    /* Fallback to Press Start 2P */
}

@font-face {
    font-family: 'Dogica';
    src: url('data:font/woff2;base64,') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
    /* Fallback to Press Start 2P */
}

/* Global Typography Variables */
:root {
    --global-font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --global-font-size: 16px;
    --global-line-height: 1.6;
    --global-font-weight: 400;
}

/* Apply global typography */
html, body {
    font-family: var(--global-font-family);
    font-size: var(--global-font-size);
    line-height: var(--global-line-height);
    font-weight: var(--global-font-weight);
}

/* Pixel font rendering optimization */
.pixel-font,
[style*="pixel"],
[style*="Press Start"],
[style*="Silkscreen"] {
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    font-smooth: never;
    -webkit-fon


(io::ErrorKind::InvalidData, e))
diff --git a/near-sdk/src/collections/unordered_map/mod.rs b/near-sdk/src/collections/unordered_map/mod.rs
index d3ba8d5..aab31a4 100644
--- a/near-sdk/src/collections/unordered_map/mod.rs
+++ b/near-sdk/src/collections/unordered_map/mod.rs
@@ -512,5 +512,5 @@ mod tests {
         impl BorshDeserialize for DeserializeCounter {
-            fn deserialize(buf: &mut &[u8]) -> std::io::Result<Self> {
+            fn deserialize_reader<R: std::io::Read>(reader: &mut R) -> std::io::Result<Self> {
                 DES_COUNT.fetch_add(1, Ordering::SeqCst);
-                u64::deserialize(buf).map(DeserializeCounter)
+                u64::deserialize_reader(reader).map(DeserializeCounter)
             }
```

## 9. next we encounter an error with `BorshDeserialize` trait derivation (`near-sdk` package):

```bash
 6  error[E0277]: the trait bound `T: Default` is not satisfied
    --> near-sdk/src/store/vec/mod.rs:145:21
     |
 145 |             values: BorshDeserialize::deserialize_reader(reader)?,
     |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Default` is not implemented for `T`
     |
 note: required for `IndexMap<T>` to implement `BorshDeserialize`
    --> near-sdk/src/store/index_map.rs:12:26
     |
 12  | #[derive(BorshSerialize, BorshDeserialize)]
     |                          ^^^^^^^^^^^^^^^^ unsatisfied trait bound introduced in this `derive` macro
 13  | pub(crate) struct IndexMap<T>
     |                   ^^^^^^^^^^^
     = note: this error originates in the derive macro `BorshDeserialize` (in Nightly builds, run with -Z macro-backtrace for more info)
 help: consider further restricting this bound
     |
 140 |     T: BorshSerialize + std::default::Default,
     |                       +++++++++++++++++++++++
```

where `IndexMap<T>` looks like the following:

```rust
#[derive(BorshSerialize, BorshDeserialize)]
pub(crate) struct IndexMap<T>
where
    T: BorshSerialize,
{
    pub(crate) prefix: Box<[u8]>,
    /// Cache for loads and intermediate changes to the underlying index map.
    /// The cached entries are wrapped in a [`Box`] to avoid existing pointers from being
    /// invalidated.
    ///
    /// Note: u32 indices are used over usize to have consistent functionality across architectures.
    /// Some functionality would be different from tests to Wasm if exceeding 32-bit length.
    #[borsh(skip)]
    pub(crate) cache: StableMap<u32, OnceCell<CacheEntry<T>>>,
}
```

On version change `v0.9` -> `v1.0.0-alpha.5` bounds derivation in `borsh` [has changed](https://github.com/near/borsh-rs/pull/178):

From bounds on the types of the fields:

```rust
// cd near-sdk; cargo expand ::store::index_map
impl<T> borsh::de::BorshDeserialize for IndexMap<T>
where
    T: BorshSerialize,
    Box<[u8]>: borsh::BorshDeserialize,
{
    fn deserialize(
        buf: &mut &[u8],
    ) -> ::core::result::Result<Self, borsh::maybestd


0

    Copyright © 2014-2021 AdminLTE.io. All rights reserved.

{% load static %}

<!DOCTYPE html>

        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>{% block title %}{% endblock %}</title>

        <link href="{% static 'assets/css/myStyles.css' %}" rel="stylesheet" />
        <link href="{% static 'assets/css/base.css' %}" rel="stylesheet" />
        <link href="{% static 'assets/css/forms.css' %}" rel="stylesheet" />

        <nav class="sb-topnav navbar navbar-expand navbar-


>

（图片来源网络，侵删）

南京哪里可以领养宠物？

南京警犬基地怎么领养幼犬？

南京孤儿院有健康孩子吗？

动物园认养流程？

南京哪里可以领养宠物？

南京领养宠物在江北有一个专门流浪狗的场所。你可以打听一下具体的位置。那地方有很多的狗，各式各样的。你去领养狗，一定要有爱心。随便的，领一只玩玩。是不可以的。要养老送终。一定要想好了再去领养。不然这只狗狗又变成了流浪狗。给社会添乱

南京警犬基地怎么领养幼犬？

想要领养小警犬需要联系主人的当地公安局警犬基地进行询问，<a href="http://www.to3158.cn/tags-y-b65851ef52a021.html


languages.@count == 0"); // links of a specific relationship are 0
      expect(notSpokenMethod2.length).equals(1);
      expect(notSpokenMethod2[0].name).equals("Latin");
    });
  });
});
import { createUnitStore } from './UnitStore'
import { normalize, denormalize, isCompound as _isCompound, isBase as _isBase, isBase } from './utils'
import { AtomicUnit, FormatOptions, RequiredOptions, ParsedUnit, TypeArithmetics, Unit, Options, UnitFactory, SimplifyOptions, PrefixOptions, symIsDefaultFun } from './types'

/**
 * Create a clone of the this unit factory function, but with the specified options.
 * @param {Object} options Configuration options to set on the new instance.
 * @returns {Function} A new instance of the unit factory function with the specified options.
 */
let _config = function _config<T = number>(options: RequiredOptions<T>): UnitFactory<T> {
  options = { ...options }

 // Check to make sure options are valid

  const validFormatPrefixDefault = ['all', 'none']
  if (options.formatPrefixDefault && !validFormatPrefixDefault.includes(options.formatPrefixDefault)) {
    throw new Error(`Invalid option for formatPrefixDefault: '${options.formatPrefixDefault}'. Valid options are ${validFormatPrefixDefault.join(', ')}`)
  }

  // Check to see if all required options.type functions have been set
  const requiredTypeFns = <const>['conv', 'clone', 'add', 'sub', 'mul', 'div', 'pow']
  let allRequiredTypeFnsPresent = true
  let oneRequiredTypeFnsPresent = false
  for (const fn of requiredTypeFns) {
    if (options.type?.[fn][symIsDefaultFun]) {
      allRequiredTypeFnsPresent = false
    } else {
      oneRequiredTypeFnsPresent = true
    }
  }

  if (oneRequiredTypeFnsPresent) {
    if (!allRequiredTypeFnsPresent) {
      throw new Error(`You must supply all required custom type functions: ${requiredTypeFns.join(', ')}`)
    }

    // Check type functions required for _choosePrefix
    if (options.autoPrefix) {
      const prefixRequiredTypeFns = <const>['lt', 'gt', 'le', 'ge', 'abs']
      let allPrefixRequiredTypeFnsPresent = true
      for (const fn of prefixRequiredTypeFns) {
        if (options.type?.[fn][symIsDefaultFun]) {
          allPrefixRequiredTypeFnsPresent = false
        }
      }
      if (!allPrefixRequiredTypeFnsPresent) {
        throw new Error(`The following custom type functions are required when prefix is true: ${prefixRequiredTypeFns.join(', ')}`)
      }
    }
  }

  Object.freeze(options)

  /**
   * Factory function unitmath returns a new Unit (so that user does not have to use "new" keyword, but we still benefit from using prototypes)
   * @param {Number|String|*} value The `number` to assign to the unit, or a `string` representing the value and the unit string together.
   * @param {String} unitString The unit string, unless already included in the `value` parameter.
   * @returns {Unit} The Unit given by the value and unit string.
   */

  function unitmath(): Unit<T>
  function unitmath(str: string): Unit<T>
  function unitmath(value: number | T | null, unitString?: string): Unit<T>
  function unitmath(value?: any, unitString?: any) {
    let unit = new _Unit(value, unitString)
    Object.freeze(unit)
    return unit
  }

  /**
   * The actual constructor for Unit. Creates a new Unit with the specified value and unit string.
   * @param {Number|String|*} value The `number` to assign to the unit, or a `string` representing the value and the unit string together.
   * @param {String} unitString The unit string, unless already included in the `value` parameter.
   * @returns {_Unit} The Unit giv


._objc_msgSend_155(
        _lib._class_NSCalendarDate1,
        _lib._sel_dateWithTimeInterval_sinceDate_1,
        secsToBeAdded,
        date?._id ?? ffi.nullptr);
    return NSCalendarDate._(_ret, _lib, retain: true, release: true);
  }

  static NSDate? getNow(SwiftLibrary _lib) {
    final _ret =
        _lib._objc_msgSend_156(_lib._class_NSCalendarDate1, _lib._sel_now1);
    return _ret.address == 0
        ? null
        : NSDate._(_ret, _lib, retain: true, release: true);
  }

  static NSObject dateWithNaturalLanguageString_locale_(
      SwiftLibrary _lib, NSString? string, NSObject locale) {
    final _ret = _lib._objc_msgSend_157(
        _lib._class_NSCalendarDate1,
        _lib._sel_dateWithNaturalLanguageString_locale_1,
        string?._id ?? ffi.nullptr,
        locale._id);
    return NSObject._(_ret, _lib, retain: true, release: true);
  }

  static NSObject dateWithNaturalLanguageString_(
      SwiftLibrary _lib, NSString? string) {
    final _ret = _lib._objc_msgSend_30(_lib._class_NSCalendarDate1,
        _lib._sel_dateWithNaturalLanguageString_1, string?._id ?? ffi.nullptr);
    return NSObject._(_ret, _lib, retain: true, release: true);
  }

  static NSObject dateWithString_(SwiftLibrary _lib, NSString? aString) {
    final _ret = _lib._objc_msgSend_30(_lib._class_NSCalendarDate1,
        _lib._sel_dateWithString_1, aString?._id ?? ffi.nullptr);
    return NSObject._(_ret, _lib, retain: true, release: true);
  }

  static NSCalendarDate new1(SwiftLibrary _lib) {
    final _ret =
        _lib._objc_msgSend_2(_lib._class_NSCalendarDate1, _lib._sel_new1);
    return NSCalendarDate._(_ret, _lib, retain: false, release: true);
  }

  static NSCalendarDate alloc(SwiftLibrary _lib) {
    final _ret =
        _lib._objc_msgSend_2(_lib._class_NSCalendarDate1, _lib._sel_alloc1);
    return NSCalendarDate._(_ret, _lib, retain: false, release: true);
  }

  static void cancelPreviousPerformRequestsWithTarget_selector_object_(
      SwiftLibrary _lib,
      NSObject aTarget,
      ffi.Pointer<ObjCSel> aSelector,
      NSObject anArgument) {
    return _lib._objc_msgSend_14(
        _lib._class_NSCalendarDate1,
        _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1,
        aTarget._id,
        aSelector,
        anArgument._id);
  }

  static void cancelPreviousPerformRequestsWithTarget_(
      SwiftLibrary _lib, NSObject aTarget) {
    return _lib._objc_msgSend_15(_lib._class_NSCalendarDate1,
        _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id);
  }

  static bool getAccessInstanceVariablesDirectly(SwiftLibrary _lib) {
    return _lib._objc_msgSend_12(_lib._class_NSCalendarDate1,
        _lib._sel_accessInstanceVariablesDirectly1);
  }

  static bool useStoredAccessor(SwiftLibrary _lib) {
    return _lib._objc_msgSend_12(
        _lib._class_NSCalendarDate1, _lib._sel_useStoredAccessor1);
  }

  static NSSet keyPaths


RITER, DefaultJobRW.IBATIS_BATCH_ITEM_WRITER_CLASS);
		writeTypeDBMap.put(DefaultJobRW.SQL_PARAMETER_JDBC_BATCH_ITEM_WRITER, DefaultJobRW.JDBC_BATCH_ITEM_WRITER_CLASS);
		writeTypeDBMap.put(DefaultJobRW.ITEM_PREPARED_STATEMENT_JDBC_BATCH_ITEM_WRITER, DefaultJobRW.JDBC_BATCH_ITEM_WRITER_CLASS);
		writeTypeDBMap.put(DefaultJobRW.EGOV_ITEM_PREPARED_STATEMENT_JDBC_BATCH_ITEM_WRITER, DefaultJobRW.EGOV_JDBC_BATCH_ITEM_WRITER_CLASS);
		writeTypeDBMap.put(DefaultJobRW.EGOV_CUSTOMIZED_JDBC_BATCH_ITEM_WRITER, DefaultJobRW.EGOV_JDBC_BATCH_ITEM_WRITER_CLASS);
		writeTypeDBMap.put(DefaultJobRW.CUSTOMIZE_DB_WRITER, "");

		return writeTypeDBMap;
	}

	/**
	 * WriterType Detail Type List 생성
	 *
	 * @return
	 */
	private HashMap<String, String> getWriteDetailType(){
		HashMap<String, String> writeDetailType = new HashMap<String, String>();

		writeDetailType.put(DefaultJobRW.DELIMITED_FLAT_FILE_ITEM_WRITER, DefaultJobRW.DELIMITED_WRITER_TYPE);
		writeDetailType.put(DefaultJobRW.FORMATTER_FLAT_FILE_ITEM_WRITER, DefaultJobRW.FORMATTER_FLAT_FILE_ITEM_WRITER_TYPE);
		writeDetailType.put(DefaultJobRW.EGOV_DELIMITED_FLAT_FILE_ITEM_WRITER, DefaultJobRW.DELIMITED_WRITER_TYPE);
		writeDetailType.put(DefaultJobRW.EGOV_FIXED_FLAT_FILE_ITEM_WRITER, DefaultJobRW.EGOV_FIXED_FLAT_FILE_ITEM_WRITER_TYPE);
		writeDetailType.put(DefaultJobRW.DELIMITED_MULTI_RESOURCE_ITEM_WRITER, DefaultJobRW.DELIMITED_MULTI_WRITER_TYPE);
		writeDetailType.put(DefaultJobRW.FORMATTER_MULTI_RESOURCE_ITEM_WRITER, DefaultJobRW.FORMATTER_MULTI_RESOURCE_ITEM_WRITER_TYPE);
		writeDetailType.put(DefaultJobRW.EGOV_DELIMITED_MULTI_RESOURCE_ITEM_WRITER, DefaultJobRW.DELIMITED_MULTI_WRITER_TYPE);
		writeDetailType.put(DefaultJobRW.EGOV_FIXED_MULTI_RESOURCE_ITEM_WRITER, DefaultJobRW.EGOV_FIXED_MULTI_RESOURCE_ITEM_WRITER_TYPE);
		writeDetailType.put(DefaultJobRW.CUSTOMIZE_FILE_WRITER, DefaultJobRW.CUSTOMIZE_FILE_TYPE);

		writeDetailType.put(DefaultJobRW.IBATIS_BATCH_ITEM_WRITER, DefaultJobRW.IBATIS_RW_TYPE);
		writeDetailType.put(DefaultJobRW.SQL_PARAMETER_JDBC_BATCH_ITEM_WRITER, DefaultJobRW.SQL_PARAMETER_JDBC_BATCH_ITEM_WRITER_TYPE);
		writeDetailType.put(DefaultJobRW.ITEM_PREPARED_STATEMENT_JDBC_BATCH_ITEM_WRITER, DefaultJobRW.ITEM_PREPARED_STATEMENT_JDBC_BATCH_ITEM_WRITER_TYPE);
		writeDetailType.put(DefaultJobRW.EGOV_ITEM_PREPARED_STATEMENT_JDBC_BATCH_ITEM_WRITER, DefaultJobRW.EGOV_ITEM_PREPARED_STATEMENT_JDBC_BATCH_ITEM_WRITER_TYPE);
		writeDetailType.put(DefaultJobRW.EGOV_CUSTOMIZED_JDBC_BATCH_ITEM_WRITER, DefaultJobRW.EGOV_CUSTOMIZED_JDBC_BATCH_ITEM_WRITER_TYPE);
		writeDetailType.put(DefaultJobRW.CUSTOMIZE_DB_WRITER, DefaultJobRW.CUSTOM


itiveType.R8:
					return KnownTypeCode.Double;
				case PrimitiveType.U1:
					return KnownTypeCode.Byte;
				case PrimitiveType.U2:
					return KnownTypeCode.UInt16;
				case PrimitiveType.U4:
					return KnownTypeCode.UInt32;
				case PrimitiveType.U8:
					return KnownTypeCode.UInt64;
				case PrimitiveType.I:
					return KnownTypeCode.IntPtr;
				case PrimitiveType.U:
					return KnownTypeCode.UIntPtr;
				default:
					return KnownTypeCode.None;
			}
		}

		public static KnownTypeCode ToKnownTypeCode(this StackType stackType, Sign sign = Sign.None)
		{
			switch (stackType) {
				case StackType.I4:
					return sign == Sign.Unsigned ? KnownTypeCode.UInt32 : KnownTypeCode.Int32;
				case StackType.I8:
					return sign == Sign.Unsigned ? KnownTypeCode.UInt64 : KnownTypeCode.Int64;
				case StackType.I:
					return sign == Sign.Unsigned ? KnownTypeCode.UIntPtr : KnownTypeCode.IntPtr;
				case StackType.F4:
					return KnownTypeCode.Single;
				case S


troduction)
- [Setting up a Node (Express) development environment](/ru/docs/Learn_web_development/Extensions/Server-side/Express_Nodejs/development_environment)
- [Express Tutorial: The Local Library website](/ru/docs/Learn_web_development/Extensions/Server-side/Express_Nodejs/Tutorial_local_library_website)
- [Express Tutorial Part 2: Creating a skeleton website](/ru/docs/Learn_web_development/Extensions/Server-side/Express_Nodejs/skeleton_website)
- [Express Tutorial Part 3: Using a Database (with Mongoose)](/ru/docs/Learn_web_development/Extensions/Server-side/Express_Nodejs/mongoose)
- [Express Tutorial Part 4: Routes and controllers](/ru/docs/Learn_web_development/Extensions/Server-side/Express_Nodejs/routes)
- [Express Tutorial Part 5: Displaying library data](/ru/docs/Learn_web_development/Extensions/Server-side/Express_Nodejs/Displaying_data)
- [Express Tutorial Part 6: Working with forms](/ru/docs/Learn_web_development/Extensions/Server-side/Express_Nodejs/forms)
- [Express Tutorial Part 7: Deploying to production](/ru/docs/Learn/Server-side/Express_Nodejs/deployment)
---
title: Полезные методы для строк
slug: Learn_web_development/Core/Scripting/Useful_string_methods
---

{{LearnSidebar}}

{{PreviousMenuNext("Learn/JavaScript/Первые_шаги/Строки", "Learn/JavaScript/Первые_шаги/Arrays", "Learn/JavaScript/Первые_шаги")}}

Мы рассмотрели базовые понятия, касающиеся строк. Давайте пойдём дальше и рассмотрим, какие полезные операции мы можем выполнять со строками, используя встроенные функции, такие как поиск длины текстовой строки, объединение и разделение строк, замена одного символа из строки другим и многое другое.

| **Необходимые знания:** | Базовая компьютерная грамотность, базовое понимание HTML и CSS, понимание того, что такое JavaScript.                                                  |
| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Задача:**             | Понять, что строки являются объектами, и изучить, как использовать некоторые из основных методов, доступных для этих объектов для управления строками. |

## Строки как объекты

Почти всё в JavaScript является объектами. Когда вы создаёте строку, например:

```
let string = 'This is my string';
```

ваша переменная становится строковым объектом, и, как результат, ей доступно множество свойств и методов. Можете убедиться в этом, перейдя на страницу {{jsxref ("String")}} и просмотрев на ней список свойств и методов!

**Только не волнуйтесь


'<leader>hr', function()
        gs.reset_hunk { vim.fn.line '.', vim.fn.line 'v' }
      end, { desc = 'reset git hunk' })

      map('n', '<leader>hs', gs.stage_hunk, { desc = 'git stage hunk' })
      map('n', '<leader>hr', gs.reset_hunk, { desc = 'git reset hunk' })
      map('n', '<leader>hS', gs.stage_buffer, { desc = 'git Stage buffer' })
      map('n', '<leader>hu', gs.undo_stage_hunk, { desc = 'undo stage hunk' })
      map('n', '<leader>hR', gs.reset_buffer, { desc = 'git Reset buffer' })
      map('n', '<leader>hp', gs.preview_hunk, { desc = 'preview git hunk' })
      map('n', '<leader>hb', function()
        gs.blame_line { full = false }
      end, { desc = 'git blame line' })
      map('n', '<leader>hd', gs.diffthis, { desc = 'git diff against index' })
      map('n', '<leader>hD', function()
        gs.diffthis('~' .. vim.v.count)
      end, { desc = 'git diff against HEAD~[count]' })

      -- Toggles
      map('n', '<leader>tb', gs.toggle_current_line_blame, { desc = 'toggle git blame line' })
      map('n', '<leader>td', gs.toggle_deleted, { desc = 'toggle git show deleted' })

      -- Text object
      map({ 'o', 'x' }, 'ih', ':<C-U>Gitsigns select_hunk<CR>', { desc = 'select git hunk' })
    end,
  },
}


                c: 28
            "n": null
          28:
            a: false
            b:
                - 1
                - 2
                - 3
        - 3:
            c: null
            d: 87
          4:
            e: true
          5:
            f: 4
            g: 5
            h: 6
`,
			targetFactory: func() any { return &nestedMaps{} },
		},
		{
			name:          "with UTF-8 special chars in key",
			input:         "�: 0\n",
			targetFactory: func() any { return &OrderedMap[string, int]{} },
		},
	} {
		t.Run(testCase.name, func(t *testing.T) {
			target := testCase.targetFactory()

			require.NoError(t, yaml.Unmarshal([]byte(testCase.input), target))

			var (
				out []byte
				err error
			)

			out, err = yaml.Marshal(target)

			if assert.NoError(t, err) {
				assert.Equal(t, testCase.input, string(out))
			}
		})
	}
}

func BenchmarkMarshalYAML(b *testing.B) {
	om := New[int, any]()
	om.Set(1, "bar")
	om.Set(7, "baz")
	om.Set(2, 28)
	om.Set(3, 100)
	om.Set(4, "baz")
	om.Set(5, "28")
	om.Set(6, "100")
	om.Set(8, "baz")
	om.Set(8, "baz")

	b.ResetTimer()

	for i := 0; i < b.N; i++ {
		_, _ = yaml.Marshal(om)
	}
}
package main

import (
    "bufio"
    "fmt"
    "os"
    "sort"
    "strconv"
    "strings"
)

// search_count
type Node struct {
    Data     map[string]*Node
    Key      string
    Is_leaf  bool
    Weight   float64
    FullWord string
}

func (n *Node) Init(key string) {
    n.Data = make(map[string]*Node)
    n.Is_leaf = false
    n.Weight = 0
    n.Key = key
    n.FullWord = ""
}

// api for operation
func (n *Node) Has_next() bool {
    return len(n.Data) > 0
}

func (n *Node) AddSubnode(keyword string, subnode *Node) {
    n.Data[keyword] = subnode
}

func (n *Node) GetSubnode(keyword string) *Node {
    return n.Data[keyword]
}

func (n *Node) Get_the_top_node(prefix string) *Node {
    top := n
    for _, c := range prefix {
        top = top.GetSubnode(string(c))
        if top == nil {
            return nil
        }

        //if top.Has_next() {
        //continue
        //} else {
        //break
        //}
    }
    return top
}

// api for sort

type NodeList []*Node

func (nl NodeList) Len() int {
    return len(nl)
}

func (nl NodeList) Less(i, j int) bool {
    return nl[i].Weight > nl[j].Weight
}

func (nl NodeList) Swap(i, j int) {
    nl[i], nl[j] = nl[j], nl[i]
}

// api for search
func Depth_walk(node *Node) map[string]*Node {
    result := make(map[string]*Node)
    if node.Is_leaf {
        result[""] = node
    }

    if node.Has_next() {
        for k, _ := range node.Data {
            s := Depth_walk(node.GetSubnode(k))
            for sk, sv := range s {
                result


;
    margin: 0;
    border-top: 1px solid var(--hairline-color);
    width: 100%;
    box-sizing: border-box;
}

.paginator a:link, .paginator a:visited {
    padding: 2px 6px;
    background: var(--button-bg);
    text-decoration: none;
    color: var(--button-fg);
}

.paginator a.showall {
    border: none;
    background: none;
    color: var(--link-fg);
}

.paginator a.showall:focus, .paginator a.showall:hover {
    background: none;
    color: var(--link-hover-color);
}

.paginator .end {
    margin-right: 6px;
}

.paginator .this-page {
    padding: 2px 6px;
    font-weight: bold;
    font-size: 0.8125rem;
    vertical-align: top;
}

.paginator a:focus, .paginator a:hover {
    color: white;
    background: var(--link-hover-color);
}

.paginator input {
    margin-left: auto;
}

.base-svgs {
    display: none;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
    color: var(--body-fg);
    background-color: var(--body-bg);
}
/*!
 * Bootstrap Utilities v5.3.2 (https://getbootstrap.com/)
 * Copyright 2011-2023 The Bootstrap Authors
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
 */:root,[data-bs-theme=light]{--bs-blue:#0d6efd;--bs-indigo:#6610f2;--bs-purple:#6f42c1;--bs-pink:#d63384;--bs-red:#dc3545;--bs-orange:#fd7e14;--bs-yellow:#ffc107;--bs-green:#198754;--bs-teal:#20c997;--bs-cyan:#0dcaf0;--bs-black:#000;--bs-white:#fff;--bs-gray:#6c757d;--bs-gray-dark:#343a40;--bs-gray-100:#f8f9fa;--bs-gray-200:#e9ecef;--bs-gray-300:#dee2e6;--bs-gray-400:#ced4da;--bs-gray-500:#adb5bd;--bs-gray-600:#6c757d;--bs-gray-700:#495057;--bs-gray-800:#343a40;--bs-gray-900:#212529;--bs-primary:#0d6efd;--bs-secondary:#6c757d;--bs-success:#198754;--bs-info:#0dcaf0;--bs-warning:#ffc107;--bs-danger:#dc3545;--bs-light:#f8f9fa;--bs-dark:#212529;--bs-primary-rgb:13,110,253;--bs-secondary-rgb:108,117,125;--bs-success-rgb:25,135,84;--bs-info-rgb:13,202,240;--bs-warning-rgb:255,193,7;--bs-danger-rgb:220,53,69;--bs-light-rgb:248,249,250;--bs-dark-rgb:33,37,41;--bs-primary-text-emphasis:#052c65;--bs-secondary-text-emphasis:#2b2f32;--bs-success-text-emphasis:#0a3622;--bs-info-text-emphasis:#055160;--bs-warning-text-emphasis:#664d03;--bs-danger-text-emphasis:#58151c;--bs-light-text-emphasis:#495057;--bs-dark-text-emphasis:#495057;--bs-primary-bg-subtle:#cfe2ff;--bs-secondary-bg-subtle:#e2e3e5;--bs-success-bg-subtle:#d1e7dd;--bs-info-bg-subtle:#cff4fc;--bs


rdCharsets
import java.util.*
import javax.crypto.Cipher
import javax.crypto.spec.IvParameterSpec
import javax.crypto.spec.SecretKeySpec

@Converter
class AesConverter(
    @Value("\${app.crypto.key}") private val key: String,
    @Value("\${app.crypto.iv}") private val iv: String,
) : AttributeConverter<String, String> {
    companion object {
        private const val ALGORITHM = "AES/CBC/PKCS5Padding"
    }

    override fun convertToDatabaseColumn(attribute: String?): String? {
        if (attribute == null) {
            return null
        }

        return try {
            val cipher = Cipher.getInstance(ALGORITHM)
            val keySpec = SecretKeySpec(key.toByteArray(), "AES")
            val ivParameterSpec = IvParameterSpec(iv.toByteArray())
            cipher.init(Cipher.ENCRYPT_MODE, keySpec, ivParameterSpec)
            val encrypted = cipher.doFinal(attribute.toByteArray(StandardCharsets.UTF_8))

            Base64.getUrlEncoder().encodeToString(encrypted)
        } catch (e: Exception) {
            throw RuntimeException(e)
        }
    }

    override fun convertToEntityAttribute(dbData: String?): String? {
        if (dbData == null) {
            return null
        }

        return try {
            val cipher = Cipher.getInstance(ALGORITHM)
            val keySpec = SecretKeySpec(key.toByteArray(), "AES")
            val ivParameterSpec = IvParameterSpec(iv.toByteArray())

            cipher.init(Cipher.DECRYPT_MODE, keySpec, ivParameterSpec)

            cipher.doFinal(
                Base64.getUrlDecoder().decode(dbData),
            ).toString(StandardCharsets.UTF_8)
        } catch (e: Exception) {
            throw RuntimeException(e)
        }
    }
}package dev.kkkkkksssssaaaa.practice.realtimealarmsystem.common.auth.service

import dev.kkkkkksssssaaaa.practice.realtimealarmsystem.common.auth.dto.TokenDto
import dev.kkkkkksssssaaaa.practice.realtimealarmsystem.common.auth.enums.Roles
import dev.kkkkkksssssaaaa.practice.realtimealarmsystem.common.auth.enums.TokenType
import dev.kkkkkksssssaaaa.practice.realtimealarmsystem.domain.user.persistance.UserRepository
import jakarta.servlet.http.HttpServletResponse
import org.springframework.http.HttpStatus
import org.springframework.stereotype.Service
import org.springframework.web.server.ResponseStatusException

@Service
class TokenRefreshService(
    private val tokenService: TokenService,
    private val userRepository: UserRepository
) {
    fun doRefresh(
        token: TokenDto,
        servletResponse: HttpServletResponse
    ): TokenDto {
        val user = userRepository.findById(token.userId)
            ?: throw ResponseStatusException(HttpStatus.NOT_FOUND, "Not found user.")

        val accessToken = tokenService.createToken(user.id!!, TokenType.ACCESS, Roles.USER)

        tokenService.setRefreshToken(servletResponse, user.id)

        return accessToken
    }
}package dev.kkkkkksssssaaaa.practice.realtimealarmsystem.domain.user.service

import dev.kkkkkksssssaaaa.practice.realtimealarmsystem.domain.user.dto.UserAccountDto
import dev.kkkkkksssssaaaa.practice.realtimealarmsystem.domain.user.dto.UserDto
import dev.kkkkkksssssaaaa.practice.realtimealarmsystem.domain.user.persistance.UserRepository
import dev.kkkkkksssssaaaa.practice.realtimealarmsystem.domain.user.presentation


_PLAYBACK = 0xffffffff;
    @Unsigned int AUDIO_DEVICE_DEFAULT_RECORDING = 0xfffffffe;
    @Unsigned int AUDIO_MASK_BIG_ENDIAN = 0x1000;
    @Unsigned int AUDIO_MASK_BITSIZE = 0xff;
    @Unsigned int AUDIO_MASK_FLOAT = 0x100;
    @Unsigned int AUDIO_MASK_SIGNED = 0x8000;
    @Unsigned int BIG_ENDIAN = 0x10e1;
    @Unsigned int BUTTON_LMASK = 0x1;
    @Unsigned int BUTTON_MMASK = 0x2;
    @Unsigned int BUTTON_RMASK = 0x4;
    @Unsigned int BUTTON_X1MASK = 0x8;
    @Unsigned int BUTTON_X2MASK = 0x10;
    @Unsigned int CACHELINE_SIZE = 0x80;
    @Unsigned int DEBUG_TEXT_FONT_CHARACTER_SIZE = 0x8;
    @Unsigned int HAPTIC_AUTOCENTER = 0x20000;
    @Unsigned int HAPTIC_CARTESIAN = 0x1;
    @Unsigned int HAPTIC_CONSTANT = 0x1;
    @Unsigned int HAPTIC_CUSTOM = 0x8000;
    @Unsigned int HAPTIC_DAMPER = 0x100;
    @Unsigned int HAPTIC_FRICTION = 0x400;
    @Unsigned int HAPTIC_GAIN = 0x10000;
    @Unsigned int HAPTIC_INERTIA = 0x200;
    @Unsigned int HAPTIC_INFINITY = 0xffffffff;
    @Unsigned int HAPTIC_LEFTRIGHT = 0x800;
    @Unsigned int HAPTIC_PAUSE = 0x80000;
    @Unsigned int HAPTIC_POLAR = 0x0;
    @Unsigned int HAPTIC_RAMP = 0x40;
    @Unsigned int HAPTIC_RESERVED1 = 0x1000;
    @Unsigned int HAPTIC_RESERVED2 = 0x2000;
    @Unsigned int HAPTIC_RESERVED3 = 0x4000;
    @Unsigned int HAPTIC_SAWTOOTHDOWN = 0x20;
    @Unsigned int HAPTIC_SAWTOOTHUP = 0x10;
    @Unsigned int HAPTIC_SINE = 0x2;
    @Unsigned int HAPTIC_SPHERICAL = 0x2;
    @Unsigned int HAPTIC_SPRING = 0x80;
    @Unsigned int HAPTIC_SQUARE = 0x4;
    @Unsigned int HAPTIC_STATUS = 0x40000;
    @Unsigned int HAPTIC_STEERING_AXIS = 0x3;
    @Unsigned int HAPTIC_TRIANGLE = 0x8;
    @Unsigned int HAT_CENTERED = 0x0;
    @Unsigned int HAT_DOWN = 0x4;
    @Unsigned int HAT_LEFT = 0x8;
    @Unsigned int HAT_RIGHT = 0x2;
    @Unsigned int HAT_UP = 0x1;
    @Unsigned int INVALID_UNICODE_CODEPOINT = 0xfffd;
    @Unsigned int JOYSTICK_AXIS_MAX = 0x7fff;
    @Unsigned int LIL_ENDIAN = 0x4d2;
    @Unsigned int MAJOR_VERSION = 0x3;
    @Unsigned int MESSAGEBOX_COLOR_COUNT = 6;
    @Unsigned int MICRO_VERSION = 0xe;
    @Unsigned int MINOR_VERSION = 0x2;
    @Unsigned int MIN_UINT64 = 0x0;
    @Unsigned int MS_PER_SECOND = 0x3e8;
    @Unsigned int NOLONGLONG = 0x1;
    @Unsigned int NS_PER_MS = 0xf4240;
    @Unsigned int NS_PER_US =


 1, start: 0, step: 2);
  setVal(1, 1, start: 1, step: 2);
  setVal(-2, 2, start: 1, end: 2 * numHandles - 2, step: 2);
  setVal(1, 3, start: 0, end: 2 * numHandles - 3, step: 2);
  diag.setValue(Tuple2(2, -2), -1);
  diag.setValue(Tuple2(1, -1), 2);

  var b = Array.zeros(shape: Tuple2(2 * numHandles, 3));
  var pointsWithoutFirst = withoutFirst(points);

  //* equivalent to b[1::2] = 2 * points[1:]
  for (var ij in enumerate((range(start: 1, end: 2 * numHandles, step: 2)))) {
    for (var k in range(end: 3)) {
      b.setValue(Tuple2(ij.item2, k),
          2 * pointsWithoutFirst[ij.item1].getComponent(k));
    }
  }

  //* equivalent to  b[0] = points[0]
  for (var k in range(end: 3)) {
    b.setValue(Tuple2(0, k), points.first.getComponent(k));
  }

  //* equivalent to  b[-1] = points[-1]

  for (var k in range(end: 3)) {
    b.setValue(Tuple2(2 * numHandles - 1, k), points.last.getComponent(k));
  }

  // TODO solve banded matrix instead of using getInverse
  var useClosedSolveFunction = isClosed(points);
  var handlePairs = Array.zeros(shape: Tuple2(2 * numHandles, 3));

  if (useClosedSolveFunction) {
    var matrix = diagToMatrix(Tuple2(l, u), diag);
    for (var i in IterableZip([
      [0, 1, -2, -1],
      [2, -1, 1, -2]
    ])) {
      var k = -1 % matrix.shape.item1;
      var j = i[0] % matrix.shape.item2;
      matrix.setValue(Tuple2(k, j), i[1].toDouble());
    }

    matrix.values = [
      [
        for (var i in range(end: matrix.shape.item2))
          if (i == 0 || i == matrix.shape.item2 - 1) 1 else 0
      ],
      ...withoutFirst(matrix.values)
    ];

    b.values.first = (points[0] * 2.0).toList();
    b.values.last = ORIGIN.toList();

    for (var i in range(end: 3)) {
      handlePairs.setColumn(i, matrix.getInverse().matMul(b).flat());
    }
  } else {
    for (var i in range(end: 3)) {
      handlePairs.setColumn(i, diag.getInverse().matMul(b).flat());
    }
  }

  var handlePairsVectors = [
    for (var line in handlePairs.getValues()) Vector3(line[0], line[1], line[2])
  ];

  var even = handlePairsVectors.whereIndexed((i, e) => i % 2 == 0).toList();
  var odd = handlePairsVectors.whereIndexed((i, e) => i % 2 == 1).toList();

  return Tuple2(even, odd);
}

bool isClosed(List<Vector3> points, {double tolerance = 1e-6}) =>
    (points.first - points.last).normSquared() <= tolerance * tolerance;

// TODO The implementation here could maybe be simpler
Array diagToMatrix(Tuple2<int, int> lAndU, Array diag) {
  var l = lAndU.item1;
  var u = lAndU.item2;
  var dim = 3;
  var matrix = Array.zeros(shape: Tuple2(dim, dim));
  for (var i in range(end: l + u + 1)) {
    var partialMatrixValues = matrix
        .getValues()
        .skip(max(0, i - u))
        .map((line) => line.skip(max(u - i, 0)).toList())
        .toList();
    var partialMatrix = Array(values: par