import time, sys
from valkka.core import *
from valkka.fs import ValkkaMultiFS, ValkkaFSManager

"""ValkkaFSManager write-only test

Filterchain

::

                  +---> ValkkaFSManager
                  |
    LiveThread ---+
      (slot=1)

"""

# rtsp_adr = "rtsp://admin:12345@192.168.0.157"
rtsp_adr = sys.argv[1]

print("camera:", rtsp_adr)

"""Define ValkkaFS
"""
vfs1 = ValkkaMultiFS.newFromDirectory(
    dirname = "./vfs1",
    blocksize = 512*1024,
    n_blocks = 10,
    verbose = True)

manager = ValkkaFSManager([vfs1])

def time_cb(mstime):
    print("time_cb:", mstime)

def time_limits_cb(tup):
    print("time_limits_cb:", tup)

def block_cb(valkkafs = None, timerange_local = None, timerange_global = None):
    print("block_cb:", valkkafs, timerange_local, timerange_global)

"""ValkkaFSManager API
"""
tr = manager.getTimeRange()
tr_ = manager.getTimeRangeByValkkaFS(vfs1)
print("timeranges:", tr, tr_)
manager.setTimeCallback(time_cb)
manager.setTimeLimitsCallback(time_limits_cb)
manager.setBlockCallback(block_cb)

"""Map stream in the manager

- writer & reader threads associated to vfs1 will map slot 1 to id 1
(- reader dumps to manager.cacherthread)
- cacherthread dumps slot 1 to framefilter
"""
info_filter = InfoFrameFilter("info")
manager.map_(
    valkkafs=vfs1,
    framefilter=info_filter,
    write_slot=1,
    read_slot=10,
    _id=1001
)
file_input_framefilter = manager.getInputFilter(vfs1)
ctx = LiveConnectionContext(LiveConnectionType_rtsp, rtsp_adr, 1, file_input_framefilter)

livethread = LiveThread("livethread")
manager.start() # starts cacherthread, reader & writer threads
livethread.startCall()
livethread.registerStreamCall(ctx)
livethread.playStreamCall(ctx)

# stream for N secs
time.sleep(60)

print("time to exit!")
manager.unmap(valkkafs = vfs1, _id=1001)

livethread.stopCall()
manager.close()
print("bye")


   static public void BlockOnInstructionWaitHandle(OMini.MiniMPIRuntime self, OMini.IBlockingInstruction instr)
        {
            Helper.SimpleWrap<bool>(
                 delegate(ClrSyncManager manager)
                 {
                     Console.WriteLine("BlockOnInstructionWaitHandle {0}", instr.ToString());
                     manager.SyncVarAccess(self, MSyncVarOp.RWVAR_READWRITE);
                     while (!instr.IsCompleted)
                     {
                         manager.LocalBacktrack();
                     }
                     manager.CommitSyncVarAccess();
                     return false;
                 },
                 delegate() { instr.WaitHandle.WaitOne(); return false; });
        }
    }
}


() {
            @Override
            public String getFormattedValue(float value) {
                return ((int)value) + "%";
            }
        });
        return dataSet;
    }

    private void setupCamera() {
        cameraProviderFuture = ProcessCameraProvider.getInstance(this);
        cameraProviderFuture.addListener(() -> {
            try {
                cameraProvider = cameraProviderFuture.get();
                bindPreview(cameraProvider);
            } catch (Exception e) {
                e.printStackTrace();
            }
        }, ContextCompat.getMainExecutor(this));

        video.setImplementationMode(PreviewView.ImplementationMode.COMPATIBLE);
        video.setScaleType(PreviewView.ScaleType.FIT_CENTER);
    }

    // Preview위젯에 cameraprovider를 bind한다.
    private void bindPreview(@NonNull ProcessCameraProvider cameraProvider) {
        Preview preview = new Preview.Builder().build();

        // 카메라를 선택함
        CameraSelector cameraSelector = new CameraSelector.Builder()
                .requireLensFacing(CameraSelector.LENS_FACING_BACK)
                .build();

        preview.setSurfaceProvider(video.getSurfaceProvider());

        cameraProvider.bindToLifecycle((LifecycleOwner) this, cameraSelector, preview);
    }

}package TheBombBoy;

import javax.swing.ImageIcon;

public class villainsLairThread implements Runnable{
	InGame ingame;
	Boolean Thread_ToF = true;

	villainsLairThread(InGame ingame){
		this.ingame = ingame;
	}

	public void run() {

		while(Thread_ToF) {

			if(ingame.easy1start == 0 && ingame.medium1start == 0 && ingame.hard1start == 0) {
				ingame.LairDamageNum = 0;
				Thread_ToF = false;
				return;
			}

			ingame.villainsLair.setIcon(new ImageIcon(ingame.vla.makeLair1()));

			if(ingame.Stage1EASYPane.isVisible() == true ) {

				if(ingame.Villain1.isVisible() == false && ingame.Villain2.isVisible() == false) {
					if(ingame.villainsLair.getBounds().intersects(ingame.UserBomb.getBounds()) && ingame.BombTime == 2 ) {
						ingame.villainsLair.setIcon(new ImageIcon(ingame.vla.makeLair_damage()));
						ingame.LairDamageNum += 1;

						if(ingame.LairDamageNum == 5) {
							try {
								Thread.sleep(500);
							} catch (InterruptedException e) {
								e.printStackTrace();
							}
							ingame.villainsLair.setVisible(false);

							ingame.LairDamageNum = 0;
							Thread_ToF = false;
							return;
						}

					}
				}

			}else if(ingame.Stage1MEDIUMPane.isVisible() == true) {

				if(ingame.Villain1.isVisible() == false && ingame.Villain2.isVisible() == false && ingame.Villain3.isVisible() == false) {
					if(ingame.villainsLair.getBounds().intersects(ingame.UserBomb.getBounds()) && ingame.BombTime == 2 ) {
						ingame.villainsLair.setIcon(new ImageIcon(ingame.vla.makeLair_damage()));
						ingame.LairDamageNum += 1;

						if(ingame.LairDamageNum == 5) {
							try {
								Thread.sleep(500);
							} catch (InterruptedException e) {
								e.printStackTrace();
							}


(MIT)

Copyright(c) 2014

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

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

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

Source: https://github.com/beatgammit/base64-js
**************************************************************************** */

namespace ajs.utils {

    "use strict";

    export class Base64 {

        protected static lookup = []
        protected static revLookup = []
        protected static Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array
        protected static code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'

        public static initialize() {
            for (var i = 0, len = Base64.code.length; i < len; ++i) {
                Base64.lookup[i] = Base64.code[i]
                Base64.revLookup[Base64.code.charCodeAt(i)] = i
            }
            Base64.revLookup['-'.charCodeAt(0)] = 62
            Base64.revLookup['_'.charCodeAt(0)] = 63
        }

        protected static placeHoldersCount(b64) {
            var len = b64.length
            if (len % 4 > 0) {
                throw new Error('Invalid string. Length must be a multiple of 4')
            }

            // the number of equal signs (place holders)
            // if there are two placeholders, than the two characters before it
            // represent one byte
            // if there is only one, then the three characters before it represent 2 bytes
            // this is just a cheap hack to not do indexOf twice
            return b64[len - 2] === '=' ? 2 : b64[len - 1] === '=' ? 1 : 0
        }

        protected static byteLength(b64) {
            // base64 is 4/3 + up to two characters of the original data
            return b64.length * 3 / 4 - Base64.placeHoldersCount(b64)
        }

        public static toByteArray(b64) {
            var i, j, l, tmp, placeHolders, arr
            var len = b64.length
            placeHolders = Base64.placeHoldersCount(b64)

            arr = new Base64.Arr(len * 3 / 4 - placeHolders)

            // if there are placeholders, only get up to the last complete 4 chars
            l = placeHolders > 0 ? len - 4 : len

            var L = 0

            for (i = 0, j = 0; i < l; i += 4, j += 3) {
                tmp = (Base64.revLookup[b64.charCodeAt(i)] << 18) | (Base64.revLookup[b64.charCodeAt(i + 1)] << 12) | (Base64.revLookup[b64.charCodeAt(i + 2)] << 6) | Base64.revLookup[b64.charCodeAt(i + 3)]
                arr[L++] = (tmp >> 16) & 0xFF
                arr[L++] = (tmp >> 8) & 0xFF


x01]), isTrue);
    expect(readBool([0xff, 0x01]), isTrue);
  });

  // Compare two doubles, where NaNs and same-sign inifinities compare equal.
  // For normal values, use equals.
  Matcher doubleEquals(double expected) =>
      expected.isNaN
          ? predicate<double>((x) => x.isNaN, 'NaN expected')
          : equals(expected);

  List<int> dataToBytes(ByteData byteData) => Uint8List.view(byteData.buffer);
  final floatToBytes = convertToBytes(PbFieldType.OF);
  int floatToBits(double value) =>
      makeData(floatToBytes(value)).getUint32(0, Endian.little);

  void test32(int bits, double value) {
    double readFloat(int bits) {
      final bytes = dataToBytes(ByteData(4)..setUint32(0, bits, Endian.little));
      return CodedBufferReader(bytes).readFloat();
    }

    expect(floatToBits(value), bits);
    expect(readFloat(bits), doubleEquals(value));
  }

  final doubleToBytes = convertToBytes(PbFieldType.OD);

  void test64(List<int> hilo, double value) {
    // Encode a double to its wire format.
    final data = makeData(doubleToBytes(value));
    final actualHilo = [
      data.getUint32(4, Endian.little),
      data.getUint32(0, Endian.little),
    ];
    //int encoded = data.getUint64(0, Endian.little);
    expect(actualHilo, hilo);

    // Decode it again (round trip).
    final bytes = dataToBytes(data);
    final reencoded = CodedBufferReader(bytes).readDouble();
    expect(reencoded, doubleEquals(value));
  }

  test('testFloat', () {
    // Denorms.
    test32(0x1, 1.401298464324817E-45);
    test32(0x2, 1.401298464324817E-45 * 2.0);
    test32(0x3, 1.401298464324817E-45 * 3.0);
    test32(0x00ba98, 1.401298464324817E-45 * 0x00ba98);
    test32(8034422, 1.401298464324817E-45 * 8034422);
    test32(0x7fffff, 1.401298464324817E-45 * 0x7fffff);
    test32(0x80000001, -1.401298464324817E-45);
    test32(0x80000002, -1.401298464324817E-45 * 2.0);
    test32(0x80000003, -1.401298464324817E-45 * 3.0);
    test32(0x8000ba98, -1.401298464324817E-45 * 0x00ba98);
    test32(0x807a9876, -1.401298464324817E-45 * 0x7a9876);
    test32(0x807fffff, -1.401298464324817E-45 * 0x7fffff);
    // Very small non-denorms.
    test32(0x00800000, 1.1754943508222875E-38);
    test32(0x00800001, 1.175494490952134E-38);
    test32(0x00801234, 1.176147355906663E-38);


ss: Quest
		/// </summary>
		WintersEdge = 45003,
		/// <summary>
		/// Class: Quest
		/// </summary>
		EverburningEmber = 45005,
		/// <summary>
		/// Level: 1
		/// Class: Consumable
		/// </summary>
		StormwindBanner = 45011,
		/// <summary>
		/// Level: 1
		/// Class: Consumable
		/// </summary>
		ThunderBluffBanner = 45013,
		/// <summary>
		/// Level: 1
		/// Class: Consumable
		/// </summary>
		OrgrimmarBanner = 45014,
		/// <summary>
		/// Level: 1
		/// Class: Consumable
		/// </summary>
		SenJinBanner = 45015,
		/// <summary>
		/// Level: 1
		/// Class: Consumable
		/// </summary>
		UndercityBanner = 45016,
		/// <summary>
		/// Level: 1
		/// Class: Consumable
		/// </summary>
		SilvermoonCityBanner = 45017,
		/// <summary>
		/// Level: 1
		/// Class: Consumable
		/// </summary>
		IronforgeBanner = 45018,
		/// <summary>
		/// Level: 1
		/// Class: Consumable
		/// </summary>
		GnomereganBanner = 45019,
		/// <summary>
		/// Level: 1
		/// Class: Consumable
		/// </summary>
		ExodarBanner = 45020,
		/// <summary>
		/// Level: 1
		/// Class: Consumable
		/// </summary>
		DarnassusBanner = 45021,
		/// <summary>
		/// Level: 1
		/// Class: Miscellaneous
		/// </summary>
		ArgentGruntling = 45022,
		/// <summary>
		/// Body
		/// Level: 1
		/// Class: Armor
		/// </summary>
		EpicPurpleShirt = 45037,
		/// <summary>
		/// Level: 80
		/// Class: Consumable
		/// </summary>
		FragmentOfValAnyr = 45038,
		/// <summary>
		/// Class: Consumable
		/// </summary>
		ShatteredFragmentsOfValAnyr = 45039,
		/// <summary>
		/// Level: 1
		/// Class: Quest
		/// </summary>
		RoughHewnPlank = 45045,
		/// <summary>
		/// Level: 1
		/// Class: Quest
		/// </summary>
		LumberjacksAxe = 45046,
		/// <summary>
		/// Class: Consumable
		/// </summary>
		SandboxTiger = 45047,
		/// <summary>
		/// Level: 53
		/// Class: Recipe
		/// </summary>
		FormulaSmokingHeartOfTheMountain_2 = 45050,
		/// <summary>
		/// Legs
		/// Level: 55
		/// Class: Armor
		/// </summary>
		GruffscaleLeggings = 45052,
		/// <summary>
		/// Level: 60
		/// Class: Jewelry
		/// </summary>
		PrismaticBlackDiamond = 45054,
		/// <summary>
		/// Level: 85
		/// Class: Consumable
		/// </summary>
		ScrollOfEnchantStaffGreaterSpellpower = 45056,
		/// <summary>
		/// Level: 1
		/// Class: Consumable
		/// </summary>
		WindUpTrainWrecker = 45057,
		/// <summary>
		/// Level: 1
		/// Class: Quest
		/// </summary>
		DustyJournal = 45058,
		/// <summary>
		/// Level: 85
		/// Class: Recipe
		/// </summary>
		FormulaEnchantStaffGreaterSpellpower = 45059,
		/// <summary>
		/// Level: 80
		/// Class: Consumable
		/// </summary>
		ScrollOfEnchantStaffSpellpower = 45060,
		/// <


erman Commander: Elite Troops Doctrine",
"Company of Heroes 2 - Soviet Commander: Partisan Tactics",
"Company of Heroes 2 - Soviet Commander: Tank Hunter Tactics",
"Company of Heroes 2 - German Commander: Encirclement Doctrine",
"Company of Heroes 2 -  German Skin: (L) Voronezh Improvised Pattern",
"Company of Heroes 2 - German Skin: (M) Voronezh Improvised Pattern",
"Company of Heroes 2 - German Skin: (H) Voronezh Improvised Pattern",
"Company of Heroes 2 - German Skin: (L) Case Blue Summer Pattern",
"Company of Heroes 2 - German Skin: (M) Case Blue Summer Pattern",
"Company of Heroes 2 - German Skin: (H) Case Blue Summer Pattern",
"Company of Heroes 2 - German Skin: (L) Stalingrad Winter Pattern",
"Company of Heroes 2 - German Skin: (M) Stalingrad Winter Pattern",
"Company of Heroes 2 - German Skin: (H) Stalingrad Winter Pattern",
"Company of Heroes 2 - Soviet Skin: (L) Two Tone Don Front",
"Company of Heroes 2 - Soviet Skin: (M) Two Tone Don Front",
"Company of Heroes 2 - Soviet Skin: (H) Two Tone Don Front",
"Company of Heroes 2 - Soviet Skin: (L) Two Tone Spring Front",
"Company of Heroes 2 - Soviet Skin: (M) Two Tone Spring Front",
"Company of Heroes 2 - Soviet Skin: (H) Two Tone Spring Front",
"Company of Heroes 2 - Soviet Skin: (L) Makeshift Sand Southern Front",
"Company of Heroes 2 - Soviet Skin: (M) Makeshift Sand Southern Front",
"Company of Heroes 2 - Soviet Skin: (H) Makeshift Sand Southern Front",
"Pinball FX2 - Plants VS. Zombies Table",
"Pinball FX2 - Star Wars Pinball: Balance of the Force Pack",
"LEGO® MARVEL Super Heroes",
"Beatbuddy: Tale of the Guardians Demo",
"DARK - Cult of the Dead DLC",
"The Sims 3 - Into the Future",
"The Sims 3 - Movie Stuff",
"Ancient Space",
"Risen 3 - Titan Lords",
"DCS: Mi-8MTv2 Hip",
"Flaming Cliffs 3",
"Unholy Heights",
"Zafehouse: Diaries",
"Carmageddon: Reincarnation",
"Defiance - Castithan Charge Pack",
"NEStalgia",
"The Castle Doctrine",
"Teslagrad",
"Galactic Arms Race",
"Delver",
"Blackguards",
"Marlow Briggs",
"Urban Trial Freestyle Special Rider Suit DLC ",
"Tom Clancy’s Splinter Cell Blacklist - High Power Pack DLC",
"Might & Magic X - Legacy Digital Deluxe Content",
"DC Universe Online - Sons of Trigon",
"EverQuest: Call of the Forsaken",
"EverQuest II: Tears of Veeshan",
"Scribblenauts Unmasked",
"Forge - Starter Pack",
"Forge - Limited Edition Starter Pack",
"Forge - Divine Starter Pack",
"Forge - PvP Pro Pack",
"RPG Maker VX Ace - Futuristic Atmospheres",
"RPG Maker VX Ace - High Fantasy Main Party Pack 1",
"RPG Maker VX Ace - Egyptian Myth Battlers",
"RPG Maker VX Ace - Arabian Nights",
"A-Train 8",
"Forge Quest",
"Black Ink Demo",
"FORCED",
"Perfection. Demo",
"Lilly Looking Through",
"Life Goes On",
"TorqueL",
"Assault Android Cactus",
"Tactical Intervention - Terrorist Starter Pack",
"Tactical Intervention - Counter-Terrorist Starter Pack",
"Tactical Intervention - Quick Fire Pack",
"METAL SLUG 3",
"Cabela's African Adventures",
"Hacker Evolution Hardcore Music Pack",
"Hacker Evolution Untold Hardcore Music Pack",
"Racing Manager 2014",


ot available to Oauth2
     * clients.
     *
     * @param orcid
     * @return
     */
    @DELETE
    @Produces(value = { VND_ORCID_JSON, ORCID_JSON, MediaType.APPLICATION_JSON })
    @Consumes(value = { VND_ORCID_JSON, ORCID_JSON, MediaType.APPLICATION_JSON })
    @Path(PROFILE_DELETE_PATH)
    T deleteProfileJson(@PathParam("orcid") String orcid);

    /**
     * DELETE a resource.
 This resource is not available to OAuth2
     * clients.
     *
     * @param orcid
     * @return
     */
    @DELETE
    @Produces(value = { VND_ORCID_XML, ORCID_XML, MediaType.APPLICATION_XML })
    @Consumes(value = { VND_ORCID_XML, ORCID_XML, MediaType.APPLICATION_XML, MediaType.WILDCARD })
    @Path(PROFILE_DELETE_PATH)
    T deleteProfileXML(@PathParam("orcid") String orcid);

    /**
     * Register a new webhook to a specific client.
     *
     * @param orcid
     *            the ORCID that corresponds to the user's record
     * @param webhook_uri
     *            the webhook that will be added to the user
     * @return
     * */
    @PUT
    @Produces(value = { VND_ORCID_XML, ORCID_XML, MediaType.APPLICATION_XML })
    @Consumes(value = { VND_ORCID_XML, ORCID_XML, MediaType.APPLICATION_XML })
    @Path(WEBHOOKS_PATH)
    T registerWebhookXML(@PathParam("orcid") String orcid, @PathParam("webhook_uri") String webhookUri);

    /**
     * Register a new webhook to a specific client.
     *
     * @param orcid
     *            the ORCID that corresponds to the user's record
     * @param webhook_uri
     *            the webhook that will be added to the user
     * @return
     * */
    @PUT
    @Produces(value = { VND_ORCID_JSON, ORCID_JSON, MediaType.APPLICATION_JSON })
    @Consumes(value = { VND_ORCID_JSON, ORCID_JSON, MediaType.APPLICATION_JSON })
    @Path(WEBHOOKS_PATH)
    T registerWebhookJson(@PathParam("orcid") String orcid, @PathParam("webhook_uri") String webhookUri);

    /**
     * Unregister a webhook from specific client.
     *
     * @param orcid
     *            the ORCID that corresponds to the user's record
     * @param webhook_uri
     *            the webhook that will be deleted from the user
     * @return
     * */
    @DELETE
    @Produces(value = { VND_ORCID_XML, ORCID_XML, MediaType.APPLICATION_XML })
    @Consumes(value = { VND_ORCID_XML, ORCID_XML, MediaType.APPLICATION_XML })
    @Path(WEBHOOKS_PATH)
    T unregisterWebhookXML(@PathParam("orcid") String orcid, @PathParam("webhook_uri") String webhookUri);

    /**
     * Unregister a webhook from specific client.
     *
     * @param orcid
     *            the ORCID that corresponds to the user's record
     * @param webhook_uri
     *            the webhook that will be deleted from the user
     * @return
     * */
    @DELETE
    @Produces(value = { VND_ORCID_JSON, ORCID_JSON, MediaType.APPLICATION_JSON })
    @Consumes(value = { VND_ORCID_JSON, ORCID_JSON, MediaType.APPLICATION_JSON })
    @Path(WEBHOOKS_PATH)
    T unregisterWebhookJson(@PathParam("orcid") String orcid, @PathParam("webhook_uri")


  x = "$$x";  /// 4: compile-time error
  x = "$ ";   /// 5: compile-time error

  x = '$';    /// 6: compile-time error
  x = 'x$';   /// 7: compile-time error
  x = '$x$';  /// 8: compile-time error
  x = '$$x';  /// 9: compile-time error
  x = '$ ';   /// 10: compile-time error

  x = """$""";    /// 11: compile-time error
  x = """x$""";   /// 12: compile-time error
  x = """$x$""";  /// 13: compile-time error
  x = """$$x""";  /// 14: compile-time error
  x = """$ """;   /// 15: compile-time error

  x = '''$''';    /// 16: compile-time error
  x = '''x$''';   /// 17: compile-time error
  x = '''$x$''';  /// 18: compile-time error
  x = '''$$x''';  /// 19: compile-time error
  x = '''$ ''';   /// 20: compile-time error

  return x;
}
// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

class A {
  final int x;
  const A.a1() : x = 'foo'; /// 01: continued
  const A.a2(this.x);
  const A.a3([this.x = 'foo']); /// 03: continued
  const A.a4(String this.x); /// 04: continued
  const A.a5(String x) : this.x = x; /// 05: continued
  const A.a6(int x) : this.x = x;
}

const a1 = const A.a1(); /// 01: static type warning, checked mode compile-time error
const a2 = const A.a2('foo'); /// 02: static type warning, checked mode compile-time error
const a3 = const A.a3(); /// 03: static type warning, checked mode compile-time error
const a4 = const A.a4('foo'); /// 04: static type warning, checked mode compile-time error
const a5 = const A.a5('foo'); /// 05: static type warning, checked mode compile-time error
const a6 = const A.a6('foo'); /// 06: static type warning, checked mode compile-time error

main() {
  print(a1); /// 01: continued
  print(a2); /// 02: continued
  print(a3); /// 03: continued
  print(a4); /// 04: continued
  print(a5); /// 05: continued
  print(a6); /// 06: continued
}
// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// Test that JavaScript properties on Object can still be classes in
// Dart.

import "package:expect/expect.dart";

void main() {
  Expect.equals(42, new __defineGetter__().hello());
  Expect.equals(42, new __defineSetter__().hello());
  Expect.equals(42, new __lookupGetter__().hello());
  Expect.equals(42, new __lookupSetter__().hello());
  Expect.equals(42, new constructor().hello());
  Expect.equals(42, new hasOwnProperty().hello());
  Expect.equals(42, new isPrototypeOf().hello());
  Expect.equals(42, new propertyIsEnumerable().hello());
  Expect.equals(42, new toLocaleString().hello());
  Expect.equals(42, new toString().hello());
  Expect.equals(42, new valueOf().hello());
}

class Hello {
  int hello() => 42;
}

class __defineGetter__ extends Hello {}
class __defineSetter__ extends Hello {}
class __lookupGetter__ extends Hello {}
class __lookupSetter__ extends Hello {}
class constructor extends Hello {}
class hasOwnProperty extends Hello {}
class isPrototypeOf extends Hello {}
class propertyIsEnumerable extends Hello {}
class toLocaleString extends Hel


ng PetApi.FindPetsByStatusWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}
```

### Parameters

| Name | Type | Description | Notes |
|------|------|-------------|-------|
| **status** | [**List<string>**](string.md) | Status values that need to be considered for filter |  |

### Return type

[**List<Pet>**](Pet.md)

### Authorization

[petstore_auth](../README.md#petstore_auth), [http_signature_test](../README.md#http_signature_test)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/xml, application/json

### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | successful operation |  -  |
| **400** | Invalid status value |  -  |
| **2XX** | Anything within 200-299 |  -  |
| **4XX** | Anything within 400-499 |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

<a id="findpetsbytags"></a>
# **FindPetsByTags**
> List<Pet> FindPetsByTags (List<string> tags)

Finds Pets by tags

Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.

### Example
```csharp
using System.Collections.Generic;
using System.Diagnostics;
using System.Net.Http;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class FindPetsByTagsExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "http://petstore.swagger.io:80/v2";
            // Configure OAuth2 access token for authorization: petstore_auth
            config.AccessToken = "YOUR_ACCESS_TOKEN";

            // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes
            HttpClient httpClient = new HttpClient();
            HttpClientHandler httpClientHandler = new HttpClientHandler();
            var apiInstance = new PetApi(httpClient, config, httpClientHandler);
            var tags = new List<string>(); // List<string> | Tags to filter by

            try
            {
                // Finds Pets by tags
                List<Pet> result = apiInstance.FindPetsByTags(tags);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling PetApi.FindPetsByTags: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}
```

#### Using the FindPetsByTagsWithHttpInfo variant
This returns an ApiResponse object which contains the response data, status code and headers.

```csharp
try
{
    // Finds Pets by tags
    ApiResponse<List<Pet>> response = apiInstance.FindPetsByTagsWithHttpInfo(tags);
    Debug.Write("Status Code: " + response.StatusCode);
    Debug.Write("Response Headers: " + response.Headers);
    Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling PetApi.FindPetsByTagsWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}
```

### Parameters

| Name | Type | Description | Notes |
|------|------|-------------|-------|
| **tags** | [**List<string>


#endif
  }
  for (int i = 0; i < BACKTRACE_STEPS; i++) {
    printf("Backtrace %d: expected: %p..%p  actual: %p ... ",
           i, expected_stack[i],
           reinterpret_cast<char*>(expected_stack[i]) + kMaxFnLen, stack[i]);
    CheckRetAddrIsInFunction(stack[i], expected_stack[i]);
    printf("OK\n");
  }

  // Check if the second stacktrace returns the same size.
  CHECK_EQ(size, GetStackTrace(stack, STACK_LEN, 0));
}

//-----------------------------------------------------------------------//

/* Dummy functions to make the backtrace more interesting. */
void CheckStackTrace4(int i) { for (int j = i; j >= 0; j--) CheckStackTraceLeaf(); }
void CheckStackTrace3(int i) { for (int j = i; j >= 0; j--) CheckStackTrace4(j); }
void CheckStackTrace2(int i) { for (int j = i; j >= 0; j--) CheckStackTrace3(j); }
void CheckStackTrace1(int i) { for (int j = i; j >= 0; j--) CheckStackTrace2(j); }
void CheckStackTrace(int i)  { for (int j = i; j >= 0; j--) CheckStackTrace1(j); }

//-----------------------------------------------------------------------//

int main(int argc, char ** argv) {
  FLAGS_logtostderr = true;
  InitGoogleLogging(argv[0]);

  CheckStackTrace(0);

  printf("PASS\n");
  return 0;
}

#else
int main() {
  printf("PASS (no stacktrace support)\n");
  return 0;
}
#endif  // HAVE_STACKTRACE
// Copyright (c) 1999, Google Inc.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//     * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//     * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//     * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

#define _GNU_SOURCE 1 // needed for O_NOFOLLOW and pread()/pwrite()

#include "utilities.h"

#include <assert.h>
#include <iomanip>
#include <string>
#ifdef HAVE_UNISTD_H
# include <unistd.h>  // For _exit.
#endif
#include <climits>
#include <sys/types.h>
#include <sys/stat.h>
#ifdef HAVE_SYS_UTSNAME_H
# include <sys/utsname.h>  // For uname.
#endif
#include <fcntl.h>
#include <cstdio>
#include <iostream>
#include <stdarg.h>
#include <stdlib.h>
#ifdef HAVE_PWD_H
# include <pwd.h>
#endif
#ifdef HAVE_SYSLOG_H
# include <syslog.h>
#endif
#include <vector>
#include <errno.h>                   // for errno
#include <sstream>
#include "base/commandlineflags.h


NOTIFICATIONS}

						{notifications.AVATAR_HTML}

{notifications.FORMATTED_TITLE}

{notifications.REFERENCE}

{notifications.FORUM}

{notifications.REASON}

{notifications.TIME}

							 {{ Icon('font', 'circle-check', lang('MARK_READ'), true, 'fas c-notification-check-icon') }}

		{% EVENT notification_dropdown_footer_before %}

			{L_SEE_ALL}

		{% if NOTIFICATIONS_WEBPUSH_ENABLE and notification_types is not defined %}

				{{ lang('NOTIFY_WEB_PUSH_ENABLE') ~ lang('COLON') }}
				<button id="subscribe_webpush" name="subscribe_webpush" class="notification-subscribe-toggle" data-l-err="{{ lang('INFORMATION') }}" data-l-msg="{{ lang('NOTIFY_WEB_PUSH_DENIED') }}">{{ Icon('svg', 'toggle-off', lang('NOTIFY_WEB_PUSH_SUBSCRIBE'), true, 'push-subscribe-toggle-icon toggle-off') }}</button>
				<button id="unsubscribe_webpush" name="unsubscribe_webpush" class="notification-subscribe-toggle hidden">{{ Icon('svg', 'toggle-on', lang('NOTIFY_WEB_PUSH_SUBSCRIBED'), true, 'push-subscribe-toggle-icon toggle-on') }}</button>

		{% endif %}
		{% EVENT notification_dropdown_footer_after %}

{L_FAQ_TITLE}


功能，会构建转发表，根据目的 MAC 地址转发数据帧
  - 具有透明性
  - 无需配置：以太网设备（包括端）插入以太网中时，它可以立即开始使用，无需用户或网络操作人员进行额外的配置。

- 集线器（物理层，还有中继器）
  - 当一个线路发送信息时，hub 向所有其他线路进行**简单重复**消息
  - 连接的所有设备处于同一个冲突域，速度就是单条线路的最大速率
  - star 连接，但本质是 bus

- 网卡（二层）

- 二层交换机
  - 和网桥类似，基于 mac 转发表进行工作
  - 具有网桥的功能，但是接口很多，每个接口连接一个端设备（星型结构），因此是无冲突的
  - 处于兼容性的考虑，也是用了 CSMA/CD
  - 具有自**学习**能力（与桥类似）
  - 传输速率很快（多条不同线路之间可以**同时**通信）
  - 交换机的效率比集线器高很多，若带宽为 10，那么对于集线器每个设备均分带宽，而交换机中每个设备都能得到 10
  - 交换机将局域网划分为不同冲突域，但是处于同一个广播域，因此对于局域网流量较多的情况应该使用交换机而不是网桥

- 三层交换机
  - 网桥、二层交换机等二层网络设备一般**没有 ip**
  - 三层交换机本质上与路由器的功能没有区别，体现在性能及使用场景
  - 三层交换机具有**路由功能**（链路层 mac+网络层 ip）
  - 三层交换机实现对**网络流量的隔离和控制**，**分隔子网**，避免了单一广播域中的问题。
  - 引入原因：日益增长的站点数量和复杂性的要求
    - 广播负载过重
      - 由二层交换机连接的一组站点和局域网构成了一个单一的**物理网络**，共享一个**MAC 广播地址**。广播帧会被发送到所有连接到二层交换机的局域网上的**所有站点**
    - 缺乏多路径支持
      - 两个节点之间只有一条线路（因为是生成树），限制速度和可靠度
    - <img src="https://thdlrt.oss-cn-beijing.aliyuncs.com/image-20230613223807349.png" alt="image-20230613223807349" style="zoom: 25%;" />

##### 路由机制

- 转发表与学习机制（注意二层交换机的转发表里是 MAC 地址）
- 环路与生成树算法 stp（分布式算法）
  - 避免出现**环**，防止广播风暴（在交换网络中，如果存在物理或逻辑的**环路**，数据包可能会不断地在环路内转发，形成无


# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import models, migrations

class Migration(migrations.Migration):

    dependencies = [
        ('api', '0118_usicalvote'),
    ]

    operations = [
        migrations.AlterField(
            model_name='usicalvote',
            name='entry',
            field=models.PositiveIntegerField(default=0, choices=[(2, '\u300c\u0442 \u043d \u03ad \u0430 \u2606\u300d'), (5, 'CELESTIC\u2600SMILE'), (7, "\u10e6's \u262a\u2605\u266a"), (9, '\xd0-SEND'), (10, 'a i r i \u266b~'), (11, "\u03b2N's"), (13, 'FURious Alpaca'), (14, 'wAr-RICE'), (16, 'Fruits\u2729Idols'), (17, '\u5922\u898b\u308b10\u5b50'), (18, '\u2727Sweet PaniQ\u2727'), (19, '\xb5nit'), (21, 'Crystal\u2756Lilies'), (22, 'Procrastinate \u2192 Tomorrow'), (23, 'Petit \u01b8\u04dc\u01b7 Papillon'), (24, '\u300e NeoN \u2606 MIDNIGHT\u300f'), (30, 'three oppais \u2764'), (31, 'Kuma Harmony'), (32, 'Apple \u03c0'), (35, 'Puresmile'), (38, '\u273f\u0187\u043d\u03c3c\u03c3\u2113\u03b1\u0442 \u0191\u03c3\u03b7\u2202\u03b1\u03b7\u0442\u273f'), (39, 'First Live!'), (40, 'NYAvigators'), (42, '\u03ac\u03bb\u03c4\u03bfs'), (45, 'SweeTea \u01b8\u04dc\u01b7'), (46, 'Paper\u2661Heart'), (49, '\u2746Ne\u03b1polit\u03b1n\u2746'), (51, '\u029a Little Wings \u025e'), (52, 'l\u039bmid\u039b'), (53, "\u03bc'sketeers"), (54, '\u30dfk\u03bc'), (56, 'lilaq\u273f'), (57, 'Sock It 2 Me'), (59, '\u8336\u8336\u8336'), (61, 'AKB0033'), (62, 'Undefined Red'), (63, 'This Mystery'), (64, "No \u03bc's No life"), (67, 'Midnight\u273fBlossoms')]),
            preserve_default=True,
        ),
    ]


, self.speed, self.movedir)
    }
}

private val targetSpawnerUse = registerUse("use_target_spawner") { self, _, _, game ->
    val ent: GameEntity = game.G_Spawn()
    ent.classname = self.target
    Math3D.VectorCopy(self.s.origin, ent.s.origin)
    Math3D.VectorCopy(self.s.angles, ent.s.angles)
    GameSpawn.ED_CallSpawn(ent, game)
    game.gameImports.unlinkentity(ent)
    GameUtil.KillBox(ent, game)
    game.gameImports.linkentity(ent)
    if (self.speed != 0f)
        Math3D.VectorCopy(self.movedir, ent.velocity)
}

/**
 * QUAKED target_blaster (1 0 0) (-8 -8 -8) (8 8 8)
 * NOTRAIL
 * NOEFFECTS
 * Fires a blaster bolt in the set direction when triggered.
 *
 * dmg default is 15 speed default is 1000
 */
private const val NO_TRAIL = 1
private const val NO_EFFECTS = 2
fun targetBlaster(self: GameEntity, game: GameExportsImpl) {
    self.use = targetBlasterUse
    GameBase.G_SetMovedir(self.s.angles, self.movedir)
    self.noise_index = game.gameImports.soundindex("weapons/laser2.wav")
    if (self.dmg == 0)
        self.dmg = 15
    if (self.speed == 0f)
        self.speed = 1000f
    self.svflags = Defines.SVF_NOCLIENT
}

private val targetBlasterUse = registerUse("use_target_blaster") { self, _, _, game ->

    // fixme
    val effect: Int = if (self.hasSpawnFlag(NO_EFFECTS))
        0
    else if (self.hasSpawnFlag(NO_TRAIL))
        Defines.EF_HYPERBLASTER
    else
        Defines.EF_BLASTER

    GameWeapon.fire_blaster(
        self, self.s.origin, self.movedir, self.dmg, self.speed.toInt(),
        Defines.EF_BLASTER,
        self.hasSpawnFlag(NO_TRAIL), // fixed?
        game
    )

    game.gameImports.sound(self, Defines.CHAN_VOICE, self.noise_index, 1f, Defines.ATTN_NORM.toFloat(), 0f)
}

/**
 * QUAKED target_earthquake (1 0 0) (-8 -8 -8) (8 8 8)
 * When triggered, this initiates a level-wide earthquake.
 * All players and monsters are affected.
 *
 * "speed" severity of the quake (default:200)
 *
 * "count" duration of the quake in seconds (default:5)
 */
fun targetEarthquake(self: GameEntity, game: GameExportsImpl) {
    if (self.targetname == null)
        game.gameImports.dprintf("untargeted ${self.classname} at ${Lib.vtos(self.s.origin)}\n")

    self.addComponent(Earthquake(
        game.gameImports.soundindex("world/quake.wav"),
        if (self.count != 0) self.count.toFloat() else 5f,
        if (self.speed != 0f) self.speed else 200f
    ))

    self.svflags = self.svflags or Defines.SVF_NOCLIENT
    self.think.action = targetEarthquakeThink
    // nextThink is set when used
    self.use = targetEarthquakeUse
}

private val targetEarthquakeUse = registerUse("target_earthquake_use") { self, other, activator, game ->
    val earthquake: Earthquake = self.getComponent() ?: return@registerUse
    earthquake.stopTime = game.level.time + earthquake.duration
    self.think.nextTime = game.level.time + Defines.FRAMETIME
    self.activator = activator
    earthquake.soundTime = 0f
}

priv


rammar of a Self type

self-type → ‘<samp>Self</samp>’

Grammar of a type inheritance clause

type-inheritance-clause
→ ‘<samp>:</samp>’
type-inheritance-list

type-inheritance-list
→
type-identifier

type-identifier
‘<samp>,</samp>’
type-inheritance-list

Next: Statements, Previous: Types, Up: Summary of the Grammar   [Contents][Index]

11.3 Expressions

Grammar of an expression

expression →
try-operator
_{opt}
prefix-expression
infix-expressions
_{opt}

expression-list
→
expression

expression
‘<samp>,</samp>’
expression-list

Grammar of a prefix expression

prefix-expression
→
prefix-operator
_{opt}
postfix-expression

prefix-expression
→
in-out-expression

in-out-expression
→ ‘<samp>&</samp>’
identifier

Grammar of a try expression

try-operator →
‘<samp>try</samp>’ | ‘<samp>try</samp>’ ‘<samp>?</samp>’ | ‘<samp>try</samp>’ ‘<samp>!</samp>’

Grammar of an await expression

await-operator
→ ‘<samp>await</samp>’

Grammar of a infix expression

infix-expression
→
infix-operator
prefix-expression

infix-expression
→
assignment-operator
try-operator
_{opt}
prefix-expression

infix-expression
→
conditional-operator
try-operator
_{opt}
prefix-expression

infix-expression
→
type-casting-operator

infix-expressions
→
infix-expression
infix-expressions
_{opt}

Grammar of an assignment operator

assignment-operator
→ ‘<samp>=</samp>’

Grammar of a conditional operator

conditional-operator
→ ‘<samp>?</samp>’
expression
‘<samp>:</samp>’

Grammar of a type-casting operator

type-casting


,
.theme-base16-ros-pine-moon-min .hljs-template-variable,
.theme-base16-ros-pine-moon-min .hljs-variable {
	color: #ecebf0;
}
.theme-base16-ros-pine-moon-min .hljs-attr,
.theme-base16-ros-pine-moon-min .hljs-link,
.theme-base16-ros-pine-moon-min .hljs-literal,
.theme-base16-ros-pine-moon-min .hljs-number,
.theme-base16-ros-pine-moon-min .hljs-symbol,
.theme-base16-ros-pine-moon-min .hljs-variable.constant_ {
	color: #eb6f92;
}
.theme-base16-ros-pine-moon-min .hljs-class .hljs-title,
.theme-base16-ros-pine-moon-min .hljs-title,
.theme-base16-ros-pine-moon-min .hljs-title.class_ {
	color: #f6c177;
}
.theme-base16-ros-pine-moon-min .hljs-strong {
	font-weight: 700;
	color: #f6c177;
}
.theme-base16-ros-pine-moon-min .hljs-addition,
.theme-base16-ros-pine-moon-min .hljs-code,
.theme-base16-ros-pine-moon-min .hljs-string,
.theme-base16-ros-pine-moon-min .hljs-title.class_.inherited__ {
	color: #ea9a97;
}
.theme-base16-ros-pine-moon-min .hljs-built_in,
.theme-base16-ros-pine-moon-min .hljs-doctag,
.theme-base16-ros-pine-moon-min .hljs-keyword.hljs-atrule,
.theme-base16-ros-pine-moon-min .hljs-quote,
.theme-base16-ros-pine-moon-min .hljs-regexp {
	color: #3e8fb0;
}
.theme-base16-ros-pine-moon-min .hljs-attribute,
.theme-base16-ros-pine-moon-min .hljs-function .hljs-title,
.theme-base16-ros-pine-moon-min .hljs-section,
.theme-base16-ros-pine-moon-min .hljs-title.function_,
.theme-base16-ros-pine-moon-min .ruby .hljs-property {
	color: #9ccfd8;
}
.theme-base16-ros-pine-moon-min .diff .hljs-meta,
.theme-base16-ros-pine-moon-min .hljs-keyword,
.theme-base16-ros-pine-moon-min .hljs-template-tag,
.theme-base16-ros-pine-moon-min .hljs-type {
	color: #c4a7e7;
}
.theme-base16-ros-pine-moon-min .hljs-emphasis {
	color: #c4a7e7;
	font-style: italic;
}
.theme-base16-ros-pine-moon-min .hljs-meta,
.theme-base16-ros-pine-moon-min .hljs-meta .hljs-keyword,
.theme-base16-ros-pine-moon-min .hljs-meta .hljs-string {
	color: #b9b9bc;
}
.theme-base16-ros-pine-moon-min .hljs-meta .hljs-keyword,
.theme-base16-ros-pine-moon-min .hljs-meta-keyword {
	font-weight: 700;
}
.theme-base16-ros-pine {
	/*!
  Theme: Rosé Pine
  Author: Emilia Dunfelt <sayhi@dunfelt.se>
  License: ~ MIT (or more permissive) [via base16-schemes-source]
  Maintainer: @highlightjs/core


(in_array(last_token.type, ['TK_COMMENT', 'TK_START_EXPR', 'TK_START_BLOCK',
                    'TK_END_BLOCK', 'TK_OPERATOR', 'TK_EQUALS', 'TK_EOF', 'TK_SEMICOLON', 'TK_COMMA'
                ]))
            )) {

            var sep = c,
                esc = false,
                has_char_escapes = false;

            resulting_string = c;

            if (sep === '/') {
                //
                // handle regexp
                //
                var in_char_class = false;
                while (input.hasNext() &&
                    ((esc || in_char_class || input.peek() !== sep) &&
                        !input.testChar(acorn.newline))) {
                    resulting_string += input.peek();
                    if (!esc) {
                        esc = input.peek() === '\\';
                        if (input.peek() === '[') {
                            in_char_class = true;
                        } else if (input.peek() === ']') {
                            in_char_class = false;
                        }
                    } else {
                        esc = false;
                    }
                    input.next();
                }
            } else if (opts.e4x && sep === '<') {
                //
                // handle e4x xml literals
                //

                var xmlRegExp = /[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[\s\S]+?}|!\[CDATA\[[\s\S]*?\]\])(\s+{[\s\S]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{[\s\S]+?}))*\s*(\/?)\s*>/g;
                input.back();
                var xmlStr = '';
                var match = input.match(startXmlRegExp);
                if (match) {
                    // Trim root tag to attempt to
                    var rootTag = match[2].replace(/^{\s+/, '{').replace(/\s+}$/, '}');
                    var isCurlyRoot = rootTag.indexOf('{') === 0;
                    var depth = 0;
                    while (match) {
                        var isEndTag = !!match[1];
                        var tagName = match[2];
                        var isSingletonTag = (!!match[match.length - 1]) || (tagName.slice(0, 8) === "![CDATA[");
                        if (!isSingletonTag &&
                            (tagName === rootTag || (isCurlyRoot && tagName.replace(/^{\s+/, '{').replace(/\s+}$/, '}')))) {
                            if (isEndTag) {
                                --depth;
                            } else {
                                ++depth;
                            }
                        }
                        xmlStr += match[0];
                        if (depth <= 0) {
                            break;
                        }
                        match = input.match(xmlRegExp);
                    }
                    // if we didn't close correctly, keep unformatted.
                    if (!match) {
                        xmlStr += input.match(/[\s\S]*/g)[0];
                    }
                    xmlStr = xmlStr.replace(acorn.allLineBreaks, '\n');
                    return [xmlStr, "TK_STRING"];
                }
            } else {
                //
                // handle string
                //
                var parse_string = function(delimiter, allow_unescaped_newlines, start_sub) {
                    // Template strings can travers lines without escape characters.
                    // Other strings cannot
                    var current_char;
                    while (input.hasNext()) {
                        current_char = input.peek();
                        if (!(esc || (current_char !== delimiter &&
                                (


了分层编译的功能。分层编译根据编译器编译、优化的规模与耗时，划分出不同的编译层次。

#### 2.2 编译对象与触发条件

在运行过程中会被即时编译器编译的目标是热点代码，主要有两类：

- 被多次调用的方法
- 被多次执行的循环体

对于这两种情况，编译的目标对象都是整个方法体，而不会是单独的循环体。

要知道某段代码是不是热点代码，是不是需要触发即时编译，这个行为称为热点探测，其实进行热点探测并不一定要知道方法具体被调用了多少次，目前主流的热点探测判定方式有两种：

1. 基于采样的热点探测：周期性地检查各个线程的调用栈顶，如果发现某个方法经常出现在栈顶，那这个方法就是热点方法。
2. 基于计数器的热点探测：采用这种方法的虚拟机会为每个方法建立计数器，统计方法的执行此时，如果执行次数超过一定的阈值就认为它是热点方法。

在HotSpot虚拟机中使用的是第二种基于计数器的热点探测方法，为了实现热点计数，HotSpot为每个方法准备了两类计数器：方法调用计数器和回边计数器（回边的意思是指在循环边界往回跳转）。

当一个方法被调用时，虚拟机会先检查该方法是否存在被即时编译过的版本，如果存在，则优先使用编译后的本地代码来执行。如果不存在已被编译过的版本，则将该方法的调用计数器值加1，然后判断方法调用计数器与回边计数器之和是否超过方法调用计数器的阈值。

执行引擎默认不会同步等待编译请求完成，而是继续进行解释器按照解释方式执行字节码，直到提交的请求被即时编译器编译完成。当编译工作完成后，这个方法的调用入口地址就会被系统自动改写成新值，下一次调用该方法时就会使用已编译的版本了，整个即时编译的交互过程如下图所示：

![](https://raw.githubusercontent.com/xfhy/Android-Notes/master/Images/%E6%96%B9%E6%B3%95%E8%B0%83%E7%94%A8%E8%AE%A1%E6%95%B0%E5%99%A8%E8


.ql-selected .ql-stroke-miter{stroke:#06c}@media (pointer:coarse){.ql-snow.ql-toolbar button:hover:not(.ql-active),.ql-snow .ql-toolbar button:hover:not(.ql-active){color:#444}.ql-snow.ql-toolbar button:hover:not(.ql-active) .ql-fill,.ql-snow .ql-toolbar button:hover:not(.ql-active) .ql-fill,.ql-snow.ql-toolbar button:hover:not(.ql-active) .ql-stroke.ql-fill,.ql-snow .ql-toolbar button:hover:not(.ql-active) .ql-stroke.ql-fill{fill:#444}.ql-snow.ql-toolbar button:hover:not(.ql-active) .ql-stroke,.ql-snow .ql-toolbar button:hover:not(.ql-active) .ql-stroke,.ql-snow.ql-toolbar button:hover:not(.ql-active) .ql-stroke-miter,.ql-snow .ql-toolbar button:hover:not(.ql-active) .ql-stroke-miter{stroke:#444}}.ql-snow,.ql-snow *{box-sizing:border-box}.ql-snow .ql-hidden{display:none}.ql-snow .ql-out-bottom,.ql-snow .ql-out-top{visibility:hidden}.ql-snow .ql-tooltip{position:absolute;transform:translateY(10px)}.ql-snow .ql-tooltip a{cursor:pointer;text-decoration:none}.ql-snow .ql-tooltip.ql-flip{transform:translateY(-10px)}.ql-snow .ql-formats{display:inline-block;vertical-align:middle}.ql-snow .ql-formats:after{clear:both;content:"";display:table}.ql-snow .ql-stroke{fill:none;stroke:#444;stroke-linecap:round;stroke-linejoin:round;stroke-width:2}.ql-snow .ql-stroke-miter{fill:none;stroke:#444;stroke-miterlimit:10;stroke-width:2}.ql-snow .ql-fill,.ql-snow .ql-stroke.ql-fill{fill:#444}.ql-snow .ql-empty{fill:none}.ql-snow .ql-even{fill-rule:evenodd}.ql-snow .ql-thin,.ql-snow .ql-stroke.ql-thin{stroke-width:1}.ql-snow .ql-transparent{opacity:.4}.ql-snow .ql-direction svg:last-child{display:none}.ql-snow .ql-direction.ql-active svg:last-child{display:inline}.ql-snow .ql-direction.ql-active svg:first-child{display:none}.ql-snow .ql-editor h1{font-size:2em}.ql-snow .ql-editor h2{font-size:1.5em}.ql-snow .ql-editor h3{font-size:1.17em}.ql-snow .ql-editor h4{font-size:1em}.ql-snow .ql-editor h5{font-size:.83em}.ql-snow .ql-editor h6{font-size:.67em}.ql-snow .ql-editor a{text-decoration:underline}.ql-snow .ql-editor blockquote{border-left:4px solid #ccc;margin-bottom:5px;margin-top:5px;padding-left:16px}.ql-snow .ql-editor code,.ql-snow .ql-editor pre{background-color:#f0f0f0;border-radius:3px}.ql-snow .ql-editor pre{white-space:pre-wrap;margin-bottom:5px;margin-top:5px;padding:5px 10px}.ql-snow .ql-editor code{font-size:85%;padding:2px 4px}.ql-snow .ql-editor pre.ql-syntax{background-color:#23241f;color:#f8f8f2;overflow:visible}.ql-snow .ql-editor img{max-width:100%}.ql-snow .ql-picker{color:#444;display:inline-bl


    private val floatCache = mutableListOf<Float>()

    private val setValue = getSingularSetter(activeInfo)

    override fun setValue(value: Any, textures: GLTextures?) {
        setValue.invoke(value, textures)
    }

    private fun getSingularSetter(activeInfo: ActiveUniformInfo): (Any, GLTextures?) -> Unit {

        return when (activeInfo.type) {
            0x1406 -> { v, _ -> setValueV1f(v) }
            0x8b50 -> { v, _ -> setValueV2f(v) }
            0x8b51 -> { v, _ -> setValueV3f(v) }
            0x8b52 -> { v, _ -> setValueV4f(v) }

            0x8b5a -> TODO() // _MAT2
            0x8b5b -> { v, _ -> setValueM3(v) } // _MAT3
            0x8b5c -> { v, _ -> setValueM4(v) } // _MAT4

            0x8b5e, 0x8d66 -> { v, t -> setValueT1(v, t!!) } // SAMPLER_2D, SAMPLER_EXTERNAL_OES
            0x8b5f -> TODO() // SAMPLER_3D
            0x8b60 -> TODO() // SAMPLER_CUBE
            0x8DC1 -> TODO() // SAMPLER_2D_ARRAY

            0x1404, 0x8b56 -> { v, _ -> setValueV1i(v) } // INT, BOOL
            0x8b53, 0x8b57 -> { v, _ -> setValueV2i(v) } // _VEC2
            0x8b54, 0x8b58 -> { v, _ -> setValueV3i(v) } // _VEC3
            0x8b55, 0x8b59 -> { v, _ -> setValueV4i(v) } // _VEC4

            else -> throw IllegalArgumentException("Illegal or unsupported type encountered: $activeInfo")

        }

    }

    fun setValueT1(v: Any, textures: GLTextures) {
        when (v) {
            is Texture -> {
                val unit = textures.allocateTextureUnit()
                GL20.glUniform1i(addr, unit)
                textures.setTexture2D(v, unit)
            }
            else -> throw IllegalArgumentException("Illegal type encountered: $v")
        }
    }

    fun setValueV1i(v: Any) {
        when (v) {
            is Int -> GL20.glUniform1i(addr, v)
            is Boolean -> GL20.glUniform1i(addr, if (v) 1 else 0)
            else -> throw IllegalArgumentException("Illegal type encountered: $v")
        }
    }

    fun setValueV2i(v: Any) {
        when (v) {
            is IntArray -> GL20.glUniform2iv(addr, v)
            is Vector2 -> GL20.glUniform2i(addr, v.x.roundToInt(), v.y.roundToInt())
            else -> throw IllegalArgumentException("Illegal type encountered: $v")
        }
    }

    fun setValueV3i(v: Any) {
        when (v) {
            is IntArray -> GL20.glUniform3iv(addr, v)
            is Vector3 -> GL20.glUniform3i(addr, v.x.roundToInt(), v.y.roundToInt(), v.z.roundToInt())
            else -> throw IllegalArgumentException("Illegal type encountered: $v")
        }
    }

    fun setValueV4i(v: Any) {
        when (v) {
            is IntArray -> GL20.glUniform4iv(addr, v)
            is Vector4 -> GL20.glUniform4i(addr, v.x.roundToInt(), v.y.roundToInt(), v.z.roundToInt(), v.w.roundToInt())
            else -> throw IllegalArgumentException("Illegal type encountered: $v")
        }
    }

    fun setValueV1f(v: Any) {

        when (v) {
            is Float -> {
                if (floatCache


"""
The tool to check the availability or syntax of domain, IP or URL.

::

    ██████╗ ██╗   ██╗███████╗██╗   ██╗███╗   ██╗ ██████╗███████╗██████╗ ██╗     ███████╗
    ██╔══██╗╚██╗ ██╔╝██╔════╝██║   ██║████╗  ██║██╔════╝██╔════╝██╔══██╗██║     ██╔════╝
    ██████╔╝ ╚████╔╝ █████╗  ██║   ██║██╔██╗ ██║██║     █████╗  ██████╔╝██║     █████╗
    ██╔═══╝   ╚██╔╝  ██╔══╝  ██║   ██║██║╚██╗██║██║     ██╔══╝  ██╔══██╗██║     ██╔══╝
    ██║        ██║   ██║     ╚██████╔╝██║ ╚████║╚██████╗███████╗██████╔╝███████╗███████╗
    ╚═╝        ╚═╝   ╚═╝      ╚═════╝ ╚═╝  ╚═══╝ ╚═════╝╚══════╝╚═════╝ ╚══════╝╚══════╝

Provides the schema of our "whois_record" table.

Author:
    Nissar Chababy, @funilrys, contactTATAfunilrysTODTODcom

Special thanks:
    https://pyfunceble.github.io/special-thanks.html

Contributors:
    https://pyfunceble.github.io/contributors.html

Project link:
    https://github.com/funilrys/PyFunceble

Project documentation:
    https://docs.pyfunceble.com

Project homepage:
    https://pyfunceble.github.io/

License:
::

    Copyright 2017, 2018, 2019, 2020, 2022, 2023, 2024, 2025 Nissar Chababy

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

        https://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
"""

from datetime import datetime, timezone

from sqlalchemy import Column, DateTime, String, Text

from PyFunceble.database.sqlalchemy.base_schema import SchemaBase

class Continue(SchemaBase):
    """
    Provides the schema of our continue table.
    """

    idna_subject = Column(Text, nullable=False)
    checker_type = Column(String(length=50), nullable=False)
    destination = Column(Text, nullable=False)
    source = Column(Text, nullable=False)
    tested_at = Column(
        DateTime(), default=lambda: datetime.now(tz=timezone.utc), nullable=False
    )
    session_id = Column(Text, nullable=True, default=None)


/*
Copyright (c) 2015, Plume Design Inc. All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
   1. Redistributions of source code must retain the above copyright
      notice, this list of conditions and the following disclaimer.
   2. Redistributions in binary form must reproduce the above copyright
      notice, this list of conditions and the following disclaimer in the
      documentation and/or other materials provided with the distribution.
   3. Neither the name of the Plume Design Inc. nor the
      names of its contributors may be used to endorse or promote products
      derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL Plume Design Inc. BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#ifndef OSN_LTE_H_INCLUDED
#define OSN_LTE_H_INCLUDED

#include <stdbool.h>

#include "osn_types.h"

/**
 * @file osn_lte.h
 *
 * @brief OpenSync LTE Interface Abstraction
 *
 * @addtogroup OSN
 * @{
 *
 * @defgroup OSN_LTE LTE
 *
 * OpenSync API for managing LTE interfaces
 *
 * @{
 */

/*
 * ===========================================================================
 *  LTE interface configuration
 * ===========================================================================
 */

/**
 * OSN LTE object type
 *
 * This is an opaque type. The actual structure implementation is hidden and is
 * platform dependent. A new instance of the object can be obtained by calling
 * @ref osn_lte_new() and must be destroyed using @ref osn_lte_del().
 */
typedef struct osn_lte osn_lte_t;

/**
 * Create a new instance of a LTE interface object.
 *
 * @param[in]   ifname  LTE interface name
 *
 * @return
 * This function returns NULL if an error occurs, otherwise a valid @ref
 * osn_lte_t object is returned.
 *
 * @note
 * The LTE interface may be created after osn_lte_apply() is called.
 */

osn_lte_t *osn_lte_new(const char *ifname);

/**
 * Destroy a valid osn_lte_t object.
 *
 * @param[in]   self  A valid pointer to an osn_lte_t object
 *
 * @return
 * This function returns true on success. On error, false is returned.
 * The input parameter should be considered invalid after this function
 * returns, regardless of the error code.
 *
 * @note
 * All resources that were allocated during the lifetime of the object are
 * freed.
 */
bool osn_lte_del(osn_lte_t *self);

/**
 * Apply the interface LTE configuration to the system. If not already created,
 * this function will create the LTE interface.
 *
 * @note
 * When this function returns, the running system may be still in an incomplete
 * configuration state -- this function just ensures that the configuration
 * process has started.
 */
bool osn_lte_apply(osn_lte_t *self);

/** @} OSN_LTE */
/** @} OSN */

#endif /* OSN_LTE_H_INCLUDED */


          五

            这几天是退一步想：假使那老头子不是刽子手扮的，真是医生，也仍然是吃人的人。他们的祖师李时珍做的“本草什么”⑷上，明明写着人肉可以煎吃；他还能说自己不吃人么？

            至于我家大哥，也毫不冤枉他。他对我讲书的时候，亲口说过可以“易子而食”⑸；又一回偶然议论起一个不好的人，他便说不但该杀，还当“食肉寝皮”⑹。我那时年纪还小，心跳了好半天。前天狼子村佃户来说吃心肝的事，他也毫不奇怪，不住的点头。可见心思是同从前一样狠。既然可以“易子而食”，便什么都易得，什么人都吃得。我从前单听他讲道理，也胡涂过去；现在晓得他讲道理的时候，不但唇边还抹着人油，而且心里满装着吃人的意思。

            六

            黑漆漆的，不知是日是夜。赵家的狗又叫起来了。

            狮子似的凶心，兔子的怯弱，狐狸的狡猾，……
    -
        authorID: 2360
        addTime: 2019-11-15T10:00:00.000Z
        content: >-
            七

            我晓得他们的方法，直捷杀了，是不肯的，而且也不敢，怕有祸祟。所以他们大家连络，布满了罗网，逼我自戕。试看前几天街上男女的样子，和这几天我大哥的作为，便足可悟出八九分了。最好是解下腰带，挂在梁上，自己紧紧勒死；他们没有杀人的罪名，又偿了心愿，自然都欢天喜地的发出一种呜呜咽咽的笑声。否则惊吓忧愁死了，虽则略瘦，也还可以首肯几下。

            他们是只会吃死肉的！——记得什么书上说，有一种东西，叫“海乙那”⑺的，眼光和样子都很难看；时常吃死肉，连极大的骨头，都细细嚼烂，咽下肚子去，想起来也教人害怕。“海乙那”是狼的亲眷，狼是狗的本家。前天赵家的狗，看我几眼，可见他也同谋，早已接洽。老头子眼看着地，岂能瞒得我过。

            最可怜的是我的大哥，他也是人，何以毫不害怕；而且合伙吃我呢？还是历来惯了


);
  EXPECT_TRUE(Vals.count(Val4));
  EXPECT_TRUE(Vals.count(Val2));
  Vals = PV.getValuesForPhi(Phi2);
  EXPECT_EQ(Vals.size(), 2u);
  EXPECT_TRUE(Vals.count(Val2));
  EXPECT_TRUE(Vals.count(Val3));
  Vals = PV.getValuesForPhi(Phi3);
  EXPECT_EQ(Vals.size(), 3u);
  EXPECT_TRUE(Vals.count(Val1));
  EXPECT_TRUE(Vals.count(Val2));
  EXPECT_TRUE(Vals.count(Val3));

  // Check that replacing an incoming phi then deleting it works
  Phi3->setIncomingValue(1, Val2);
  PV.invalidateValue(Phi2);
  Phi2->eraseFromParent();
  PV.invalidateValue(Phi3);
  Vals = PV.getValuesForPhi(Phi1);
  EXPECT_EQ(Vals.size(), 2u);
  EXPECT_TRUE(Vals.count(Val4));
  EXPECT_TRUE(Vals.count(Val2));
  Vals = PV.getValuesForPhi(Phi3);
  EXPECT_EQ(Vals.size(), 2u);
  EXPECT_TRUE(Vals.count(Val1));
  EXPECT_TRUE(Vals.count(Val2));
}
//=======- AliasSetTrackerTest.cpp - Unit test for the Alias Set Tracker  -===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#include "llvm/Analysis/AliasSetTracker.h"
#include "llvm/Analysis/AliasAnalysis.h"
#include "llvm/Analysis/TargetLibraryInfo.h"
#include "llvm/Analysis/TypeBasedAliasAnalysis.h"
#include "llvm/AsmParser/Parser.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/IR/Module.h"
#include "llvm/Support/SourceMgr.h"
#include "llvm/TargetParser/Triple.h"
#include "gtest/gtest.h"

using namespace llvm;

TEST(AliasSetTracker, AliasUnknownInst) {
  StringRef Assembly = R"(
    @a = common global i32 0, align 4
    @b = common global float 0.000000e+00, align 4

    ; Function Attrs: nounwind ssp uwtable
    define i32 @read_a() #0 {
      %1 = load i32, i32* @a, align 4, !tbaa !3
      ret i32 %1
    }

    ; Function Attrs: nounwind ssp uwtable
    define void @write_b() #0 {
      store float 1.000000e+01, float* @b, align 4, !tbaa !7
      ret void
    }

    ; Function Attrs: nounwind ssp uwtable
    define void @test() #0 {
      %1 = call i32 @read_a(), !tbaa !3
      call void @write_b(), !tbaa !7
      ret void
    }

    !3 = !{!4, !4, i64 0}
    !4 = !{!"int", !5, i64 0}
    !5 = !{!"omnipotent char", !6, i64 0}
    !6 = !{!"Simple C/C++ TBAA"}
    !7 = !{!8, !8, i64 0}
    !8 = !{!"float", !5, i64 0}
  )";

  // Parse the IR. The two calls in @test can not access aliasing elements.
  LLVMContext Context;
  SMDiagnostic Error;
  auto M = parseAssemblyString(Assembly, Error, Context);
  ASSERT_TRUE(M) << "Bad assembly?";

  // Initialize the alias result.
  Triple Trip(M->getTargetTriple());
  TargetLibraryInfoImpl TLII(Trip);
  TargetLibraryInfo TLI(TLII);
  AAResults AA(TLI);
  TypeBasedAAResult TBAAR;
  AA.addAAResult(TBAAR);

  // In


',
            'ApprovalTests',
            'Refactoring',
            'Live Coding',
            'Agile',
          ],
          lang: ['fr'],
        },
        {
          title: "La pyramide des tests - d'oú sort il?",
          abstract:
            "Mike Cohn a dit qu'il fallait beacoup de tests bas niveau et peu de tests haut niveau. Quand est-ce que c'est vrai? Quand dois-je penser à apprendre à faire des tests 'unitaires' pour ne pas écrouler ma productivité avec une maintenance lourde des tests haut niveau? Une analyse basé sur deux expéreinces diamétralement opposées.",
          tags: [
            'Legacy Code',
            'Test',
            'TDD',
            'Extreme Programming',
            'ApprovalTests',
            'Refactoring',
            'Live Coding',
            'Agile',
          ],
          lang: ['fr'],
        },
      ],
      cities: ['Grenoble'],
      contacts: {
        twitter: 'johan_alps',
        mail: 'martinsson.johan@gmail.com',
      },
    },
    {
      since: '2014-07-23',
      name: 'Pierre Baillet',
      bio:
        'Principal Engineer at Sonos • Mauvais plaisantin mais bon vivant • ',
      picture:
        'https://www.gravatar.com/userimage/7364231/abcb8f5931db676141afd368fb844cc2.jpg?size=250',
      websites: [
        {
          name: 'Web',
          url: 'http://oct.zoy.org',
        },
        {
          name: 'LinkedIn',
          url: 'https://fr.linkedin.com/in/octplane/',
        },
        {
          name: 'GitHub',
          url: 'https://github.com/octplane',
        },
      ],
      location: 'Bordeaux',
      sessions: [
        {
          title: 'Datadog pour les nuls',
          abstract:
            "Fort de mon expérience chez Datadog, je vous propose de découvrir Datadog et ce que ce SaaS peut vous apporter en terme d'observabilité et de monitoring.",
          tags: ['Datadog', 'Monitoring', 'Observabilité'],
          lang: ['fr'],
        },
        {
          title: 'Le Chaos Engineering pour les nuls',
          abstract:
            "Vos services sont les plus robustes du monde ? Êtes vous prêt à passer à la vitesse supérieure ? Découvrez le Chaos Engineering, fils fou et prodige des SRE et de l'armée de 12 singes.",
          tags: ['Chaos', 'Monitoring', 'Robustness', 'Reliability'],
          lang: ['fr'],
        },
        {
          title: 'Des fossés et des trolls',
          abstract:
            'What is ze devops ? Concept nébuleux ou révolution industrielle ? Comment combler le fossé entre les développeurs et les opérationnels (avec autre choses que des trolls).',
          tags: ['Git', 'Deployment', 'DevOps', 'Intégration continue'],
          lang: ['fr'],
        },
        {
          title: 'Git pour les nuls',
          abstract:
            'Débutant en SCM ou vétérans de SVN, le contrôle de source est quelque chose qui est cher à votre coeur. Passez à la vitesse supérieure avec Git, le système de contrôle de source décentralisé très déroutant au premier abord. Initiez-vous avec moi, en jouant avec git, son workflow et ses autres joyeusetés. Ne perdez plus de source, jamais !',
          tags: ['Git', 'Deployment', 'DevOps', 'Intégration continue'],
          lang: ['fr'],
        },
        {
          title: 'Les


#!/usr/bin/env python3
# -*- coding: utf-8 -*-

# 数据结构

# 列表（List）：
my_list = [1, 2, 3, 4, 5]
# 列表是一种有序的集合，其中的元素可以是任意类型，并且可以通过索引来访问和修改
# 列表是可变的（Mutable），即列表中的元素可以被增加、删除或修改

# append()  在列表末尾添加一个元素
# insert()  在指定位置插入一个元素
# extend()  将另一个列表的所有元素添加到当前列表的末尾

# pop()     删除并返回列表中指定位置的元素，默认为末尾元素
# remove()  删除列表中指定值的元素，只删除第一个匹配的元素
# del       关键字删除列表中指定位置的元素
del my_list[1]

# ⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝

# 元组（Tuple）：
my_tuple = (1, 2, 3, 4, 5)
# 元组也是一种有序的集合，其中的元素可以是任意类型，并且可以通过索引来访问
# 元组是不可变的（Immutable），即元组中的元素不可被修改
# 定义一个只有 1 个元素的 tuple，必须加一个逗号,，来消除歧义。因为括号()既可以表示 tuple，又可以表示数学公式中的小括号
t = (1,)
t = (1)  # 这种情况下，按小括号进行计算，计算结果自然是 1，不是 tuple

# ⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝

# 字典（Dictionary）：
my_dict = {'name': 'John', 'age': 30}
# 字典是一种无序的键值对集合，其中的元素是由键和值组成的
# 字典中的键是唯一的，而值可以是任意类型
# 字典是可变的，即字典中的键值对可以被增加、删除或修改

'''dict的key必须是不可变对象'''
'''在Python中，字符串、整数等都是不可变的，因此，可以放心地作为 key。而 list 是可变的，就不能作为 key'''

# 要避免 key 不存在的错误，有两种办法，一是通过 in 判断 key 是否存在
'Thomas' in my_dict
# False

# 二是通过 dict 提供的 get() 方法，如果 key 不存在，可以返回 None，或者自己指定的 value
my_dict.get('Thomas')
my_dict.get('Thomas', -1)
# -1

# 删除一个 key，用 pop(key) 方法，对应的 value 也会从 dict 中删除
my_dict.pop('age')

# dict 内部存放的顺序和 key 放入的顺序是没有关系的
'''
和list比较，dict有以下几个特点：
查找和插入的速度极快，不会随着key的增加而变慢；
需要占用大量的内存，内存浪费多。

而list相反：
查找和插入的时间随着元素的增加而增加；
占用空间小，浪费内存很少。

所以，dict是用空间来换取时间的一种方法。
'''
# ⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝⏝

# 集合（Set）：
my_set = {1, 2, 3, 4, 5}
# 集合是一种无序的唯一元素集合，其中的元素不会重复
# 集合中的元素可以是任意不可变类型（例如整数、浮点数、字符串、元组等）
# 集合是可变的，即集合中的元素可以被增加或删除

# add(key) 方法可以添加元素到 set 中
my_set.add(4)
# remove(key) 方法可以删除元素
my_set.remove(4)

# set 可以看成数学意义上的无序和无重复元素的集合，因此，两个 set 可以做数学意义上的交集、并集等操作
s1 = set([1, 2, 3])
s2 = set([2, 3, 4])

s1 & s2
# {2, 3}
s1 | s2
# {1, 2, 3, 4}

# set 和 dict 的唯一区别仅在于没有存储对应的 value
# 但是，set 的原理和 dict 一样，所以，同样不可以放入可变对象，因为无法判断两个可变对象是否相等，也就无法保证 set 内部“不会有重复元素”。

# 再议不可变对象
# str 是不变对象，而 list 是可变对象

# 对于可变对象，比如 list，对 list 进行操作，list 内部的内容是会变化的
a = ['c', 'b', 'a']
a.sort()
a
# ['a', 'b', 'c']

# 对于不可变对象
a = 'abc'
a.replace('a', 'A')
# 'Abc'
a
# 'abc'

# 虽然字符串有个 replace() 方法，也确实变出了 'Abc'，但变量 a 最后仍是 'abc'，如下
a = 'abc'
b = a.replace('a', 'A')
b
# 'Abc'
a
# 'abc'

# 始终牢记，a 是变量，而 'abc' 才是字符串对象！
# replace 方法创建了一个新字符串 'Abc' 并返回

# 对于不变对象来说，调用对象自身的任意方法，也不会改变该对象自身的内容。
# 相反，这些方法会创建新的对象并返回，这样，就保证了不可变对象本身永远是不可变的。

# 使用 key-value 存储结构的 dict 在 Python 中非常有用，选择不可变对象作为 key 很重要，最常用的 key 是字符串。


回收站 (  )

评论数

[[${commentCount}]]

                             0}" class="text-white">你有  [[${unRead}]]  条未读评论
                            -

文集数

[[${kindCount}]]

                            -

标签数

[[${tagCount}]]

                            -

 访问统计

                                <canvas id="lineChart"></canvas>

每天12:00更新前一天的访问数据

 来访概况

                                        点击
                                        访客

                                        昨天：
                                        <td clas


 parallelEntities };
        } catch (error) {
            console.log('Error : ', JSON.stringify(error));
            throw (error);
        }
    }

    /**
     * A situation in which the imports cannot happen
     */
    verifyInputJSONValidatin() {

        try {
            _.forOwn(this.inputJSON, (value: any, key: string) => {
                value = (value.length) ? value : [];
                value.forEach((x: string) => {
                    let dependentEntities = this.inputJSON[x] ? this.inputJSON[x] : [];
                    if (_.includes(dependentEntities, key)) throw ('Invalid InputJSON')
                });

            });
        }
        catch (error) {
            throw (error);
        }
    }
    /**
     *
     * @param x key
     */
    private arrangeOrder(x: string) {

        let values = this.inputJSON[x] ? this.inputJSON[x] : [];
        values.forEach((y: string) => this.arrangeOrder(y))
        this.dependentEntities.add(x);
    }

    /**
     *  Mark all the imports that can happen in parallel
     */
    private findParallelEntity(): Set<string> {

        let keys = Object.keys(this.inputJSON);
        let allValues = [].concat.apply([], Object.values(this.inputJSON));
        let unique = _.uniq(allValues);
        let diffEntity = _.difference(keys, unique);
        let parallelEntity = new Set();
        diffEntity.forEach((x: string) => {
            const values = this.inputJSON[x] ? this.inputJSON[x] : [];
            if (!values.length) {
                parallelEntity.add(x);
            }
        });
        return parallelEntity;
    }
    /**
     * Mark all imports that need to happen in sequence
     */
    private findSequenceEnity() {

        let data = new Set();
        _.forOwn(this.inputJSON, (value: any, key: string) => {
            if (!value.length)
                this.dependentEntities.add(key);
            else {
                data.add(key)
                value.forEach((x) => data.add(x))
            }
        });
        data.forEach((x) => this.arrangeOrder(x))

    }

}

const objTest: ClsResolveDependency = new ClsResolveDependency();
let result: IResult = objTest.resolveDependency(inputJSON)
console.log('Results of parallelEntities : ', result.parallelEntities);
console.log('Results of squenceEntities : ', result.squenceEntities);

import { AncientWisdom } from './ancientWisdom.model';
import { BasicCostClaculator } from '../basicCostCalculator';

export class PermanentUpgradeLongerFarmTimer extends AncientWisdom {
    constructor() {
        super();

        this.name = 'Longer Farm Map Timer';
        this.costCalculator = new BasicCostClaculator(100);
        this.bonusMultiplier = 5;
        this.maxUnlocks = 3;
    }

    formatBonus(val: number): string {
        return '+' + (this.calculateBonus(val)).toLocaleString();
    }
}
//04-condicioneeales.ts
const casado = true;
if(casado == true){
    console.log("Si estoy casada");
}else{
    console.log("No estoy casada");
}

if(casado == false) {  // Expresión -->boolean
    console.log("No estoy casada");
}else{
    console.log("Si estoy casada");
}

if(casado != true) {
    console.log("No estoy casada");
}else{
    console.log("Si estoy casada");
}

if(casado != false) {
    console.log("Si estoy casada");
}else{
    console.log("No estoy casada");
}

const tengoMosa = true;
const estaCasado = casado == true;  //expresión
const soyMosero = tengoMosa == true;
if(


>

Referenced by tbb::mutex::scoped_lock::try_acquire().

The documentation for this class was generated from the following file:

mutex.h

Copyright © 2005-2018 Intel Corporation.  All Rights Reserved.

Intel, Pentium, Intel Xeon, Itanium, Intel XScale and VTune are
registered trademarks or trademarks of Intel Corporation or its
subsidiaries in the United States and other countries.

* Other names and brands may be claimed as the property of others.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.5"/>
<title>Class List</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>

<link href="doxygen.css" rel="stylesheet" type="text/css" />

Main Page

Related Pages

Modules

Namespaces

Classes

Files

Class List

Class Hierarchy

Class Members

Class List

Here are the classes, structs, unions and interfaces with brief descriptions:

[detail level 1234<span onclick="javasc


// Copyright (c) Wojciech Figat. All rights reserved.

using Flax.Build;
using System.IO;

namespace Flax.Deps.Dependencies
{
    /// <summary>
    /// AMD GPU Services (AGS) library
    /// https://github.com/GPUOpen-LibrariesAndSDKs/AGS_SDK
    /// </summary>
    /// <seealso cref="Flax.Deps.Dependency" />
    class AGS : Dependency
    {
        /// <inheritdoc />
        public override TargetPlatform[] Platforms
        {
            get => new[] { TargetPlatform.Windows };
        }

        /// <inheritdoc />
        public override void Build(BuildOptions options)
        {
            var root = options.IntermediateFolder;
            var moduleFolder = Path.Combine(options.ThirdPartyFolder, "AGS");

            // Get the source
            CloneGitRepoFast(root, "https://github.com/GPUOpen-LibrariesAndSDKs/AGS_SDK.git");

            // Copy files
            foreach (var platform in options.Platforms)
            {
                BuildStarted(platform);


/heads/main/hetzner_traffic_manager.sh
   sudo chmod 700 ./hetzner_traffic_manager.sh
   sudo chown -R root:root ./hetzner_traffic_manager.sh
   ```

3. Configure the script

- Open `hetzner_traffic_manager.sh` and add your Hetzner API token and server ID in the configuration section:

   ```bash
   API_TOKEN="your-api-token"        # Your Hetzner Cloud API token
   SERVER_ID="your-server-id"        # The ID of the server to monitor
   LIMIT_TB_OFFSET=-1                # Adjusts the included traffic down (-1) or up (+1) in TB
   LIMIT_GB_OFFSET=0                 # Fine-tune the traffic limit in GB (can adjust the value of LIMIT_TB_OFFSET)
   ```
   Note: Ensure there is a sufficient buffer from the traffic limit because the Hetzner API does not update the total outgoing traffic in real-time. This delay can lead to inaccuracies if the buffer is too small. The delay is as in the dashboard, about 1 hour.
   The values of `LIMIT_TB_OFFSET` and `LIMIT_GB_OFFSET` are used together to calculate the `LIMIT_BYTES_OFFSET`.
   Additionally, Bash natively does not support floating-point calculations without additional libraries or tools. Therefore, TB values derived from the calculated byte offset cannot be fully trusted for precise console output. Manually verify the conversion from bytes to TB when using the GB offset to ensure accuracy.

### Usage

1. **Run the script to test**:

   After adjusting the configuration, you can run the script directly to test it:

   ```bash
   /root/hetzner_traffic_manager.sh
   ```

2. **Automate with Cron**:

   You can run the script regularly using Cron. Add it to your Crontab:

   ```bash
   sudo crontab -e
   ```

   Example: Run every minute:

   ```bash
   * * * * * /root/hetzner_traffic_manager.sh
   ```

   Alternative way to add via a temporary file:

   ```bash
   crontab -u root -l > /tmp/tmp_crontab && echo "* * * * * /root/hetzner_traffic_manager.sh" >> /tmp/tmp_crontab
   crontab -u root /tmp/tmp_crontab && rm /tmp/tmp_crontab

**Possible Improvements**:
- Manage multiple servers returned by the API query and match them based on their IDs.
- Apply the offset limit for each server individually, allowing for more flexible traffic monitoring across multiple servers.
- Better handling of API errors.
# Dockerfiles

[![Circle CI](https://img.shields.io/circleci/project/github/JanitorTechnology/dockerfiles.svg)](https://circleci.com/gh/JanitorTechnology/workflows/dockerfiles)
[![Docker Hub](https://img.shields.io/docker/automated/janitortechnology/janitor.svg)](https://hub.docker.com/r/janitortechnology/)

Popular development environments as Docker containers.

Core images are available on Docker Hub under [/janitortechnology/](https://hub.docker.com/u/janitortechnology/).

## Ubuntu-dev

Most images here are based on `ubuntu-dev`, which is basically `ubuntu:16.04` with:

- Useful packages like `clang`, `git`, `vim`…
- A `user` which can `sudo`
- Remote access via `ssh`, [Cloud9 IDE](https://c9.io) and [noVNC](https://kanaka.github.io/noVNC/)
- An extensible `supervisor` configuration

To build [janitortechnology/ubuntu-dev](https://hub.docker.com/r/janitortechnology/ubuntu-dev/) yourself:

    cd ubuntu-dev
    docker build -t janitortechnology/ubuntu-dev -f ubuntu-dev.dockerfi


ipping Network",
		"NextLevel Sports Management Signs High-Profile Athletes",
		//"Sustainable Agriculture Group Promotes Organic Farming",
		//"Tech Innovators Inc. to Host Annual Tech Summit This Fall",
		//"Cloud Based Solutions Unveils New Secure Data Services",
	}
)

// initializeRobSentences tokenizes the fixed robSentences (as opposed to using FineWeb, the default)
// and trims any padding.
func initializeRobSentences(minNumExamples int) []tokenizedSentence {
	numSentences := len(robSentences)
	results := make([]tokenizedSentence, max(numSentences, minNumExamples))

	// Create tokenizer: it is configured by the "tokenizer.json" to a max_length of 128, with padding.
	repoTokenizer := hub.New(KnightsAnalyticsSBertID).WithAuth(hfAuthToken)
	localFile := must.M1(repoTokenizer.DownloadFile("tokenizer.json"))
	tokenizer := must.M1(dtok.FromFile(localFile))
	defer func() { _ = tokenizer.Close() }()

	for idxSentence, sentence := range robSentences {
		encoding := tokenizer.EncodeWithOptions(sentence, false,
			dtok.WithReturnTypeIDs(),
			dtok.WithReturnAttentionMask(),
		)

		// Find sequenceLen for sentence.
		sequenceLen := len(encoding.AttentionMask)
		for sequenceLen > 0 && encoding.AttentionMask[sequenceLen-1] == 0 {
			sequenceLen--
		}
		sequenceLen = 13

		results[idxSentence].Encoding[0] = padOrTrim(sequenceLen,
			sliceMap(encoding.IDs, func(id uint32) int64 { return int64(id) }),
			0)
		results[idxSentence].Encoding[1] = padOrTrim(sequenceLen,
			sliceMap(encoding.AttentionMask, func(id uint32) int64 { return int64(id) }),
			0)
		results[idxSentence].Encoding[2] = padOrTrim(sequenceLen,
			sliceMap(encoding.TypeIDs, func(id uint32) int64 { return int64(id) }),
			0)
	}

	// Replicate extra examples at the end.
	for ii := numSentences; ii < len(results); ii++ {
		results[ii] = results[ii-numSentences] // Keep repeating.
	}
	return results
}

// formatDuration formats the duration with 2 decimal places but keeping the unit suffix.
func formatDuration(d time.Duration) string {
	s := d.String()
	i := 0
	for ; i < len(s); i++ {
		if (s[i] < '0' || s[i] > '9') && s[i] != '.' {
			break
		}
	}
	// Found the time unit (the suffix)
	num := s[:i]
	unit := s[i:]
	f, err := strconv.ParseFloat(num, 64)
	if err != nil {
		return s
	}
	return fmt.Sprintf("%.2f%s", f, unit)
}

func implParallelBenchmark[E any](
	name string,
	numWorkers, batchSize int, header bool,
	warmUpRuns int,
	inputFn func() E,
	workerFn func(workerIdx int, e E)) {
	// Parallelization:
	var wg sync.WaitGroup
	done := xsync.NewLatch()

	// Start producer of inputs:
	//   - We add some buffer, because we don't want the preparation of the inputs (producer)
	//     to be a bottleneck or even accounted for.
	examplesChan := make(chan E, numWorkers)
	wg.Add(1)
	go func() {
		defer wg.Done()
		// Create input and output tensors.
		for {
			e := inputFn()
			// Write the example or interrupt.
			select {
			case <-done.WaitChan():
				// Finished executing, simply exit.
				return
			case examplesChan <- e:
				// Move forward to produce the next input example.
			}
		}
	}()

	// Start consumers:
	finishedCounter :=


 70000 && !testDone) {
        objectRestorableIterator.restore();
        objectRestorableIterator.clearRestorePoint();
        i = 40000;
        testDone = true;
      }
    }
  }
}
//  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 edu.iu.dsc.tws.comms.selectors;

import java.util.HashSet;
import java.util.Set;

import org.junit.Assert;
import org.junit.Test;

public class HashingSelectorTest {
  @Test
  public void testNext() {
    HashingSelector selector = new HashingSelector();
    Set<Integer> sources = new HashSet<>();
    for (int i = 0; i < 10; i++) {
      sources.add(i);
    }
    Set<Integer> dests = new HashSet<>();
    for (int i = 0; i < 10; i++) {
      dests.add(i);
    }
    selector.prepare(null, sources, dests);

    Assert.assertEquals(selector.next(0, 1), 1);
    Assert.assertEquals(selector.next(0, 2), 2);
    Assert.assertEquals(selector.next(0, 222), 2);

    int[] ints = {1, 2, 3}; // hash 30817
    Assert.assertEquals(selector.next(0, ints), 7);
  }
}
//  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 edu.iu.dsc.tws.comms.utils;

import java.util.Comparator;

import org.junit.Assert;
import org.junit.Test;

import edu.iu.dsc.tws.api.comms.structs.Tuple;

public class HeapTest {

  @Test
  public void insert() {
    Heap<Integer, Integer> heap = new Heap<>(7, Comparator.comparingInt(o -> o));
    heap.insert(new Tuple<>(15, 15), 1);
    heap.insert(new Tuple<>(6, 6), 1);
    heap.insert(new Tuple<>(17, 17), 1);
    heap.insert(new Tuple<>(7, 7), 1);
    heap.insert(new Tuple<>(10, 10), 1);
    heap.insert(new Tuple<>(12, 12), 1);
    heap.insert(new Tuple<>(5, 5), 1);

    Assert.assertArrayEquals(new int[]{5, 7, 6, 15, 10, 17, 12},
        heap.getRawArray().stream().mapToInt(HeapNode::getKey).toArray());
  }

  @Test
  public void extractMin() {
    Heap<Integer, Integer> heap = new Heap<>(7, Comparator.comparingInt(o -> o));
    heap.insert(new Tuple<>(15, 15), 1);
    heap.insert(new Tuple<>(6, 6), 1);
    heap.insert(new Tuple<>(17, 17), 1);
    heap.insert(new Tuple<>(5, 5), 1);
    heap.insert(new Tuple<>(7, 7), 1);
    heap.insert(new Tuple


le = readFile(filePath);
      file.writeAsStringSync("");
      return true;
    } catch (err) {
     // LogUtil.e(err);
      return false;
    }
  }

  ///删除缓存文件
  static Future<bool> deleteFileData(String filePath) async {
    try {
      final file = readFile(filePath);
      file.delete();
      return true;
    } catch (err) {
   //   LogUtil.e(err);
      return false;
    }
  }

  ///日志上报文件
  static Future<File?> getAppLogFile(String fileName) async {
    //获取存储路径
    final filePath = await getAppDocDir();
    if (filePath == null) {
      return null;
    }
    //或者file对象（操作文件记得导入import 'dart:io'）
    String dirPath =
        "$filePath${Platform.pathSeparator}report${Platform.pathSeparator}";
    var saveDir = Directory(dirPath);
    bool hasExisted = await saveDir.exists();
    if (!hasExisted) {
      saveDir.create();
    }
    File realFile = File("$dirPath$fileName");
    if (!realFile.existsSync()) {
      realFile = await realFile.create();
      //var deviceInfo = await ReportUtil().getDeviceInfo();
     // LogUtil.d("deviceInfo \n ${deviceInfo.toString()}");
     //  realFile.writeAsStringSync("deviceInfo:${deviceInfo.toString()}\n",
     //      flush: true);
    }
    return realFile;
  }

  ///获取日志存文件
  static Future<String?> getAppLogFilePath() async {
    //获取存储路径
    final filePath = await getAppDocDir();
    if (filePath == null) {
      return null;
    }
    return "$filePath${Platform.pathSeparator}report${Platform.pathSeparator}$logReportFileName";
  }

  ///app初始化的时候 进行日志上报文件初始化
  static Future<void> initLogFileReport() async {
    // try {
    //   File? file = await getAppLogFile(logReportFileName);
    //   if(file == null) {
    //     return;
    //   }
    //   var deviceInfo = await ReportUtil().getDeviceInfo();
    //   if(!file.existsSync()) {
    //     file.create();
    //     LogUtil.d("deviceInfo \n ${deviceInfo.toString()}");
    //     file.writeAsStringSync(deviceInfo.toString(), flush: true);
    //   }
    //   //App启动的时候 判断最后修改时间 >24h 清空文件
    //   DateTime now = DateTime.now();
    //   int? logFileLastAccessTime = SpUtil.getInt(SpKey.logFileLastAccessTime, defValue: 0);
    //   DateTime lastModifyTime = DateTime.fromMillisecondsSinceEpoch(logFileLastAccessTime!);
    //   if(logFileLastAccessTime == 0 || now.millisecondsSinceEpoch - lastModifyTime.millisecondsSinceEpoch > 24 * 3600000) {
    //     SpUtil.putInt(SpKey.logFileLastAccessTime, now.millisecondsSinceEpoch);
    //     file.writeAsStringSync("", flush: true);
    //     file.writeAsStringSync(deviceInfo.toString(),flush: true);
    //     LogUtil.d("--------------reset log content------------");
    //   }
    //   await file.writeAsString("2023-7-20-version", mode: FileMode.append, flush: true);
    // } catch (err) {
    //   LogUtil.e(err);
    // }
  }

  ///手动清理日志文件 只能在上报成功后调用
  // static Future<void> clearReportLogFile


_ID).unwrap());
    params.push(u8::try_from(oid.oid.len).unwrap());
    params.extend_from_slice(oid_slc);

    let mut public_ptr: *mut sys::SECKEYPublicKey = null_mut();

    // Try to make an insensitive key so that we can read the key data for tracing.
    let insensitive_secret_ptr = if log_enabled!(log::Level::Trace) {
        unsafe {
            sys::PK11_GenerateKeyPairWithOpFlags(
                *slot,
                sys::CK_MECHANISM_TYPE::from(sys::CKM_EC_KEY_PAIR_GEN),
                (&mut Item::wrap(&params) as *mut sys::SECItem).cast(),
                &mut public_ptr,
                sys::PK11_ATTR_SESSION | sys::PK11_ATTR_INSENSITIVE | sys::PK11_ATTR_PUBLIC,
                sys::CK_FLAGS::from(sys::CKF_DERIVE),
                sys::CK_FLAGS::from(sys::CKF_DERIVE),
                null_mut(),
            )
        }
    } else {
        null_mut()
    };
    assert_eq!(insensitive_secret_ptr.is_null(), public_ptr.is_null());
    let secret_ptr = if insensitive_secret_ptr.is_null() {
        unsafe {
            sys::PK11_GenerateKeyPairWithOpFlags(
                *slot,
                sys::CK_MECHANISM_TYPE::from(sys::CKM_EC_KEY_PAIR_GEN),
                (&mut Item::wrap(&params) as *mut sys::SECItem).cast(),
                &mut public_ptr,
                sys::PK11_ATTR_SESSION | sys::PK11_ATTR_SENSITIVE | sys::PK11_ATTR_PRIVATE,
                sys::CK_FLAGS::from(sys::CKF_DERIVE),
                sys::CK_FLAGS::from(sys::CKF_DERIVE),
                null_mut(),
            )
        }
    } else {
        insensitive_secret_ptr
    };
    assert_eq!(secret_ptr.is_null(), public_ptr.is_null());
    let sk = PrivateKey::from_ptr(secret_ptr)?;
    let pk = PublicKey::from_ptr(public_ptr)?;
    trace!("Generated key pair: sk={:?} pk={:?}", sk, pk);
    Ok((sk, pk))
}

#[cfg(test)]
mod test {
    use super::{generate_key_pair, Config, HpkeR, HpkeS};
    use crate::hpke::Aead;
    use crate::init;

    const INFO: &[u8] = b"info";
    const AAD: &[u8] = b"aad";
    const PT: &[u8] = b"message";

    #[allow(clippy::similar_names)] // for sk_x and pk_x
    #[test]
    fn make() {
        init();
        let cfg = Config::default();
        let (mut sk_s, pk_s) = generate_key_pair(cfg.kem()).unwrap();
        let (mut sk_r, mut pk_r) = generate_key_pair(cfg.kem()).unwrap();
        let hpke_s = HpkeS::new(cfg, &pk_s, &mut sk_s, &mut pk_r, INFO).unwrap();
        let _hpke_r = HpkeR::new(cfg, &pk_r, &mut sk_r, &hpke_s.enc().unwrap(), INFO).unwrap();
    }

    #[allow(clippy::similar_names)] // for sk_x and pk_x
    fn seal_ope


from dolfin import *
import mpi4py.MPI
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.collections import LineCollection

def plot_mesh(coordinates, n, m, type):
    coordinates = np.transpose(coordinates)
    if type == 'Circle':
        plt.scatter(coordinates[0], coordinates[1])
    if type == 'Square':
        x = np.reshape(coordinates[0], (n+1, m+1))
        y = np.reshape(coordinates[1], (n+1, m+1))
        plt.scatter(coordinates[0], coordinates[1])
        segs1 = np.stack((x, y), axis=2)
        segs2 = segs1.transpose(1, 0, 2)
        plt.gca().add_collection(LineCollection(segs1))
        plt.gca().add_collection(LineCollection(segs2))

# comm = mpi4py.MPI.COMM_WORLD
# mesh = UnitDiscMesh.create(comm, 1, 1, 2)
n = 10
m = 10
mesh = UnitSquareMesh(n, m)
V = FunctionSpace(mesh, "Lagrange", 1)

plot_mesh(mesh.coordinates(), n, m, 'Square')
#plt.show()

def boundary(x):
    return x[0] < DOLFIN_EPS or x[0] > 1.0 - DOLFIN_EPS
u0 = Constant(0.0)
bc = DirichletBC(V, u0, boundary)

u = TrialFunction(V)
v = TestFunction(V)
#f = Expression("10*exp(-(pow(x[0] - 0.5, 2) + pow(x[1] - 0.5, 2)) / 0.02)", degree=2)
g = Expression("sin(5*x[0])", degree=1)
a = inner(grad(u), grad(v))*dx
L = g*v*dx

u = Function(V)
solve(a == L, u)

vertex_values = u.compute_vertex_values()
print(vertex_values)


mber {
        response += &format!("#{}", number);
    }
    response += "!";

    ctx.say(response).await?;
    Ok(())
}
use rustc::ty::{self, Ty, TypeFoldable, UpvarSubsts, Instance};
use rustc::ty::layout::{TyLayout, HasTyCtxt, FnTypeExt};
use rustc::mir::{self, Body};
use rustc::session::config::DebugInfo;
use rustc_target::abi::call::{FnType, PassMode, IgnoreMode};
use rustc_target::abi::{Variants, VariantIdx};
use crate::base;
use crate::debuginfo::{self, VariableAccess, VariableKind, FunctionDebugContext};
use crate::traits::*;

use syntax_pos::{DUMMY_SP, BytePos, Span};
use syntax::symbol::kw;

use std::iter;

use rustc_data_structures::bit_set::BitSet;
use rustc_data_structures::indexed_vec::IndexVec;

use self::analyze::CleanupKind;
use self::place::PlaceRef;
use rustc::mir::traversal;

use self::operand::{OperandRef, OperandValue};

/// Master context for codegenning from MIR.
pub struct FunctionCx<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> {
    instance: Instance<'tcx>,

    mir: &'a mir::Body<'tcx>,

    debug_context: FunctionDebugContext<Bx::DIScope>,

    llfn: Bx::Value,

    cx: &'a Bx::CodegenCx,

    fn_ty: FnType<'tcx, Ty<'tcx>>,

    /// When unwinding is initiated, we have to store this personality
    /// value somewhere so that we can load it and re-use it in the
    /// resume instruction. The personality is (afaik) some kind of
    /// value used for C++ unwinding, which must filter by type: we
    /// don't really care about it very much. Anyway, this value
    /// contains an alloca into which the personality is stored and
    /// then later loaded when generating the DIVERGE_BLOCK.
    personality_slot: Option<PlaceRef<'tcx, Bx::Value>>,

    /// A `Block` for each MIR `BasicBlock`
    blocks: IndexVec<mir::BasicBlock, Bx::BasicBlock>,

    /// The funclet status of each basic block
    cleanup_kinds: IndexVec<mir::BasicBlock, analyze::CleanupKind>,

    /// When targeting MSVC, this stores the cleanup info for each funclet
    /// BB. This is initialized as we compute the funclets' head block in RPO.
    funclets: IndexVec<mir::BasicBlock, Option<Bx::Funclet>>,

    /// This stores the landing-pad block for a given BB, computed lazily on GNU
    /// and eagerly on MSVC.
    landing_pads: IndexVec<mir::BasicBlock, Option<Bx::BasicBlock>>,

    /// Cached unreachable block
    unreachable_block: Option<Bx::BasicBlock>,

    /// The location where each MIR arg/var/tmp/ret is stored. This is
    /// usually an `PlaceRef` representing an alloca, but not always:
    /// sometimes we can skip the alloca and just store the value
    /// directly using an `OperandRef`, which makes for tighter LLVM
    /// IR. The conditions for using an `OperandRef` are as follows:
    ///
    /// - the type of the local must be judged "immediate" by `is_llvm_immediate`
    /// - the operand must never be referenced indirectly
    ///     - we should not take its address using the `&` operator
    ///     - nor should it appear in a place path like `tmp.a`
    /// - the operand must be defined by an rvalue that can generate immediate
    ///   values
    ///
    /// Avoiding allocs can also be important for certain intrinsics,


en
				disabled = true
				return
			end
			spellIcon = select(3, GetSpellInfo(spellId))
			maxRange = select(9, GetSpellInfo(spellId))

			QuickButton_Initialize()

			if DB.enabled and button then
				core:ShowIf(button, IsUsableSpell(spellName) == 1)
				UPDATE_BINDINGS()
			elseif button then
				button:Hide()
			end
		end
		core:RegisterForEvent("PLAYER_ENTERING_WORLD", PLAYER_ENTERING_WORLD)
		core:RegisterForEvent("SPELLS_CHANGED", PLAYER_ENTERING_WORLD)

		do
			local function init()
				if not disabled then
					QuickButton_Initialize()
				end
			end
			core:RegisterForEvent("PLAYER_TALENT_UPDATE", init)
			core:RegisterForEvent("RAID_ROSTER_UPDATE", init)
			core:RegisterForEvent("PARTY_MEMBERS_CHANGED", init)
		end

		function UPDATE_BINDINGS()
			if not disabled and button and button.hotkey then
				button.hotkey:SetText(GetBindingKey("CLICK QuickButtonFrame:LeftButton") or "")
			end
		end
		core:RegisterForEvent("UPDATE_BINDINGS", UPDATE_BINDINGS)
	end

	-- keybindings
	_G.BINDING_HEADER_KPACKQUICKBUTTON = "|cfff58cbaK|r|caaf49141Pack|r QuickButton"
end)


/*
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */

#pragma once

#include <map>

#include <folly/json/dynamic.h>

#include "mcrouter/lib/carbon/RequestReplyUtil.h"
#include "mcrouter/lib/config/RouteHandleFactory.h"
#include "mcrouter/routes/McRouteHandleBuilder.h"

namespace facebook {
namespace memcache {
namespace mcrouter {

namespace detail {

template <class RouterInfo>
typename RouterInfo::RouteHandlePtr makeRoutingGroupRoute(
    std::map<std::string, typename RouterInfo::RouteHandlePtr>
        routingGroupPolicies,
    typename RouterInfo::RouteHandlePtr defaultPolicy) {
  return makeRouteHandleWithInfo<RouterInfo, RoutingGroupRoute>(
      std::move(routingGroupPolicies), std::move(defaultPolicy));
}

} // namespace detail

template <class RouterInfo>
typename RouterInfo::RouteHandlePtr makeRoutingGroupRoute(
    RouteHandleFactory<typename RouterInfo::RouteHandleIf>& factory,
    const folly::dynamic& json) {
  if (!json.isObject()) {
    return factory.create(json);
  }

  auto jsonDefaultPolicy = json.get_ptr("default_policy");
  auto jOpPolicies = json.get_ptr("routing_group_policies");

  checkLogic(
      (jsonDefaultPolicy != nullptr || jOpPolicies != nullptr),
      "RoutingGroupRoute needs either 'default_policy' "
      "or 'routing_group_policies'");

  typename RouterInfo::RouteHandlePtr defaultPolicy;
  if (jsonDefaultPolicy) {
    defaultPolicy = factory.create(*jsonDefaultPolicy);
  }

  std::map<std::string, typename RouterInfo::RouteHandlePtr>
      routingGroupPolicies;

  if (jOpPolicies) {
    checkLogic(
        jOpPolicies->isObject(),
        "RoutingGroupRoute: routing_group_policies is not an object");

    for (auto& it : jOpPolicies->items()) {
      checkLogic(
          it.first.isString(),
          "RoutingGroupRoute: routing_group_policies' "
          "key is not a string");

      auto key = it.first.getString();
      checkLogic(
          key == carbon::kArithmeticKey || key == carbon::kDeleteKey ||
              key == carbon::kGetKey || key == carbon::kUpdateKey,
          "RoutingGroupRoute: {} is not a valid routing group.",
          key);

      checkLogic(
          routingGroupPolicies.find(key) == routingGroupPolicies.end(),
          "RoutingGroupRoute: {} is a duplicate key!",
          key);

      routingGroupPolicies[key] = factory.create(it.second);
    }

    return detail::makeRoutingGroupRoute<RouterInfo>(
        std::move(routingGroupPolicies), std::move(defaultPolicy));
  }

  return defaultPolicy;
}

} // namespace mcrouter
} // namespace memcache
} // namespace facebook


();
    hasher.update(claim_payload);
    let result: GenericArray<u8, U32> = hasher.finalize();
    let mut report_data = [0u8; 64];
    report_data[0..32].copy_from_slice(&result);
    let report = Report::for_target(&targetinfo, &report_data);
    let pkcs1 = priv_key.to_pkcs1_der();
    priv_key.zeroize();
    if let Ok(secret) = pkcs1 {
        match crate::sgx_app::keypair_seal::seal_secret(csprng, secret.as_der(), result.into()) {
            Ok(sealed_secret) => Ok((pub_key, sealed_secret, report)),
            Err(e) => Err(CloudError::SealingError(e)),
        }
    } else {
        Err(CloudError::SecretGenerationError)
    }
}

/// helper to decrypt the backup key
fn decrypt_wrapped_key(
    priv_key: &RsaPrivateKey,
    backup_data_seal: CloudBackupSeal,
) -> Result<GenericArray<u8, U32>, CloudError> {
    let mut wrapping_key = priv_key
        .decrypt(
            PaddingScheme::new_oaep::<sha2::Sha256>(),
            &backup_data_seal.encrypted_symmetric_key,
        )
        .map_err(|_| CloudError::DecryptionError)?;
    let msealing_key = keywrap::aes256_unwrap_key_with_pad(
        &wrapping_key,
        &backup_data_seal.wrapped_cloud_sealing_key,
    );
    wrapping_key.zeroize();
    msealing_key.map_err(CloudError::UnwrapError)
}

/// As cloud vendors may not guarantee HW affinity,
/// this is optionally used to seal the keypair with the externally provided
/// key (e.g. injected from cloud HSM) with `Aes256GcmSiv`.
/// The payload encrypted with this key can then be used to recover
/// when the instance is relocated etc.
pub fn cloud_backup(
    csprng: &mut OsRng,
    backup: CloudBackupKey,
    keypair: &Keypair,
) -> Result<CloudBackupKeyData, CloudError> {
    let mut priv_key_raw = crate::sgx_app::keypair_seal::unseal_secret(&backup.sealed_rsa_key)
        .map_err(CloudError::SealingError)?;
    let mpriv_key = RsaPrivateKey::from_pkcs1_der(&priv_key_raw);
    priv_key_raw.zeroize();
    let mut priv_key = mpriv_key.map_err(|_| CloudError::SecretGenerationError)?;
    let mbackup_key = decrypt_wrapped_key(&priv_key, backup.backup_key);
    priv_key.zeroize();
    let mut gk = mbackup_key?;
    let mut nonce = [0u8; 12];
    csprng.fill_bytes(&mut nonce);
    let payload = Payload {
        msg: keypair.secret.as_bytes(),
        aad: keypair.public.as_bytes(),
    };
    let nonce_ga = GenericArray::from_slice(&nonce);
    let aead = Aes256GcmSiv::new(&gk);
    let r = aead
        .encrypt(nonce_ga, payload)
        .map(|sealed_secret| CloudBackupKeyData {
            sealed_secret,
            nonce,
            public_key: keypair.public,
        })
        .map_err(|_| CloudError::EncryptionError);
    gk.zeroize();
    r
}

/// tries to recover the secret from the cloud backup data
/// and (re-)seal it for the current CPU
pub fn reseal_recover_cloud(
    csprng: &mut OsRng,
    backup: CloudBackupKey,
    cloud_backup: CloudBackupKeyData,
) -> Result<SealedKeyData, CloudError> {
    let mut priv_key_raw = crate::sgx_app::keypair_seal::