 KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package ads

import (
	"testing"

	envoy_filters_tcp_proxy "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/network/tcp_proxy/v3"
	"github.com/stretchr/testify/assert"
	"github.com/stretchr/testify/require"
	"google.golang.org/protobuf/types/known/wrapperspb"

	"kmesh.net/kmesh/api/v2/filter"
)

func TestNewFilterTcpProxy(t *testing.T) {
	t.Run("ClusterSpecifier is Cluster", func(t *testing.T) {
		envoyTcpProxy := &envoy_filters_tcp_proxy.TcpProxy{
			StatPrefix: "ut-test",
			MaxConnectAttempts: &wrapperspb.UInt32Value{
				Value: uint32(3),
			},
			ClusterSpecifier: &envoy_filters_tcp_proxy.TcpProxy_Cluster{
				Cluster: "ut-cluster",
			},
		}
		tcpProxy := newFilterTcpProxy(envoyTcpProxy)
		require.NotNil(t, tcpProxy)
		assert.Equal(t, "ut-cluster", tcpProxy.GetCluster())
	})
	t.Run("ClusterSpecifier is WeightedClusters", func(t *testing.T) {
		weightedClusters := []*envoy_filters_tcp_proxy.TcpProxy_WeightedCluster_ClusterWeight{
			{
				Name:   "ut-bar",
				Weight: 1,
			},
			{
				Name:   "ut-baz",
				Weight: 3,
			},
		}
		envoyTcpProxy := &envoy_filters_tcp_proxy.TcpProxy{
			StatPrefix: "ut-test",
			MaxConnectAttempts: &wrapperspb.UInt32Value{
				Value: uint32(3),
			},
			ClusterSpecifier: &envoy_filters_tcp_proxy.TcpProxy_WeightedClusters{
				WeightedClusters: &envoy_filters_tcp_proxy.TcpProxy_WeightedCluster{
					Clusters: weightedClusters,
				},
			},
		}
		tcpProxy := newFilterTcpProxy(envoyTcpProxy)
		require.NotNil(t, tcpProxy)
		weightedClustersSpecifier, ok := tcpProxy.ClusterSpecifier.(*filter.TcpProxy_WeightedClusters)
		require.True(t, ok)
		assert.Equal(t, "ut-bar", weightedClustersSpecifier.WeightedClusters.Clusters[0].Name)
		assert.Equal(t, uint32(1), weightedClustersSpecifier.WeightedClusters.Clusters[0].Weight)
		assert.Equal(t, "ut-baz", weightedClustersSpecifier.WeightedClusters.Clusters[1].Name)
		assert.Equal(t, uint32(3), weightedClustersSpecifier.WeightedClusters.Clusters[1].Weight)
	})
}
/*
 * Copyright The Kmesh Authors.
 *
 * 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:
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package cache

import (
	"testing"

	"github.com/stretchr/testify/assert"
)

func TestEndpointCache(t *testing.T) {
	// Create a sample LocalityCa


/* vim: set expandtab ts=4 sw=4: */
/*
 * You may redistribute this program and/or modify it under the terms of
 * the GNU General Public License as published by the Free Software Foundation,
 * either version 3 of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <https://www.gnu.org/licenses/>.
 */
#ifndef EncodingSchemeModule_H
#define EncodingSchemeModule_H

#ifdef SUBNODE
    #error "this file should not be included in subnode"
#endif

#include "dht/DHTModuleRegistry.h"
#include "memory/Allocator.h"
#include "util/log/Log.h"
#include "util/Linker.h"
Linker_require("dht/EncodingSchemeModule.c")

void EncodingSchemeModule_register(struct DHTModuleRegistry* reg,
                                   struct Log* logger,
                                   struct Allocator* alloc);

#endif


"Named_Boxarts/Star Force (USA) (Beta).png",
  "Named_Boxarts/Star Force (USA).png",
  "Named_Boxarts/Star Gate (1987-09-24)(HAL Kenkyuujo)(JP)[b].png",
  "Named_Boxarts/Star Gate (1987-09-24)(HAL Kenkyuujo)(JP)[h][o][iNES title].png",
  "Named_Boxarts/Star Gate (1987-09-24)(HAL Kenkyuujo)(JP)[h2][o][iNES title].png",
  "Named_Boxarts/Star Gate (1987-09-24)(HAL Kenkyuujo)(JP)[h3][o][iNES title].png",
  "Named_Boxarts/Star Gate (1987-09-24)(HAL Kenkyuujo)(JP)[o][b].png",
  "Named_Boxarts/Star Gate (1987-09-24)(HAL Kenkyuujo)(JP)[o].png",
  "Named_Boxarts/Star Gate (1987-09-24)(HAL Kenkyuujo)(JP)[tr fr KS151][v1.0].png",
  "Named_Boxarts/Star Gate (1987-09-24)(HAL Kenkyuujo)(JP).png",
  "Named_Boxarts/Star Gate (Japan).png",
  "Named_Boxarts/Star Luster (1985-12-06)(Namco)(JP)[h][iNES title].png",
  "Named_Boxarts/Star Luster (1985-12-06)(Namco)(JP).png",
  "Named_Boxarts/Star Luster (1987)(FMG)(JP)[p].png",
  "Named_Boxarts/Star Luster (Japan) (Namco Anthology 1).png",
  "Named_Boxarts/Star Luster (Japan) (Namcot Collection).png",
  "Named_Boxarts/Star Luster (Japan) (Virtual Console).png",
  "Named_Boxarts/Star Luster (Japan).png",
  "Named_Boxarts/Star Soldier (1986-06-13)(Hudson)(JP)[b].png",
  "Named_Boxarts/Star Soldier (1986-06-13)(Hudson)(JP)[b2].png",
  "Named_Boxarts/Star Soldier (1986-06-13)(Hudson)(JP)[o][b2].png",
  "Named_Boxarts/Star Soldier (1986-06-13)(Hudson)(JP).png",
  "Named_Boxarts/Star Soldier (1987)(FMG)(JP)[p].png",
  "Named_Boxarts/Star Soldier (1989-01)(Taxan)(US)[h Vimm][iNES title].png",
  "Named_Boxarts/Star Soldier (1989-01)(Taxan)(US).png",
  "Named_Boxarts/Star Soldier (Japan) (Sample).png",
  "Named_Boxarts/Star Soldier (Japan).png",
  "Named_Boxarts/Star Soldier (USA).png",
  "Named_Boxarts/Star Trek - 25th Anniversary (1992-02)(Ultra Soft)(US)[b].png",
  "Named_Boxarts/Star Trek - 25th Anniversary (1992-02)(Ultra Soft)(US)[b2].png",
  "Named_Boxarts/Star Trek - 25th Anniversary (1992-02)(Ultra Soft)(US)[b3].png",
  "Named_Boxarts/Star Trek - 25th Anniversary (1992-02)(Ultra Soft)(US)[h Vimm][iNES title].png",
  "Named_Boxarts/Star Trek - 25th Anniversary (1992-02)(Ultra Soft)(US).png",
  "Named_Boxarts/Star Trek - 25th Anniversary (Germany).png",
  "Named_Boxarts/Star Trek - 25th Anniversary (USA).png",
  "Named_Boxarts/Star Trek - The Next Generation (1993-09)(Absolute)(US)[h Vimm][iNES title].png",
  "Named_Boxarts/Star Trek - The Next Generation (1993-09)(Absolute)(US).png",
  "Named_Boxarts/Star Trek - The Next Generation


EventV0 encoded) {
    stream.writeString(encoded.doc);
    stream.writeString(encoded.lib);
    stream.writeString(encoded.name);

    int prefixTopicsSize = encoded.prefixTopics.length;
    stream.writeInt(prefixTopicsSize);
    for (int i = 0; i < prefixTopicsSize; i++) {
      stream.writeString(encoded.prefixTopics[i]);
    }

    int paramsSize = encoded.params.length;
    stream.writeInt(paramsSize);
    for (int i = 0; i < paramsSize; i++) {
      XdrSCSpecEventParamV0.encode(stream, encoded.params[i]);
    }

    XdrSCSpecEventDataFormat.encode(stream, encoded.dataFormat);
  }

  static XdrSCSpecEventV0 decode(XdrDataInputStream stream) {
    final doc = stream.readString();
    final lib = stream.readString();
    final name = stream.readString();

    int prefixTopicsSize = stream.readInt();
    List<String> prefixTopics = List<String>.empty(growable: true);
    for (int i = 0; i < prefixTopicsSize; i++) {
      prefixTopics.add(stream.readString());
    }

    int paramsSize = stream.readInt();
    List<XdrSCSpecEventParamV0> params =
        List<XdrSCSpecEventParamV0>.empty(growable: true);
    for (int i = 0; i < paramsSize; i++) {
      params.add(XdrSCSpecEventParamV0.decode(stream));
    }

    final dataFormat = XdrSCSpecEventDataFormat.decode(stream);

    return XdrSCSpecEventV0(doc, lib, name, prefixTopics, params, dataFormat);
  }
}

class XdrSCSpecEntryKind {
  final _value;
  const XdrSCSpecEntryKind._internal(this._value);
  toString() => 'SCSpecEntryKind.$_value';
  XdrSCSpecEntryKind(this._value);
  get value => this._value;

  static const SC_SPEC_ENTRY_FUNCTION_V0 =
      const XdrSCSpecEntryKind._internal(0);
  static const SC_SPEC_ENTRY_UDT_STRUCT_V0 =
      const XdrSCSpecEntryKind._internal(1);
  static const SC_SPEC_ENTRY_UDT_UNION_V0 =
      const XdrSCSpecEntryKind._internal(2);
  static const SC_SPEC_ENTRY_UDT_ENUM_V0 =
      const XdrSCSpecEntryKind._internal(3);
  static const SC_SPEC_ENTRY_UDT_ERROR_ENUM_V0 =
      const XdrSCSpecEntryKind._internal(4);
  static const SC_SPEC_ENTRY_EVENT_V0 = const XdrSCSpecEntryKind._internal(5);

  static XdrSCSpecEntryKind decode(XdrDataInputStream stream) {
    int value = stream.readInt();
    switch (value) {
      case 0:
        return SC_SPEC_ENTRY_FUNCTION_V0;
      case 1:
        return SC_SPEC_ENTRY_UDT_STRUCT_V0;
      case 2:
        return SC_SPEC_ENTRY_UDT_UNION_V0;
      case 3:
        return SC_SPEC_ENTRY_UDT_ENUM_V0;
      case 4:
        return SC_SPEC_ENTRY_UDT_ERROR_ENUM_V0;
      case 4:
        return SC_SPEC_ENTRY_EVENT_V0;
      default:
        throw Exception("Unknown enum value: $value");
    }
  }

  static void encode(XdrDataOutputStream stream, XdrSCSpecEntryKind value) {
    stream.writeInt(value.value);
  }
}

class XdrSCSpecEntry {
  XdrSCSpecEntry(this._kind);
  XdrSCSpecEntryKind _kind;
  XdrSCSpecEntryKind get discriminant => this._kind;
  set discriminant(XdrSCSpecEntryKind value) => this._kind = value;

  XdrSCSpecFunctionV0? _functionV0;
  XdrSCSpecFunctionV0? get functionV0 => this._functionV0;


r nz,seasonsFunc_03_67f8
	ld a,$c7
	ld (wGfxRegs1.WINY),a
	ld (wGfxRegs2.WINY),a
	ld a,$03
	ldh (<hNextLcdInterruptBehaviour),a
	ld a,$02
seasonsFunc_03_67e9:
	ld (wCutsceneState),a
	xor a
	ld ($cfc0),a
	ld b,$10
	ld hl,$cbb3
	jp clearMemory

seasonsFunc_03_67f8:
	ld a,$40
	ld (wGfxRegs2.LYC),a
	ld a,$47
	ld (wGfxRegs2.WINX),a
	ld a,$a5
	ld (wGfxRegs1.WINX),a
	ld a,($cbb8)
	ld (wGfxRegs2.WINY),a
	ld (wGfxRegs1.WINY),a
	ld ($cbbc),a
	jr seasonsFunc_03_684c

incCbb3:
	ld hl,$cbb3
	inc (hl)
	ret

seasonsFunc_03_681a:
	ld a,($cbb7)
	ld hl,seasonsTable_03_6844
	rst_addAToHl
	ld a,(hl)
	cp $ff
	ret z
	ld l,a
	ld h,$d0
	push hl
	ld de,$9c00
	ld bc,$0f02
	call queueDmaTransfer
	pop hl
	set 2,h
	ld e,$01
	call queueDmaTransfer
	ld a,$08
	ld ($cbb8),a
	ld hl,$cbb7
	inc (hl)
	ret

seasonsTable_03_6844:
	.db $c0 $a0 $80 $60
	.db $40 $20 $00 $ff

seasonsFunc_03_684c:
	ld a,$02
	ld ($ff00+R_SVBK),a
	ld a,($cbb8)
	and $07
	ld hl,$d800
	rst_addDoubleIndex
	ld de,$d9e0
	ld b,$10
	call copyMemory
	ld a,($cbb8)
	and $07
	ld hl,$d820
	rst_addDoubleIndex
	ld de,$d9f0
	ld b,$10
	call copyMemory
	ld a,$00
	ld ($ff00+R_SVBK),a
	ld hl,$d9e0
	ld de,$94e1
	ld bc,$0102
	jp queueDmaTransfer

cutsceneHandler_0c_stage2:
	ld a,($cbb3)
	rst_jumpTable
	.dw @state0
	.dw @state1
	.dw @state2

@seasonsFunc_03_688c:
	call disableLcd
	call clearScreenVariablesAndWramBank1
	call incCbb3
	ld bc,ROOM_SEASONS_5d4
	call cutsceneHandler_0c_stage3@loadNewRoom
	ld hl,w1Link.enabled
	ld (hl),$03
	ld l,<w1Link.yh
	ld (hl),$58
	ld l,<w1Link.xh
	ld (hl),$70
	ld l,<w1Link.direction
	ld (hl),$02
	xor a
	ld (wLinkForceState),a
	ld a,$01
	ld (wScreenShakeMagnitude),a
	call resetCamera
	ld a,$02
	jp cutsceneHandler_0c_stage3@state0Func1

@state0:
	ld a,(wPaletteThread_mode)
	or a
	ret nz
	call @seasonsFunc_03_688c
	ld hl,objectData.objectData_insidePirateShipLeavingSubrosia
	jp parseGivenObjectData

@state1:
	ret

@state2:
	ld a,$03
	call seasonsFunc_03_67e9
	jp fadeoutToWhite

cutsceneHandler_0c_stage3:
	ld a,($cbb3)
	rst


ze; i++) {
                int[] block = new int[groupSize];
                // Copy des valeurs suivantes dans un tableau
                System.arraycopy(slope, (2 + i * groupSize), block, 0, groupSize);
                // Clone le tableau et tri le clone pour déterminer les extrema
                int[] blockClone = new int[groupSize];
                System.arraycopy(block, 0, blockClone, 0, groupSize);
                Arrays.sort(blockClone);
                int maxAbs = Math.max(Math.abs(blockClone[0]),
                        Math.abs(blockClone[blockClone.length - 1]));
                // Nombre de bits necessaires = log2(maxAbs)
                // + 1 pour compenser l'arrondi
                // + 1 pour le signe
                int n = (int) (Math.max(0, Math.log(maxAbs) / Math.log(2) + 2));
                NBitArray group = new NBitArray(n, groupSize);
                for (int j = 0; j < groupSize; j++) {
                    group.setValue(block[j], j);
                }
                dos.writeByte(n);
                dos.write(group.getBytes());
            }
            dos.close();
        } catch (Exception e) {
            dos.close();
            throw e;
        }
    }

    /**
     *
Write a GeographicGrid in a Blegg-compressed format.

     *
     * @param gg grid to write.
     * @param os OutputStream
     */
    public static void write(GeographicGrid gg,
                             OutputStream os) throws Exception {

        compress(gg.getValues(), gg.getScale(), 16, gg.getX0(), gg.getY0(),
                gg.getGridWidth(), gg.getGridHeight(), os);
    }

    /**
     * Convert a serial position in the zig-zag compressed file into a
     * line/column position.
     */
    private int[] getPos(int serialNumber, int nbl, int nbc) {
        if (serialNumber >= nbl * nbc) {
            return null;
        }
        int line = serialNumber / nbc;
        int column = line % 2 == 0 ? serialNumber - line * nbc : nbc - 1 - (serialNumber - line * nbc);
        return new int[]{line, column};
    }

    /**
     *
Champ de bits destiné à stocker des entiers sign�s sur une largeur
     * ajustée au plus juste (0 < nombre de bits < 256).
 Une série de n
     * valeurs comprises entre -16 et 15 pourront par exemple être stockées sur
     * n x 5 bits.
 Les bits sont ordonnés des bits de poids faible vers les
     * bits de poids fort. Le dernier bit de chaque groupe est le bit de
     * signe.

     */
    static class NBitArray {

        BitSet bitSet;
        int nbBits;
        int groupSize;

        /**
         * Constructeur
         */
        public NBitArray(int nbBits, int groupSize) throws Exception {
            if (!((groupSize * nbBits) % 8 == 0)) {
                throw new Exception("La taille d'un bloc doit �tre un multiple de 8");
            }
            this.nbBits = nbBits;
            this.groupSize = groupSize;
            bitSet = new BitSet(groupSize * nbBits);
        }

        /**
         *
Retourne la valeur stockée sur nbBits à la position pos.
 La
         * fonction lit nbBits bits.

         */
        public int getValue(int n) {
            return getValue(n, nbBits);
        }

        /**
         *
Retourne la n-ième valeur de size bits de large.

Le
         * premier bit vaut 1 si vrai

Le second vaut 2 si vrai

         *
Le troisieme vaut 4 si vrai

...

Le dernier est
         * le bit de signe


9},{21.79,63.71},{21.79,64.0},{21.72,64.47},{21.66,64.87},{21.62,65.36},{21.6,65.76},{21.6,66.27},{21.6,66.87},{21.6,67.23},{21.48,67.58},{21.36,67.72},{21.27,67.84},{21.08,67.95},{20.7,68.12},{20.49,68.18},{20.28,68.23},{20.02,68.28},{19.56,68.29},{19.28,68.2},{18.95,67.91},{18.69,67.59},{18.26,67.08},{17.98,66.5},{17.83,66.12},{17.71,65.59},{17.63,65.11},{17.63,64.74},{17.78,64.42},{18.01,64.03},{18.17,63.78},{18.3,63.62},{18.57,63.42},{18.87,63.18},{19.12,63.02},{19.25,62.73},{19.38,62.4},{19.62,62.04},{19.79,61.85},{20.05,61.59},{20.38,61.35},{20.76,61.39},{20.91,61.65},{21.02,62.01}}}},394,nil,nil,1979,"H",nil,0},
[26865] = {'Tecahuna',49700,49700,73,73,1,nil,nil,0,nil,nil,14,nil,nil,0},
[26867] = {'Mummy Effect Bunny',4979,4979,60,60,0,{[394]={{70.53,17.2},{70.33,17.22},{70.17,17.37},{70.08,17.63},{70.1,17.91},{70.38,18.29},{70.58,18.27},{70.73,18.1},{70.82,17.84},{70.8,17.56}}},nil,394,nil,nil,35,"AH",nil,0},
[26868] = {'Provisioner Lorkran',4399,4524,73,74,0,{[394]={{22.69,66.17}}},nil,394,{12436},{12436},1979,"H","General Goods",643},
[26869] = {'Pit-Fighting Spectator',4399,4524,73,74,0,{[394]={{22.66,65.64},{23.25,63.93},{23.15,65.97},{23.44,63.95},{23.04,65.91},{23.82,64.83},{22.74,64.63},{23.19,65.87},{22.76,64.55},{22.82,65.77},{23.0,65.85},{23.25,65.94},{23.23,65.51},{22.73,65.63}}},nil,394,nil,nil,1979,"H",nil,0},
[26870] = {'Darkspear Dragon Hunter',8982,9610,70,72,0,{[65]={{47.58,32.23},{47.57,32.77},{47.83,32.27},{47.77,32.77},{47.61,31.85},{47.16,32.38},{47.36,32.94},{47.29,32.77}}},nil,65,nil,nil,1980,"H",nil,0},
[26871] = {'Ancient Drakkari King',1988,1988,73,73,0,nil,nil,0,nil,nil,14,nil,nil,0},
[26872] = {'Weakened Giant',12338,12762,74,75,0,nil,nil,0,nil,nil,1771,"AH",nil,0},
[26873] = {'Mage-Commander Evenstar',7952,7952,73,73,0,{[65]={{40.25,66.87}}},nil,65,{12107,12110},{12098,12106},35,"AH",nil,2},
[26874] = {'Infected Wildlife',1,1,1,1,0


    treeMap.addTemplate("{N|Z[1,2]}月{N|Z[1-3]}{(日|号)}", TIME)

    //日
    treeMap.addTemplate("{N[1,2]}{(日|号)}", TIME)
    treeMap.addTemplate("{Z[1-3]}{(日|号)}", TIME)

    //跨度时间 3天 三天
    treeMap.addTemplate("{N|Z[1-5]}天", TIME)

    //x个月
    treeMap.addTemplate("{N|Z[1-5]}个月", TIME)

    //5周
    treeMap.addTemplate("{N|Z[1-5]}周", TIME)

    treeMap.addTemplate("{Z|N[1-2]}{(点|点钟|点半|点N刻)}", TIME)

    treeMap.addTemplate("{N[1-2]}点{N[1-2]}分", TIME)
    treeMap.addTemplate("{Z[1-3]}点{N[1-3]}分", TIME)

    treeMap.addTemplate("{Z|N[1-3]}{(小时|个小时)}", TIME)
    treeMap.addTemplate("{Z|N[1-3]}{(分|分钟)}", TIME)
    treeMap.addTemplate("{Z|N[1-3]}{(秒|秒钟)}", TIME)

    //数字 正负 整数 浮点数
    treeMap.addTemplate("{N[1-50]}", NUMBER)
    treeMap.addTemplate("-{N[1-50]}", NUMBER)

    treeMap.addTemplate("{Z[1-30]}", NUMBER)
    treeMap.addTemplate("负{Z[1-30]}", NUMBER)

    treeMap.addTemplate("{Z[1-20]}点{N[1,20]}", NUMBER)
    treeMap.addTemplate("负{Z[1-20]}点{N[1,20]}", NUMBER)

    //MQ 数量 一个 一双
    treeMap.addTemplate("{Z|N[1-10]}{(元|串|事|册|丘|下|丈|丝|举|具|包|厘|刀|分|列|则|剂|副|些|匝|队|部|出|个)}", MQ)
    treeMap.addTemplate("{Z|N[1-10]}{(介|令|份|伙|件|任|倍|儋|亩|记|双|发|叠|节|茎|通|造|遍|道)}", MQ)
    treeMap.addTemplate("{Z|N[1-10]}{(遭|对|尊|头|套|弓|引|张|弯|开|庄|床|座|庹|帖|帧|席|常|幅|幢|口|句|号|台|只|吊|合|名)}", MQ)
    treeMap.addTemplate("{Z|N[1-10]}{(吨|和|味|响|骑|门|间|阕|宗|客|家|彪|层|尾|届|声|扎|打|扣|把|抛|批|抔|抱|拨|担|拉|抬)}", MQ)
    treeMap.addTemplate("{Z|N[1-10]}{(拃|挂|挑|挺|捆|掬|排|捧|掐|提|握|摊|摞|撇|


PrimalColumnSteepest(const ClpPrimalColumnSteepest &rhs);

  /// Assignment operator
  ClpPrimalColumnSteepest &operator=(const ClpPrimalColumnSteepest &rhs);

  /// Destructor
  virtual ~ClpPrimalColumnSteepest();

  /// Clone
  virtual ClpPrimalColumnPivot *clone(bool copyData = true) const;

  //@}

  ///@name Private functions to deal with devex
  /** reference would be faster using ClpSimplex's status_,
         but I prefer to keep modularity.
     */
  inline bool reference(int i) const
  {
    return ((reference_[i >> 5] >> (i & 31)) & 1) != 0;
  }
  inline void setReference(int i, bool trueFalse)
  {
    unsigned int &value = reference_[i >> 5];
    int bit = i & 31;
    if (trueFalse)
      value |= (1 << bit);
    else
      value &= ~(1 << bit);
  }
  /// Set/ get persistence
  inline void setPersistence(Persistence life)
  {
    persistence_ = life;
  }
  inline Persistence persistence() const
  {
    return persistence_;
  }

  //@}
  //---------------------------------------------------------------------------

protected:
  ///@name Protected member data
  // Update weight
  double devex_;
  /// weight array
  double *weights_;
  /// square of infeasibility array (just for infeasible columns)
  CoinIndexedVector *infeasible_;
  /// alternate weight array (so we can unroll)
  CoinIndexedVector *alternateWeights_;
  /// save weight array (so we can use checkpoint)
  double *savedWeights_;
  // Array for exact devex to say what is in reference framework
  unsigned int *reference_;
  /** Status
         0) Normal
         -1) Needs initialization
         1) Weights are stored by sequence number
     */
  int state_;
  /**
         0 is exact devex, 1 full steepest, 2 is partial exact devex
         3 switches between 0 and 2 depending on factorization
         4 starts as partial dantzig/devex but then may switch between 0 and 2.
         5 is always partial dantzig
         By partial exact devex is meant that the weights are updated as normal
         but only part of the nonbasic variables are scanned.
         This can be faster on very easy problems.

         New dubious option is >=10 which does mini-sprint

     */
  int mode_;
  /* Infeasibility state i.e. array of infeasibilities and sequenceIn-
	0 - correct
	1 - needs correcting
	2 - not known but column sequence has been chosen
     */
  int infeasibilitiesState_;
  /// Life of weights
  Persistence persistence_;
  /// Number of times switched from partial dantzig to 0/2
  int numberSwitched_;
  // This is pivot row (or pivot sequence round re-factorization)
  int pivotSequence_;
  // This is saved pivot sequence
  int savedPivotSequence_;
  // This is saved outgoing variable
  int savedSequenceOut_;
  // Iteration when last rectified
  int lastRectified_;
  // Size of factorization at invert (used to decide algorithm)
  int sizeFactorization_;
  //@}
};

#endif

/* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2
*/
/* $Id$ */
// Copyright (C) 2000, International Business Machines
// Corporation and others.  All Rights Reserved.
//


LWIMTYP_SPECIAL
LWINF_BUILD                   lwhost.h
LWINF_GETBUILD()
LWINF_GETMAJOR()
LWINF_GETMINOR()
LWINF_MAJORREV
LWINF_MINORREV
LWINF_PRODINSP3D
LWINF_PRODLWAV
LWINF_PRODOTHER
LWINF_PRODUCT
LWINF_RESERVED
LWINIT_PREVIEW                lwrender.h
LWINIT_RENDER
LWINSTUPDATE_GLOBAL           lwhandler.h
LWINTERFACE_VERSION
LWINTERFACEINFO_GLOBAL        lwrender.h
LWIO_ASCII                    lwio.h
LWIO_BINARY
LWIO_BINARY_IFF
LWIO_OBJECT
LWIO_SCENE
LWIP_ASPECT()                 lwimageio.h
LWIP_DONE()
LWIP_FORWARD                  lwrender.h
LWIP_NUMCOLORS()              lwimageio.h
LWIP_PIVOT                    lwrender.h
LWIP_PIVOT_ROT
LWIP_POSITION
LWIP_RIGHT
LWIP_ROTATION
LWIP_SCALING
LWIP_SENDLINE()               lwimageio.h
LWIP_SETMAP()
LWIP_SETPARAM()
LWIP_SETSIZE()
LWIP_UP                       lwrender.h
LWIP_W_FORWARD
LWIP_W_POSITION
LWIP_W_RIGHT
LWIP_W_UP
LWIPT_ANGLE                   lwtxtr.h
LWIPT_DISTANCE
LWIPT_FLOAT
LWIPT_PERCENT
LWISM_BICUBIC                 lwimage.h
LWISM_BILINEAR
LWISM_BSPLINE
LWISM_MEDIAN
LWISM_SUBSAMPLING
LWISM_SUPERSAMPLING
LWITEM_ALL                    lwrender.h
LWITEM_CAUSTICS
LWITEM_NULL
LWITEM_RADIOSITY
LWITEMF_ACTIVE
LWITEMF_FULLTIME_IK
LWITEMF_GOAL_ORIENT
LWITEMF_LOCKED
LWITEMF_REACH_GOAL
LWITEMF_SELECTED
LWITEMF_SHOWCHANNELS
LWITEMF_SHOWCHILDREN
LWITEMF_UNAFFECT_BY_IK
LWITEMINFO_GLOBAL
LWITEMMOTION_HCLASS           lwmotion.h
LWITEMMOTION_ICLASS
LWITEMMOTION_VERSION
LWIVIS_HIDDEN                 lwrender.h
LWIVIS_VISIBLE
LWKEY_BIAS                    lwenvel.h
LWKEY_CONTINUITY
LWKEY_PARAM_0
LWKEY_PARAM_1
LWKEY_PARAM_2
LWKEY_PARAM_3
LWKEY_SHAPE
LWKEY_TENSION
LWKEY_TIME
LWKEY_VALUE
LWLAYOUTGENERIC_CLASS         lwgene


 formNode.ui.choiceList.open === "multiSelect") {
        const value = data[_xfa_object.$getChildren]().map(child => child[_xfa_object.$content].trim()).join("\n");
        formNode[_xfa_object.$setValue](createText(value));
      } else if (this._isConsumeData()) {
        (0, _util.warn)(`XFA - Nodes haven't the same type.`);
      }
    } else if (!data[_xfa_object.$isDataValue]() || this._isMatchTemplate()) {
      this._bindElement(formNode, data);
    } else {
      (0, _util.warn)(`XFA - Nodes haven't the same type.`);
    }
  }
  _findDataByNameToConsume(name, isValue, dataNode, global) {
    if (!name) {
      return null;
    }
    let generator, match;
    for (let i = 0; i < 3; i++) {
      generator = dataNode[_xfa_object.$getRealChildrenByNameIt](name, false, true);
      while (true) {
        match = generator.next().value;
        if (!match) {
          break;
        }
        if (isValue === match[_xfa_object.$isDataValue]()) {
          return match;
        }
      }
      if (dataNode[_xfa_object.$namespaceId] === _namespaces.NamespaceIds.datasets.id && dataNode[_xfa_object.$nodeName] === "data") {
        break;
      }
      dataNode = dataNode[_xfa_object.$getParent]();
    }
    if (!global) {
      return null;
    }
    generator = this.data[_xfa_object.$getRealChildrenByNameIt](name, true, false);
    match = generator.next().value;
    if (match) {
      return match;
    }
    generator = this.data[_xfa_object.$getAttributeIt](name, true);
    match = generator.next().value;
    if (match && match[_xfa_object.$isDataValue]()) {
      return match;
    }
    return null;
  }
  _setProperties(formNode, dataNode) {
    if (!formNode.hasOwnProperty("setProperty")) {
      return;
    }
    for (const {
      ref,
      target,
      connection
    } of formNode.setProperty.children) {
      if (connection) {
        continue;
      }
      if (!ref) {
        continue;
      }
      const nodes = (0, _som.searchNode)(this.root, dataNode, ref, false, false);
      if (!nodes) {
        (0, _util.warn)(`XFA - Invalid reference: ${ref}.`);
        continue;
      }
      const [node] = nodes;
      if (!node[_xfa_object.$isDescendent](this.data)) {
        (0, _util.warn)(`XFA - Invalid node: must be a data node.`);
        continue;
      }
      const targetNodes = (0, _som.searchNode)(this.root, formNode, target, false, false);
      if (!targetNodes) {
        (0, _util.warn)(`XFA - Invalid target: ${target}.`);
        continue;
      }
      const [targetNode] = targetNodes;
      if (!targetNode[_xfa_object.$isDescendent](formNode)) {
        (0, _util.warn)(`XFA - Invalid target: must be a property or subproperty.`);
        continue;
      }
      const targetParent = targetNode[_xfa_object.$getParent]();
      if (targetNode instanceof _template.SetProperty || targetParent instanceof _template.SetProperty) {
        (0, _util.warn)(`XFA - Invalid target: cannot be a setProperty or one of its properties.`);
        continue;
      }
      if (targetNode instanceof _template.BindItems || targetParent instanceof _template.BindItems) {
        (0, _util.warn)(`XFA - Invalid target: cannot be a bindItems or one of its pro


bin-fg: #009999;
    --chroma-literal-number-float-fg: #009999;
    --chroma-literal-number-hex-fg: #009999;
    --chroma-literal-number-integer-fg: #009999;
    --chroma-literal-number-integer-long-fg: #009999;
    --chroma-literal-number-oct-fg: #009999;
    --chroma-operator-fg: #000000;
    --chroma-operator-word-fg: #000000;
    --chroma-comment-fg: #999988;
    --chroma-comment-hashbang-fg: #999988;
    --chroma-comment-multiline-fg: #999988;
    --chroma-comment-single-fg: #999988;
    --chroma-comment-special-fg: #999999;
    --chroma-comment-preproc-fg: #999999;
    --chroma-comment-preproc-file-fg: #999999;
    --chroma-generic-deleted-fg: #000000;
    --chroma-generic-deleted-bg: #ffdddd;
    --chroma-generic-emph-fg: #000000;
    --chroma-generic-error-fg: #aa0000;
    --chroma-generic-heading-fg: #999999;
    --chroma-generic-inserted-fg: #000000;
    --chroma-generic-inserted-bg: #ddffdd;
    --chroma-generic-output-fg: #888888;
    --chroma-generic-prompt-fg: #555555;
    --chroma-generic-subheading-fg: #aaaaaa;
    --chroma-generic-traceback-fg: #aa0000;
    --chroma-text-whitespace-fg: #bbbbbb;

    // Header colors
    --result-header-bg: #f5f8fa;

    // Search input "chip" colors
    // Transparency needs to be added to make the text selection marker visible
    --search-input-token-pattern: #{rgba($gray-04, 0.6)};
    --search-input-token-filter: #{rgba($oc-blue-1, 0.6)};
    --search-input-token-keyword: #{rgba($violet-01, 0.6)};
}

.theme-dark {
    // Affects default browser styles.
    color-scheme: dark;

    --primary-2: #0f59aa;
    --primary-4: #03284f;
    --secondary: var(--gray-08);
    --secondary-2: #242936;
    --secondary-3: #1f232e;
    --secondary-4: #1e222f;
    --success-2: #156724;
    --success-3: #237332;
    --success-4: #054410;
    --info-2: #05454e;
    --info-3: #005766;
    --info-4: #025762;
    --warning-2: #815504;
    --warning-3: #9c6500;
    --warning-4: #3d2904;
    --danger-2: #6b1515;
    --danger-3: #801b1b;
    --danger-4: #3d0a0a;
    --danger-text: var(--oc-red-6);
    --body-color: var(--gray-04);
    --body-bg: var(--gray-12);
    --color-bg-1: var(--gray-11);
    --color-bg-2: var(--gray-10);
    --color-bg-3: var(--gray-08);
    --mark-bg: #7a341e;
    --merged-4: #1f0a5c;
    --text-body: var(--gray-05);
    --text-muted: var(--gray-06);
    --text-muted-highlighted: #a9b9da; // --text-muted with higher contrast when shown on a --mark-


main::after {
    content: " ";
    display: block;
    flex-basis: 100%;
    width: 0.5rem;
  }
  main > * {
    flex-grow: 1;
    margin: 0.5rem;
    max-width: 30rem;
    min-width: 22.5rem;
    width: 24%;
    width: calc(100% / 4 - 1rem);
  }
}
@media not all and (min-width: 60rem) {
  body > header,
  body > footer {
    grid-auto-flow: row;
    justify-content: center;
  }
  body > header > div {
    margin-bottom: 0.75rem;
  }
  main > * {
    margin: 1rem;
  }
  article {
    overflow-x: auto;
    overflow-y: hidden;
  }
}
html,
body {
  height: 100%;
  width: 100%;
}
body {
  font-family: 'Fira Sans Condensed', 'Fira Sans', sans-serif;
  margin: 0;
}
body > header,
body > footer {
  align-items: center;
  background: black;
  color: white;
  display: grid;
  grid-gap: 0.5rem;
  padding: 0.5rem;
  text-align: center;
}
body > header {
  font-size: 80%;
}
body > header img {
  max-height: 5rem;
}
body > header h1 {
  font-size: 1.5rem;
  font-weight: 600;
}
body > header h2 {
  font-size: 1.15rem;
  font-weight: 500;
}
body > header address {
  margin-bottom: 0.25rem;
  margin-top: 0.75rem;
}
body > header .publication-info {
  display: none;
}
body > header time {
  margin-top: 0.25rem;
}
main {
  box-sizing: border-box;
  min-height: 0;
}
main > * {
  box-sizing: border-box;
}
main > figure {
  align-content: center;
  display: flex;
  justify-content: center;
}
main img,
main object {
  align-self: center;
  justify-self: center;
  max-width: 100%;
  vertical-align: middle;
}
main figure {
  text-align: center;
}
main figure img {
  width: 100%;
}
main figure img:first-of-type:last-of-type,
main figure object:first-of-type:last-of-type {
  display: block;
  margin: auto;
}
main figure figcaption {
  display: block;
  margin-top: 0.5rem;
}
article {
  background: #eeeeec;
  display: flex;
  flex-direction: column;
  hyphens: auto;
  line-height: 1.35;
  padding: 0 0.5rem 0.5rem 0.5rem;
}
article p,
article ul,
article ol,
article pre,
article div,
article figure,
article hr {
  margin: 0;
}
article > *,
article > p,
article > ul,
article > ol,
article > pre,
article > div,
article > figure,
article > hr {
  margin: 0.5rem 0 auto 0;
}
article > mjx-container,
article > .MJXc-display,
article > .MJXp-display,
article > .MathJax_Display,
article > .MathJax_Preview,
article > .MathJax_SVG_Display,
article > .MathJax_SVG_Preview,
article > .MathJax_PHTML_Display,
article > .MathJax_PHTML_Preview,
article > .MathJax_MathML {
  /* override MathJaX */
  margin: 0.5rem 0 a


scriptUrl);

  const handleComplete = (data) => {
    let fullAddress = data.address;
    let extraAddress = '';

    if (data.addressType === 'R') {
      if (data.bname !== '') {
        extraAddress += data.bname;
      }
      if (data.buildingName !== '') {
        extraAddress += extraAddress !== '' ? `, ${data.buildingName}` : data.buildingName;
      }
      fullAddress += extraAddress !== '' ? ` (${extraAddress})` : '';
    }

    console.log(fullAddress); // e.g. '서울 성동구 왕십리로2길 20 (성수동1가)'
  };

  const handleClick = () => {
    open({ onComplete: handleComplete });
  };

  return (
    <button type='button' onClick={handleClick}>
      Open
    </button>
  );
};
```

`useDaumPostcodePopup` 실행 시 우편번호 서비스의 스크립트 주소를 전달할 수 있습니다. 반환한 함수를 실행할 때 다음 우편번호 서비스의 생성자 및 팝업 설정값을 전달할 수 있습니다. 전달하지 않은 설정값은 다음 우편번호 서비스의 기본 설정을 따라갑니다.

| name | type | default | description
|:----:|:----:|:-------:|:-----------|
| scriptUrl | `string` | [CURRENT_URL](https://t1.daumcdn.net/mapjsapi/bundle/postcode/prod/postcode.v2.js) | Daum 우편번호 서비스의 스크립트 주소입니다.|
| onComplete | `function` | `undefined` | 우편번호 검색이 끝났을 때 사용자가 선택한 정보를 받아올 콜백함수입니다. 주소 데이터의 구성은 [Daum 가이드](http://postcode.map.daum.net/guide)를 참고해주세요. |
| onSearch | `function` | `undefined` | 주소를 검색할 경우 실행되는 콜백함수입니다. 검색 결과 정보의 구성은 [Daum 가이드](http://postcode.map.da


ersion                      Show the program version"));
  _cupsLangPuts(out, _("-C COUNTRY                     Set country."));
  _cupsLangPuts(out, _("-L LOCALITY                    Set locality name."));
  _cupsLangPuts(out, _("-O ORGANIZATION                Set organization name."));
  _cupsLangPuts(out, _("-R CSR-FILENAME                Specify certificate signing request file."));
  _cupsLangPuts(out, _("-S STATE                       Set state."));
  _cupsLangPuts(out, _("-U ORGANIZATIONAL-UNIT         Set organizational unit name."));
  _cupsLangPuts(out, _("-a SUBJECT-ALT-NAME            Add a subjectAltName."));
  _cupsLangPuts(out, _("-d DAYS                        Set expiration date in days."));
  _cupsLangPuts(out, _("-p PURPOSE                     Comma-delimited certificate purpose\n"
                      "                               (serverAuth, clientAuth, codeSigning, emailProtection, timeStamping, OCSPSigning)"));
  _cupsLangPuts(out, _("-r ROOT-NAME                   Name of root certificate"));
  _cupsLangPuts(out, _("-t TYPE                        Certificate type\n"
                      "                               (rsa-2048, rsa-3072, rsa-4096, ecdsa-p256, ecdsa-p384, ecdsa-p521)"));
  _cupsLangPuts(out, _("-u USAGE                       Comma-delimited key usage\n"
                      "                               (digitalSignature, nonRepudiation, keyEncipherment, dataEncipherment, keyAgreement, keyCertSign, cRLSign, encipherOnly, decipherOnly, default-ca, default-tls)"));

  return (out == stderr);
}


, (Integer) 15);
        splayTree.splay(splayTree.root.right);
        Assert.assertEquals(splayTree.root.value, (Integer) 15);
        Assert.assertEquals(splayTree.root.left.value, (Integer) 10);
    }

    @Test
    public void testSplayZigZig() {
        SplayTree splayTree = new SplayTree();
        Node root = new Node(15, null, null, null);
        splayTree.root = root;
        Node left = new Node(10, root, null, null);
        Node leftleft = new Node(5, left, null, null);
        left.left = leftleft;
        root.left = left;
        splayTree.splay(leftleft);
        Assert.assertEquals(splayTree.root.value, (Integer) 5);
        Assert.assertEquals(splayTree.root.right.value, (Integer) 10);
        Assert.assertEquals(splayTree.root.right.right.value, (Integer) 15);
        splayTree.splay(splayTree.root.right.right);
        Assert.assertEquals(splayTree.root.value, (Integer) 15);
        Assert.assertEquals(splayTree.root.left.value, (Integer) 10);
        Assert.assertEquals(splayTree.root.left.left.value, (Integer) 5);
    }

    @Test
    public void testSplayZigZag() {
        SplayTree splayTree = new SplayTree();
        Node root = new Node(15, null, null, null);
        splayTree.root = root;
        Node left = new Node(10, root, null, null);
        Node leftright = new Node(12, left, null, null);
        left.right = leftright;
        root.left = left;
        // zig zag left-right
        splayTree.splay(leftright);
        Assert.assertEquals(splayTree.root.value, (Integer) 12);
        Assert.assertEquals(splayTree.root.right.value, (Integer) 15);
        Assert.assertEquals(splayTree.root.left.value, (Integer) 10);
        // zig zag from other side (right-left)
        splayTree.root.right.left = new Node(13, splayTree.root.right, null, null);
        splayTree.splay(splayTree.root.right.left);
        Assert.assertEquals(splayTree.root.value, (Integer) 13);
        Assert.assertEquals(splayTree.root.left.value, (Integer) 12);
        Assert.assertEquals(splayTree.root.right.value, (Integer) 15);
    }

}
package org.intelligentjava.algos.simplestructures;

import org.intelligentjava.algos.trees.utils.ArrayUtils;
import org.intelligentjava.algos.trees.utils.HeapUtils;

/**
 * Priority queue implementation.
 *
 * @author Ignas Lelys
 * @created Apr 18, 2011
 *
 */
public class PriorityQueue {

    private int[] heap;

    private int heapSize = 0;

    public PriorityQueue() {
        heap = new int[100];
    }

    public void insertElement(int element) {
        heapSize++;
        heap[heapSize - 1] = Integer.MIN_VALUE;
        changeElementValue(heapSize - 1, element);
    }

    public void changeElementValue(int index, int newValue) {
        if (heap[index] > newValue) {
            throw new RuntimeException("New value is smaller than old one.");
        }
        heap[index] = newValue;
        while (index > 0 && heap[HeapUtils.getParent(index)] < heap[index]) {
            ArrayUtils.swap(heap, index, HeapUtils.getParent(index));
            index = HeapUtils.getParent(index);
        }
    }

    public int getElement() {
        return heap[0];
    }

    public int removeElement() {
        if (heapSize < 1) {
            throw new RuntimeException();
        }
        int maxElement = heap[0];
        heap[0] = heap[heapSize - 1];
        heapSize--;
        HeapUtils.maxHeapify(heap, 0, heapSize);
        return maxElement;
    }

}
pa


abel{color:#fff}.tabulator .tabulator-footer .tabulator-page{color:#333;font-family:inherit;font-weight:inherit;font-size:inherit}.tabulator-row.tabulator-group{min-width:100%;color:#333}.tabulator-row.tabulator-group:hover{cursor:pointer;background-color:rgba(0,0,0,.1)}.tabulator-row.tabulator-group span{color:#666}.tabulator-edit-select-list{background:#fff}.tabulator-edit-select-list .tabulator-edit-select-list-item{color:#666}.tabulator-edit-select-list .tabulator-edit-select-list-item.active{color:#999;background:#444}.tabulator-edit-select-list .tabulator-edit-select-list-item.active.focused{outline:1px solid hsla(0,0%,60%,.5)}.tabulator-edit-select-list .tabulator-edit-select-list-item.focused{outline:1px solid #444}.tabulator-edit-select-list .tabulator-edit-select-list-item:hover{color:#999;background:#666}.tabulator-print-table .tabulator-print-table-group{color:#333}
/*# sourceMappingURL=tabulator_midnight.min.css.map */@import url('https://fonts.googleapis.com/css2?family=Lexend:wght@100;200;300;400;500;600;700;800;900&display=swap')
layer(base);
@import 'tailwindcss';

@custom-variant dark (&:where(.dark, .dark *));

@theme {
  --text-*: initial;
  --text-xs: 0.56rem;
  --text-sm: 0.75rem;
  --text-base: 1rem;
  --text-lg: 1.33rem;
  --text-xl: 1.78rem;
  --text-2xl: 2.37rem;
  --text-3xl: 3.16rem;
  --text-4xl: 4.21rem;
  --text-5xl: 5.61rem;
  --text-6xl: 7.48rem;
  --text-7xl: 9.97rem;

  --color-*: initial;
  --color-dark-content: #edede9;
  --color-dark-content-secondary: #f5ebe0;
  --color-dark-base: #282d2d;

  --color-dark-50: oklch(86.53% 0.00658 197.86);
  --color-dark-100: oklch(82.734% 0.00774 197.677);
  --color-dark-200: oklch(74.93% 0.01127 197.334);
  --color-dark-300: oklch(66.926% 0.01495 197.083);
  --color-dark-400: oklch(58.502% 0.01655 196.932);
  --color-dark-500: oklch(49.381% 0.01357 196.95);
  --color-dark-600: oklch(39.815% 0.01043 196.982);
  --color-dark-700: oklch(29.225% 0.00706 197.034);
  --color-dark-800: oklch(25.207% 0.00587 197.057);
  --color-dark-900: oklch(21.894% 0.00457 197.126);
  --color-dark-950: oklch(19.694% 0.00468 197.044);

  --color-light-content: #272d2d;
  --color-light-content-secondary: #5e503f;
  --color-light-base: #edede9;

  --color-light-50: oklch(97.558% 0.00254 107.115);
  --color-light-100: oklch(94.499% 0.00522 106.819);
  --color-light-200: oklch(87.799% 0.00945 100.101);
  --color-light-300: oklch(80.1% 0.01785 106.882);
  --color-light-400: oklch(71.232% 0.02407 101.539);
  --color-light-500: oklch(64.807% 0.02771 97.319);
  --color-light-600: oklch(60.052% 0.02456 89.876);
  --color-light-700: oklch(52.843% 0.02067 89.451);
  --color-light-800: oklch(46.462% 0


, such as headings, are sized
   * in em all things will be computed relative to that body size.
   */

  --jp-ui-font-scale-factor: 1.2;
  --jp-ui-font-size0: 0.83333em;
  --jp-ui-font-size1: 13px; /* Base font size */
  --jp-ui-font-size2: 1.2em;
  --jp-ui-font-size3: 1.44em;
  --jp-ui-font-family: system-ui, -apple-system, blinkmacsystemfont, 'Segoe UI',
    helvetica, arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji',
    'Segoe UI Symbol';

  /*
   * Use these font colors against the corresponding main layout colors.
   * In a light theme, these go from dark to light.
   */

  /* Defaults use Material Design specification */
  --jp-ui-font-color0: rgba(0, 0, 0, 1);
  --jp-ui-font-color1: rgba(0, 0, 0, 0.87);
  --jp-ui-font-color2: rgba(0, 0, 0, 0.54);
  --jp-ui-font-color3: rgba(0, 0, 0, 0.38);

  /*
   * Use these against the brand/accent/warn/error colors.
   * These will typically go from light to darker, in both a dark and light theme.
   */

  --jp-ui-inverse-font-color0: rgba(255, 255, 255, 1);
  --jp-ui-inverse-font-color1: rgba(255, 255, 255, 1);
  --jp-ui-inverse-font-color2: rgba(255, 255, 255, 0.7);
  --jp-ui-inverse-font-color3: rgba(255, 255, 255, 0.5);

  /* Content Fonts
   *
   * Content font variables are used for typography of user generated content.
   *
   * The font sizing here is done assuming that the body font size of --jp-content-font-size1
   * is applied to a parent element. When children elements, such as headings, are sized
   * in em all things will be computed relative to that body size.
   */

  --jp-content-line-height: 1.6;
  --jp-content-font-scale-factor: 1.2;
  --jp-content-font-size0: 0.83333em;
  --jp-content-font-size1: 14px; /* Base font size */
  --jp-content-font-size2: 1.2em;
  --jp-content-font-size3: 1.44em;
  --jp-content-font-size4: 1.728em;
  --jp-content-font-size5: 2.0736em;

  /* This gives a magnification of about 125% in presentation mode over normal. */
  --jp-content-presentation-font-size1: 17px;
  --jp-content-heading-line-height: 1;
  --jp-content-heading-margin-top: 1.2em;
  --jp-content-heading-margin-bottom: 0.8em;
  --jp-content-heading-font-weight: 500;

  /* Defaults use Material Design specification */
  --jp-content-font-color0: rgba(0, 0, 0, 1);
  --jp-content-font-color1: rgba(0, 0, 0, 0.87);
  --jp-content-font-color2: rgba(0, 0, 0, 0.54);
  --jp-content-font-color3: rgba(0, 0, 0, 0.38);
  --jp-content-link-color: var(--md-blue-900);
  --jp-content-link-visited-color: var(--md-purple-700);
  --jp-content-font-family: system-ui, -apple-system, blinkmacsystemfont,
    'Se


import django.db.models.deletion
import taggit.managers
from django.db import migrations, models

import utilities.json
import utilities.jsonschema

class Migration(migrations.Migration):
    dependencies = [
        ('dcim', '0204_device_role_rebuild'),
        ('extras', '0126_exporttemplate_file_name'),
    ]

    operations = [
        migrations.CreateModel(
            name='ModuleTypeProfile',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False)),
                ('created', models.DateTimeField(auto_now_add=True, null=True)),
                ('last_updated', models.DateTimeField(auto_now=True, null=True)),
                (
                    'custom_field_data',
                    models.JSONField(blank=True, default=dict, encoder=utilities.json.CustomFieldJSONEncoder),
                ),
                ('description', models.CharField(blank=True, max_length=200)),
                ('comments', models.TextField(blank=True)),
                ('name', models.CharField(max_length=100, unique=True)),
                ('schema', models.JSONField(blank=True, null=True, validators=[utilities.jsonschema.validate_schema])),
                ('tags', taggit.managers.TaggableManager(through='extras.TaggedItem', to='extras.Tag')),
            ],
            options={
                'verbose_name': 'module type profile',
                'verbose_name_plural': 'module type profiles',
                'ordering': ('name',),
            },
        ),
        migrations.AddField(
            model_name='moduletype',
            name='attribute_data',
            field=models.JSONField(blank=True, null=True),
        ),
        migrations.AddField(
            model_name='moduletype',
            name='profile',
            field=models.ForeignKey(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.PROTECT,
                related_name='module_types',
                to='dcim.moduletypeprofile',
            ),
        ),
        migrations.AlterModelOptions(
            name='moduletype',
            options={'ordering': ('profile', 'manufacturer', 'model')},
        ),
    ]


_Size() int {
	return m.Size()
}

func (m *MsgDelegateFeedConsent) XXX_DiscardUnknown() {
	xxx_messageInfo_MsgDelegateFeedConsent.DiscardUnknown(m)
}

var xxx_messageInfo_MsgDelegateFeedConsent proto.InternalMessageInfo

// MsgDelegateFeedConsentResponse defines the Msg/DelegateFeedConsent response type.
type MsgDelegateFeedConsentResponse struct{}

func (m *MsgDelegateFeedConsentResponse) Reset()         { *m = MsgDelegateFeedConsentResponse{} }
func (m *MsgDelegateFeedConsentResponse) String() string { return proto.CompactTextString(m) }
func (*MsgDelegateFeedConsentResponse) ProtoMessage()    {}
func (*MsgDelegateFeedConsentResponse) Descriptor() ([]byte, []int) {
	return fileDescriptor_ade38ec3545c6da7, []int{5}
}

func (m *MsgDelegateFeedConsentResponse) XXX_Unmarshal(b []byte) error {
	return m.Unmarshal(b)
}

func (m *MsgDelegateFeedConsentResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	if deterministic {
		return xxx_messageInfo_MsgDelegateFeedConsentResponse.Marshal(b, m, deterministic)
	} else {
		b = b[:cap(b)]
		n, err := m.MarshalToSizedBuffer(b)
		if err != nil {
			return nil, err
		}
		return b[:n], nil
	}
}

func (m *MsgDelegateFeedConsentResponse) XXX_Merge(src proto.Message) {
	xxx_messageInfo_MsgDelegateFeedConsentResponse.Merge(m, src)
}

func (m *MsgDelegateFeedConsentResponse) XXX_Size() int {
	return m.Size()
}

func (m *MsgDelegateFeedConsentResponse) XXX_DiscardUnknown() {
	xxx_messageInfo_MsgDelegateFeedConsentResponse.DiscardUnknown(m)
}

var xxx_messageInfo_MsgDelegateFeedConsentResponse proto.InternalMessageInfo

func init() {
	proto.RegisterType((*MsgAggregateExchangeRatePrevote)(nil), "terra.oracle.v1beta1.MsgAggregateExchangeRatePrevote")
	proto.RegisterType((*MsgAggregateExchangeRatePrevoteResponse)(nil), "terra.oracle.v1beta1.MsgAggregateExchangeRatePrevoteResponse")
	proto.RegisterType((*MsgAggregateExchangeRateVote)(nil), "terra.oracle.v1beta1.MsgAggregateExchangeRateVote")
	proto.RegisterType((*MsgAggregateExchangeRateVoteResponse)(nil), "terra.oracle.v1beta1.MsgAggregateExchangeRa


ndom since only 1/4 of selections remain
        index++;
      }
      this.chosenPassage = newRangeOfPassage[index].content;
    }
  }
  onSelectFiction(genre: string): void {
    if (this.selectedGenre == null) {
      this.selectedGenre = 'Fiction';
      var newRangeOfPassage: Passage[] = new Array(25);
      var k = 0;//keeps count of which index of the passage range I'm on
      for (var i = 0; i < 100; i++) {
        if (myHundredPassage[i].writingGenre == this.selectedGenre && k < 25) {
          newRangeOfPassage[k] = myHundredPassage[i];
          k++;
        }
      }

      var randomNumber = Math.random();
      var theRandomNumber = randomNumber * 100;
      var chosenNumber = Math.round(theRandomNumber);
      var upperBound = 4;
      var index = 0;
      while (chosenNumber >= upperBound) {
        upperBound += 4;//4 because each Passage has 4 times the probability of being selected at random since only 1/4 of selections remain
        index++;
      }
      this.chosenPassage = newRangeOfPassage[index].content;
    }
  }
  finishedTyping(): void {
    if (this.isButtonPressed != true) {
      this.isButtonPressed = true;

      var wordSplitOriginalPassage = this.chosenPassage.split(" ");
      var inputValue = (<HTMLInputElement>document.getElementById("userInput")).value;
      var wordSplitTypedPassage = inputValue.split(" ");

      var countCorrectWords = 0;
      var countTotalWords = wordSplitOriginalPassage.length;
      try {
        for (var i = 0; i < wordSplitTypedPassage.length; i++) {
          if (wordSplitOriginalPassage[i] == wordSplitTypedPassage[i])
            countCorrectWords++;
        }
      }
      catch (e)//if the original passage is shorter than the input passage
      {
        for (var i = wordSplitOriginalPassage.length; i < wordSplitTypedPassage.length; i++) {
          countTotalWords++;//only increment the total words because having more words always means they are incorrect
        }
      }
      this.accuracy = countCorrectWords / countTotalWords * 100;

      var elapsedTimeInMilliseconds = new Date().getTime() - this.start;
      var elapsedTimeinMinutes = elapsedTimeInMilliseconds / 60000;// millisecond -> second is 1000, second -> minute is 60
      var wordCount = wordSplitTypedPassage.length;
      this.wordPerMinute = wordCount / elapsedTimeinMinutes;
      //backend add to typers collection
      this.typerService.selectedTyper = {
        accuracy: this.accuracy,
        wpmSpeed: this.wordPerMinute
      }
      this.typerService.postTyper(this.typerService.selectedTyper).subscribe((res) => {
      });
      //backend assign avgTyper data to be outputted in html
      this.typerService.getAverageTyper().subscribe((res) => {
        this.averageTyper = res as Typer;
      });

    }
  }
  reset(): void{
    this.typerService.selectedTyper = {
      accuracy: null,
      wpmSpeed: null
    }
  }
}
import { Either } from '@xroom.app/data-types/lib/either'
import { Option } from '@xroom.app/data-types/lib/option'
import { Json } from '@xroom.app/data-types/lib/json'
import { ValidateError } from './errors'
import { Tuple } from './util'

// SECTION Types

/** Possible property types */
type PropType = 'optional' | 'required'

/** Standard unknown value validator */
export type Validator<T> = ValidatorExtension<Option<Json>, T>

/** Result of validation - array of errors or value of type T */
export type ValidationResult<T> = Either<Readonly


 .event-date-time {
		float: right;
		max-width: 39%;
	}

	.community-events .event-date,
	.community-events .event-time {
		text-align: right;
	}
}
/*! This file is auto-generated */
html{background:#fff;margin:0 2rem}body{background:#fff;border:0;color:#3c434a;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;margin:0 auto;padding:4rem 0;max-width:700px;-webkit-font-smoothing:subpixel-antialiased}a{color:#2271b1}a:active,a:hover{color:#135e96}a:focus{color:#043959;box-shadow:0 0 0 1px #4f94d4,0 0 2px 1px rgba(79,148,212,.8)}h1,h2{border-bottom:1px solid #dcdcde;clear:both;color:#646970;font-size:calc(2rem + ((1vw - .48rem) * -.4167));padding:0 0 7px;font-weight:400}h3{font-size:calc(1.5rem + ((1vw - .48rem) * -.2778))}dd,dt,li,p{padding-bottom:.5rem;font-size:calc(1.2rem + ((1vw - .48rem) * -.1389));line-height:1.8}.code,code{font-family:Consolas,Monaco,monospace}dl,ol,ul{padding:.5rem .5rem .5rem 2rem}a img{border:0}abbr{border:0;font-variant:normal}fieldset{border:0;padding:0;margin:0}label{cursor:pointer}#logo{margin:0 auto 25px;padding:0 0 25px;width:84px;height:84px;overflow:hidden;background-image:url(../images/cp-logo-aqua.png?ver=202303);background-image:none,url(../images/classicpress-logo.svg?ver=202303);background-size:84px;background-position:center top;background-repeat:no-repeat;color:#3c434a;font-size:20px;font-weight:400;line-height:1.3em;text-decoration:none;text-align:center;text-indent:-9999px;outline:0;border:0}.step{margin:20px 0 15px}.step,th{text-align:left;padding:0}.language-chooser.wp-core-ui .step .button.button-large{font-size:14px}textarea{border:1px solid #dcdcde;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;width:100%;box-sizing:border-box}.form-table{border-collapse:collapse;margin-top:1em;width:100%}.form-table td{margin-bottom:9px;padding:10px 20px 10px 0;font-size:14px;vertical-align:top}.form-table th{font-size:14px;text-align:left;padding:10px 20px 10px 0;width:140px;vertical-align:top}.form-table code{line-height:1.28571428;font-size:14px}.form-table p{margin:4px 0 0;font-size:11px}.form-table input{line-height:1.33333333;font-size:15px;padding:3px 5px}input,submit{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif}#pass-strength-result,.form-table input[type=email],.form-table input[type=password],.form-table input[type=text],.form-table input[type=url]{width:218px}.form-table th p{font-weight:400}.form-table.install-success td,.form-table.install-success th{vertical-align:middle;padding:16px 20px 16px 0}.form-ta


.GetKeyStore()
}
package web

import (
	"encoding/json"
	"net/http"
	"testing"

	"github.com/pkg/errors"
	"github.com/stretchr/testify/assert"
	"go.uber.org/zap"

	"github.com/smartcontractkit/chainlink/v2/core/logger"
	"github.com/smartcontractkit/chainlink/v2/plugins"
)

type responseWriter struct {
	statusCode int
	header     http.Header
}

func (r *responseWriter) Write(b []byte) (int, error) {
	return 0, errors.New("could not write to response")
}

func (r *responseWriter) Header() http.Header {
	return http.Header{}
}

func (r *responseWriter) WriteHeader(statusCode int) {
	r.statusCode = statusCode
}

func newResponseWriter() *responseWriter {
	return &responseWriter{header: make(http.Header)}
}

func TestLoopRegistryServer_CantWriteToResponse(t *testing.T) {
	l, o := logger.TestLoggerObserved(t, zap.ErrorLevel)
	s := &LoopRegistryServer{
		exposedPromPort: 1,
		registry:        plugins.NewLoopRegistry(l),
		logger:          l.(logger.SugaredLogger),
		jsonMarshalFn:   json.Marshal,
	}

	rw := newResponseWriter()
	s.discoveryHandler(rw, &http.Request{})
	assert.Equal(t, rw.statusCode, http.StatusInternalServerError)
	assert.Equal(t, 1, o.FilterMessageSnippet("could not write to response").Len())
}

func TestLoopRegistryServer_CantMarshal(t *testing.T) {
	l, o := logger.TestLoggerObserved(t, zap.ErrorLevel)
	s := &LoopRegistryServer{
		exposedPromPort: 1,
		registry:        plugins.NewLoopRegistry(l),
		logger:          l.(logger.SugaredLogger),
		jsonMarshalFn: func(any) ([]byte, error) {
			return []byte(""), errors.New("can't unmarshal")
		},
	}

	rw := newResponseWriter()
	s.discoveryHandler(rw, &http.Request{})
	assert.Equal(t, rw.statusCode, http.StatusInternalServerError)
	assert.Equal(t, 1, o.FilterMessageSnippet("could not write to response").Len())
}
package web

import (
	"database/sql"
	"fmt"
	"net/http"
	"regexp"

	"github.com/smartcontractkit/chainlink/v2/core/auth"
	"github.com/smartcontractkit/chainlink/v2/core/bridges"
	"github.com/smartcontractkit/chainlink/v2/core/logger/audit"
	"github.com/smartcontractkit/chainlink/v2/core/services/chainlink"
	"github.com/smartcontractkit/chainlink/v2/core/store/models"
	"github.com/smartcontractkit/chainlink/v2/core/web/presenters"

	"github.com/gin-gonic/gin"
	"github.com/pkg/errors"
)

var (
	externalInitiatorNameRegexp = regexp.MustCompile("^[a-zA-Z0-9-_]+$")
)

// ValidateExternalInitiator checks whether External Initiator parameters are
// safe for processing.
func ValidateExternalInitiator(
	exi *bridges.ExternalInitiatorRequest,
	orm bridges.ORM,
) error {
	fe := models.NewJSONAPIErrors()
	if len([]rune(exi.Name)) == 0 {
		fe.Add("No name specified")
	} else if !externalInitiatorNameRegexp.MatchString(exi.Name) {
		fe.Add("Name must be alphanumeric and may contain '_' or '-'")
	} else if _, err := orm.FindExternalInitiatorByName(exi.Name); err == nil {
		fe.Add(fmt.Sprintf("Name %v already exists", ex


        break;

    case ALIGN_RIGHT:
        xContent = x + (w - wContent);
        break;
    }

    // Align the content area vertically
    int yContent = 0;

    switch (mVerticalAlign)
    {
    case VERTICAL_ALIGN_TOP:
        yContent = y;
        break;

    case VERTICAL_ALIGN_CENTER:
        yContent = y + (h - hContent) / 2;
        break;

    case VERTICAL_ALIGN_BOTTOM:
        yContent = y + (h - hContent);
        break;
    }

    // Place the image and the text
    int xImage = 0;
    int yImage = 0;
    int xText = 0;
    int yText = 0;

    switch (mImagePosition)
    {
    case IMAGE_POSITION_LEFT:
        xImage = xContent;
        yImage = yContent + (hContent - hImage) / 2;
        xText = xContent + wImage + wGap;
        yText = yContent + (hContent - hText) / 2;
        break;

    case IMAGE_POSITION_TOP:
        xImage = xContent + (wContent - wImage) / 2;
        yImage = yContent;
        xText = xContent + (wContent - wText) / 2;
        yText = yContent + hImage + hGap;
        break;

    case IMAGE_POSITION_RIGHT:
        xImage = xContent + wText + wGap;
        yImage = yContent + (hContent - hImage) / 2;
        xText = xContent;
        yText = yContent + (hContent - hText) / 2;
        break;

    case IMAGE_POSITION_BOTTOM:
        xImage = xContent + (wContent - wImage) / 2;
        yImage = yContent + hText + hGap;
        xText = xContent + (wContent - wText) / 2;
        yText = yContent;
        break;
    }

    // Paint the background
    DrawBackground(hDC);

    // Clip the content area
    IntersectClipRect(hDC, x, y, x + w, y + h);

    // Paint the image
    if (mImage)
    {
        DrawImage(hDC, xImage, yImage);
    }

    // Paint the text
    if (StrLen(mText) > 0)
    {
        DrawText(hDC, xText, yText);
    }
}

void Label::ReadConfig()
{
    // Layout
    mAlign = GetRCEnum("TutorialAlign", gAlignEnum);
    mImagePosition = GetRCEnum("TutorialImagePosition", gImagePositionEnum);
    mImageTextGap = GetRCInt("TutorialImageTextGap", 4);
    mPaddingLeft = GetRCInt("TutorialPaddingLeft", 0);
    mPaddingTop = GetRCInt("TutorialPaddingTop", 0);
    mPaddingRight = GetRCInt("TutorialPaddingRight", 0);
    mPaddingBottom = GetRCInt("TutorialPaddingBottom", 0);
    mVerticalAlign = GetRCEnum("TutorialVerticalAlign", gVerticalAlignEnum);

    // Content
    TCHAR imageFile[MAX_PATH];

    GetRCString("TutorialImage", imageFile, NULL, MAX_PATH);
    mImage = LoadLSImage(imageFile, NULL);
    GetRCString("TutorialText", mText, NULL, MAX_TEXT);

    // Position and Size
    mAlwaysOnTop = GetRCBoolDef("TutorialAlwaysOnTop", FALSE);
    mVisible = !GetRCBoolDef("TutorialStartHidden", FALSE);
    mX = GetRCInt("TutorialX", 0);
    mY = GetRCInt("TutorialY", 0);
    mWidth = GetRCInt("TutorialWidth", 64);
    mHeight = GetRCInt("TutorialHeight", 64


Dao;
    @Resource
    ParameterDao parameterDao;

    public void installMinicap(AdbDevice device) {
        if (device == null) {
            logTools.printLog("没有找到ADB设备！","error");
        }

//        if (isMinicapInstalled(device)) {
//            logTools.printLog("手机已安装MINICAP","info");
//            return;
//        }
        //先删除手机里存在的minicap文件，避免手机升级等因素造成minicap不匹配
        deviceListenerService.executeShellCommand(device.getIDevice(),MINICAP_CLEAR_COMMAND);
        String sdk = device.getProperty(Constant.PROP_SDK);
        String abi = device.getProperty(Constant.PROP_ABI);
        sdk = sdk.trim();
        abi = abi.trim();
        // minicap
        File minicap_bin = getMinicap(abi);
        if (minicap_bin == null || !minicap_bin.exists()) {
            logTools.printLog("没有找到对应的MINICAP BIN文件！","error");
        }
        try {
            deviceListenerService.executePushFile(device.getIDevice(), minicap_bin.getAbsolutePath(), REMOTE_PATH + "/" + MINICAP_BIN);
        } catch (Exception e) {
            logTools.printLog("MINICAP BIN文件推送手机设备失败！","error");
        }

        // minicap.so
        File minicap_so = getMinicapSo(abi, sdk);
        if (minicap_so == null || !minicap_so.exists()) {
            logTools.printLog("没有找到对应的MINICAP SO文件！","error");
        }

        try {
            deviceListenerService.executePushFile(device.getIDevice(), minicap_so.getAbsolutePath(), REMOTE_PATH + "/" + MINICAP_SO);
        } catch (Exception e) {
            logTools.printLog("MINICAP SO文件推送手机设备失败！","error");
        }
        //等待MINICAP文件传到手机中再继续
        boolean minicap_exist = false;
        while(!minicap_exist){
            String minicapbin = deviceListenerService.executeShellCommand(device.getIDevice(), " ls " + REMOTE_PATH + " | grep " + MINICAP_BIN);
            String minicapso = deviceListenerService.executeShellCommand(device.getIDevice(), " ls " + REMOTE_PATH + " | grep " + MINICAP_SO);
            if(minicapbin!=null && minicapbin.contains(MINICAP_BIN) && minicapso!=null && minicapso.contains(MINICAP_SO)){
                minicap_exist=true;
            }
        }
        deviceListenerService.executeShellCommand(device.getIDevice(), "chmod 777 " + REMOTE_PATH + "/" + MINICAP_BIN);
    }

    public boolean isMinicapInstalled(AdbDevice device) {
        if (device == null || device.getIDevice() == null) {
            return false;
        }
        String minicapbin = deviceListenerService.executeShellCommand(device.getIDevice(), " ls " + REMOTE_PATH + " | grep " + MINICAP_BIN);
        String minicapso = deviceListenerService.executeShellCommand(device.getIDevice(), " ls " + REMOTE_PATH + " | grep " + MINICAP_SO);

//        String s = deviceListenerService.executeShellCommand(device.getIDevice(), String.format("LD_LIBRARY_PATH=%s %s/%s -i", REMOTE_PATH, REMOTE_PATH, MINICAP_BIN));
        if(minicapbin!=null && minicapbin.contains(MINICAP_BIN) && minicapso!=null && minicapso.contains(MINICAP_SO)){
           return  true;
        }else{
            return false;
        }
    }

    public File getMinicap(String abi) {
        List<Map<String, Object>> paramlist = parameterDao.getParamByName(Constant.MINIPATH);
        String miniPath = (String) paramlist.get(0).get("value")


alizationSettings('ic_launcher');

  const InitializationSettings initializationSettings = InitializationSettings(
      android: initializationSettingsAndroid,
      iOS: DarwinInitializationSettings());

  await LocalNotificationService.flutterLocalNotificationsPlugin.initialize(
    initializationSettings,
    onDidReceiveNotificationResponse:
        LocalNotificationService.handleNotificationTap,
  );

  // Check for notification launch in terminated state
  final NotificationAppLaunchDetails? notificationAppLaunchDetails =
      await LocalNotificationService.flutterLocalNotificationsPlugin
          .getNotificationAppLaunchDetails();

  final didNotificationLaunchApp =
      notificationAppLaunchDetails?.didNotificationLaunchApp ?? false;

  if (didNotificationLaunchApp &&
      notificationAppLaunchDetails?.notificationResponse != null) {
    // Save for later use
    NotificationLaunchHandler.pendingNotificationResponse =
        notificationAppLaunchDetails!.notificationResponse;
  }

  try {
    print('Firebase initialized. BEFORE TRY');
    await Firebase.initializeApp(
      options: DefaultFirebaseOptions.currentPlatform,
    );
    print('Firebase initialized successfully.');
  } catch (e) {
    print('Firebase initialization failed: $e');
  }

  runApp(const MyApp());
}

class MyApp extends StatefulWidget {
  const MyApp({super.key});

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      supportedLocales: const [
        Locale('en'),
        Locale('en', 'GB'),
        Locale('ar'),
        Locale('de'),
        Locale('es'),
        Locale('fr'),
        Locale('hi'),
        Locale('hu'),
        Locale('ja'),
        Locale('ko'),
        Locale('lt'),
        Locale('ms'),
        Locale('nl'),
        Locale('pt'),
        Locale('ru'),
        Locale('sv'),
        Locale('tr'),
        Locale('zh'),
        Locale('zh', 'TW'),
      ],
      localizationsDelegates: const [
        cc.Translations.delegate,
        GlobalMaterialLocalizations.delegate,
        GlobalWidgetsLocalizations.delegate,
        GlobalCupertinoLocalizations.delegate,
      ],
      theme: ThemeData(
        appBarTheme: AppBarTheme(
          scrolledUnderElevation: 0.0,
        ),
      ),
      title: 'CometChat Flutter Sample App',
      navigatorKey: CallNavigationContext.navigatorKey,
      home: GuardScreen(),
      debugShowCheckedModeBanner: false,
    );
  }
}
import 'dart:async';
import 'dart:io';

import 'package:flutter/foundation.dart';
import 'package:flutter/services.dart' hide MessageHandler;

class ApnsRemoteMessage {
  ApnsRemoteMessage.fromMap(this.payload);

  final Map<String, dynamic> payload;

  String? get actionIdentifier => UNNotificationAction.getIdentifier(payload);
}

typedef ApnsMessageHandler = Future<void> Function(ApnsRemoteMessage);
typedef WillPresentHandler = Future<bool> Function(ApnsRemoteMessage);

enum ApnsAuthorizationStatus {
  authorized,
  denied,
  notDetermined,
  unsupported,
}

class ApnsPushConnectorOnly {
  final MethodChannel _channel = () {
    assert(Platform.isIOS,
        'ApnsPushConnectorOnly can only be created on iOS platform!');
    return const MethodChannel('flutter_apns');
  }();
  ApnsMessageHandler? _onMessage;
  ApnsMessageHandler? _onLaunch;


">§
fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more

source§
impl<T> DeserializeOwned for Twhere
    T: for<'de> Deserialize<'de>,

{% extends "base.html" %}

{% block title %} Index Page ! {% endblock title %}

{% block content %}

Index Page

        {% for person in people %}

{{ person.name }}  <button onclick="delete_person({{ person.pid }})">Delete</button>Details

        {% endfor %}

    <form action="{{ url_for('index') }}" method='POST'>
        <input type='text' name='name' placeholder='Name' required>

        <input type='number' name='age' placeholder='Age'>

        <input type='text' name='job' placeholder='Job'>

        <input type='submit' value='Send'>
    </form>


>AR, cmd->Address);
        }
      }
      else
      {
        /*---- Command with only data phase ----*/
        if (cmd->DataMode != QSPI_DATA_NONE)
        {
          /* Configure QSPI: CCR register with all communications parameters */
          WRITE_REG(hqspi->Instance->CCR, (cmd->DdrMode | cmd->DdrHoldHalfCycle | cmd->SIOOMode |
                                           cmd->DataMode | (cmd->DummyCycles << POSITION_VAL(QUADSPI_CCR_DCYC)) |
                                           cmd->AlternateByteMode | cmd->AddressMode |
                                           cmd->InstructionMode | FunctionalMode));
        }
      }
    }
  }
}

/**
  * @}
  */

#endif /* HAL_QSPI_MODULE_ENABLED */
/**
  * @}
  */

/**
  * @}
  */

/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/


ags
	add r2, sp, #0
	mov r0, r5
	mov r1, #0x59
	bl GetExclusiveItemWithEffectFromBag
	add r1, sp, #0
	mov r0, #1
	bl PrepareItemForPrinting__02345728
	ldr r2, _023024DC ; =0x00000C39
	mov r0, r6
	mov r1, r5
	bl LogMessageByIdWithPopupCheckUserTarget
_023024AC:
	mov r0, #1
	b _023024D4
_023024B4:
	mov r0, r6
	mov r1, r5
	mov r2, r4
	bl ov29_02301A84
	cmp r0, #0
	movne r0, #1
	moveq r0, #0
	and r0, r0, #0xff
_023024D4:
	add sp, sp, #8
	ldmia sp!, {r4, r5, r6, pc}
	.align 2, 0
#ifdef JAPAN
_023024DC: .word 0x00000978
#else
_023024DC: .word 0x00000C39
#endif
	arm_func_end IsProtectedFromNegativeStatus

	arm_func_start ov29_023024E0
ov29_023024E0: ; 0x023024E0
	stmdb sp!, {r3, r4, r5, lr}
	mov r4, r1
	mov r1, #7
	mov r5, r0
	bl IqSkillIsEnabled
	cmp r0, #0
	bne _02302534
	cmp r4, #0
	beq _02302518
	mov r0, r5
	mov r1, #1
	bl IsBlinded
	cmp r0, #0
	bne _0230252C
_02302518:
	ldr r0, [r5, #0xb4]
	ldrb r0, [r0, #0xd0]
	cmp r0, #2
	cmpne r0, #4
	bne _02302534
_0230252C:
	mov r0, #1
	ldmia sp!, {r3, r4, r5, pc}
_02302534:
	mov r0, #0
	ldmia sp!, {r3, r4, r5, pc}
	arm_func_end ov29_023024E0

	arm_func_start AddExpSpecial
AddExpSpecial: ; 0x0230253C
#ifdef JAPAN
#define ADD_EXP_SPECIAL_OFFSET -4
#else
#define ADD_EXP_SPECIAL_OFFSET 0
#endif
	stmdb sp!, {r3, r4, r5, r6, r7, lr}
	mov r7, r1
	ldr r5, [r7, #0xb4]
	mov r6, r2
	mov r0, r5
	bl IsExperienceLocked
	cmp r0, #0
	ldmneia sp!, {r3, r4, r5, r6, r7, pc}
	ldrb r0, [r5, #0xa]
	cmp r0, #0x64
	bne _02302580
	cmp r6, #0
	ldrgt r0, _023026B4 ; =DUNGEON_PTR
	movgt r1, #1
	ldrgt r0, [r0]
	strgtb r1, [r0, #0xf]
	ldmia sp!, {r3, r4, r5, r6, r7, pc}
_02302580:
	ldr r2, [r5, #0x20]
	mov r0, r7
	mov r1, #0x1c
	add r4, r2, r6
	bl IqSkillIsEnabled
	cmp r0, #0
	beq _023025C0
	ldr r0, _023026B8 ; =EXP_ELITE_EXP_BOOST
	mov r1, #0x64
	ldrsh r0, [r0]
	mov r0, r0, lsl #8
	bl _s


copper pieces or 100 gems or any combination.\nNote that only valuable metals (copper, silver, electrum, gold, platinum, etc.) and gems (and jewelry, of course) are located. The potion won\'t locate worthless metals or magical items which don\'t contain precious metals or gems. The imbiber of the potion can "feel\'\' the direction in which the treasure lies, but not its distance.\nIntervening substances other than special magical wards or lead-lined walls will not withstand the powers that the liquor bestows upon the individual. The effects of the potion last for 5d4 rounds.}}{{use=Press the *Duration* button and select the creature drinking the potion (requires rounds to be counted in the Turn Order, which can be incremented using the *Maintenance Menu*.}}{{materials=Potion}}'},
						{name:'Potion-of-Undead-Control',type:'Potion',ct:'2+1d4',charge:'charged',cost:'0',body:'\\amp{template:'+fields.potionTemplate+'}{{title=Potion of Undead Control}}{{splevel=Potion}}{{school=Enchantment/Charm}}Specs=[Potion of Undead Control,Potion,1H,Enchantment-Charm]{{components=M}}{{time=1 to drink\n1+1d4 to take effect}}PotionData=[sp:2+1d4,rc:charged]{{range=[120 yards](!rounds --aoe @{selected|token_id}|circle|yards|0|120|120|magic|true)}}{{duration=[5d4 rounds](!rounds --target area|@{selected|token_id}|\\amp#64;{target|Select Undead to control|token_id}|Potion of Undead Control|\\amp#91;[5d4]\\amp#93;|-1|Charmed by @{selected|character_name}|chained-heart)}}{{aoe=16HD of Undead}}{{save=Special}}{{effects=Gives the imbiber the ability to charm undead. The charm ability is similar to the 1st-level wizard spell, *charm person*. It affects a maximum of 16 Hit Dice of undead, rounding down any hit point additions to the lowest die (e.g., 4 + 1 equals 4 Hit Dice). The undead are entitled to saving throws vs. spell only if they have intelligence. Saving throws are rolled with -2 penalties due to the power of the potion; the effects wear off in 5d4 rounds. To determine the type of undead\naffected by a particular potion, roll 1d10 and consult the following table:\n\\amplt;table\\ampgt;\\amplt;tr\\ampgt;\\amplt;th scope="col"\\ampgt;D10 Roll\\amplt;/th\\ampgt;\\amplt;th scope="col"\\ampgt;Undead Type\\amplt;/th\\ampgt;\\amplt;/tr\\ampgt;\\amplt;tr\\ampgt;\\amplt;td\\ampgt;1\\amplt;/td\\ampgt;\\amplt;td\\ampgt;Ghasts\\amplt;/td\\ampgt;\\amplt;/tr\\ampgt;\\amplt;tr\\ampgt;\\amplt;td\\ampgt;2\\amplt;/td\\ampgt;\\amplt;td\\ampgt;Ghosts\\amplt;/td\\ampgt;\\amplt;/tr\\ampgt;\\amplt;tr\\ampgt;\\amplt;td\\ampgt;3\\amplt;/td\\ampgt;\\amplt;td\\ampgt;Ghouls\\amplt;/td\\ampgt;\\amplt;/tr\\ampgt;\\amplt;tr\\ampgt;\\amplt;td\\ampgt;4\\amplt;/td\\ampgt;\\amplt;td\\ampgt;Shadows\\amplt;/td\\ampgt;\\amplt;/tr\\ampgt;\\amplt;tr\\ampgt;\\amplt;td\\


" height="256" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path fill="currentColor" d="M219.3 211.9 168.8 73l7.6-21h7.6a12 12 0 000-24H88a12 12 0 00-12 12 11.9 11.9 0 0010.9 11.9l-58.2 160a12.1 12.1 0 007.2 15.4 11.8 11.8 0 004.1.7 12 12 0 0011.3-7.9L60 196h38.5l-5.8 15.9a12.1 12.1 0 007.2 15.4 11.8 11.8 0 004.1.7 12 12 0 0011.3-7.9l17.5-48.1h46.4l17.5 48.1A12 12 0 00208 228a11.8 11.8 0 004.1-.7 12.1 12.1 0 007.2-15.4ZM124.7 124H86.2l8.8-24h38.4Zm17.4-48h-38.4l8.7-24h38.5Zm-73.3 96 8.7-24H116l-8.8 24Zm72.7-24 14.5-39.9 14.5 39.9Z"/></svg>';
  static const String ladder_duotone =
      '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="256" height="256" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path fill="currentColor" d="M215.5 213.3 164.5 73l9.1-25H184a8 8 0 000-16H88a8 8 0 000 16h4.6L32.5 213.3a7.9 7.9 0 004.8 10.2 8.6 8.6 0 002.7.5 7.9 7.9 0 007.5-5.3l9.7-26.7h47l-7.7 21.3a7.9 7.9 0 004.8 10.2 8.6 8.6 0 002.7.5 7.9 7.9 0 007.5-5.3L130 168h52l18.5 50.7a7.9 7.9 0 007.5 5.3 8.6 8.6 0 002.7-.5 7.9 7.9 0 004.8-10.2Zm-88-85.3h-47l11.6-32h47Zm29.1-80-11.7 32H98l11.6-32ZM63.1 176l11.6-32h47L110 176Zm72.7-24L156 96.4l20.2 55.6Z"/></svg>';
  static const String ladder_fill =
      '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="256" height="256" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path fill="currentColor" d="M215.5 213.3 164.5 73l9.1-25H184a8 8 0 000-16H88a8 8 0 000 16h4.6L32.5 213.3a7.9 7.9 0 004.8 10.2 8.6 8.6 0 002.7.5 7.9 7.9 0 007.5-5.3l9.7-26.7h47l-7.7 21.3a7.9 7.9 0 004.8 10.2 8.6 8.6 0 002.7.5 7.9 7.9 0 007.5-5.3L130 168h52l18.5 50.7a7.9 7.9 0 007.5 5.3 8.6 8.6 0 002.7-.5 7.9 7.9 0 004.8-10.2Zm-88-85.3h-47l11.6-32h47Zm29.1-80-11.7 32H98l11.6-32ZM63.1 176l11.6-32h47L110 176Zm72.7-24L156 96.4l20.2 55.6Z"/></svg>';
  static const String ladder_light =
      '<svg xmlns="htt


(Ø)))
@JvmName("b50d5") operator fun F<T<F<F<T<T<Ø>>>>>>.div(d: T<F<T<Ø>>>) = F(T(F(T(Ø))))
@JvmName("b50d10") operator fun F<T<F<F<T<T<Ø>>>>>>.div(d: F<T<F<T<Ø>>>>) = T(F(T(Ø)))
@JvmName("b50d25") operator fun F<T<F<F<T<T<Ø>>>>>>.div(d: T<F<F<T<T<Ø>>>>>) = F(T(Ø))
@JvmName("b51d3") operator fun T<T<F<F<T<T<Ø>>>>>>.div(d: T<T<Ø>>) = T(F(F(F(T(Ø)))))
@JvmName("b51d17") operator fun T<T<F<F<T<T<Ø>>>>>>.div(d: T<F<F<F<T<Ø>>>>>) = T(T(Ø))
@JvmName("b52d13") operator fun F<F<T<F<T<T<Ø>>>>>>.div(d: T<F<T<T<Ø>>>>) = F(F(T(Ø)))
@JvmName("b52d26") operator fun F<F<T<F<T<T<Ø>>>>>>.div(d: F<T<F<T<T<Ø>>>>>) = F(T(Ø))
@JvmName("b54d3") operator fun F<T<T<F<T<T<Ø>>>>>>.div(d: T<T<Ø>>) = F(T(F(F(T(Ø)))))
@JvmName("b54d6") operator fun F<T<T<F<T<T<Ø>>>>>>.div(d: F<T<T<Ø>>>) = T(F(F(T(Ø))))
@JvmName("b54d9") operator fun F<T<T<F<T<T<Ø>>>>>>.div(d: T<F<F<T<Ø>>>>) = F(T(T(Ø)))
@JvmName("b54d18") operator fun F<T<T<F<T<T<Ø>>>>>>.div(d: F<T<F<F<T<Ø>>>>>) = T(T(Ø))
@JvmName("b54d27") operator fun F<T<T<F<T<T<Ø>>>>>>.div(d: T<T<F<T<T<Ø>>>>>) = F(T(Ø))
@JvmName("b55d5") operator fun T<T<T<F<T<T<Ø>>>>>>.div(d: T<F<T<Ø>>>) = T(T(F(T(Ø))))
@JvmName("b55d11") operator fun T<T<T<F<T<T<Ø>>>>>>.div(d: T<T<F<T<Ø>>>>) = T(F(T(Ø)))
@JvmName("b56d7") operator fun F<F<F<T<T<T<Ø>>>>>>.div(d: T<T<T<Ø>>>) = F(F(F(T(Ø))))
@JvmName("b56d14") operator fun F<F<F<T<T<T<Ø>>>>>>.div(d: F<T<T<T<Ø>>>>) = F(F(T(Ø)))
@JvmName("b56d28") operator fun F<F<F<T<T<T<Ø>>>>>>.div(d: F<F<T<T<T<Ø>>>>>) = F(T(Ø))
@JvmName("b57d3") operator fun T<F<F<T<T<T<Ø>>>>>>.div(d: T<T<Ø>>) = T(T(F(F(T(Ø)))))
@JvmName("b57d19") operator fun T<F<F<T<T<T<Ø>>>>>>.div(d: T<


nolint:staticcheck // ignore SA1019: Non-distributable layers are deprecated, and not recommended for future use.
		return Gzip, nil
	case ocispecs.MediaTypeImageLayerZstd, ocispecs.MediaTypeImageLayerNonDistributableZstd: //nolint:staticcheck // ignore SA1019: Non-distributable layers are deprecated, and not recommended for future use.
		return Zstd, nil
	default:
		return nil, errors.Errorf("unsupported media type %s", mediaType)
	}
}

func IsMediaType(ct Type, mt string) bool {
	mt, ok := toOCILayerType[mt]
	if !ok {
		return false
	}
	return mt == ct.MediaType()
}

// DetectLayerMediaType returns media type from existing blob data.
func DetectLayerMediaType(ctx context.Context, cs content.Store, id digest.Digest, oci bool) (string, error) {
	ra, err := cs.ReaderAt(ctx, ocispecs.Descriptor{Digest: id})
	if err != nil {
		return "", err
	}
	defer ra.Close()

	ct, err := detectCompressionType(io.NewSectionReader(ra, 0, ra.Size()))
	if err != nil {
		return "", err
	}

	switch ct {
	case Uncompressed:
		if oci {
			return ocispecs.MediaTypeImageLayer, nil
		}
		return images.MediaTypeDockerSchema2Layer, nil
	case Gzip, EStargz:
		if oci {
			return ocispecs.MediaTypeImageLayerGzip, nil
		}
		return images.MediaTypeDockerSchema2LayerGzip, nil

	default:
		return "", errors.Errorf("failed to detect layer %v compression type", id)
	}
}

// detectCompressionType detects compression type from real blob data.
func detectCompressionType(cr *io.SectionReader) (Type, error) {
	var buf [10]byte
	var n int
	var err error

	if n, err = cr.Read(buf[:]); err != nil && err != io.EOF {
		// Note: we'll ignore any io.EOF error because there are some
		// odd cases where the layer.tar file will be empty (zero bytes)
		// and we'll just treat it as a non-compressed stream and that
		// means just create an empty layer.
		//
		// See issue docker/docker#18170
		return nil, err
	}

	if _, _, err := estargz.OpenFooter(cr); err == nil {
		return EStargz, nil
	}

	for c, m := range map[Type][]byte{
		Gzip: {0x1F, 0x8B, 0x08},
		Zstd: {0x28, 0xB5, 0x2F, 0xFD},
	} {
		if n < len(m) {
			continue
		}
		if bytes.Equal(m, buf[:len(m)]) {
			return c, nil
		}
	}

	return Uncompressed, nil
}

var toDockerLayerType = map[string]string{
	ocispecs.MediaTypeImageLayer:                     images.MediaTypeDockerSchema2Layer,
	images.MediaTypeDockerSchema2Layer:               images.MediaTypeDockerSchema2Layer,
	ocispecs.MediaTypeImageLayerGzip:                 images.MediaTypeDockerSchema2LayerGzip,
	images.MediaTypeDockerSchema2LayerGzip:           images.MediaTypeDockerSchema2LayerGzip,
	images.MediaTypeDockerSchema2LayerForeign:        images.MediaTypeDockerSchema2LayerForeign,
	images.MediaTypeDockerSchema2LayerForeignGzip:    images.MediaTypeDockerSchema2LayerForeignGzip,
	ocispecs.MediaTypeImageLayerNonDistributable:     images.MediaTypeDockerSchema2LayerForeign,     //nolint:staticcheck // ignore SA1019: Non-distributable layers are deprecated, and not recommended for future use.
	ocispecs.MediaTypeImageLayerNonDistributableGzip: images.MediaTypeDockerSchema2LayerForeignGzip, //nolint:staticch


essU160().toBase58(), 1000000000L, acct, 20000, 0);
                Thread.sleep(6000);
                showBalance(ontSdk,new Account[]{acct1,acct2,acct3});

                System.exit(0);
            }
            if(false){
                ontSdk.neovm().oep4().sendApprove(acct1, acct2.getAddressU160().toBase58(), 1000000000L, acct, 20000, 0);
                Thread.sleep(6000);
                showBalance(ontSdk,new Account[]{acct1,acct2,acct3});
                System.exit(0);
            }
            if(true){
                ontSdk.neovm().oep4().queryAllowance(acct1.getAddressU160().toBase58(), acct2.getAddressU160().toBase58());
                Thread.sleep(6000);
                showBalance(ontSdk,new Account[]{acct1,acct2,acct3});
            }
            if(false){
                ontSdk.neovm().oep4().sendTransferFrom(acct1, acct2.getAddressU160().toBase58(),acct1.getAddressU160().toBase58(), 1000000000L, acct, 20000, 0);
                Thread.sleep(6000);
                showBalance(ontSdk,new Account[]{acct1,acct2,acct3});
                System.exit(0);
            }

            if(false){
                Account[] accounts = new Account[]{acct1,acct2};
                State[] states = new State[]{new State(acct1.getAddressU160(),acct3.getAddressU160(),100),new State(acct2.getAddressU160(),acct4.getAddressU160(),200)};
                String txhash = ontSdk.neovm().oep4().sendTransferMulti(accounts,states,acct1,20000,0);
                return;
            }

//            String balance = ontSdk.neovm().oep4().queryBalanceOf(acct.getAddressU160().toBase58());
//            System.out.println(new BigInteger(Helper.reverse(Helper.hexToBytes(balance))).longValue());
//            balance = ontSdk.neovm().oep4().queryBalanceOf(multiAddr);
//            System.out.println(new BigInteger(Helper.reverse(Helper.hexToBytes(balance))).longValue());
//            System.exit(0);

            if(false) {
                String name = ontSdk.neovm().oep4().queryName();
                System.out.println(new String(Helper.hexToBytes(name)));
                String symbol = ontSdk.neovm().oep4().querySymbol();
                System.out.println(new String(Helper.hexToBytes(symbol)));
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    public static void showBalance(OntSdk ontSdk,Account[] accounts) throws Exception {
        for (int i=0;i<accounts.length;i++){
            int a = i+1;
            System.out.println("account"+ a +":"+ ontSdk.neovm().oep4().queryBalanceOf(accounts[i].getAddressU160().toBase58()));
        }
    }

    public static OntSdk getOntSdk() throws Exception {
//        String ip = "http://139.219.108.204";
        String ip = "http://127.0.0.1";
        ip = "http://polaris3.ont.io";
//        ip= "http://139.219.138.201";
//        String ip = "http://101.132.193.149";
//        String ip = "http://polaris1.ont.io";
        String restUrl = ip + ":" + "20334";
        String rpcUrl = ip + ":" + "20336";
        String wsUrl = ip + ":" + "20335";

        OntSdk wm = OntSdk.getInstance();
        wm.setRpc(rpcUrl);
        wm.setRestful(restUrl);
        wm.setDefaultConnect(wm.getRestful());
        wm.neovm().oep4().setContractAddress("55e02438


理もDashboardで行えます。

完了済みの構成を見てみたい場合は、サンプルアプリケーションをご覧ください。

Callback URLを構成する

Callback URLとは、Auth0がユーザーを認証後にリダイレクトするアプリケーション内URLです。設定されていない場合、ユーザーはログイン後にアプリケーションに戻りません。

サンプルプロジェクトに沿って進めている場合は、http://localhost:3000/callbackに設定してください。

ログアウトURLを構成する

ログアウトURLとは、Auth0がユーザーをログアウト後にリダイレクトするアプリケーション内URLです。設定されていない場合、ユーザーはアプリケーションからログアウトできず、エラーを受け取ります。

サンプルプロジェクトに沿って進めている場合は、http://localhost:3000に設定してください。

## SDKをインストールして構成する {{{ data-action="code" data-code="Program.cs" }}}

NuGetからインストールする

Auth0をBlazor Serverと統合するには、Auth0.AspNetCore.AuthenticationNuGetパッケージをアプリケーションにインストールすることでSDKを使用できます。

ミドルウェアを構成する

Blazor Serverアプリケーションで認証を可能にするには、SDKが提供するミドルウェアを使います。Program.csファイルに移動してbuilder.Services.AddAuth0WebAppAuthentication()を呼び出し、SDKのミドルウェアを登録します。

DomainとClientIdは必ず構成してください。SDKがどのAuth0テナントとアプリケーションを使用すべきかを認識するために必要となるフィールドです。

認証と認可がProgram.csファイルで有効になったことを確認します。

## ログイン {{{ data-action="code" data-code="Login.cshtml.cs" }}}

Blazor Serverアプリケーションにユーザーをログインさせるには、LoginModelをPagesディレクトリに追加します。

LoginModelのOnGetメソッド内でHttpContext.ChallengeAsync()を呼び出し、Auth0Constants.AuthenticationSchemeを認証スキームとして渡します。これにより当社のSDKが内部に登録してい


/*
 *
 * Copyright 2021-2025 Software Radio Systems Limited
 *
 * This file is part of srsRAN.
 *
 * srsRAN is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as
 * published by the Free Software Foundation, either version 3 of
 * the License, or (at your option) any later version.
 *
 * srsRAN 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 Affero General Public License for more details.
 *
 * A copy of the GNU Affero General Public License can be found in
 * the LICENSE file in the top-level directory of this distribution
 * and at http://www.gnu.org/licenses/.
 *
 */

#pragma once

#include <cstdint>

namespace srsran {
namespace ofh {

/// Open Fronthaul sequence identifier checker.
class sequence_id_checker
{
public:
  /// Default destructor.
  virtual ~sequence_id_checker() = default;

  /// \brief Updates the expected sequence identifier value for the given eAxC and compares it with the given sequence
  /// identifier, returning the difference between them.
  ///
  /// A negative difference means that the sequence identifier is from the past.
  /// A difference of 0 means that the current sequence identifier matches the expected.
  /// A positive difference means that the sequence identifier belongs to the future. In this case, the expected
  /// sequence identifier is updated with the given sequence identifier.
  virtual int update_and_compare_seq_id(unsigned eaxc, uint8_t seq_id) = 0;
};

} // namespace ofh
} // namespace srsran


    val optionList = mutableListOf<PauseOption>()
        optionList += PauseOption("play.pause.resume", true) {
            unpauseGame(true)
        }
        optionList += PauseOption("play.pause.startOver", !(gameMode is EndlessPolyrhythm && gameMode.dailyChallenge != null)) {
            startOverPauseAction()
        }
        optionList += PauseOption(Localization.getVar("play.pause.quit"), true) {
            quitPauseAction(ExitReason.Quit(currentFailureCount.get()))
        }
        this.pauseOptions.set(optionList)
    }

    init {
        introCardSceneRoot.doClipping.set(true)

        blackBarsAmount = FloatVar {
            val effectInLastSec = 0.5f // Effect only in the first and last few seconds
            val time = introCardTime.use() * introCardDuration // Counts down from duration to 0.0 sec

            val interpolation = Interpolation.smoother
            val firstThreshold = introCardDuration - effectInLastSec
            when {
                time <= 0f -> 0f
                time > firstThreshold -> {
                    val timePercent = 1f - (time - firstThreshold) / effectInLastSec
                    interpolation.apply(0f, 1f, timePercent)
                }
                time < effectInLastSec -> {
                    val timePercent = 1f - time / effectInLastSec
                    interpolation.apply(1f, 0f, timePercent)
                }
                else -> 1f
            }
        }
        textSlide = TextSlideInterp(introCardTime, interpPower = 4.5f)

        // Black bars: Full is 16:9 = 1.778, cinema is 2.35:1 = 2.35. About 25% less height
        val slantAmount = 1f
        val barHeight = 0.125f * 1.25f
        val superHardRed = Color.valueOf("880000").lerp(Color.BLACK, 0.35f)
        val blackBarsColor = if (contract.isSuperHard) superHardRed else Color.BLACK
        val blackBarsColorOpaque = blackBarsColor.cpy()
        val blackBarsColorTransparent = blackBarsColor.cpy().apply { this.a *= 0.8f }
        introCardSceneRoot += QuadElement().apply { // Top
            this.topBottomGradient(blackBarsColorOpaque, blackBarsColorTransparent)

            this.bindHeightToParent(multiplier = barHeight * slantAmount)
            Anchor.TopLeft.yConfigure(this) {
                val h = bounds.height.use()
                -h + (blackBarsAmount.use() * h)
            }

            this.bottomLeftOffsetV.set(0f)
            this.bottomRightOffsetV.set(1f - slantAmount)
        }
        introCardSceneRoot += QuadElement().apply { // Bottom
            this.topBottomGradient(blackBarsColorTransparent, blackBarsColorOpaque)

            this.bindHeightToParent(multiplier = barHeight * slantAmount)
            Anchor.BottomLeft.yConfigure(this) {
                val h = bounds.height.use()
                h - (blackBarsAmount.use() * h)
            }

            this.topLeftOffsetV.set(1f)
            this.topRightOffsetV.set(slantAmount)
        }
        // Title and tagline
        val titleAndTaglineTextColor = /*if (contract.isSuperHard) Color.RED.cpy().lerp(Color.WHITE, 0.35f) else*/ Color.WHITE.cpy()
        introCardSceneRoot += TextLabel(contract.name.getOrCompute(), font = PRManiaGame.instance.fontGamePracticeClear).apply {
            Anchor.CentreLeft.configure(this, offsetY = {
                -(bounds.height.use() / 2f)
            })
            this.bindHeightToParent(multiplier = 0.125f)

            this.margin.set(Insets(0f, 0f, 50f, 50f))
            this.renderAlign.set(RenderAlign.center)
            this


 pgx.CollectRows(rows, pgx.RowToAddrOfStructByName[Transfer])
	assert.NoError(t, err)

	assert.Len(t, transfers, 6)

	assert.WithinDuration(t, time.Now(), transfers[0].CreatedAt, time.Minute)
	assert.WithinDuration(t, time.Now(), transfers[1].CreatedAt, time.Minute)
	assert.WithinDuration(t, time.Now(), transfers[2].CreatedAt, time.Minute)
	assert.WithinDuration(t, time.Now(), transfers[3].CreatedAt, time.Minute)
	assert.WithinDuration(t, time.Now(), transfers[4].CreatedAt, time.Minute)
	assert.WithinDuration(t, time.Now(), transfers[5].CreatedAt, time.Minute)

	assert.Equal(t, transfers[0].CreatedAt, transfers[0].EventAt) // Defaults to now(), matching created_at
	assert.Equal(t, eventAt, transfers[1].EventAt.UTC())
	assert.Equal(t, eventAt, transfers[2].EventAt.UTC())
	assert.Equal(t, eventAt, transfers[3].EventAt.UTC())
	assert.Equal(t, eventAt, transfers[4].EventAt.UTC())
	assert.Equal(t, eventAt, transfers[5].EventAt.UTC())
}

func TestCreateMultipleTransfers(t *testing.T) {
	conn := dbconn(t)
	ctx := t.Context()

	account1 := createAccount(t, conn, "account 1", "USD")
	account2 := createAccount(t, conn, "account 2", "USD")
	account3 := createAccount(t, conn, "account 3", "USD")

	_, err := conn.Exec(ctx, `
		select * from pgledger_create_transfers(
			($1, $2, '10'),
			($2, $3, '20'),
			($3, $1, '50'))`,
		account1.ID, account2.ID, account3.ID)
	assert.NoError(t, err)

	foundAccount1 := getAccount(t, conn, account1.ID)
	foundAccount2 := getAccount(t, conn, account2.ID)
	foundAccount3 := getAccount(t, conn, account3.ID)

	assert.Equal(t, "40", foundAccount1.Balance)
	assert.Equal(t, "-10", foundAccount2.Balance)
	assert.Equal(t, "-30", foundAccount3.Balance)

	assert.Equal(t, 2, foundAccount1.Version)
	assert.Equal(t, 2, foundAccount2.Version)
	assert.Equal(t, 2, foundAccount3.Version)
}

func TestMultipleTransfersRollsBackIfOneIsBad(t *testing.T) {
	conn := dbconn(t)
	ctx := t.Context()

	account1 := createAccount(t, conn, "account 1", "USD")
	account2 := createAccount(t, conn, "account 2", "USD")

	rows, err := conn.Query(ctx, "select id from pgledger_create_account('negative-only', 'USD', allow_positive_balance => false)")
	assert.NoError(t, err)

	account3ID, err := pgx.CollectExactlyOneRow(rows, pgx.RowTo[string])
	assert.NoError(t, err)

	_, err = conn.Exec(ctx, `
		select * from pgledger_create_transfers(
			($1, $2, '10'),
			($2, $3, '20'),
			($3, $1, '50'))`,
		account1.ID, account2.ID, account3ID)
	assert.ErrorContains(t, err, fmt.Sprintf("Account (id=%s, name=%s) does not allow positive balance", account3ID, "negative-only"))

	foundAccount1 := getAccount(t, conn, account1.ID)
	foundAccount2 := getAccount(


t:Schema(title = "工具展示名称", required = true)
    val displayName: String,
    @get:Schema(title = "工具类型", required = true)
    val type: String,
    @get:Schema(title = "分析耗时", required = true)
    val elapseTime: Long,
    @get:Schema(title = "第几次构建", required = true)
    val buildNum: Int,
    @get:Schema(title = "工具类型，用来拼接URL", required = false)
    val pattern: String?,
    @get:Schema(title = "告警总数", required = true)
    val defectCount: Int,
    @get:Schema(title = "工具对应的跳转地址", required = false)
    val defectUrl: String?
)
package com.tencent.devops.common.audit

import com.tencent.bk.audit.AuditRequestProvider
import com.tencent.bk.audit.constants.AccessTypeEnum
import com.tencent.bk.audit.constants.UserIdentifyTypeEnum
import com.tencent.bk.audit.exception.AuditException
import com.tencent.bk.audit.model.AuditHttpRequest
import com.tencent.devops.common.api.auth.AUTH_HEADER_USER_ID
import com.tencent.devops.common.api.constant.REQUEST_CHANNEL
import com.tencent.devops.common.api.constant.REQUEST_IP
import com.tencent.devops.common.api.enums.RequestChannelTypeEnum
import jakarta.servlet.http.HttpServletRequest
import org.slf4j.LoggerFactory
import org.springframework.web.context.request.RequestContextHolder
import org.springframework.web.context.request.ServletRequestAttributes

class BkAuditRequestProvider : AuditRequestProvider {
    companion object {
        private const val HEADER_USER_IDENTIFY_TENANT_ID = "X-User-Identify-Tenant-Id"
        private const val HEADER_USER_IDENTIFY_TYPE = "X-User-Identify-Type"
        private const val HEADER_REQUEST_ID = "X-DEVOPS-RID"
        private val logger = LoggerFactory.getLogger(BkAuditRequestProvider::class.java)
    }

    override fun getRequest(): AuditHttpRequest {
        val httpServletRequest: HttpServletRequest = getHttpServletRequest()
        return AuditHttpRequest(httpServletRequest)
    }

    private fun getHttpServletRequest(): HttpServletRequest {
        val requestAttributes = RequestContextHolder.getRequestAttributes()
        if (requestAttributes == null) {
            logger.error("Could not get RequestAttributes from RequestContext!")
            throw AuditException("Parse http request error")
        }
        return (requestAttributes as ServletRequestAttributes).request
    }

    override fun getUsername(): String? {
        val httpServletRequest = getHttpServletRequest()
        return httpServletRequest.getHeader(AUTH_HEADER_USER_ID)
    }

    override fun getUserIdentifyType(): UserIdentifyTypeEnum? {
        val httpServletRequest = getHttpServletRequest()
        return UserIdentifyTypeEnum.valOf(
            httpServletRequest.getHeader(HEADER_USER_IDENTIFY_TYPE)
        )
    }

    override fun getUserIdentifyTenantId(): String? {
        val httpServletRequest = getHttpServletRequest()
        return httpServletRequest.getHeader(HEADER_USER_IDENTIFY_TENANT_ID)
    }

    override fun getAccessType(): AccessTypeEnum {
        val httpServletRequest = getHttpServletRequest()
        val requestChannel = (httpServletRequest.getAttribute(REQUEST_CHANNEL)
            ?: httpServletRequest.getHeader(REQUEST_CHANNEL))?.toString()
        logger.debug("get request channel:$requestChannel")
        return when (requestChannel) {
            RequestChannelTypeEnum.USER.name,
            RequestChannelTypeEnum.OP.name -> AccessTypeEnum.WEB

            RequestChannelTypeEnum.API.name -> AccessTypeEnum.API
            else


ler) =>
  createNestedAccessor(source, undefined, handler)

const createNestedAccessor: CreateNestedAccessor = (
  source,
  nestedKey,
  handler
) => {
  return new Proxy(source as any, {
    get(_, key) {
      const createAbsoluteKey = (key) =>
        nestedKey ? [nestedKey, key].join(".") : key

      if (key === "key") {
        return () => nestedKey
      }

      if (key === "keyAt") {
        return (key) =>
          createNestedAccessor(source, createAbsoluteKey(key), handler).key()
      }

      if (key === "get") {
        return (...args) => {
          if (handler) {
            return handler(source, nestedKey, ...(args as any))
          }

          return nestedKey === undefined ? source : get(source, nestedKey)
        }
      }

      if (key === "getAt") {
        return (key, ...args) =>
          createNestedAccessor(source, createAbsoluteKey(key), handler).get(
            ...(args as any)
          )
      }

      if (key === "has") {
        return () => has(source, nestedKey!)
      }

      if (key === "hasAt") {
        return (key) =>
          createNestedAccessor(source, createAbsoluteKey(key), handler).has()
      }

      return createNestedAccessor(source, createAbsoluteKey(key), handler)
    },
  })
}
export interface IColor {
  color: string;
  value: string;
}

export interface IColorsState {
  isFetching: boolean;
  items: Array<IColor>;
}
var arr: number[] = [1,2,3,4];
function square(arr: number[])
{
    for (let i = 0; i< arr.length; i++)
    {

    arr[i] = arr[i]*arr[i]

    }
    return arr;

}

console.log(square(arr));
/**
 * Key schema.
 *
 * @export
 */
export interface IKey {
    /**
     * The code associated to the current `key`.
     */
    code: number;
    /**
     * The friendly `name` of the current `key`.
     *
     */
    name: string;
}

/**
 * Key modifier schema.
 *
 * @export
 */
export interface IKeyModifier extends IKey {
    /**
     * The friendly `name` of the current modifier.
     *
     */
    name: 'Shift' | 'Control' | 'Alt';
}

/**
 * A complete collection of `keys` that can be used to emit fake events for testing.
 *
 * @export
 */
export class Key implements Record<keyof Key, IKey> {
    /**
     * Metadata for key `q`.
     *
     */
    public static q: IKey = {
        name: 'q',
        code: 81,
    };
    /**
     * Metadata for key `w`.
     *
     */
    public static w: IKey = {
        name: 'w',
        code: 87,
    };
    /**
     * Metadata for key `e`.
     *
     */
    public static e: IKey = {
        name: 'e',
        code: 69,
    };
    /**
     * Metadata for key `r`.
     *
     */
    public static r: IKey = {
        name: 'r',
        code: 82,
    };
    /**
     * Metadata for key `t`.
     *
     */
    public static t: IKey = {
        name: 't',
        code: 84,
    };
    /**
     * Metadata for key `y`.
     *
     */
    public static y: IKey = {
        name: 'y',
        code: 89,
    };
    /**
     * Metadata for key `u`.
     *
     */
    public static u: IKey = {
        name: 'u',
        code: 85,
    };
    /**
     * Metadata for key `i`.
     *
     */
    public static i: IKey = {
        name: 'i',
        code: 73,
    };
    /**
     * Metadata for key `o`.
     *
     */
    public static o: IKey