import json
import os
import re
import urllib
import alfred
import pocket

(action, query) = alfred.args() # proper decoding and unescaping of command line arguments

def login():
	code = pocket.getRequestCode()
	with open('code.json', 'w') as myFile:
		myFile.write(json.dumps(code))

	results = [alfred.Item(
		attributes={'uid': alfred.uid(0), 'arg': code["code"]},
		title='Login!',
		icon='icon.png',
		subtitle=u'Login with Pocket.com (you will be taken to pocket.com)'
	)] # a single Alfred result
	xml = alfred.xml(results) # compiles the XML answer
	alfred.write(xml) # writes the XML back to Alfred

def post():
	obj = applescript(query)
	pocket.post(obj)

def applescript(argument):
	if argument == "isChrome":
		return os.popen("""osascript -e 'tell app "System Events" to count processes whose name is "Google Chrome"' """).read().rstrip()
	if argument == "isSafari":
		return os.popen("""osascript -e 'tell app "System Events" to count processes whose name is "Safari"' """).read().rstrip()
	if argument == "chrome":
		obj = {}
		obj["url"] =  os.popen(""" osascript -e 'tell application "Google Chrome" to return URL of active tab of front window' """).readline()
		obj["title"] =  os.popen(""" osascript -e 'tell application "Google Chrome" to return title of active tab of front window' """).readline()
		return obj
	if argument == "safari":
		obj = {}
		obj["url"] =  os.popen(""" osascript -e 'tell application "Safari" to return URL of front document' """).readline()
		obj["title"] =  os.popen(""" osascript -e 'tell application "Safari" to return name of front document' """).readline()
		return obj
	if argument == 'isClipboard':
		clip = os.popen(""" osascript -e "get the clipboard" """).readline()
		try:
			url = re.search("(?P<url>https?://[^\s]+)", clip).group("url")
		except:
			url = ""
		return bool(url)
	if argument == 'clip':
		obj = {}
		clip = os.popen(""" osascript -e "get the clipboard" """).readline()
		try:
			obj["url"] = re.search("(?P<url>https?://[^\s]+)", clip).group("url")
		except:
			obj["url"] = ""
		return obj

def get_actions():
	arr = []
	isChrome = bool(int(applescript("isChrome")))
	isSafari = bool(int(applescript("isSafari")))
	isClipboard = applescript("isClipboard")

	if isChrome:
		chrome_url = applescript("chrome")
		arr.append(alfred.Item(
			attributes={'uid': alfred.uid(0), 'arg': "chrome"},
			title='Pocket - save url from Chrome',
			icon='icon.png',
			subtitle= chrome_url["title"].decode('utf8')
		))
	if isSafari:
		s_url = applescript("safari")
		arr.append(alfred.Item(
			attributes={'uid': alfred.uid(0), 'arg': "safari"},
			title='Pocket - save url from Safari',
			icon='icon.png',
			subtitle=s_url["title"].decode('utf8')
		))
	if isClipboard:
		c_url = applescript("clip")
		arr.append(alfred.Item(
				attributes={'uid': alfred.uid(0), 'arg': "clip"},
				title='Pocket - save url from Clipboard',
				icon='icon.png',
				subtitle=c_url["url"].decode('utf8')
			))
	xml = alfred.xml(arr)
	alfred.write(xml)

if action == 'login':
	login()
elif action == 'post':
	post()
elif action == 'get_actions':
	get_actions()


.inp").append(getData("ColumnNameInp"))
          .append(")==null || inputValue(frm.inp").append(getData("ColumnNameInp"))
          .append(")==\"\") {\n");
      if (getData("IsDisplayed").equals("Y"))
        validation.append("    setWindowElementFocus(frm.inp").append(getData("ColumnNameInp"))
            .append("_R);\n");
      validation.append("    showJSMessage(1);\n");
      validation.append("    return false;\n");
      validation.append("  }\n");
    }
    setValidation(validation.toString());
    setCalloutJS();
    {

      String text = "function debugSearch(key, text, keyField) {\n" + "  return true;\n" + "}";
      addJSCode("debugSearch", text);
    }
    if (!getData("IsReadOnly").equals("Y") && !getData("IsReadOnlyTab").equals("Y")) {
      StringBuffer commandScript = new StringBuffer();
      StringBuffer text = new StringBuffer();
      commandScript.append("openPAttribute(null, null, '../info/AttributeSetInstance.html', ");
      commandScript.append("null, true, 'frmMain', 'inp").append(getData("ColumnNameInp"))
          .append("', ");
      commandScript.append("'inp").append(getData("ColumnNameInp")).append("_R', ");
      commandScript.append("inputValue(document.frmMain.inp").append(getData("ColumnNameInp"))
          .append("_R), ");
      commandScript.append("'inpIDValue', inputValue(document.frmMain.inp")
          .append(getData("ColumnNameInp")).append("), ");
      commandScript.append("'WindowID', inputValue(document.frmMain.inpwindowId), ");
      commandScript.append("'inpKeyValue', inputValue(document.frmMain.inp")
          .append(getData("ColumnNameInp")).append("), ");
      commandScript.append("'inpwindowId', inputValue(document.frmMain.inpwindowId), ");
      commandScript.append("'inpProduct', inputValue(document.frmMain.inpmProductId)");
      text.append(commandScript).append(", 'Command', 'KEY'");
      commandScript.append(");");
      text.append(");");
      setOnLoad("keyArray[keyArray.length] = new keyArrayItem(\"ENTER\", \"" + text.toString()
          + "\", \"inp" + getData("ColumnNameInp") + "_R\", \"null\");");
      this.imageName = "AttributeSetInstance";
      this.searchName = getData("Name");
      this.command = commandScript.toString();
    }
  }
}
/*
 *************************************************************************
 * The contents of this file are subject to the Openbravo  Public  License
 * Version  1.1  (the  "License"),  being   the  Mozilla   Public  License
 * Version 1.1  with a permitted attribution clause; you may not  use this
 * file except in compliance with the License. You  may  obtain  a copy of
 * the License at http://www.openbravo.com/legal/license.html
 * Software distributed under the License  is  distributed  on  an "AS IS"
 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
 * License for the specific  language  governing  rights  and  limitations
 * under the License.
 * The Original Code is Openbravo ERP.
 * The Initial Developer of the Original Code is Openbravo SLU
 * All portions are Copyright (C) 2009-2010 Openbravo SLU
 * All Rights Reserved.
 * Contributor(s):  ______________________________________.
 ************************************************************************
 */
package org.openbravo.test.javascript;

import java.io.File;
import java.net.URL;
import java.util.Properties;

import junit.framework.TestCase;

import org.openbravo.base.exception.OBException;
import org.openbravo.base.session.OBPropertiesProvider;

/**
 * Test case for JavaScript API check
 *


a4,a3
cbylflXLoop	move.w	(a3)+,(a2)+
		dbra	d5,cbylflXLoop

		dbra	d4,cbylFullLoop

cbylNoFullTile
		move.w	d0,d4
		beq.s	cbylSkip
		subq.w	#1,d4
cbylRestLoop	move.w	(a4)+,(a2)+
		dbra	d4,cbylRestLoop

cbylSkip
		addq.w	#1,d3
		andi.w	#CBTILEDI


queryDispatcher.RunQueryAsync("test(4, 2)");
            await queryDispatcher.RunQueryAsync("test(2, 5)");
            await queryDispatcher.RunQueryAsync("test(6, 2)");
            await queryDispatcher.RunQueryAsync("test(8, 2)");
            await queryDispatcher.RunQueryAsync("test(25, 5)");


/ switch (sealedClass) {
///   case Subclass(:final field):
///     return ...;
///   case Subclass2(:final field2):
///     return ...;
/// }
/// ```

@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function(@JsonKey(fromJson: AppSettingProps.safeFromJson)  AppSettingProps appSetting,  List<Profile> profiles,  List<HotKeyAction> hotKeyActions,  String? currentProfileId,  bool overrideDns,  DAV? dav,  NetworkProps networkProps,  VpnProps vpnProps, @JsonKey(fromJson: ThemeProps.safeFromJson)  ThemeProps themeProps,  ProxiesStyle proxiesStyle,  WindowProps windowProps,  ClashConfig patchClashConfig,  ScriptProps scriptProps)  $default,) {final _that = this;
switch (_that) {
case _Config():
return $default(_that.appSetting,_that.profiles,_that.hotKeyActions,_that.currentProfileId,_that.overrideDns,_that.dav,_that.networkProps,_that.vpnProps,_that.themeProps,_that.proxiesStyle,_that.windowProps,_that.patchClashConfig,_that.scriptProps);case _:
  throw StateError('Unexpected subclass');

}
}
/// A variant of `when` that fallback to returning `null`
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
///   case Subclass(:final field):
///     return ...;
///   case _:
///     return null;
/// }
/// ```

@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function(@JsonKey(fromJson: AppSettingProps.safeFromJson)  AppSettingProps appSetting,  List<Profile> profiles,  List<HotKeyAction> hotKeyActions,  String? currentProfileId,  bool overrideDns,  DAV? dav,  NetworkProps networkProps,  VpnProps vpnProps, @JsonKey(fromJson: ThemeProps.safeFromJson)  ThemeProps themeProps,  ProxiesStyle proxiesStyle,  WindowProps windowProps,  ClashConfig patchClashConfig,  ScriptProps scriptProps)?  $default,) {final _that = this;
switch (_that) {
case _Config() when $default != null:
return $default(_that.appSetting,_that.profiles,_that.hotKeyActions,_that.currentProfileId,_that.overrideDns,_that.dav,_that.networkProps,_that.vpnProps,_that.themeProps,_that.proxiesStyle,_that.windowProps,_that.patchClashConfig,_that.scriptProps);case _:
  return null;

}
}

}

/// @nodoc
@JsonSerializable()

class _Config implements Config {
  const _Config({@JsonKey(fromJson: AppSettingProps.safeFromJson) this.appSetting = defaultAppSettingProps, final  List<Profile> profiles = const [], final  List<HotKeyAction> hotKeyActions = const [], this.currentProfileId, this.overrideDns = false, this.dav, this.networkProps = defaultNetworkProps, this.vpnProps = defaultVpnProps, @JsonKey(fromJson: ThemeProps.safeFromJson) required this.themeProps, this.proxiesStyle = defaultProxiesStyle, this.windowProps = defaultWindowProps, this.patchClashConfig = defaultClashConfig, this.scriptProps = const ScriptProps()}): _profiles = profiles,_hotKeyActions = hotKeyActions;
  factory _Config.fromJson(Map<String, dynamic> json) => _$ConfigFromJson(json);

@override@JsonKey(fromJson: AppSettingProps.safeFromJson) final  AppSettingProps appSetting;
 final  List<Profile> _profiles;
@override@JsonKey() List<Profile> get profiles {
  if (_profiles is EqualUnmodifiableListView) return _profiles;
  // ignore: implicit_dynamic_type
  return EqualUnmodifiableListView(_profiles);
}

 final  List<HotKeyAction> _hotKeyActions;
@override@JsonKey() List


class="idlAttrType">DOMString，只读，允许为 null

                                        候选的地址，允许 IPv4 地址、IPv6 地址和完全合格的域名（FQDN）。这对应于 connection-address 字段，在 candidate-attribute
                                        中。

                                        远程候选可能会被暴露，例如通过 [[SelectedCandidatePair]].remote。默认情况下，用户代理必须将任何暴露的远程候选的 address 属性设置为
                                        null。一旦 RTCPeerConnection
                                        实例通过 Web 应用程序使用 addIceCandidate
                                        学习到一个地址，用户代理可以在该 RTCPeerConnection
                                        实例中代表该新学到地址的远程候选的任何 <a data-xref-type="_IDL_" data-link-type="idl"


3

// CHECK: pabsw	305419896, %mm3
// CHECK:  encoding: [0x0f,0x38,0x1d,0x1d,0x78,0x56,0x34,0x12]
        	pabsw	0x12345678,%mm3

// CHECK: pabsw	%mm3, %mm3
// CHECK:  encoding: [0x0f,0x38,0x1d,0xdb]
        	pabsw	%mm3,%mm3

// CHECK: pabsw	3735928559(%ebx,%ecx,8), %xmm5
// CHECK:  encoding: [0x66,0x0f,0x38,0x1d,0xac,0xcb,0xef,0xbe,0xad,0xde]
        	pabsw	0xdeadbeef(%ebx,%ecx,8),%xmm5

// CHECK: pabsw	69, %xmm5
// CHECK:  encoding: [0x66,0x0f,0x38,0x1d,0x2d,0x45,0x00,0x00,0x00]
        	pabsw	0x45,%xmm5

// CHECK: pabsw	32493, %xmm5
// CHECK:  encoding: [0x66,0x0f,0x38,0x1d,0x2d,0xed,0x7e,0x00,0x00]
        	pabsw	0x7eed,%xmm5

// CHECK: pabsw	3133065982, %xmm5
// CHECK:  encoding: [0x66,0x0f,0x38,0x1d,0x2d,0xfe,0xca,0xbe,0xba]
        	pabsw	0xbabecafe,%xmm5

// CHECK: pabsw	305419896, %xmm5
// CHECK:  encoding: [0x66,0x0f,0x38,0x1d,0x2d,0x78,0x56,0x34,0x12]
        	pabsw	0x12345678,%xmm5

// CHECK: pabsw	%xmm5, %xmm5
// CHECK:  encoding: [0x66,0x0f,0x38,0x1d,0xed]
        	pabsw	%xmm5,%xmm5

// CHECK: pabsd	3735928559(%ebx,%ecx,8), %mm3
// CHECK:  encoding: [0x0f,0x38,0x1e,0x9c,0xcb,0xef,0xbe,0xad,0xde]
        	pabsd	0xdeadbeef(%ebx,%ecx,8),%mm3

// CHECK: pabsd	69, %mm3
// CHECK:  encoding: [0x0f,0x38,0x1e,0x1d,0x45,0x00,0x00,0x00]
        	pabsd	0x45,%mm3

// CHECK: pabsd	32493, %mm3
// CHECK:  encoding: [0x0f,0x38,0x1e,0x1d,0xed,0x7e,0x00,0x00]
        	pabsd	0x7eed,%mm3

// CHECK: pabsd	3133065982, %mm3
// CHECK:  encoding: [0x0f,0x38,0x1e,0x1d,0xfe,0xca,0xbe,0xba]
        	pabsd	0xbabecafe,%mm3

// CHECK: pabsd	305419896, %mm3
// CHECK:  encoding: [0x0f,0x38,0x1e,0x1d,0x78,0x56,0x34,0x12]
        	pabsd	0x12345678,%mm3

// CHECK: pabsd	%mm3, %mm3
// CHECK:  encodi


        } else if objects[PLAYER].fighter.map_or(false, |f| f.hp > 0) {
            let (monster, player) = util::mut_two(monster_id, PLAYER, objects);
            monster.attack(player, game);
        }
    }
    Ai::Basic
}

pub fn ai_confused(
    monster_id: usize,
    previous_ai: Box<Ai>,
    num_turns: i32,
    objects: &mut [Object],
    game: &mut Game,
) -> Ai {
    if num_turns >= 0 {
        // Confusion!
        // Move in a random direction, decreasing the num_turns
        game.log.add(
            format!("The {} stumbles around in a daze!", objects[monster_id].name),
            tcod::colors::RED,
        );
        movement::move_by(
            monster_id,
            rand::thread_rng().gen_range(-1, 2),
            rand::thread_rng().gen_range(-1, 2),
            objects,
            game,
        );
        Ai::Confused {
            previous_ai,
            num_turns: num_turns - 1,
        }
    } else {
        game.log.add(
            format!("The {} is no longer confused.", objects[monster_id].name),
            tcod::colors::RED,
        );
        *previous_ai
    }
}
<reponame>crocme10/test-config
use clap::{App, Arg};
use snafu::{ResultExt, Snafu};

mod server;
mod settings;

#[derive(Debug, Snafu)]
pub enum Error {
    #[snafu(display("Command Line Interface Error: {}", msg))]
    CLIError { msg: String },
    #[snafu(display("Server Error: {}", source))]
    ServerError {
        #[snafu(backtrace)]
        source: server::Error,
    },
}

const VERSION: &str = env!("CARGO_PKG_VERSION");

#[tokio::main]
async fn main() -> Result<(), Error> {
    let matches = App::new("Testing Configuration")
        .version(VERSION)
        .author(clap::crate_authors!("\n"))
        .arg(
            Arg::with_name("config dir")
                .value_name("DIR")
                .short("c")
                .long("config-dir")
                .help("Config directory"),
        )
        .arg(
            Arg::with_name("run mode")
                .value_name("STRING")
                .short("m")
                .long("run_mode")
                .help("Run Mode: dev, prod, test"),
        )
        .arg(
            Arg::with_name("value")
                .value_name("KEY=VALUE")
                .short("v")
                .multiple(true)
                .help("Set config values"),
        )
        .get_matches();

    server::run(&matches).await.context(ServerError)
}
#[macro_use]
extern crate crossbeam_channel;
#[macro_use]
extern crate log;
extern crate structopt;

use communication::Server;
use structopt::StructOpt;

mod block;
mod index;
mod protocol;

use block::BlockProcessor;
use index::IndexStore;
use protocol::{NamenodeProtocol, TransferStreamHandler};

use std::net::TcpListener;
use std::path::Path;
use std::sync::{Arc, RwLock};

fn main() {
    // initialize logger
    env_logger::init();

    // parse arguments
    let config = Config::from_args();

    // initialize IndexStore
    let index_store = Arc::new(RwLock::new(IndexStore::new(
        config.namenode_ip_address.clone(), config.namenode_port)));

    // initialize BlockProcessor
    let path = Path::new(&config


 v3, v0, v1, v6, v7, v4, v5));
      tmp.addAll(GeometryUtils.hilbert3D(
          vec[4], half, iterations, v2, v3, v0, v1, v6, v7, v4, v5));
      tmp.addAll(GeometryUtils.hilbert3D(
          vec[5], half, iterations, v4, v3, v2, v5, v6, v1, v0, v7));
      tmp.addAll(GeometryUtils.hilbert3D(
          vec[6], half, iterations, v4, v3, v2, v5, v6, v1, v0, v7));
      tmp.addAll(GeometryUtils.hilbert3D(
          vec[7], half, iterations, v6, v5, v2, v1, v0, v3, v4, v7));

      // Return recursive call
      return tmp;
    }

    // Return complete Hilbert Curve.
    return vec;
  }

  /**
	 * Generates a Gosper curve (lying in the XY plane)
	 *
	 * https://gist.github.com/nitaku/6521802
	 *
	 * @param size The size of a single gosper island.
	 */
  static gosper(size) {
    size = (size != null) ? size : 1;

    Function fractalize = (config) {
      var output;
      var input = config["axiom"];

      for (var i = 0, il = config["steps"];
          0 <= il ? i < il : i > il;
          0 <= il ? i++ : i--) {
        output = '';

        for (var j = 0, jl = input.length; j < jl; j++) {
          var char = input[j];

          if (config["rules"].keys.indexOf(char) >= 0) {
            output += config["rules"][char];
          } else {
            output += char;
          }
        }

        input = output;
      }

      return output;
    };

    Function toPoints = (Map<String, dynamic> config) {
      num currX = 0, currY = 0;
      num angle = 0;
      List<num> path = [0, 0, 0];
      var fractal = config["fractal"];

      for (var i = 0, l = fractal.length; i < l; i++) {
        var char = fractal[i];

        if (char == '+') {
          angle += config["angle"];
        } else if (char == '-') {
          angle -= config["angle"];
        } else if (char == 'F') {
          currX += config["size"] * Math.cos(angle);
          currY += -config["size"] * Math.sin(angle);
          path.addAll([currX, currY, 0]);
        }
      }

      return path;
    };

    //

    var gosper = fractalize({
      "axiom": 'A',
      "steps": 4,
      "rules": {"A": 'A+BF++BF-FA--FAFA-BF+', "B": '-FA+BFBF++BF+FA--FA-B'}
    });

    var points = toPoints({
      "fractal": gosper,
      "size": size,
      "angle": Math.PI / 3 // 60 degrees
    });

    return points;
  }
}
part of jsm_utils;

// import { UnpackDepthRGBAShader } from '../shaders/UnpackDepthRGBAShader.js';

/**
 * This is a helper for visualising a given light's shadow map.
 * It works for shadow casting lights: DirectionalLight and SpotLight.
 * It renders out the shadow map and displays it on a HUD.
 *
 * Example usage:
 *	1) Import ShadowMapViewer into your app.
 *
 *	2) Create a shadow casting light and name it optionally:
 *		var light = new DirectionalLight( 0xffffff, 1 );
 *		light.castShadow = true;
 *		light.name = 'Sun';
 *
 *	3) Create a shadow map viewer for that light and set its size and position optionally:
 *		var shadowMapViewer = new ShadowMapViewer( light );
 *		shadowMapViewer.size.set(


-- Use noise on a grid triangles

VERTEX_SHADER = [[
#version 400
layout (location = 0) in vec3 vp;
layout (location = 1) in vec3 vn;
out vec3 color;
uniform mat4 uViewMatrix, uProjectionMatrix;
uniform float uTime;
void main() {
float roughness = 2.0;
float innertexture = 50;
float yflow = 1.50;
    vec3 pt = vec3((vp.x + noise1(uTime/10.0-vp.z))* 40, noise1(noise1(vp.x * (roughness* 3.0)) + noise1(vp.z * roughness) + uTime * 0.5) * yflow, vp.z * 40);
color = vec3(0.8-noise1(vp.x*innertexture), 1.0-noise1(vp.x*innertexture), 1.0-(noise1(vp.x*innertexture))); //vertical
//color = vec3(0.8-noise1(vp.z*innertexture), 1.0-noise1(vp.z*innertexture), 1.0-(noise1(vp.z*inner


holder textView
     * @param messageResId the message resource id
     * @param link the link
     */
    private fun htmlLinks(linkView: TextView, messageResId: Int, link: String) {
        val linkMessage = getString(messageResId)
        val linkHtml = "$linkMessage $link"
        linkView.text = Html.fromHtml(linkHtml, Html.FROM_HTML_MODE_COMPACT)
        linkView.setOnClickListener {
            this.startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(link)))
        }
    }

    /**
     * Show the progress bar.
     */
    override fun showLoading() {
        binding.mainProgress.visibility = View.VISIBLE
    }

    /**
     * Hide the progress bar.
     */
    override fun hideLoading() {
        binding.mainProgress.visibility = View.INVISIBLE
    }
}
package com.toolsboox.plugin.calendar.da.v2

import com.toolsboox.da.Stroke
import java.util.*

/**
 * Calendar interface, common data and methods.
 *
 * @author Gábor AUTH
 */
interface Calendar {
    val calendarStrokes: Map<String, List<Stroke>>
    val calendarValues: Map<String, Map<String, Float?>>
    val noteStrokes: Map<String, List<Stroke>>
    val created: Date?
    val updated: Date?

    companion object {
        /**
         * Deep copy of map of strokes.
         *
         * @param mapOfStrokes the map of strokes
         * @return the map of strokes
         */
        fun strokesDeepCopy(mapOfStrokes: Map<String, List<Stroke>>): MutableMap<String, List<Stroke>> {
            val strokes = mutableMapOf<String, List<Stroke>>()
            mapOfStrokes.forEach { strokes[it.key] = Stroke.listDeepCopy(it.value) }
            return strokes
        }

        /**
         * Deep copy of map of values.
         *
         * @param mapOfValues the map of values
         * @return the map of values
         */
        fun valuesDeepCopy(mapOfValues: Map<String, Map<String, Float?>>): MutableMap<String, Map<String, Float?>> {
            val values = mutableMapOf<String, Map<String, Float?>>()
            mapOfValues.forEach { values[it.key] = it.value.toMap() }
            return values
        }
    }
}package com.toolsboox.plugin.calendar.da.v2

import com.squareup.moshi.JsonClass
import com.toolsboox.da.Stroke
import java.util.*

/**
 * Calendar year data class.
 *
 * @author Gábor AUTH
 */
@JsonClass(generateAdapter = true)
data class CalendarYear(
    val year: Int,
    val locale: Locale = Locale.getDefault(),

    override var calendarStrokes: MutableMap<String, List<Stroke>> = mutableMapOf(),
    override var calendarValues: MutableMap<String, Map<String, Float?>> = mutableMapOf(),
    override var noteStrokes: MutableMap<String, List<Stroke>> = mutableMapOf(),
    override var created: Date? = null,
    override var updated: Date? = null
) : Calendar {

    companion object {
        /**
         * Name of the default calendar page style.
         */
        const val DEFAULT_STYLE = "Default"

        /**
         * Covert calendar year data class from v1 format to v2 format.
         *
         * @param v1 the v1 data class
         * @return the v2 data class
         */
        fun convert(v1: com.toolsboox.plugin.calendar.da.v1.CalendarYear): CalendarYear {
            val strokes = com.toolsboox.plugin.teamdrawer.nw.domain.Stroke.convertTo(v1.strokes)
            val notesStrokes = com.toolsboox.plugin.teamdrawer.nw.domain.Stroke.convertTo(v1.notesStrokes)

            val calendarStrokes = mutableMapOf(DEFAULT_ST


e then we can carry on, otherwise we should abort.
      return false;
    } else if (tile.index >= 0 && tile.layer.callbacks.length > tile.index && !tile.layer.callbacks[tile.index](body.sprite, tile)) {
      //  If it returns true then we can carry on, otherwise we should abort.
      return false;
    }

    //  We don't need to go any further if this tile doesn't actually separate
    if (!tile.faceLeft && !tile.faceRight && !tile.faceTop && !tile.faceBottom) {
      //   This could happen if the tile was meant to be collided with re: a callback, but otherwise isn't needed for separation
      return false;
    }

    var ox = 0;
    var oy = 0;
    var minX = 0;
    var minY = 1;

    if (body.deltaAbsX() > body.deltaAbsY()) {
      //  Moving faster horizontally, check X axis first
      minX = -1;
    } else if (body.deltaAbsX() < body.deltaAbsY()) {
      //  Moving faster vertically, check Y axis first
      minY = -1;
    }

    if (body.deltaX() != 0 && body.deltaY() != 0 && (tile.faceLeft || tile.faceRight) && (tile.faceTop || tile.faceBottom)) {
//  We only need do this if both axis have checking faces AND we're moving in both directions
      minX = Phaser.Math.min(Phaser.Math.abs(body.position.x - tile.right), Phaser.Math.abs(body.right - tile.left));
      minY = Phaser.Math.min(Phaser.Math.abs(body.position.y - tile.bottom), Phaser.Math.abs(body.bottom - tile.top));
    }

    if (minX < minY) {
      if (tile.faceLeft || tile.faceRight) {
        ox = this.tileCheckX(body, tile);

//  That's horizontal done, check if we still intersects? If not then we can return now
        if (ox != 0 && !tile.intersects(body.position.x, body.position.y, body.right, body.bottom)) {
          return true;
        }
      }

      if (tile.faceTop || tile.faceBottom) {
        oy = this.tileCheckY(body, tile);
      }
    } else {
      if (tile.faceTop || tile.faceBottom) {
        oy = this.tileCheckY(body, tile);

//  That's vertical done, check if we still intersects? If not then we can return now
        if (oy != 0 && !tile.intersects(body.position.x, body.position.y, body.right, body.bottom)) {
          return true;
        }
      }

      if (tile.faceLeft || tile.faceRight) {
        ox = this.tileCheckX(body, tile);
      }
    }

    return (ox != 0 || oy != 0);

  }

  /**
   * Check the body against the given tile on the X axis.
   *
   * @private
   * @method Phaser.Physics.Arcade#tileCheckX
   * @param {Phaser.Physics.Arcade.Body} body - The Body object to separate.
   * @param {Phaser.Tile} tile - The tile to check.
   * @return {number} The amount of separation that occured.
   */

  num tileCheckX(Body body, Phaser.Tile tile) {

    num ox = 0;

    if (body.deltaX() < 0 && !body.blocked.left && tile.collideRight && body.checkCollision.left) {
      //  Body is moving LEFT
      if (tile.faceRight && body.x < tile.right) {
        ox = body.x - tile.right;

        if (ox < -this.TILE_BIAS) {
          ox = 0;
        }
      }
    } else if (body.deltaX() > 0 && !body.blocked.right && tile.collideLeft && body.checkCollision.right) {
      //  Body is moving RIGHT
      if (tile


 joined after year 2020 and stays in Mumbai city.

let Employee = new Map();
Employee.set(1, {ID : 1, Name : "Fiyona", City :  "Mumbai", DOJ : new Date(2021, 1, 24)});
Employee.set(2, {ID : 2, Name : "Divyang", City :  "Ahmedabad", DOJ : new Date(2021, 1, 21)});
Employee.set(3, {ID : 3, Name : "Bhautik", City : "Mumbai", DOJ : new Date(2021, 2, 1)});
Employee.set(4, {ID : 4, Name : "Riya", City :  "Ahmedabad", DOJ : new Date(2019, 1, 16)});
Employee.set(5, {ID : 5, Name : "Monali", City :  "Ahmedabad", DOJ : new Date(2020, 1, 3)});

// Employee.set(3, {ID : 3, Name : "Nita", City :  "Mumbai", DOJ : new Date(2021, 2, 1)});

// Display Employee Details
console.log("Employee Details : ");
for(var entry of Employee.entries()){
    console.log(Employee.get(entry[0]));
}
seperator();

// Search By ID
console.log("Search by Id 2 : ");
var searchById = function () {
    let id = 2;
    if(Employee.has(id) == true){
        console.log(Employee.get(id));
    }
    else{
        console.log("Data not found");
    }
}
searchById();
seperator();

// Joined after year 2020
console.log("Joined after year 2020 : ");
for(var entry of Employee.entries()){
    if(entry[1].DOJ.getYear() > 120){
        console.log(Employee.get(entry[0]));
    }
}
// Employee.forEach(function (value) {
//     for(var x in value){
//         if(value.DOJ.getYear() > 120){
//             console.log(value[x]);
//         }
//     }
// });

seperator();

// Joined after year 2020 and stays in Mumbai city.
console.log("Joined after year 2020 and stays in Mumbai city : ");
for(var entry of Employee.entries()){
    if(entry[1].DOJ.getYear() > 120 && entry[1].City == "Mumbai"){
        console.log(Employee.get(entry[0]));
    }
}
// Employee.forEach(function (value) {
//     for(var x in value){
//         if(value.DOJ.getYear() > 120 && value.City == "Mumbai"){
//             console.log(value[x]);
//         }
//     }
// });
seperator();

function seperator() {
    console.log("------------------------------------------------------------------------------------");
}

// // Initializing values
// let Employee = new Map();
// let emp1 = new Set();
// let emp2 = new Set();
// let emp3 = new Set();
// let emp4 = new Set();
// let emp5 = new Set();

// emp1.add("Fiyona").add("Ahmedabad").add(new Date(2020, 1, 24));
// emp2.add("Divyang").add("Ahmedabad").add(new Date(2021, 1, 21));
// emp3.add("Nita").add("Mumbai").add(new Date(2021, 2, 1));
// emp4.add("Riya").add("Ahmedabad").add(new Date(2019, 1, 16));
// emp5.add("Monali").add("Mumbai").add(new Date(2021, 1, 3));

// Employee.set(1, emp1);
// Employee.set(2, emp2);
// Employee.set(3, emp3);
// Employee.set(4, emp4);
// Employee.set(5, emp5);

// // Display Employee Details
// console.log("Employee Details : ");
// for(var entry of Employee.entries()){
//     console.log(`ID : ${entry[0]}`);
//     for(var s of entry[1]){
//         console.log(`\t${s}`);
//     }
// }
// console.log("");

// // Search By ID
// console.log("Search by Id : ");
// var searchById = function () {
//     let id = 2;
//     if(Employee.has(id) == true){
//         cons


util.parse_time "3 min")
    assert.equals(3 * 60, util.parse_time "3 minutes")
    assert.equals(90, util.parse_time "1.5 minutes")
  end)

  it("should parse hours", function()
    assert.equals(3 * 60 * 60, util.parse_time "3h")
    assert.equals(3 * 60 * 60, util.parse_time "3 h")
    assert.equals(3 * 60 * 60, util.parse_time "3 hour")
    assert.equals(3 * 60 * 60, util.parse_time "3 hours")
    assert.equals(1.5 * 60 * 60, util.parse_time "1.5 hours")
  end)

  it("should parse minutes and seconds", function()
    assert.equals(3 * 60 + 10, util.parse_time "3m 10s")
    assert.equals(3 * 60 + 10, util.parse_time "3m10s")
    assert.equals(3 * 60 + 10, util.parse_time "3min10s")
  end)
end)


 common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216).

## INPUTS

### System.Security.Cryptography.X509Certificates.X509Certificate.X509Certificate2

X509Certificate2 objects are received by the *TargetCertificate* parameter.

### Microsoft.IdentityServer.PowerShell.Resources.ClaimsProviderTrust

ClaimsProviderTrust objects are received by the *TargetClaimsProviderTrust* parameter.

### System.String

String objects are received by the *TargetIdentifier* and *TargetName* parameters.

## OUTPUTS

### Microsoft.IdentityServer.PowerShell.Resources.ClaimsProviderTrust

Returns the disabled ClaimsProviderTrust object when the *PassThru* parameter is specified. By default, this cmdlet does not generate any output.

## NOTES
* A relying party in Active Directory Federation Services (AD FS) is an organization in which web servers that host one or more web-based applications reside. Tokens and Information Cards that originate from a claims provider can then be presented and ultimately accessed by the web-based resources that are located in the relying party organization. When AD FS is configured in the role of the relying party, it acts as a partner that trusts a claims provider to authenticate users. Therefore, the relying party accesses the claims that are packaged in security tokens that come from users in the claims provider. In other words, a relying party is the organization whose web servers are protected by the resource-side federation server. The federation server in the relying party uses the security tokens that the claims provider produces to issue tokens to the web servers that are located in the relying party.

## RELATED LINKS

[Add-AdfsClaimsProviderTrust](./Add-AdfsClaimsProviderTrust.md)

[Disable-AdfsClaimsProviderTrust](./Disable-AdfsClaimsProviderTrust.md)

[Get-AdfsClaimsProviderTrust](./Get-AdfsClaimsProviderTrust.md)

[Remove-AdfsClaimsProviderTrust](./Remove-AdfsClaimsProviderTrust.md)

[Set-AdfsClaimsProviderTrust](./Set-AdfsClaimsProviderTrust.md)

[Update-AdfsClaimsProviderTrust](./Update-AdfsClaimsProviderTrust.md)

---
UID: NF:ndis.NdisCmDispatchIncomingCall
title: NdisCmDispatchIncomingCall function (ndis.h)
description: NdisCmDispatchIncomingCall informs the client of an incoming call on a SAP previously registered by that client.
old-location: netvista\ndiscmdispatchincomingcall.htm
tech.root: netvista
ms.date: 05/02/2018
keywords: ["NdisCmDispatchIncomingCall function"]
ms.keywords: NdisCmDispatchIncomingCall, NdisCmDispatchIncomingCall function [Network Drivers Starting with Windows Vista], condis_call_manager_ref_892a99ac-d4f0-4f4b-9656-a43c99d67aca.xml, ndis/NdisCmDispatchIncomingCall, netvista.ndiscmdispatchincomingcall
req.header: ndis.h
req.include-header: Ndis.h
req.target-type: Desktop
req.target-min-winverclnt: Supported for NDIS 6.0 and NDIS 5.1 drivers (see    NdisCmDispatchIncomingCall   (NDIS 5.1)) in Windows Vista. Supported for NDIS 5.1 drivers (see    NdisCmDispatchIncomingCall   (NDIS 5.1)) in Windows XP.
req.target-min-winversvr:
req.kmdf-ver:
req.umdf-ver:
req.ddi-compliance: Irql_CallManager_Function
req.unicode-ansi:
req.idl


,                                     /* tp_getattr */
  0,                                     /* tp_setattr */
  0,                                     /* tp_compare */
  0,                                     /* tp_repr */
  0,                                     /* tp_as_number */
  0,                                     /* tp_as_sequence */
  0,                                     /* tp_as_mapping */
  0,                                     /* tp_hash  */
  0,                                     /* tp_call */
  0,                                     /* tp_str */
  0,                                     /* tp_getattro */
  0,                                     /* tp_setattro */
  0,                                     /* tp_as_buffer */
  Py_TPFLAGS_DEFAULT,                    /* tp_flags */
  brotli_Compressor_doc,                 /* tp_doc */
  0,                                     /* tp_traverse */
  0,                                     /* tp_clear */
  0,                                     /* tp_richcompare */
  0,                                     /* tp_weaklistoffset */
  0,                                     /* tp_iter */
  0,                                     /* tp_iternext */
  brotli_Compressor_methods,             /* tp_methods */
  brotli_Compressor_members,             /* tp_members */
  0,                                     /* tp_getset */
  0,                                     /* tp_base */
  0,                                     /* tp_dict */
  0,                                     /* tp_descr_get */
  0,                                     /* tp_descr_set */
  0,                                     /* tp_dictoffset */
  (initproc)brotli_Compressor_init,      /* tp_init */
  0,                                     /* tp_alloc */
  brotli_Compressor_new,                 /* tp_new */
};

static BROTLI_BOOL decompress_stream(BrotliDecoderState* dec,
                                     std::vector<uint8_t>* output,
                                     uint8_t* input, size_t input_length) {
  BROTLI_BOOL ok = BROTLI_TRUE;
  Py_BEGIN_ALLOW_THREADS

  size_t available_in = input_length;
  const uint8_t* next_in = input;
  size_t available_out = 0;
  uint8_t* next_out = NULL;

  BrotliDecoderResult result = BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT;
  while (result == BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT) {
    result = BrotliDecoderDecompressStream(dec,
                                           &available_in, &next_in,
                                           &available_out, &next_out, NULL);
    size_t buffer_length = 0; // Request all available output.
    const uint8_t* buffer = BrotliDecoderTakeOutput(dec, &buffer_length);
    if (buffer_length) {
      (*output).insert((*output).end(), buffer, buffer + buffer_length);
    }
  }
  ok = result != BROTLI_DECODER_RESULT_ERROR && !available_in;

  Py_END_ALLOW_THREADS
  return ok;
}

PyDoc_STRVAR(brotli_Decompressor_doc,
"An object to decompress a byte string.\n"
"\n"
"Signature:\n"
"  Decompressor()\n"
"\n"
"Raises:\n"
"  brotli.error: If arguments are invalid.\n");

typedef struct {
  PyObject_HEAD
  BrotliDecoderState* dec;
} brotli_Decompressor


(Type(7)));
  EXPECT_EQ("('StreamableInGlobal' with value StreamableInGlobal)",
            PrintToString(Type(StreamableInGlobal{})));
  EXPECT_EQ(
      "('testing::gtest_printers_test::NonPrintable' with value 1-byte object "
      "<11>)",
      PrintToString(Type(NonPrintable{})));
}
#endif  // GTEST_HAS_ABSL

}  // namespace gtest_printers_test
}  // namespace testing
#include "stdafx.h"
#include <windows.h>
#include <windowsx.h>
#include <onnxruntime_cxx_api.h>
#include <cuda_provider_factory.h>
#include <onnxruntime_c_api.h>
#include <tensorrt_provider_factory.h>
#include <mkldnn_provider_factory.h>

#include <opencv2/core/core.hpp>
#include <opencv2/opencv.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <vector>
#include <stdlib.h>
#include <iostream>

using namespace cv;
using namespace std;

#pragma comment(lib, "user32.lib")
#pragma comment(lib, "gdi32.lib")
#pragma comment(lib, "onnxruntime.lib")

Ort::Env env{ ORT_LOGGING_LEVEL_WARNING, "test" };

static constexpr const int width_ = 224;
static constexpr const int height_ = 224;
static constexpr const int channel = 3;

std::array<float, 1 * width_ * height_*channel> input_image_{};
std::array<float, 1 * 3 * height_ * width_> results_{};
std::array<float, 3> results_extra{};
int result_[height_ * width_]{ 0 };
Mat outputimage(height_, width_, CV_8UC3, Scalar(0, 0, 0));

Ort::Value input_tensor_{ nullptr };
std::array<int64_t, 4> input_shape_{ 1,channel, height_, width_ };

Ort::Value output_tensor_{ nullptr };
std::array<int64_t, 4> output_shape_{ 1,3,height_, width_ };

OrtSession* session_ = nullptr;
OrtSessionOptions* session_option;

int main()
{
	auto allocator_info = Ort::MemoryInfo::CreateCpu(OrtDeviceAllocator, OrtMemTypeCPU);
	input_tensor_ = Ort::Value::CreateTensor<float>(allocator_info, input_image_.data(), input_image_.size(), input_shape_.data(), input_shape_.size());
	output_tensor_ = Ort::Value::CreateTensor<float>(allocator_info, results_.data(), results_.size(), output_shape_.data(), output_shape_.size());
	const char* input_names[] = { "input1" };
	const char* output_names[] = { "output1" };
	ORT_THROW_ON_ERROR(OrtCreateSessionOptions(&session_option));
	//ORT_THROW_ON_ERROR(OrtSessionOptionsAppendExecutionProvider_Mkldnn(session_option, 1));
	//ORT_THROW_ON_ERROR(OrtSessionOptionsAppendExecutionProvider_Tensorrt(session_option, 0));
	ORT_THROW_ON_ERROR(OrtSessionOptionsAppendExecutionProvider_CUDA(session_option, 0));
	ORT_THROW_ON_ERROR(OrtCreateSession(env, L"mosaic.onnx", session_option, &session_));
	//ORT_THROW_ON_ERROR(OrtCreateSession(env, L"candy.onnx", session_option, &session_));
	//ORT_THROW_ON_ERROR(OrtCreateSession(env, L"pointilism.onnx", session_option, &session_));
	//ORT_THROW_ON_ERROR(OrtCreateSession(env, L


local DebuffColor = {
		Magic	= { r = 0.20, g = 0.60, b = 1.00 },
		Curse	= { r = 0.60, g = 0.00, b = 1.00 },
		Disease = { r = 0.60, g = 0.40, b = 0 },
		Poison = { r = 0.00, g = 0.60, b = 0 },
	}

	local function GetDebuffColor(dispellType)
		local color = DebuffColor[dispellType]
		if color then return color.r, color.g, color.b
		else return 0,0,0,0 end
	end

	--local auraDurationFilter = 36
	local auraDurationFilter = 600
	local function DefaultFilterFunction(debuff)
		return (debuff.duration < auraDurationFilter)
	end

	local aura = {}

	local function UpdateAuraWidget(frame, unit)
		local unitid, expireTime
		local AuraFrames = frame.AuraFrames
		local AuraFrame
		local auraCount = 0

		if unit.isTarget then unitid = "target"
		elseif unit.isMouseover then unitid = "mouseover" end

		if not unit.guid then
			for index = 1, 4 do	AuraFrame = AuraFrames[index]; AuraFrame:Hide() end
		elseif unitid and unit.guid == UnitGUID(unitid) then
			-- Display the desired debuffs

			for index = 1, 40 do
				local name, rank, icon, count, dispelType, duration, expires, caster, isStealable = UnitDebuff(unitid, index ,"PLAYER")

				aura.name, aura.rank, aura.icon, aura.count = name, rank, icon, count
				aura.dispelType, aura.duration, aura.expires, aura.caster = dispelType, duration, expires, caster

				AuraFrame = AuraFrames[auraCount+1]

				if name and icon and frame.Filter(aura) then
					auraCount = auraCount + 1
					AuraFrame.Icon:SetTexture(icon)
					if count > 1 then AuraFrame.Stacks:SetText(count)
					else  AuraFrame.Stacks:SetText("") end
					AuraFrame:PolledHideIn(expires)
					--AuraFrame:Show()
				else AuraFrame:Hide() end
				if auraCount > 7 then return end
			end

		--[[

		elseif unit.partyID then
			-- unit.partyID

			-- Cycle through auras
			--print(unit.name, unit.partyID, "Aura Widget")
			unitid = unit.partyID

			for ind


",
                    "\tTotal: ", total_count, " (",
                    total_count * 1e2f / values_.size(), "%)");
    lower_bound = upper_bound;
  }
  return result;
}

}  // namespace common
}  // namespace cartographer
/*
 * Copyright 2018 The Cartographer Authors
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#include "cartographer/transform/timestamped_transform.h"

#include "cartographer/transform/rigid_transform_test_helpers.h"
#include "gmock/gmock.h"
#include "gtest/gtest.h"

namespace cartographer {
namespace transform {
namespace {

TEST(TimestampedTransformTest, ToProtoAndBack) {
  const TimestampedTransform expected{
      common::FromUniversal(12345678),
      Rigid3d(Eigen::Vector3d(1., 2., 3.),
              Eigen::Quaterniond(1., 2., 3., 4.).normalized())};
  const TimestampedTransform actual = FromProto(ToProto(expected));
  EXPECT_EQ(expected.time, actual.time);
  EXPECT_THAT(actual.transform, IsNearly(expected.transform, 1e-6));
}

}  // namespace
}  // namespace transform
}  // namespace cartographer
/*
 * Copyright 2017 The Cartographer Authors
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
#include "cartographer/transform/rigid_transform.h"

#include <random>

#include "cartographer/transform/rigid_transform_test_helpers.h"
#include "cartographer/transform/transform.h"
#include "gtest/gtest.h"

namespace cartographer {
namespace transform {
namespace {

template <typename T>
class RigidTransformTest : public ::testing::Test {
 protected:
  T eps() { return std::numeric_limits<T>::epsilon(); }

  Rigid2<T> GetRandomRigid2() {
    const T x = T(0.7) * distribution_(prng_);
    const T y = T(0.7) * distribution_(prng_);
    const T theta = T(0.2) * distribution_(prng_);
    return transform::Rigid2<T>(typename Rigid2<T>::Vector(x, y), theta);
  }

  Rigid3<T> GetRandomRigid3() {
    const T x = T(0.7) * distribution_(prng_);
    const T y = T(0.7) * distribution_(prng_);
    const T z = T(0.7) * distribution_(prng_);
    const T ax = T(0.7) * distribution_(prng_);
    const T ay = T(0.7) * distribution_(prng_);
    const T az = T(0.7) * distribution_(prng_);
    return transform::Rigid3<T>(typename Rigid3<T>::Vector(x, y, z),


mediate
export const cancelAnimationFrame = (global as any as Window).cancelAnimationFrame || global.clearImmediate

export * from './omit'
export * from './extend'
import {Component, ElementRef, OnInit} from '@angular/core';
import {ConfigService} from './config.service';

interface Rotation {
  x: number;
  y: number;
  z: number;
}

interface Rotateable {
  rotation: Rotation;
}

declare const THREE: any;

@Component({
  selector: 'my-scene',
  template: '',
  styles: [`
    :xhost {
      display: grid;
    }

    xcanvas {
      height: 100%;
      width: 100%;
    }
  `],
})
export class SceneComponent implements OnInit {
  private host: HTMLElement = this.elRef.nativeElement;

  constructor(private elRef: ElementRef, private config: ConfigService) {}

  ngOnInit() {
    const rect = this.host.getBoundingClientRect();
    const w = rect.width;
    const h = rect.height;

    const geometry1 = new THREE.BoxGeometry(1, 1, 1);
    const material1 = new THREE.MeshBasicMaterial({
      color: 'orange',
    });
    const cube = new THREE.Mesh(geometry1, material1);

    const edges = new THREE.BoxHelper(cube, 'darkorchid');

    const group = new THREE.Group();
    group.add(cube);
    group.add(edges);

    const scene = new THREE.Scene();
    scene.add(group);

    const camera = new THREE.PerspectiveCamera(undefined, w / h);
    camera.position.set(2, 2, 5);
    camera.lookAt(scene.position);

    const renderer = new THREE.WebGLRenderer();
    renderer.setSize(w, h);
    this.host.appendChild(renderer.domElement);

    const stereoEffect = new THREE.StereoEffect(renderer);
    stereoEffect.setSize(w, h);

    let prevAutoRotateMode;
    const render = () => {
      requestAnimationFrame(render);

      if (this.config.autoRotate) {
        if (this.config.autoRotateMode !== prevAutoRotateMode) {
          prevAutoRotateMode = this.config.autoRotateMode;
          this.rotateTo(group, {x: 0, y: 0, z: 0});
        }

        switch(this.config.autoRotateMode) {
          case 'random':
            this.rotateBy(group, 0.005);
            break;
          case 'diagonal':
            const axis = new THREE.Vector3(1, 1, 1).normalize();
            group.rotateOnAxis(axis, 0.01);
            break;
          default:
            break;
        }
      } else {
        this.rotateTo(group, this.config.rotation);
      }

      const activeRenderer = this.config.isStereo ? stereoEffect : renderer;
      activeRenderer.setSize(w, h);
      activeRenderer.render(scene, camera);
    };

    render();
  }

  private rotateBy(target: Rotateable, rad: number) {
    return this.rotateTo(target, {
      x: target.rotation.x + rad,
      y: target.rotation.y + rad,
      z: target.rotation.z + rad,
    });
  }

  private rotateTo(target: Rotateable, to: Rotation) {
    target.rotation.x = to.x;
    target.rotation.y = to.y;
    target.rotation.z = to.z;
  }
}
function doSomething() {
    for (var i = 0; i < 5; i++) {
        console.log(i);
    }

    console.log('Finally: ' + i);
}

function doSomethingElse() {
    for (let i = 0; i < 5; i++) {
        console.log(i);
    }

    console.log('Finally: ' + i); // even if use let keyword TS witl give the compile time error.
}

doSomething();
doSomethingElse();import {Observable} from "../observable/observable"
import {lift} from "../internal/lift"

export const bufferTime = <T>(duration:number) => lift<T, T[]>(observer => {

  let timer:NodeJS.Timeout
  let


} catch (error) {
      console.error(error);
    }
  }

  /**
   * Firebaseトークンを取得する
   * @param {string} id ID
   */
  public async getFirebaseToken(id: string) {
    const db = new FireStore();
    const token = await db.getFirebaseToken(id);
    if (token === "") {
      throw new Error(`Firebaseトークンを取得できませんでした id=${id}`);
    } else {
      // データを取得したので削除
      await db.deleteFirebaseToken(id);
      return token;
    }
  }

  /**
   * アクセストークンレスポンスであるか
   * @param {object} response 検証したいレスポンス
   * @return {boolean} 検証結果
   */
  private isAccessTokenResponse(
    response: any
  ): response is AccessTokenResponse {
    if (
      response.access_token !== undefined &&
      response.token_type !== undefined &&
      response.expires_in !== undefined &&
      response.refresh_token !== undefined
    ) {
      return true;
    }
    return false;
  }

  /**
   * ユーザープロフィールのレスポンスであるか
   * @param {object} response 検証したいレスポンス
   * @return {boolean} 検証結果
   */
  private isUserProfileResponse(
    response: any
  ): response is UserProfileResponse {
    if (
      response.user_id !== undefined &&
      response.email !== undefined &&
      response.name !== undefined
    ) {
      return true;
    }
    return false;
  }
}
/**
 * アクセストークン取得結果
 * https://developer.amazon.com/ja/docs/login-with-amazon/authorization-code-grant.html#access-token-response
 */
interface AccessTokenResponse {
  /**
   * アクセストークン
   */
  // eslint-disable-next-line camelcase
  access_token: string;
  /**
   * トークンタイプ(bearer)
   */
  // eslint-disable-next-line camelcase
  token_type: string;
  /**
   * 有効時間（秒）
   */
  // eslint-disable-next-line camelcase
  expires_in: string;
  /**
   * リフレッシュトークン
   */
  // eslint-disable-next-line camelcase
  refresh_token: string;
}

/**
 * ユーザープロフィール取得結果
 * https://developer.amazon.com/ja/docs/login-with-amazon/obtain-customer-profile.html#customer-profile-response
 */
interface UserProfileResponse {
  /**
   * ユーザーID
   */
  // eslint-disable-next-line camelcase
  user_id: string;
  /**
   * メールアドレス
   */
  email: string;
  /**
   * 氏名
   */
  name: string;
  // postal_codeは存在しない
}
declare type Callback<T = undefined, E = Error> = (
  err: E | null,
  data: T
) => void;

declare type Dictionary<T> = Record<string, T>;
/**
 * @module db
 */
export default class DB {
  _db: Map<string, Buffer>

  constructor() {
    this._db = new Map()
  }

  put(key: Buffer, value: Buffer) {
    this._db.set(key.toString('hex'), value)
  }

  get(key: Buffer): Buffer | undefined {
    return this._db.get(key.toString('hex'))
  }

  del(key: Buffer) {
    return this._db.delete(key.toString('hex'))
  }
}
import { Pipe, PipeTransform } from "@angular/core";


return {
	fadeOut = 1.5,
	mode = 2,
	fadeType = 1,
	once = true,
	id = "LUCK19901",
	fadein = 1.5,
	scripts = {
		{
			actor = 199010,
			side = 2,
			nameColor = "#a9f548",
			dir = 1,
			say = "おお指揮官いい感じ！今ならなんでもできちゃうって雰囲気っす！あざっす！",
			typewriter = {
				speed = 0.05,
				speedUp = 0.01
			},
			painting = {
				alpha = 0.3,
				time = 1
			}
		},
		{
			expression = 1,
			nameColor = "#a9f548",
			side = 2,
			dir = 1,
			actor = 199010,
			say = "いやぁ、これは皆を集めてド派手なパーティーでもやる流れっすね！",
			typewriter = {
				speed = 0.05,
				speedUp = 0.01
			},
			painting = {
				alpha = 0.3,
				time = 1
			}
		},
		{
			expression = 5,
			nameColor = "#a9f548",
			side = 2,
			dir = 1,
			acto


}function Pre(n,a,c,u){let p=[];for(let T=a;T<c.length;T++){let k=c[T];(u===ae&&!vCe(k)||u===rt&&R$e(k)||u===j&&vCe(k))&&p.push(zn(c[T]))}let h=p.length?Gr(p,2):Oe;return Fp(u,h,BC(n))}function Mre(n){L.assert((n.flags&2097152)!==0,"Should only get Alias here.");let a=Ai(n);if(!a.immediateTarget){let c=Uu(n);if(!c)return L.fail();a.immediateTarget=I_(c,!0)}return a.immediateTarget}function O$e(n,a){var c;let u=Um(n);Mrt(n,u);let p=U?Ua():void 0,h=Ua(),T=[],k=Ki;pCe(n);let O=o0(n,void 0),H=O&&O.pattern&&(O.pattern.kind===203||O.pattern.kind===207),J=BC(n),de=J?8:0,Ae=Yn(n)&&!B6(n),xe=Ij(n),tt=!O&&Ae&&!xe,It=ke,Tn=!1,un=!1,Nn=!1,en=!1;for(let Jt of n.properties)Jt.name&&ts(Jt.name)&&vg(Jt.name);let cn=0;for(let Jt of n.properties){let Cn=fr(Jt),Rn=Jt.name&&Jt.name.kind===164?vg(Jt.name):void 0;if(Jt.kind===299||Jt.kind===300||o_(Jt)){let Br=Jt.kind===299?NIe(Jt,a):Jt.kind===300?UC(!u&&Jt.objectAssignmentInitializer?Jt.objectAssignmentInitializer:Jt.name,a):PIe(Jt,a);if(Ae){let wa=di(Jt);wa?(wu(Br,wa,Jt),Br=wa):xe&&xe.typeExpression&&wu(Br,$r(xe.typeExpression),Jt)}It|=Ur(Br)&458752;let Hr=Rn&&fh(Rn)?Rn:void 0,qi=Hr?wo(4|Cn.flags,Np(Hr),de|4096):wo(4|Cn.flags,Cn.escapedName,de);if(Hr&&(qi.links.nameType=Hr),u)(Jt.kind===299&&OC(Jt.initializer)||Jt.kind===300&&Jt.objectAssignmentInitializer)&&(qi.flags|=16777216);else if(H&&!(Ur(O)&512)){let wa=ja(O,Cn.escapedName);wa?qi.flags|=wa.flags&16777216:!Y.suppressExcessPropertyErrors&&!Cm(O,ae)&&Fe(Jt.name,_.Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1,E(Cn),Ee(O))}if(qi.declarations=Cn.declarations,qi.parent=Cn.parent,Cn.valueDeclaration&&(qi.valueDeclaration=Cn.valueDeclaration),qi.links.type=Br,qi.links.target=Cn,Cn=qi,p?.set(qi.escapedName,qi),O&&a&&a&2&&!(a&4)&&(Jt.kind===299||Jt.kind===171)&&Yf(Jt)){let wa=F1(n);L.assert(wa);let Xc=Jt.kind===299?Jt.initializer:Jt;v2e(wa,Xc,Br)}}else if(Jt.kind===301){R<2&&Hc(Jt,2),T.length>0&&(k=e0(k,rr(),n.symbol,It,J),T=[],h=Ua(),un


on(BindType bt, StringBuilder sb)
    {
        string funcName = "LuaOpen_" + bt.wrapName;

        sb.AppendLineEx("\r\n\t[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]");
        sb.AppendFormat("\tstatic int {0}(IntPtr L)\r\n", funcName);
        sb.AppendLineEx("\t{");
        sb.AppendLineEx("\t\ttry");
        sb.AppendLineEx("\t\t{");
        sb.AppendLineEx("\t\t\tLuaState state = LuaState.Get(L);");
        sb.AppendFormat("\t\t\tstate.BeginPreModule(\"{0}\");\r\n", bt.nameSpace);
        sb.AppendFormat("\t\t\t{0}Wrap.Register(state);\r\n", bt.wrapName);
        sb.AppendFormat("\t\t\tint reference = state.GetMetaReference(typeof({0}));\r\n", bt.name);
        sb.AppendLineEx("\t\t\tstate.EndPreModule(L, reference);");
        sb.AppendLineEx("\t\t\treturn 1;");
        sb.AppendLineEx("\t\t}");
        sb.AppendLineEx("\t\tcatch(Exception e)");
        sb.AppendLineEx("\t\t{");
        sb.AppendLineEx("\t\t\treturn LuaDLL.toluaL_exception(L, e);");
        sb.AppendLineEx("\t\t}");
        sb.AppendLineEx("\t}");
    }

    static string GetOS()
    {
        return LuaConst.osDir;
    }

    static string CreateStreamDir(string dir)
    {
        dir = Application.streamingAssetsPath + "/" + dir;

        if (!File.Exists(dir))
        {
            Directory.CreateDirectory(dir);
        }

        return dir;
    }

    static void BuildLuaBundle(string subDir, string sourceDir)
    {
        string[] files = Directory.GetFiles(sourceDir + subDir, "*.bytes");
        string bundleName = subDir == null ? "lua.unity3d" : "lua" + subDir.Replace('/', '_') + ".unity3d";
        bundleName = bundleName.ToLower();

#if UNITY_5 || UNITY_2017 || UNITY_2018
        for (int i = 0; i < files.Length; i++)
        {
            AssetImporter importer = AssetImporter.GetAtPath(files[i]);

            if (importer)
            {
                importer.assetBundleName = bundleName;
                importer.assetBundleVariant = null;
            }
        }
#else
        List<Object> list = new List<Object>();

        for (int i = 0; i < files.Length; i++)
        {
            Object obj = AssetDatabase.LoadMainAssetAtPath(files[i]);
            list.Add(obj);
        }

        BuildAssetBundleOptions options = BuildAssetBundleOptions.CollectDependencies | BuildAssetBundleOptions.CompleteAssets | BuildAssetBundleOptions.DeterministicAssetBundle;

        if (files.Length > 0)
        {
            string output = string.Format("{0}/{1}/" + bundleName, Application.streamingAssetsPath, GetOS());
            File.Delete(output);
            BuildPipeline.BuildAssetBundle(null, list.ToArray(), output, options, EditorUserBuildSettings.activeBuildTarget);
        }
#endif
    }

    static void ClearAllLuaFiles()
    {
        string osPath = Application.streamingAssetsPath + "/" + GetOS();

        if (Directory.Exists(osPath))
        {
            string[] files = Directory.GetFiles(osPath, "Lua*.unity3d");

            for (int i = 0; i < files.Length; i++)
            {
                File.Delete(files[i]);
            }
        }

        string path = osPath + "/Lua";

        if (Directory.Exists(path))
        {
            Directory.Delete(path, true);
        }

        path = Application.streamingAssetsPath + "/Lua";

        if


itute_id": "CCCma", "experiment_id": "decadal2010", "source": "CanCM4 2010 atmosphere: CanAM4 (AGCM15i, T63L35) ocean: CanOM4 (OGCM4.0, 256x192L40) sea ice: CanSIM1 (Cavitating Fluid, T63 Gaussian Grid) land: CLASS2.7", "model_id": "CanCM4", "forcing": "GHG,Oz,SA,BC,OC,LU,Sl,Vl (GHG includes CO2,CH4,N2O,CFC11,effective CFC12)", "parent_experiment_id": "N/A", "parent_experiment_rip": "N/A", "branch_time": 0.0, "contact": "cccma_info@ec.gc.ca", "references": "http://www.cccma.ec.gc.ca/models", "initialization_method": 1, "physics_version": 1, "tracking_id": "64384802-3f0f-4ab4-b569-697bd5430854", "branch_time_YMDH": "2011:01:01:00", "CCCma_runid": "DHFP1B_E002_I2011_M01", "CCCma_parent_runid": "DHFP1_E002", "CCCma_data_licence": "1) GRANT OF LICENCE - The Government of Canada (Environment Canada) is the \\nowner of all intellectual property rights (including copyright) that may exist in this Data \\nproduct. You (as \\"The Licensee\\") are hereby granted a non-exclusive, non-assignable, \\nnon-transferable unrestricted licence to use this data product for any purpose including \\nthe right to share these data with others and to make value-added and derivative \\nproducts from it. This licence is not a sale of any or all of the owner\'s rights.\\n2) NO WARRANTY - This Data product is provided \\"as-is\\"; it has not been designed or \\nprepared to meet the Licensee\'s particular requirements. Environment Canada makes no \\nwarranty, either express or implied, including but not limited to, warranties of \\nmerchantability and fitness for a particular purpose. In no event will Environment Canada \\nbe liable for any indirect, special, consequential or other damages attributed to the \\nLicensee\'s use of the Data product.", "product": "output", "experiment": "10- or 30-year run initialized in year 2010", "frequency": "day", "creation_date": "2012-03-28T15:32:08Z", "history": "2012-03-28T15:32:08Z CMOR rewrote data to comply with CF standards and CMIP5 requirements.", "Conventions": "CF-1.4", "project_id": "CMIP5", "table_id": "Table day (28 March 2011) f9d6cfec5981bb8be1801b35a81002f0", "title": "CanCM4 model output prepared for CMIP5 10- or 30-year run initialized in year 2010", "parent_experiment": "N/A", "modeling_realm": "atmos", "realization": 2, "cmor_version": "2.8.0"}'),
                                  ('title', 'ECA heat indice SU'), (
                                      'references',
                                      'ATBD of the ECA indices calculation (http://eca.knmi.nl/documents/atbd.pdf)'),
                                  ('institution', 'Climate impact portal (http://climate4impact.eu)'),
                                  ('comment', ' ')])
            self.assertDictEqual(to_test, actual)
            var = ds.variables['SU']
            to_test = dict(var.__dict__)
            to_test.pop('_FillValue', None)
            self.assertEqual(to_test, {'units': 'days',
                                       'standard_name': AbstractIcclimFunction.standard_name,
                                       'long_name': 'Summer days (number of days where daily maximum temperature > 25 degrees)',
                                       'grid_mapping': 'latitude_longitude'})


hes.leafHashes, 4, 5)

	validTree := exampleNMT(nIDSize, true, nIDList...)

	tests := []struct {
		name                 string
		tree                 *NamespacedMerkleTree
		proofStart, proofEnd int
		wantErr              bool
		errType              error
	}{
		{"corrupt leaf hash", treeWithCorruptLeafHash, 4, 5, true, ErrInvalidNodeLen},
		{"unordered leaf hashes: the out of order range", treeWithUnorderedLeafHashes, 4, 5, true, ErrUnorderedSiblings},
		{"unordered leaf hashes: the first leaf", treeWithUnorderedLeafHashes, 1, 2, true, ErrUnorderedSiblings}, // for a tree with an unordered set of leaves, the buildRangeProof function  should produce an error for any input range,
		// not just the corrupted range.
		{"unordered leaf hashes: the last leaf", treeWithUnorderedLeafHashes, 7, 8, true, ErrUnorderedSiblings}, // for a tree with an unordered set of leaves, the buildRangeProof function  should produce an error for any input range,
		// not just the corrupted range.
		{"invalid proof range: start > end", validTree, 5, 4, true, ErrInvalidRange},
		{"invalid proof range: start = end", validTree, 5, 5, true, ErrInvalidRange},
		{"invalid proof range: start < 0", validTree, -1, 4, true, ErrInvalidRange},
		{"invalid proof range: end > number of leaves", validTree, 0, len(validTree.leaves) + 1, true, ErrInvalidRange},
	}
	for _, tt := range tests {
		t.Run(tt.name, func(t *testing.T) {
			_, err := tt.tree.buildRangeProof(tt.proofStart, tt.proofEnd)
			assert.Equal(t, tt.wantErr, err != nil)
			if tt.wantErr {
				assert.True(t, errors.Is(err, tt.errType))
			}
		})
	}
}

// Test_ProveRange_Err tests that ProveRange returns an error when the underlying tree has an invalid state e.g., leaves are not ordered by namespace ID or a leaf hash is corrupted.
func Test_ProveRange_Err(t *testing.T) {
	// create an NMT with 8 sequentially namespaced leaves, numbered from 1 to 8.
	treeWithCorruptLeafHash := exampleNMT(2, true, 1, 2, 3, 4, 5, 6, 7, 8)
	// corrupt a leaf hash
	treeWithCorruptLeafHash.leafHashes[4] = treeWithCorruptLeafHash.leafHashes[4][:treeWithCorruptLeafHash.NamespaceSize()]

	// create an NMT with 8 sequentially namespaced leaves, numbered from 1 to 8.
	treeWithUnorderedLeafHashes := exampleNMT(2, true, 1, 2, 3, 4, 5, 6, 7, 8)
	// swap the positions of the 4th and 5th leaves
	swap(treeWithUnorderedLeafHashes.leaves, 4, 5)
	swap(treeWithUnorderedLeafHashes.leafHashes, 4, 5)

	tests := []struct {
		name                 string
		tree                 *NamespacedMerkleTree
		proofStart, proofEnd int
		wantErr              bool
		errType              error
	}{
		{"corrupt leaf hash", treeWithCorruptLeafHash, 4, 5, true, ErrInvalidNodeLen},
		{"unordered leaf hashes: the out of order leaf", treeWithUnorderedLeafHashes, 4, 5, true, ErrUnorderedSiblings},
		{"unordered leaf hashes: first leaf", treeWithUnorderedLeafHashes, 1, 2, true, ErrUnorderedSiblings}, // for a tree with an unordered set of leaves, the ProveRange method  should produce an error for any input range,
		// not just the corrupted range.


DKGPhase_DKG_PHASE_VERIFYING, // Wrong phase
	}
	k.SetEpochBLSData(ctx, epochBLSData)

	msg := &types.MsgSubmitDealerPart{
		Creator: "dealer1",
		EpochId: epochID,
	}

	_, err := ms.SubmitDealerPart(goCtx, msg)
	require.Error(t, err)
	assert.Contains(t, err.Error(), "not in dealing phase")
}

func TestSubmitDealerPart_DeadlinePassed(t *testing.T) {
	k, ms, goCtx := setupMsgServerDealer(t)
	ctx := sdk.UnwrapSDKContext(goCtx)

	epochID := uint64(1)
	epochBLSData := types.EpochBLSData{
		EpochId:                   epochID,
		DkgPhase:                  types.DKGPhase_DKG_PHASE_DEALING,
		DealingPhaseDeadlineBlock: ctx.BlockHeight() - 1, // Past deadline
	}
	k.SetEpochBLSData(ctx, epochBLSData)

	msg := &types.MsgSubmitDealerPart{
		Creator: "dealer1",
		EpochId: epochID,
	}

	_, err := ms.SubmitDealerPart(goCtx, msg)
	require.Error(t, err)
	assert.Contains(t, err.Error(), "dealing phase deadline has passed")
}

func TestSubmitDealerPart_NotParticipant(t *testing.T) {
	k, ms, goCtx := setupMsgServerDealer(t)
	ctx := sdk.UnwrapSDKContext(goCtx)

	epochID := uint64(1)
	epochBLSData := types.EpochBLSData{
		EpochId:                   epochID,
		ITotalSlots:               100,
		TSlotsDegree:              33,
		DkgPhase:                  types.DKGPhase_DKG_PHASE_DEALING,
		DealingPhaseDeadlineBlock: ctx.BlockHeight() + 100,
		Participants: []types.BLSParticipantInfo{
			{
				Address:            "other_participant",
				Secp256K1PublicKey: []byte("pubkey1"),
				PercentageWeight:   math.LegacyNewDec(100),
				SlotStartIndex:     0,
				SlotEndIndex:       99,
			},
		},
		DealerParts: []*types.DealerPartStorage{
			{DealerAddress: "", Commitments: [][]byte{}, ParticipantShares: []*types.EncryptedSharesForParticipant{}},
		},
	}
	k.SetEpochBLSData(ctx, epochBLSData)

	msg := &types.MsgSubmitDealerPart{
		Creator: "not_a_participant",
		EpochId: epochID,
	}

	_, err := ms.SubmitDealerPart(goCtx, msg)
	require.Error(t, err)
	assert.Contains(t, err.Error(), "not a participant")
}

func TestSubmitDealerPart_AlreadySubmitted(t *testing.T) {
	k, ms, goCtx := setupMsgServerDealer(t)
	ctx := sdk.UnwrapSDKContext(goCtx)

	epochID := uint64(1)
	dealerAddr := "dealer1"

	epochBLSData := types.EpochBLSData{
		EpochId:                   epochID,
		ITotalSlots:               100,
		TSlotsDegree:              33,
		DkgPhase:                  types.DKGPhase_DKG_PHASE_DEALING,
		DealingPhaseDeadlineBlock: ctx.BlockHeight() + 100,
		Participants: []types.BLSParticipantInfo{
			{
				Address:            dealerAddr,
				Secp256K1PublicKey: []byte("pubkey1"),
				PercentageWeight:   math.LegacyNewDec(100),
				SlotStartIndex:     0,
				SlotEndIndex:       99,
			},
		},
		DealerParts: []*types.DealerPartStorage{
			{DealerAddress: dealerAdd


 #1]
	cmp r0, #0
	beq _02254B9C
	cmp r0, #1
	beq _02254BAC
	b _02254BBA
_02254B9C:
	ldr r0, [r4, #0x48]
	mov r1, #1
	bl ov29_02254CC0
	ldrb r0, [r4, #1]
	add r0, r0, #1
	strb r0, [r4, #1]
	b _02254BBA
_02254BAC:
	ldr r0, [r4, #0x48]
	bl ov29_02254CF0
	cmp r0, #0
	beq _02254BBA
	mov r0, #1
	pop {r4, pc}
_02254BBA:
	mov r0, #0
	pop {r4, pc}
	.align 2, 0
	thumb_func_end ov29_02254B8C

	thumb_func_start ov29_02254BC0
ov29_02254BC0: ; 0x02254BC0
	push {r4, r5, r6, lr}
	add r5, r0, #0
	add r6, r1, #0
	mov r0, #8
	mov r1, #0x90
	bl AllocFromHeap
	add r4, r0, #0
	beq _02254C04
	add r0, #8
	mov r1, #8
	bl ov20_022536F4
	str r6, [r4]
	bl ov20_02252D34
	str r0, [r4, #4]
	mov r0, #0
	str r0, [r4, #0x6c]
	bl ov20_02252D24
	str r0, [r4, #0x30]
	mov r1, #0
	str r1, [r4, #0x34]
	add r2, r4, #0
	add r0, r1, #0
_02254BF4:
	add r1, r1, #1
	str r0, [r2, #0x38]
	add r2, r2, #4
	cmp r1, #8
	blt _02254BF4
	str r4, [r5]
	mov r0, #1
	pop {r4, r5, r6, pc}
_02254C04:
	mov r0, #0
	pop {r4, r5, r6, pc}
	thumb_func_end ov29_02254BC0

	thumb_func_start ov29_02254C08
ov29_02254C08: ; 0x02254C08
	push {r4, r5, r6, r7, lr}
	sub sp, #0xc
	add r6, r0, #0
	mov r0, #8
	str r0, [sp]
	add r0, r6, #0
	add r0, #0x58
	mov r1, #0xc
	mov r2, #0x28
	mov r3, #0x29
	bl ov20_02253FBC
	cmp r0, #0
	beq _02254C74
	mov r3, #0
	str r3, [sp]
	mov r2, #1
	str r2, [sp, #4]
	mov r0, #8
	str r0, [sp, #8]
	mov r0, #0xc
	mov r1, #0x2a
	bl GfGfxLoader_LoadWholePalette
	add r2, r6, #0
	ldr r0, [r6, #0x30]
	ldr r1, _02254C7C ; =ov29_022550C0
	add r2, #0x58
	bl ov20_02253E74
	mov r1, #


Exception("Refresh token is not found in request cookies.");
    }

    //Login olduktan sonra verilecek RefreshTokenı oluşturur
    private void setRefreshTokenToCookie(RefreshToken refreshToken)
    {
        CookieOptions cookieOptions = new() { HttpOnly = true, Expires = DateTime.UtcNow.AddDays(7) };
        Response.Cookies.Append(key: "refreshToken", refreshToken.Token, cookieOptions);
    }
}


",
[6170] = "Hexer-Reagenzien",
[6172] = "Verlorene Vorräte",
[6175] = "Artefakt der Atal'ai",
[6181] = "Fetisch von Hakkar",
[6184] = "Monströses Kriecherbein",
[6190] = "Draenethystsplitter",
[6193] = "Artefaktbündel der Atal'ai",
[6196] = "Noborus Knüppel",
[6212] = "Jammal'ans Kopf",
[6245] = "Karnitols Ranzen",
[6246] = "Zornsäerklaue",
[6247] = "Zornsäerhorn",
[6248] = "Skorpashigift",
[6249] = "Gealterter Kodobalg",
[6250] = "Teufelshundgehirn",
[6251] = "Netherflügel",
[6252] = "Verdammniswächterblut",
[6257] = "Muskelmagen eines Roc",
[6258] = "Eisenfellleber",
[6259] = "Groddoc-Leber",
[6281] = "Schädel eines klappernden Skeletts",
[6283] = "Das Buch von Ur",
[6285] = "Egalins Zauberfoliant",
[6288] = "Schrifttafel der Atal'ai",
[6312] = "Dalins Herz",
[6313] = "Comars Herz",
[6435] = "Erfüllter brennender Edelstein",
[6441] = "Schattenpirscherskalp",
[6442] = "Orakelkristall",
[6443] = "Deviatbalg",
[6462] = "Gesicherte Kiste",
[6464] = "Klageessenz",
[6486] = "Angesengte Schuppe",
[6487] = "Kopf eines schändlichen Familiars",
[6534] = "Schmiedestahlbarren",
[6535] = "Schrifttafel der Verga",
[6634] = "Ritualsalbe",
[6640] = "Teufelspirscherhuf",
[6652] = "Reagenzienbeutel",
[6655] = "Leuchtendes Holzscheit",
[6684] = "Schnüffelnasenleitstecken",
[6753] = "Federglücksbringer",
[6766] = "Flayed Demon Skin (old2)",
[6767] = "Tyranis' Anhänger",
[6782] = "Marshal Haggards Abzeichen",
[6783] = "Stumpfzahns Schlüssel",
[6785] = "Macht der Leere",
[6799] = "Vejreks Kopf",
[6800] = "Umbralerz",
[6805] = "Horn von Vorlus",
[6808] = "Eluniterz",
[6809] = "Eluras Medaillon",
[6810] = "Surenas Halsschmuck",
[6838] = "Versengter Spinnenfangzahn",
[6839] = "Verkohltes Horn",
[6840] = "Galvanisiertes Horn",
[6841] = "Phiole mit Phlogiston",
[6844] = "Brennendes Blut",
[6845] = "Brennender Fels",
[6846] = "Schrift der Defias",
[6847] = "Dunkeleisenmanuskript",
[6848] = "Sengkoralle",
[6849] = "Sonnenverbrannte Schale",
[6887] = "Tüpfelgelbschwanz",
[6894] = "Wirbelherz",
[6895] = "Jordans Schmiedehammer",
[6912] = "Herzholz",
[6914] =


160, 1, 1, 1]
        ]

        input_channel = _make_divisible(16 * width_mult, 8)
        # 416,416,3 -> 208,208,16
        layers = [conv_3x3_bn(3, input_channel, 2)]

        block = InvertedResidual
        for k, t, c, use_se, use_hs, s in self.cfgs:
            output_channel = _make_divisible(c * width_mult, 8)
            exp_size = _make_divisible(input_channel * t, 8)
            layers.append(block(input_channel, exp_size, output_channel, k, s, use_se, use_hs))
            input_channel = output_channel
        self.features = nn.Sequential(*layers)

        self.conv = conv_1x1_bn(input_channel, exp_size)
        self.avgpool = nn.AdaptiveAvgPool2d((1, 1))
        output_channel = _make_divisible(1280 * width_mult, 8) if width_mult > 1.0 else 1280
        self.classifier = nn.Sequential(
            nn.Linear(exp_size, output_channel),
            h_swish(),
            nn.Dropout(0.2),
            nn.Linear(output_channel, num_classes),
        )

        self._initialize_weights()

    def forward(self, x):
        x = self.features(x)
        x = self.conv(x)
        x = self.avgpool(x)
        x = x.view(x.size(0), -1)
        x = self.classifier(x)
        return x

    def _initialize_weights(self):
        for m in self.modules():
            if isinstance(m, nn.Conv2d):
                n = m.kernel_size[0] * m.kernel_size[1] * m.out_channels
                m.weight.data.normal_(0, math.sqrt(2. / n))
                if m.bias is not None:
                    m.bias.data.zero_()
            elif isinstance(m, nn.BatchNorm2d):
                m.weight.data.fill_(1)
                m.bias.data.zero_()
            elif isinstance(m, nn.Linear):
                n = m.weight.size(1)
                m.weight.data.normal_(0, 0.01)
                m.bias.data.zero_()

def mobilenet_v3(pretrained=False, **kwargs):
    model = MobileNetV3(**kwargs)
    if pretrained:
        state_dict = torch.load('./model_data/mobilenetv3-large-1cd25616.pth')
        model.load_state_dict(state_dict, strict=True)
    return model


, 0); width]; height],
        }
    }

    fn generate_noise(&mut self, noise: &PerlinNoise, map_configuration: &MapConfiguration) {
        let scale = if map_configuration.scale > 0_f32 {
            map_configuration.scale
        } else {
            0.0001
        };

        let mut min_altitude = f32::MAX;
        let mut max_altitude = f32::MIN;
        for y in 0..self.height {
            for x in 0..self.width {
                let mut amplitude = 1_f32;
                let mut frequency = 1_f32;
                let mut noise_altitude = 0_f32;
                for i in 0..map_configuration.octaves {
                    let current_offset = map_configuration.offset.pow((i + 1) as u32) as f32;
                    noise_altitude += (noise.perlin(
                        x as f32 * scale * frequency + current_offset,
                        y as f32 * scale * frequency + current_offset,
                    ) * 2_f32
                        - 1_f32)
                        * amplitude;
                    amplitude *= map_configuration.persistance;
                    frequency *= map_configuration.lacunarity;
                }

                if noise_altitude < min_altitude {
                    min_altitude = noise_altitude;
                }
                if noise_altitude > max_altitude {
                    max_altitude = noise_altitude;
                }

                self.z[y][x].0 = noise_altitude;
            }
        }

        //Put back for 0 to 1.
        for y in 0..self.height {
            for x in 0..self.width {
                self.z[y][x].0 = (self.z[y][x].0 - min_altitude) / (max_altitude - min_altitude)
            }
        }
    }

    fn find_islands(&mut self) {
        for y in 0..self.height {
            for x in 0..self.width {
                if self.z[y][x].1 == 0 && self.z[y][x].0 > 0.5 {
                    self.island_count += 1;
                    self.set_island(x, y, self.island_count);
                }
            }
        }

        println!("Number of islands: {}.", self.island_count);
    }

    fn set_island(&mut self, x: usize, y: usize, current_island: usize) {
        let mut queue: VecDeque<(usize, usize)> = VecDeque::default();
        self.z[y][x].1 = current_island;
        queue.push_back((x, y));

        let neighbours: Vec<(isize, isize)> = vec![(1, 0), (0, 1), (-1, 0), (0, -1)];

        while !queue.is_empty() {
            let (x, y) = queue.pop_back().unwrap();
            self.z[y][x].1 = current_island;
            let new_tiles: Vec<(usize, usize)> = neighbours
                .iter()
                .map(|(dx, dy)| (x as isize + *dx, y as isize + *dy))
                .filter(|(x, y)| {
                    0 <= *x && *x < self.width as isize && 0 <= *y && *y < self.height as isize
                })
                .map(|(x, y)| (x as usize, y as usize))
                .filter(|(x, y)| self.z[*y][*x].1 == 0 && self.z[*y][*x].0 > 0.5)
                .collect();
            for (x, y) in new_tiles {
                s


	'Connection': 'keep-alive',
	'User-Agent': 'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1547.76 Safari/537.36',
};

function main() {
	var prefs = AnyBalance.getPreferences();
	var baseurl = 'https://voltmart.su/';
	AnyBalance.setDefaultCharset('utf-8');

	/* Проверяем не забыл ли пользователь ввести данные */

	checkEmpty(prefs.login, 'Введите логин!');
	checkEmpty(prefs.password, 'Введите пароль!');
	checkEmpty(prefs.card, 'Введите номер бонусной карты!');

	/* Проверяем доступность ресурса */

	var html = AnyBalance.requestGet(baseurl + 'login.aspx', g_headers);

	if(!html || AnyBalance.getLastStatusCode() > 400){
		AnyBalance.trace(html);
		throw new AnyBalance.Error('Ошибка при подключении к сайту провайдера! Попробуйте обновить данные позже.');
	}

	/* Пробуем залогиниться */

	var params = AB.createFormParams(html, function(params, str, name, value) {
		if (name == 'ctl00$cphMain$txtEmail')
			return prefs.login;
		else if (name == 'ctl00$cphMain$txtPassword')
			return prefs.password;
			else if (name == '__EVENTTARGET')
				return 'ctl00$cphMain$btnLogin';
		return value;
	});

	// есть ли капча?
	if(/Код подтверждения/i.test(html)){
		var imgUrl = getParam(html, null, null, /Код подтверждения[\s\S]*?<div[^>]*?class\s*?=\s*?"captha-img"[\s\S]*?<img[^>]*src\s*?=\s*?['"]([\s\S]*?)['"]/i, null, html_entity_decode);
		var img = AnyBalance.requestGet(baseurl + imgUrl, g_headers);
		var captcha = AnyBalance.retrieveCode('Введите код с картинки', img);
		params['ctl00$cphMain$dnfValid$txtValidCode'] = captcha;
	}

	html = AnyBalance.requestPost(baseurl + 'login.aspx', params, g_headers);

	if(!html || AnyBalance.getLastStatusCode() > 400){
		AnyBalance.trace(html);
		throw new AnyBalance.Error('Ошибка при входе в личный кабинет! Попробуйте обновить данные позже.');
	}

	// по наличию ссылки 'Выйти' проверяем залогинились или нет
	var exitLink = getElementById(html, 'lbLogOut', replaceTagsAndSpaces);
	if (!/Выйти/i.test(exitLink)) {
		// определяем ошибку
		var error = getElementsByClassName(html, 'notify-item type-error', replaceTagsAndSpaces);
		if (error.length) {
			throw new AnyBalance.Error(error[0], null, /Неверный логин или пароль/i.test(error[0]));
		} else {
			// если не смогли определить ошибку, то показываем дефолтное сообщение
			AnyBalance.trace(html);
			throw new AnyBalance.Error('Не удалось зайти в личный кабинет. Сайт изменен?');
		}
	}

	/* Получаем данные *


0e0d4b401ee83bded6fd043e5d0',1,'Peka2D_Run_::CFL()'],['../structt__arrays__.html#a7215812fbe3ad267229f1d6673021d41',1,'t_arrays_::CFL()']]],
  ['check_75',['check',['../structt__cuPtr__.html#a389407b2433da8f7823efcf509517150',1,'t_cuPtr_']]],
  ['check_5fangle_76',['check_angle',['../mesh_8h.html#a51442af2e72f35dd80ec8bd438d2eae5',1,'check_angle(l_g_cells *lcells, t_message *msg): mesh.cpp'],['../mesh_8cpp.html#a51442af2e72f35dd80ec8bd438d2eae5',1,'check_angle(l_g_cells *lcells, t_message *msg): mesh.cpp']]],
  ['cidx_77',['cidx',['../structt__arrays__.html#ab02f4a9de243d9e6b7ea05a5137031c9',1,'t_arrays_::cidx()'],['../structt__cuPtr__.html#a5a17c53c6ca6c3738aa1a697eb9d71fa',1,'t_cuPtr_::cidx()']]],
  ['cidxin_78',['cidxIn',['../structt__arrays__.html#a9dc32a2778b6f2d0f668489568d59d17',1,'t_arrays_::cidxIn()'],['../structt__cuPtr__.html#a60489592f3f771936e9f7586b9aa4dbb',1,'t_cuPtr_::cidxIn()']]],
  ['cidxout_79',['cidxOut',['../structt__arrays__.html#a76b581ed4527219089b505a7d2ce1b44',1,'t_arrays_::cidxOut()'],['../structt__cuPtr__.html#a472ed9190e4ab2918f81a22a2d54abcc',1,'t_cuPtr_::cidxOut()']]],
  ['cmpp_80',['cmpp',['../mesh_8cpp.html#a80b9b4af0b64cb992537364bc6f48d68',1,'cmpp(const void *id1, const void *id2): mesh.cpp'],['../mesh_8h.html#a80b9b4af0b64cb992537364bc6f48d68',1,'cmpp(const void *id1, const void *id2): mesh.cpp']]],
  ['computeinitialmassbalance_81',['computeInitialMassBalance',['../calculate_8cuh.html#a151d12e24bd6fa0cbffa7d87aded5aa5',1,'computeInitialMassBalance(t_arrays *carrays, t_arrays *garrays, t_cuPtr *cuPtr, t_message *msg): calculate.cu'],['../calculate_8cpp.html#a74f8f59e765880594d5315fc70e46f37',1,'computeInitialMassBalance(t_arrays *carrays, t_message *msg): calculate.cpp'],['../calculate_8cu.html#a151d12e24bd6fa0cbffa7d87aded5aa5',1,'computeInitialMassBalance(t_arrays *carrays, t_arrays *garrays, t_cuPtr *cuPtr, t_message *msg): calculate.cu'],['../calculate_8h.html#a74f8f59e765880594d5315fc70e46f37',1,'computeInitialMassBalance(t_arrays *carrays, t_message *msg): calculate.cpp']]],
  ['computesim_82',['computeSim',['../structt__timers__.html#adfff72bb476538ecc345edc4d4066335',1,'t_timers_']]],
  ['computesimulation_83',['computeSimulatio


hasSize(maxKeys)
      assertThat(it.contents[0].owner).isNull()
    }
  }

  @Test
  fun `list objects v2 returns owner if fetchOwner=true`() {
    val bucketName = "bucket"
    val prefix: String? = null
    val delimiter: String? = null
    val encodingType = "url"
    val startAfter: String? = null
    val maxKeys = 10 //of 14
    val continuationToken: String? = null
    val fetchOwner = true
    givenBucketWithContents(bucketName, prefix)
    iut.listObjectsV2(
      bucketName,
      prefix,
      delimiter,
      encodingType,
      startAfter,
      maxKeys,
      continuationToken,
      fetchOwner
    ).also {
      assertThat(it).isNotNull()
      assertThat(it.name).isEqualTo(bucketName)
      assertThat(it.prefix).isEqualTo(prefix)
      assertThat(it.startAfter).isEqualTo(startAfter)
      assertThat(it.encodingType).isEqualTo(encodingType)
      assertThat(it.isTruncated).isTrue()
      assertThat(it.maxKeys).isEqualTo(maxKeys)
      assertThat(it.nextContinuationToken).isNotEmpty()
      assertThat(it.contents).hasSize(maxKeys)
      assertThat(it.contents[0].owner).isNotNull()
    }
  }

  @Test
  fun testListObjectsV1() {
    val bucketName = "bucket"
    val prefix: String? = null
    val delimiter: String? = null
    val marker: String? = null
    val encodingType = "url"
    val maxKeys = 10 //of 14
    givenBucketWithContents(bucketName, prefix)
    iut.listObjectsV1(bucketName, prefix, delimiter, marker, encodingType, maxKeys).also {
      assertThat(it).isNotNull()
      assertThat(it.name).isEqualTo(bucketName)
      assertThat(it.prefix).isEqualTo(prefix)
      assertThat(it.marker).isEqualTo(marker)
      assertThat(it.encodingType).isEqualTo(encodingType)
      assertThat(it.isTruncated).isTrue()
      assertThat(it.maxKeys).isEqualTo(maxKeys)
      assertThat(it.nextMarker).isEqualTo("c/1/1")
      assertThat(it.contents).hasSize(maxKeys)
    }
  }

  @Test
  fun testVerifyBucketExists_success() {
    val bucketName = "bucket"
    whenever(bucketStore.doesBucketExist(bucketName)).thenReturn(true)
    iut.verifyBucketExists(bucketName)
  }

  @Test
  fun testVerifyBucketExists_failure() {
    val bucketName = "bucket"
    givenBucket(bucketName)
    whenever(bucketStore.doesBucketExist(bucketName)).thenReturn(false)
    assertThatThrownBy { iut.verifyBucketExists(bucketName) }
      .isEqualTo(S3Exception.NO_SUCH_BUCKET)
  }

  @Test
  fun testVerifyBucketObjectLockEnabled_success() {
    val bucketName = "bucket"
    whenever(bucketStore.isObjectLockEnabled(bucketName)).thenReturn(true)
    iut.verifyBucketObjectLockEnabled(bucketName)
  }

  @Test
  fun testVerifyBucketObjectLockEnabled_failure() {
    val bucketName = "bucket"
    givenBucket(bucketName)
    whenever(bucketStore.isObjectLockEnabled(bucketName)).thenReturn(false)
    assertThatThrownBy { iut.verifyBucketObjectLockEnabled(bucketName) }
      .isEqualTo(S3Exception.NOT_FOUND_BUCKET_OBJECT_LOCK)
  }

  @Test
  fun testVerifyBucketNameIsAllowed_success() {
    val bucketName = "bucket"
    iut.verifyBucketNameIsAllowed(bucketName)
  }

  @Test
  fun testVerifyBucketNameIsAllowed_failure() {


        minutes = minutes - (hours * 60);
    }
    hwinfo.uptime = format!("{} Hours, {} Minutes", hours, minutes);

    // Parse /proc/meminfo
    let mut mem_total: u64 = 0;
    let mut mem_available: u64 = 0;
    let meminfo = fs::read_to_string("/proc/meminfo")
        .expect("There was an error whilst reading /proc/meminfo");
    for line in meminfo.lines() {
        let line = line.replace("\t", "").replace(" ", "");
        let line = line.split_once(":");
        match line {
            Some(("MemTotal", s)) => {
                let s = s.replace("kB", "");
                mem_total = s
                    .parse::<u64>()
                    .expect(format!("There was an error parsing 'MemTotal:{}'!", s).as_ref());
            }
            Some(("MemAvailable", s)) => {
                let s = s.replace("kB", "");
                mem_available = s
                    .parse::<u64>()
                    .expect(format!("There was an error parsing 'MemAvailable:{}'!", s).as_ref());
            }
            _ => continue,
        }
    }
    hwinfo.mem_total = mem_total / 1024;
    hwinfo.mem_used = (mem_total - mem_available) / 1024;

    hwinfo
}

fn print_ascii_art(info: &mut OsInfo, config: &Configuration, force_distro: Option<String>) {
    let mut distro_id = info.id.clone();
    if let Some(distro) = force_distro {
        distro_id = distro;
    }
    let art = match distro_id.as_ref() {
        "arch" => include_str!("../distro_art/arch").to_string(),
        "artix" => include_str!("../distro_art/artix").to_string(),
        "debian" => include_str!("../distro_art/debian").to_string(),
        "endeavouros" => include_str!("../distro_art/endeavouros").to_string(),
        "ubuntu" => include_str!("../distro_art/ubuntu").to_string(),
        "linuxlite" => include_str!("../distro_art/linuxlite").to_string(),
        _ => include_str!("../distro_art/unknown").to_string(),
    };

    info.art_lines = art.lines().count();

    println!();

    for line in art.lines() {
        println!(
            "\x1b[38;5;{}m{}\x1b[0m",
            config.art_color.unwrap_or(255),
            line
        );
    }
}

fn print_distro_info(os_info: &OsInfo, hw_info: &HwInfo, config: &Configuration) {
    //println!("\x1b[H");
    //print!("\x1b[0;0H");
    //\x1b[1B
    let key_color = format!("\x1b[38;5;{}m", config.key_color.unwrap_or(255));
    let value_color = format!("\x1b[38;5;{}m", config.value_color.unwrap_or(255));
    let separator = &config.separator.as_ref().unwrap();
    let owos = match config.case {
        Some(CaseEnum::Mixed) => "OwOS",
        Some(CaseEnum::Lowercase) => "owos",
        Some(CaseEnum::Uppercase) => "OWOS",
        _ => "OWOS",
    };
    let kewnel = match config.case {
        Some(CaseEnum::Mixed) => "Kewnel",
        Some(CaseEnum::Lowercase) => "kewnel",
        Some(CaseEnum::Uppercase) => "KEWNEL",
        _ => "KEWNEL",
    };
    let uwuptime = match config.case {
        Some(CaseEnum::Mixed) => "U


         #6428
    '1B' // 4e2e         #27
    '61V' // 4e2f         #1607
    '124M' // 4e30         #3236
    '14O' // 4e31         #378
    '195V' // 4e32         #5091
    'A' // 4e33
    '2C' // 4e34         #54
    '19J' // 4e35         #503
    '116L' // 4e36         #3027
    '14O' // 4e37         #378
    '183Z' // 4e38         #4783
    '203G' // 4e39         #5284
    '7K' // 4e3a         #192
    '243B' // 4e3b         #6319
    '136V' // 4e3c         #3557
    '61Y' // 4e3d         #1610
    '3Q' // 4e3e         #94
    '14O' // 4e3f         #378
    'a19J' // 4e40-4e41    #503
    '40T' // 4e42         #1059
    '183M' // 4e43         #4770
    '19J' // 4e44         #503
    '222Y' // 4e45         #5796
    '7J' // 4e46         #191
    '14O' // 4e47         #378
    '159D' // 4e48         #4137
    '61Y' // 4e49         #1610
    'A' // 4e4a
    '241F' // 4e4b         #6271
    '3N' // 4e4c         #91
    '135F' // 4e4d         #3515
    '208H' // 4e4e         #5415
    '174R' // 4e4f         #4541
    '3Q' // 4e50         #94
    '1B' // 4e51         #27
    '116R' // 4e52         #3033
    '116Q' // 4e53         #3032
    '1R' // 4e54         #43
    '1B' // 4e55         #27
    '166A' // 4e56         #4316
    '259A' // 4e57         #6734
    '194G' // 4e58         #5050
    '176A' // 4e59         #4576
    'a14O' // 4e5a-4e5b    #378
    '147P' // 4e5c         #3837
    '221T' // 4e5d         #5765
    '125C' // 4e5e         #3252
    '241B' // 4e5f         #6267
    '2D' // 4e60         #55
    '3I' // 4e61         #86
    'a1B' // 4e62-4e63    #27
    'a7J' // 4e64-4e65    #191
    '1Z' // 4e66         #51
    '7J' // 4e67         #191
    '1B' // 4e68         #27
    '14O' // 4e69         #378
    '1Y' // 4e6a         #50
    '50F' // 4e6b         #1305
    'A' // 4e6c
    '261D' // 4e6d         #6789
    'aA' // 4e6e-4e6f
    '1Z' // 4e70         #51
    '257I' // 4e71         #6690
    'A' // 4e72
    '205Q' // 4e73         #5346
    'a1B' // 4e74-4e75    #27
    'a50F' // 4e76-4e77    #1305
    '40V' // 4e78         #1061
    '1B' // 4e79         #27
    'cA' // 4e7a-4e7d
    '215


ng Minecraft Forge.
 * https://github.com/WYSI-Foundation/LiquidBouncePlus/
 */
package net.minusmc.minusbounce.utils.render.shader.shaders

import net.minecraft.client.renderer.GlStateManager
import net.minusmc.minusbounce.utils.render.shader.Shader
import org.lwjgl.opengl.GL11
import java.awt.Color
import kotlin.math.abs

/**
 * @author inf, remoted through pie's pc (shader not by me though)
 */
class RoundedRectShader : Shader("roundedrect.frag") {
    override fun setupUniforms() {
        setupUniform("u_size")
        setupUniform("u_radius")
        setupUniform("u_color")
    }

    override fun updateUniforms() {
        // ignore
    }

    companion object {
        @JvmField
        val INSTANCE = RoundedRectShader()

        @Suppress("NOTHING_TO_INLINE")
        inline fun draw(x: Float, y: Float, x2: Float, y2: Float, radius: Float, color: Color): RoundedRectShader {
            val width = abs(x2 - x)
            val height = abs(y2 - y)
            val instance = INSTANCE

            instance.startShader()

            instance.setUniformf("u_size", width, height)
            instance.setUniformf("u_radius", radius)
            instance.setUniformf("u_color", color.red / 255f, color.green / 255f, color.blue / 255f, color.alpha / 255f)

            GlStateManager.enableBlend()
            GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA)
            GlStateManager.enableAlpha()
            GlStateManager.alphaFunc(GL11.GL_GREATER, 0.0f)
            instance.drawQuad(x, y, width, height)
            GlStateManager.disableBlend()

            instance.stopShader()

            return instance
        }
    }
}/*
 * MinusBounce Hacked Client
 * A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge.
 * https://github.com/MinusMC/MinusBounce
 */
package net.minusmc.minusbounce.utils.render.shader.shaders

import net.minecraft.client.gui.ScaledResolution
import net.minusmc.minusbounce.utils.render.RenderUtils
import net.minusmc.minusbounce.utils.render.shader.Shader
import org.lwjgl.opengl.Display
import org.lwjgl.opengl.GL20

class BackgroundDarkShader : Shader("backgrounddark.frag") {
    private var time = 0f
    override fun setupUniforms() {
        setupUniform("iResolution")
        setupUniform("iTime")
    }

    override fun updateUniforms() {
        val scaledResolution = ScaledResolution(mc)
        val resolutionID = getUniform("iResolution")
        if (resolutionID > -1) GL20.glUniform2f(
            resolutionID,
            Display.getWidth().toFloat(),
            Display.getHeight().toFloat()
        )
        val timeID = getUniform("iTime")
        if (timeID > -1) GL20.glUniform1f(timeID, time)
        time += 0.005f * RenderUtils.delta


 (mode === 'pac_script') {
      mode = config.value.pacScript && config.value.pacScript.url ? 'pac_script_url' : 'pac_script_data';
    }

    ctx.fillStyle = prefs['color-' + mode];
    ctx.fillRect(5.04, 8.652, 37.83, 20.176);

    if (mode.startsWith('pac_script')) {
      ctx.fillStyle = mode === 'pac_script_url' ? prefs['color-system'] : prefs['color-fixed_servers'];
      ctx.fillRect(5.04, 8.652, 37.83 / 2, 20.176);
    }
    if (mode === 'fixed_servers' && prefs.text) {
      const profile = (prefs.profiles || []).filter(p => {
        const profile = prefs['profile.' + p];
        return profile && app.compare(profile, config);
      }).shift();
      if (profile) {
        ctx.fillStyle = '#fff';
        ctx.font = '400 20px/24px Roboto,sans-serif';
        ctx.textAlign = 'center';
        ctx.textBaseline = 'middle';
        ctx.fillText(profile[0], 24, 19);
      }
    }

    chrome.browserAction.setIcon({
      imageData: ctx.getImageData(0, 0, 48, 48)
    }, () => chrome.runtime.lastError);

    let title = 'Proxy Switcher\n\n';
    title += ({
      'direct': _('modeDirect'),
      'auto_detect': _('modeAuto'),
      get 'pac_script_url'() {
        return _('modePACU') + config.value.pacScript.url;
      },
      'pac_script_data': _('modePACD'),
      'fixed_servers': _('modeFixed'),
      'system': _('modeSystem')
    })[mode];

    chrome.browserAction.setTitle({title}, () => chrome.runtime.lastError);
  };
})();

chrome.proxy.settings.onChange.addListener(icon);

/* badge */
const tabs = {};

const badge = tabId => chrome.browserAction.setBadgeText({
  tabId,
  text: tabs[tabId] && tabs[tabId].length ? String(tabs[tabId].length) : ''
}, () => chrome.runtime.lastError);

badge.install = () => {
  chrome.tabs.query({}, ts => ts.forEach(t => tabs[t.id] = []));
  chrome.tabs.onCreated.addListener(badge.events.onCreated);
  chrome.tabs.onRemoved.addListener(badge.events.onRemoved);
  chrome.webRequest.onBeforeRequest.addListener(badge.events.onBeforeRequest, {
    urls: ['*://*/*'],
    types: ['main_frame']
  });
  chrome.webRequest.onCompleted.addListener(badge.events.onCompleted, {urls: ['*://*/*']});
  chrome.webRequest.onErrorOccurred.addListener(badge.events.onErrorOccurred, {urls: ['*://*/*']});
};
badge.uninstall = () => {
  chrome.tabs.query({}, tabs => tabs.forEach(tab => chrome.browserAction.setBadgeText({
    tabId: tab.id,
    text: ''
  })));
  chrome.tabs.onCreated.removeListener(badge.events.onCreated);
  chrome.tabs.onRemoved.removeListener(badge.events.onRemoved);
  if (chrome.webRequest) {
    chrome.webRequest.onBeforeRequest.remove


f ( heavyWeapons[j] == -1 ) {
				continue;
			}
		}

		// check travel time
		if ( !BotGoalForEntity( bs, i, &goal, BGU_MEDIUM ) && !requested ) {
			continue;   // NOTE: BotGoalForEntity() must be called first, so that if it fails, but we requested it, it still goes through with valid goal information
		}

		t = trap_AAS_AreaTravelTimeToGoalArea( bs->areanum, bs->origin, goal.areanum, bs->tfl );
		if ( !t || t > MAX_BOTLEADER_TRAVEL ) {
			continue;
		}

		if ( ( bestRequested == requested ) && ( t > bestTime ) ) {
			continue;
		}

		// we have a valid leader
		if ( requested ) {
			j = rand() % 2;
			if ( j == 0 ) {
				BotVoiceChatAfterIdleTime( bs->client, "WhereTo", SAY_TEAM, 1000 + rand() % 3000, BOT_SHOWTEXT, ( requested ? 4000 : 20000 ), qfalse );
			} else if ( j == 1 ) {
				BotVoiceChatAfterIdleTime( bs->client, "LetsGo", SAY_TEAM, 1000 + rand() % 3000, BOT_SHOWTEXT, ( requested ? 4000 : 20000 ), qfalse );
			}

			bs->lead_time = trap_AAS_Time() + 99999.0;
			bestRequested = qtrue;
		}
		best = i;
	}
	//
	return best;
}

int EntGetNumBotFollowers( int entNum ) {
	return 0;
}

/*
==================
BotSetLeaderTagEnt
==================
*/
void BotSetLeaderTagEnt( bot_state_t *bs ) {
}

int BotEngagementFunc( bot_state_t *bs ) {
	return 0;
}

int BotBehaviourFunc( bot_state_t *bs ) {
	return 0;
}

int BotObjectiveFunc( bot_state_t *bs ) {
	return 0;
}


CK(p15.GetCode() == 15);
  VIXL_CHECK(p14.VnB().GetLaneSizeInBits() == kBRegSize);
  VIXL_CHECK(p14.VnH().GetLaneSizeInBits() == kHRegSize);
  VIXL_CHECK(p14.VnS().GetLaneSizeInBits() == kSRegSize);
  VIXL_CHECK(p14.VnD().GetLaneSizeInBits() == kDRegSize);
  VIXL_CHECK(p14.VnB().GetLaneSizeInBytes() == kBRegSizeInBytes);
  VIXL_CHECK(p14.VnH().GetLaneSizeInBytes() == kHRegSizeInBytes);
  VIXL_CHECK(p14.VnS().GetLaneSizeInBytes() == kSRegSizeInBytes);
  VIXL_CHECK(p14.VnD().GetLaneSizeInBytes() == kDRegSizeInBytes);
  VIXL_CHECK(Helper::GetQualification(p1) == kNone);
  VIXL_CHECK(Helper::GetQualification(p2.Zeroing()) == kZeroing);
  VIXL_CHECK(Helper::GetQualification(p3.Merging()) == kMerging);
  VIXL_CHECK(Helper::GetQualification(p4.VnB()) == kWithLaneSize);
  VIXL_CHECK(Helper::GetQualification(p5.VnH()) == kWithLaneSize);
  VIXL_CHECK(Helper::GetQualification(p6.VnS()) == kWithLaneSize);
  VIXL_CHECK(Helper::GetQualification(p7.VnD()) == kWithLaneSize);
}

TEST(sve_z_registers) {
  VIXL_CHECK(z0.GetCode() == 0);
  VIXL_CHECK(z31.GetCode() == 31);

  VIXL_CHECK(z0.Is(z0));
  VIXL_CHECK(!z0.Is(z1));
  VIXL_CHECK(!z0.Is(v0));
  VIXL_CHECK(!z0.Is(b0));
  VIXL_CHECK(!z0.Is(q0));

  VIXL_CHECK(AreAliased(z5, z5));
  VIXL_CHECK(AreAliased(z5, b5));
  VIXL_CHECK(AreAliased(b5, z5));
  VIXL_CHECK(AreAliased(z5, z5.B()));
  VIXL_CHECK(AreAliased(z5, z5.VnB()));

  VIXL_CHECK(!AreAliased(z6, z7));
  VIXL_CHECK(!AreAliased(b6, z7));
  VIXL_CHECK(!AreAliased(x7, z7));
}

TEST(sve_z_registers_vs_neon) {
  // There are three related register variants to consider in VIXL's API:
  //
  //    "b0": NEON: The least-significant byte of v0.
  //    "v0.B": NEON: v0, with an unspecified number of byte-sized lanes.
  //    "z0.B": SVE: z0, with an unspecified number of byte-sized lanes.
  //
  // The first two cases are indistinguishable in VIXL; both are obtained using
  // something like `v0.B()`. This is fine for NEON because there is no
  // ambiguity in practice; the "v0.B" form is always used with an index that
  // makes the meaning clear.

  VIXL_ASSERT(v6.B().Is(b6));
  VIXL_ASSERT(v7.H().Is(h7));
  VIXL_ASSERT(v8.S().Is(s8));
  VIXL_ASSERT(v9.D().Is(d9));

  VIXL_ASSERT(z6.B().Is(b6));
  VIXL


# from distutils.version import LooseVersion

try:
    from xdist import __version__ as xdist_version
except ImportError:
    # no xdist installed - create a substitute API
    def is_xdist_worker(session):
        return False

    def is_xdist_master(session):
        return False

    def is_main_process(session):
        return True

    def get_xdist_worker_id(request_or_session):
        return "master"  # for consistency with the original method
else:
    try:
        # our PR has been accepted in pytest-xdist so we can use these in latest versions
        from xdist import is_xdist_worker, is_xdist_master, get_xdist_worker_id
    except ImportError:
        # if LooseVersion(xdist_version) <= LooseVersion("1.31.0"):
        # old xdist with no api
        def is_xdist_worker(request_or_session):
            """Return `True` if this is a xdist worker, `False` otherwise

            :param request_or_session: the `pytest` `request` or `session` object
            :return:
            """
            return hasattr(request_or_session.config, "workerinput")

        def is_xdist_master(request_or_session):
            """Return `True` if this is the xdist master, `False` otherwise

            Note: this method returns `False` when distribution has not been activated
            at all.

            :param request_or_session: the `pytest` `request` or `session` object
            :return:
            """
            return (not is_xdist_worker(request_or_session)
                    and getattr(request_or_session.config.option, 'dist', 'no') != "no")

        def get_xdist_worker_id(request_or_session):
            """Return the id of the current worker ('gw0', 'gw1', etc) or None
            if running on the master node.

            :param request_or_session: the `pytest` `request` or `session` object
            :return:
            """
            if hasattr(request_or_session.config, "workerinput"):
                return request_or_session.config.workerinput["workerid"]
            else:
                # TODO shall we raise an exception if dist is not enabled ?
                #  i.e. `not is_xdist_master(request_or_session)` ?
                return "master"
    # else:
    #     from xdist import (get_xdist_worker_id as get_xdist_worker_id,
    #                        is_xdist_master as is_xdist_master,
    #                        is_xdist_worker as is_xdist_worker)

    def is_main_process(session):
        return not is_xdist_worker(session)