HKEY  key_handle;

    // Open the key where the proc speed is hidden.
    long l_error = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0", 0, KEY_READ, &key_handle);

    assert(l_error == ERROR_SUCCESS);
    UNREFERENCED_PARAMETER(l_error);

    // Query the key.
    RegQueryValueExA(key_handle, "~MHz", nullptr, nullptr, (LPBYTE)&freq_mhz, &buf_size);

    RegCloseKey(key_handle);

    return freq_mhz;
}

static __int64 GetRdtscTicksPerSecond()
{
    // Use this to control how much time is spent measuring the high freq clock.
    // Measure for 1 / scaling seconds.
    // Higher numbers mean less time spent measuring but larger potential error range.
    const __int64 scaling = 4;

    // Variables for the clock-cycles.
    __int64 cycles_start = 0, cycles_stop = 0;

    // Variables for the High-Res Performance Counter.
    unsigned __int64 ctr_start = 0, freq = 0, ctr_stop = 0;

    // Retrieve performance-counter frequency per second.
    if (!QueryPerformanceFrequency((LARGE_INTEGER*)&freq))
    {
        return 0;
    }

    // Retrieve the current value of the performance counter.
    QueryPerformanceCounter((LARGE_INTEGER*)&ctr_stop);

    // Add the frequency to the counter-value.
    ctr_stop += freq / scaling;

    cycles_start = __rdtsc();

    do
    {
        // Retrieve the value of the performance counter
        // until 1 sec has gone by.
        QueryPerformanceCounter((LARGE_INTEGER*)&ctr_start);
    } while (ctr_start < ctr_stop);

    cycles_stop = __rdtsc();

    return (cycles_stop - cycles_start) * scaling;
}

Profiler::Profiler()
{
    // Constructor uses init to determine tick rate on this computer.
    rdtsc_ticks_per_second_ = 0;
    Init();
}

bool Profiler::Init()
{
    // Determine tick rate on this computer.
    // Also SetThreadAffinityMask to ensure accurate timings since running on same core always.
    Reset();

    SetThreadAffinityMask(GetCurrentThread(), 1);

    rdtsc_ticks_per_second_ = GetRdtscTicksPerSecond();
    DWORD freq              = GetCpuFreq();

    DWORD freq_compare = DWORD(rdtsc_ticks_per_second_ / 1000000);

    if (freq_compare != freq)
    {
        return false;
    }

    return true;
}

void Profiler::Reset()
{
    started_timestamps_.clear();
    total_time_below_parent_.clear();
    function_map_.clear();

    total_time_    = 0;
    timing_errors_ = 0;
    is_active_     = false;
}

void Profiler::Start()
{
    Reset();
    is_active_  = true;
    start_time_ = __rdtsc();
}

void Profiler::Stop()
{
    stop_time_ = __rdtsc();
    is_active_ = false;
}

bool Profiler::EnterFunction(const char* function_name)
{
    UNREFERENCED_PARAMETER(function_name);

    __int64 start_timestamp = __rdtsc();

    // Ignore any profiling calls when not active.
    if (!Active())
    {
        return true;
    }

    // Add enter timestamp to stack.
    started_timestamps_.push_back(start_timestamp);
    // Start time below total at 0.
    total_time_below_parent_.push_back(0);

    return true;
}

bool Profiler::LeaveFunction(const char* function_name)
{
    __int64 end_timestamp = __rdtsc();

    // Ignore any profiling calls when not active.
    if (!Active())
    {


-- #####################
-- # Keyboard Bindings
local pkg = require'pkglib'
local mty = require'metaty'
local ds = require'ds'
local T = require'ele.types'
local keys = require'ele.keys'
local A = require'ele.action'.Actions
local byte, char = string.byte, string.char
local ty = mty.ty

local M = {}
local Bindings, Action = T.Bindings, T.Action

local BIND_TYPES = {
  Action,
}

Bindings.DEFAULT = Bindings{insert = {}, command = {}}

Bindings.new=function()
  return Bindings{insert = {}, command = {}}
end
Bindings._update=function(b, mode, bindings, checker)
  local bm = b[mode]
  for ks, act in pairs(bindings) do
    if act then
      if ty(act) == Action then assert(ty(act.fn) == 'function')
      else
        local aname = act[1]
        if not A[aname] then error(
          'event[1] is an unknown action: '..aname
        )end
      end
    end
    ks = keys.parseKeys(ks)
    if checker then
      for _, k in ipairs(ks) do checker(k) end
    end
    ds.setPath(bm, ks, act or nil)
  end
end
Bindings.updateInsert=function(b, bindings)
  return b:_update('insert', bindings, function(k)
    assert(keys.KEY_INSERT)
    if keys.insertKey(k) and k ~= 'tab' then error(
      'bound visible in insert mode: '..k
    )end
  end)
end
Bindings.updateCommand=function(b, bindings)
  return b:_update('command', bindings)
end
Bindings.default=function() return ds.deepcopy(Bindings.DEFAULT) end

-- default key bindings (updated in Default Bindings section)

-- #####################
-- # Default Bindings

-- -- Insert Mode
Bindings.DEFAULT:updateInsert{
  ['^Q ^Q'] = A.quit,
  ['^J']    = A.command, ['esc']   = A.command,
  ['back']  = A.back,
  ['tab']   = A.tab2,
}

-- Co


 this.x = x;
        this.y = y;
        this.z = z;
    }
    else if (arguments.length === 1)
    {
        // 1 argument means point
        fillPointFromPoint(this, x);
    }
    else
    {
        // no arguments mean create empty
        clearPoint(this);
    }
}

function Sphere3D(radius, rings, slices)
{
    this.radius = radius;
    this.innerRingsCount = rings;
    this.slicesCount = slices;

    var M_PI_2 = Math.PI / 2;
    var dTheta = (Math.PI * 2) / this.slicesCount;
    var dPhi = Math.PI / this.innerRingsCount;

    this.rings = [];
    // always add both poles
    this.rings.push([new Vertex3D(0, this.radius, 0)]);

    // Iterate over latitudes (rings)
    for (var lat = 0; lat < this.innerRingsCount; ++lat)
    {
        var phi = M_PI_2 - lat * dPhi - dPhi / 2;
        var cosPhi = Math.cos(phi);
        var sinPhi = Math.sin(phi);
        //console.log("lat = " + lat + " phi = " + (phi / Math.PI) + " sinPhi = " + sinPhi);

        var vertices = [];
        // Iterate over longitudes (slices)
        for (var lon = 0; lon < this.slicesCount; ++lon)
        {
            var theta = lon * dTheta;
            var cosTheta = Math.cos(theta);
            var sinTheta = Math.sin(theta);
            var p = new Vertex3D();
            p.x = this.radius * cosTheta * cosPhi;
            p.y = this.radius * sinPhi;
            p.z = this.radius * sinTheta * cosPhi;
            vertices.push(p);
        }
        this.rings.push(vertices);
    }

    // always add both poles
    this.rings.push([new Vertex3D(0, -this.radius, 0)]);
}

function rotateX(vertex, radians)
{
    var y = vertex.y;
    vertex.y = (y * Math.cos(radians)) + (vertex.z * Math.sin(radians) * -1.0);
    vertex.z = (y * Math.sin(radians)) + (vertex.z * Math.cos(radians));
}

function rotateY(vertex, radians)
{
    var x = vertex.x;
    vertex.x = (x * Math.cos(radians)) + (vertex.z * Math.sin(radians) * -1.0);
    vertex.z = (x * Math.sin(radians)) + (vertex.z * Math.cos(radians));
}

function rotateZ(vertex, radians)
{
    var x = vertex.x;
    vertex.x = (x * Math.cos(radians)) + (vertex.y * Math.sin(radians) * -1.0);
    vertex.y = (x * Math.sin(radians)) + (vertex.y * Math.cos(radians));
}

function projection(xy, z, xyOffset, zOffset, distance)
{
    return ((distance * xy) / (z - zOffset)) + xyOffset;
}

function getSphereVertex(xDegrees, yDegrees, yDegOffset, radius, rotation)
{
    var v = new Vertex3D();
    var theta = degToRad(xDegrees);
    var phi = (Math.PI / 2) - degToRad(yDegrees - yDegOffset);
    v.x = radius * Math.cos(theta) * Math.cos(phi);
    v.y = radius * Math.sin(phi);
    v.z = radius * Math.sin(theta) * Math.cos(phi);

    rotateX(v, rotation.x);
    rotateY(v, rotation.y);
    rotateZ(v, rotation.z);

    return v;
}

/*
  Q Light Controller Plus
  FixtureDrag


FindClosest::new(&map.gps_bounds.to_bounds());
    for (id, r) in &map.roads {
        let center = PolyLine::new(r.center_points.clone());
        closest.add(
            (*id, true),
            center.shift_right(LANE_THICKNESS).get(timer).points(),
        );
        closest.add(
            (*id, false),
            center.shift_left(LANE_THICKNESS).get(timer).points(),
        );
    }

    for s in shapes.shapes.into_iter() {
        let pts = if let Some(pts) = map.gps_bounds.try_convert(&s.points) {
            pts
        } else {
            continue;
        };
        if pts.len() <= 1 {
            continue;
        }
        // The endpoints will be close to other roads, so match based on the middle of the
        // blockface.
        // TODO Long lines sometimes cover two roads. Should maybe find ALL matches within the
        // threshold distance?
        if let Some(middle) = PolyLine::maybe_new(pts).map(|pl| pl.middle()) {
            if let Some(((r, fwds), _)) = closest.closest_pt(middle, LANE_THICKNESS * 5.0) {
                let osm_tags = &mut map.roads.get_mut(&r).unwrap().osm_tags;

                // Skip if the road already has this mapped.
                if !osm_tags.contains_key(osm::INFERRED_SIDEWALKS) {
                    continue;
                }

                let definitely_no_sidewalks = match osm_tags.get(osm::HIGHWAY) {
                    Some(hwy) => hwy == "motorway" || hwy == "motorway_link",
                    None => false,
                };
                if definitely_no_sidewalks {
                    timer.warn(format!(
                        "Sidewalks shapefile says there's something along motorway {}, ignoring",
                        r
                    ));
                    continue;
                }

                if fwds {
                    if osm_tags.get(osm::SIDEWALK) == Some(&"left".to_string()) {
                        osm_tags.insert(osm::SIDEWALK.to_string(), "both".to_string());
                    } else {
                        osm_tags.insert(osm::SIDEWALK.to_string(), "right".to_string());
                    }
                } else {
                    if osm_tags.get(osm::SIDEWALK) == Some(&"right".to_string()) {
                        osm_tags.insert(osm::SIDEWALK.to_string(), "both".to_string());
                    } else {
                        osm_tags.insert(osm::SIDEWALK.to_string(), "left".to_string());
                    }
                }
            }
        }
    }
    timer.stop("apply sidewalk hints");
}
/// This is a generated file. Do not modify.
/// Se


lish Poison";
CT_RA_CLEANSE = "Cleanse";
CT_RA_PURIFY = "Purify";
CT_RA_REMOVECURSE = "Remove Curse";
CT_RA_CUREDISEASE = "Cure Disease";
CT_RA_CUREPOISON = "Cure Poison";
CT_RA_REMOVELESSERCURSE = "Remove Lesser Curse";

-- Resurrections
CT_RA_RESURRECTION = "Resurrection";
CT_RA_REDEMPTION = "Redemption";
CT_RA_REBIRTH = "Rebirth";
CT_RA_ANCESTRALSPIRIT = "Ancestral Spirit";
CT_RA_REINCARNATION = "Reincarnation";

-- Pets
CT_RA_IMP = "Imp";
CT_RA_VOIDWALKER = "Voidwalker";
CT_RA_SUCCUBUS = "Succubus";
CT_RA_FELHUNTER = "Felhunter";
CT_RA_DOOMGUARD = "Doomguard";
CT_RA_INFERNAL = "Infernal";

-- RAReg/RADur
CT_RA_DURABILITY = "^Durability (%d+) / (%d+)$";
CT_REG_PRIEST = "Sacred Candle";
CT_REG_PRIEST_SPELL = "Prayer of Fortitude";
CT_REG_MAGE = "Arcane Powder";
CT_REG_MAGE_SPELL = "Arcane Brilliance";
CT_REG_DRUID = "Wild Thornroot";
CT_REG_DRUID_SPELL = "Gift of the Wild";
CT_REG_WARLOCK = "Soul Shard";
CT_REG_SHAMAN = "Ankh";
CT_REG_SHAMAN_SPELL = "Reincarnation";
CT_REG_PALADIN = "Symbol of Divinity";
CT_REG_PALADIN_SPELL = "Divine Intervention";

-- Hunter's Mark
CT_RA_HUNTERSMARK = "Hunter's Mark";


lude("py.Windows.Security.Credentials.h")
#include "py.Windows.Security.Credentials.h"
#endif

#if __has_include("py.Windows.Storage.Streams.h")
#include "py.Windows.Storage.Streams.h"
#endif

namespace py::impl::Windows::Devices::WiFiDirect
{
}

namespace py::wrapper::Windows::Devices::WiFiDirect
{
    using WiFiDirectAdvertisement = py::winrt_wrapper<winrt::Windows::Devices::WiFiDirect::WiFiDirectAdvertisement>;
    using WiFiDirectAdvertisementPublisher = py::winrt_wrapper<winrt::Windows::Devices::WiFiDirect::WiFiDirectAdvertisementPublisher>;
    using WiFiDirectAdvertisementPublisherStatusChangedEventArgs = py::winrt_wrapper<winrt::Windows::Devices::WiFiDirect::WiFiDirectAdvertisementPublisherStatusChangedEventArgs>;
    using WiFiDirectConnectionListener = py::winrt_wrapper<winrt::Windows::Devices::WiFiDirect::WiFiDirectConnectionListener>;
    using WiFiDirectConnectionParameters = py::winrt_wrapper<winrt::Windows::Devices::WiFiDirect::WiFiDirectConnectionParameters>;
    using WiFiDirectConnectionRequest = py::winrt_wrapper<winrt::Windows::Devices::WiFiDirect::WiFiDirectConnectionRequest>;
    using WiFiDirectConnectionRequestedEventArgs = py::winrt_wrapper<winrt::Windows::Devices::WiFiDirect::WiFiDirectConnectionRequestedEventArgs>;
    using WiFiDirectDevice = py::winrt_wrapper<winrt::Windows::Devices::WiFiDirect::WiFiDirectDevice>;
    using WiFiDirectInformationElement = py::winrt_wrapper<winrt::Windows::Devices::WiFiDirect::WiFiDirectInformationElement>;
    using WiFiDirectLegacySettings = py::winrt_wrapper<winrt::Windows::Devices::WiFiDirect::WiFiDirectLegacySettings>;
}

namespace py
{
}


string, batchSize int) error {
	if batchSize < 1 {
		return fmt.Errorf("batchSize value must be positive")
	}
	if !c.isWorkerRegistered(taskName) {
		return fmt.Errorf("no worker registered for taskName: %s", taskName)
	}
	c.batchSizeByTaskNameMutex.Lock()
	defer c.batchSizeByTaskNameMutex.Unlock()
	previous := c.batchSizeByTaskName[taskName]
	c.batchSizeByTaskName[taskName] -= batchSize
	log.Debug(
		"Decreased batchSize for task",
		"taskName", taskName,
		"from", previous,
		"to", c.batchSizeByTaskName[taskName],
	)
	if previous-batchSize <= 0 {
		c.batchSizeByTaskName[taskName] = 0
		log.Info("Stopped worker for task", "taskName", taskName)
	}
	return nil
}

// Pause pauses all workers running the provided task. When paused, workers will not poll for new tasks and no new
// goroutines are started. However it does not stop any goroutines running. Workers must be resumed at a later time
// using Resume. Failing to call `Resume()` on a TaskRunner running one or more workers can result in a goroutine leak.
func (c *TaskRunner) Pause(taskName string) {
	c.pausedWorkersMutex.Lock()
	defer c.pausedWorkersMutex.Unlock()
	c.pausedWorkers[taskName] = true
}

// Resume all running workers for the provided taskName. If workers for the provided task are not paused, calling this
// method has no impact.
func (c *TaskRunner) Resume(taskName string) {
	c.pausedWorkersMutex.Lock()
	defer c.pausedWorkersMutex.Unlock()
	c.pausedWorkers[taskName] = false
}

// Shutdown the TaskRunner will stop polling for tasks and once all running workers are done,
// a signal will be sent to the WaitGroup to indicate that this worker has completed its work.
// When used in conjunction with TaskRunner.WaitWorkers() it allows a graceful shutdown.
func (c *TaskRunner) Shutdown(taskName string) {
	log.Info("Shutting down workers for task", "taskName", taskName)
	c.batchSizeByTaskNameMutex.Lock()
	delete(c.batchSizeByTaskName, taskName)
	c.batchSizeByTaskNameMutex.Unlock()

	c.pausedWorkersMutex.Lock()
	delete(c.pausedWorkers, taskName)
	c.pausedWorkersMutex.Unlock()

	c.pollIntervalByTaskNameMutex.Lock()
	delete(c.pollIntervalByTaskName, taskName)
	c.pollIntervalByTaskNameMutex.Unlock()

	c.pollTimeoutMutex.Lock()
	delete(c.pollTimeoutByTaskName, taskName)
	c.pollTimeoutMutex.Unlock()
}

func (c *TaskRunner) isPaused(taskName string) bool {
	c.pausedWorkersMutex.RLock()
	defer c.pausedWorkersMutex.RUnlock()
	return c.pausedWorkers[taskName]
}

// WaitWorkers uses an internal waitgroup to block the calling thread until all workers started by this TaskRunner have
// been shut down.
func (c *TaskRunner) WaitWorkers() {
	c.workerWaitGroup.Wait()
}

func (c *TaskRunner) startWorker(taskName string, executeFunction model.ExecuteTaskFunction, batchSize int, pollInterval time.Duration, taskDomain string) error {
	c.SetPollIntervalForTask(taskName, pollInterval)
	c.Resume(taskName)
	previousMaxAllowedWorkers, err := c.getMaxAllowedWorkers(taskName)
	if err != nil {
		return err
	}
	err = c.increaseMaxAllowedWorkers(taskName, batchSize)
	if err != nil {
		return err
	}
	if previousMaxAllowedWorkers < 1 {
		c.workerWaitGroup.Add(1)


     and create the repetitions by memcpy. */
  if (table_bits > max_length) {
    table_bits = max_length;
    table_size = 1 << table_bits;
  }
  key = 0;
  key_step = BROTLI_REVERSE_BITS_LOWEST;
  bits = 1;
  step = 2;
  do {
    symbol = bits - (BROTLI_HUFFMAN_MAX_CODE_LENGTH + 1);
    for (bits_count = count[bits]; bits_count != 0; --bits_count) {
      symbol = symbol_lists[symbol];
      code = ConstructHuffmanCode((uint8_t)bits, (uint16_t)symbol);
      ReplicateValue(&table[BrotliReverseBits(key)], step, table_size, code);
      key += key_step;
    }
    step <<= 1;
    key_step >>= 1;
  } while (++bits <= table_bits);

  /* If root_bits != table_bits then replicate to fill the remaining slots. */
  while (total_size != table_size) {
    memcpy(&table[table_size], &table[0],
           (size_t)table_size * sizeof(table[0]));
    table_size <<= 1;
  }

  /* Fill in 2nd level tables and add pointers to root table. */
  key_step = BROTLI_REVERSE_BITS_LOWEST >> (root_bits - 1);
  sub_key = (BROTLI_REVERSE_BITS_LOWEST << 1);
  sub_key_step = BROTLI_REVERSE_BITS_LOWEST;
  for (len = root_bits + 1, step = 2; len <= max_length; ++len) {
    symbol = len - (BROTLI_HUFFMAN_MAX_CODE_LENGTH + 1);
    for (; count[len] != 0; --count[len]) {
      if (sub_key == (BROTLI_REVERSE_BITS_LOWEST << 1U)) {
        table += table_size;
        table_bits = NextTableBitSize(count, len, root_bits);
        table_size = 1 << table_bits;
        total_size += table_size;
        sub_key = BrotliReverseBits(key);
        key += key_step;
        root_table[sub_key] = ConstructHuffmanCode(
            (uint8_t)(table_bits + root_bits),
            (uint16_t)(((size_t)(table - root_table)) - sub_key));
        sub_key = 0;
      }
      symbol = symbol_lists[symbol];
      code = ConstructHuffmanCode((uint8_t)(len - root_bits), (uint16_t)symbol);
      ReplicateValue(
          &table[BrotliReverseBits(sub_key)], step, table_size, code);
      sub_key += sub_key_step;
    }
    step <<= 1;
    sub_key_step >>= 1;
  }
  return (uint32_t)total_size;
}

uint32_t duckdb_brotli::BrotliBuildSimpleHuffmanTable(HuffmanCode* table,
                                       int root_bits,
                                       uint16_t* val,
                                       uint32_t num_symbols) {
  uint32_t table_size = 1;
  const uint32_t goal_size = 1U << root_bits;
  switch (num_symbols) {
    case 0:
      table[0] = ConstructHuffmanCode(0, val[0]);
      break;
    case 1:
      if (val[1] > val[0]) {
        table[0] = ConstructHuffmanCode(1, val[0]);
        table[1] = ConstructHuffmanCode(1, val[1]);
      } else {
        table[0] = ConstructHuffmanCode(1, val[1]);
        table[1] = ConstructHuffmanCode(1, val[0]);
      }
      table_size = 2;
      break;
    case 2:
      table[0] = ConstructHuffmanCode(1, val[0]);
      table[2


local Translations = {
    info = {
        open_shop = "[E] Open DMV",
        already_taking = 'You are already taking the driving test.',
        already_took = 'You already took your tests! Go to the City Hall to buy your license.',

    },
    error = {
        failed_theory = 'You failed your test!',
        failed_driver = 'You failed the driving test, please try again.',
        driving_fast = 'You are driving too fast. Slow Down',
        damaged_vehicle = 'You damaed the vehicle.',
        errors = 'Errors: %{value} / %{value2}',
        error_paid = 'You paid $ %{value}'
    },
    success = {
        take_driver = 'You are taking the driving Test.',
        passed_theory = 'You passed your test!',
        passed_driver = 'You passed the driving test!',
        passed_theory_giv


if p.piecetype == PieceType::Knight{
					if p.color == color{
						return true;
					}
				}
			}
		}
		'hori_verti: for dir in &[(0, -1), (1, 0), (0, 1), (-1, 0)]{
			let mut to_x = pos.x as i8;
			let mut to_y = pos.y as i8;
			let mut first_step = true;
			loop{
				to_x += dir.0;
				to_y += dir.1;
				if to_x < 0 || to_x >= 8 || to_y < 0 || to_y >= 8 { continue 'hori_verti; }
				if let Some(p) = self.get_reference_at(to_x as usize, to_y as usize){
					if p.color == color && (p.piecetype == PieceType::Rook || p.piecetype == PieceType::Queen || (p.piecetype == PieceType::King && first_step)){
						return true;
					}
					break;
				}

				first_step = false;
			}
		}
		'diagonal_down: for dir in &[(1, 1), (-1, 1)]{
			let mut to_x = pos.x as i8;
			let mut to_y = pos.y as i8;
			let mut first_step = true;
			loop{
				to_x += dir.0;
				to_y += dir.1;
				if to_x < 0 || to_x >= 8 || to_y < 0 || to_y >= 8 { continue 'diagonal_down; }
				if let Some(p) = self.get_reference_at(to_x as usize, to_y as usize){
					if p.color == color && (p.piecetype == PieceType::Bishop || p.piecetype == PieceType::Queen || (p.piecetype == PieceType::King && first_step) || (p.piecetype == PieceType::Pawn && p.color == White && first_step)){
						return true;
					}
					break;
				}
				first_step = false;
			}
		}
		'diagonal_up: for dir in &[(1, -1), (-1, -1)]{
			let mut to_x = pos.x as i8;
			let mut to_y = pos.y as i8;
			let mut first_step = true;
			loop{
				to_x += dir.0;
				to_y += dir.1;
				if to_x < 0 || to_x >= 8 || to_y < 0 || to_y >= 8 { continue 'diagonal_up; }
				if let Some(p) = self.get_reference_at(to_x as usize, to_y as usize){
					if p.color == color && (p.piecetype == PieceType::Bishop || p.piecetype == PieceType::Queen || (p.piecetype == PieceType::King && first_step) || (p.piecetype == PieceType::Pawn && p.color == Black && first_step)){
						return true;
					}
					break;
				}
				first_step = false;
			}
		}
		false
	}

	//Takler alle spesialtilfeller når en bonde skal flyttes.
	//Det inkluderer en passant, og promotering.
	fn handle_pawn_moves(&mut self, m: &Move) -> Option<i8>{
		let passant;
		if (m.from.y as i8 - m.to.y as i8).abs() == 2{
			passant = Some(m.from.x as i8);
			self.zobrist.update_en_passant(m.from.x);
		}else { passant = None; }

		if let Some(ps) = self.passants[


;
//! let curve = circle
//!     .axis_iter(Axis(0))
//!     .map(|c| [c[0], c[1]])
//!     .collect::<Vec<_>>();
//! let new_curve = Efd::from_curve(&curve, None).generate(20);
//! # assert_eq!(new_curve.len(), 20);
//! ```
//!
//! # Features
//!
//! This crate support no-std solution via using "libm",
//! a crate provide pure-rust math functions, please enable it if disabled the "std" feature.
#![warn(missing_docs)]
#![cfg_attr(not(feature = "std"), no_std)]
extern crate alloc;
#[cfg(not(feature = "std"))]
extern crate core as std;

#[cfg(not(any(feature = "std", feature = "libm")))]
compile_error!("please enable math function from either \"std\" or \"libm\"");

pub use crate::{efd::*, geo_info::*};

mod efd;
mod geo_info;
mod math;
pub mod tests;
<filename>src/keys.rs
use std::collections::HashMap;
use std::sync::atomic::AtomicBool;
use std::sync::Arc;

use chrono::{DateTime, Utc};
use serde::{Deserialize, Serialize};
use serenity::client::bridge::gateway::ShardManager;
use serenity::prelude::TypeMapKey;
use sqlx::PgPool;
use tokio::sync::Mutex;

pub struct ShardManagerContainer;
impl TypeMapKey for ShardManagerContainer {
    type Value = Arc<Mutex<ShardManager>>;
}

pub struct BotCtl;
impl TypeMapKey for BotCtl {
    type Value = AtomicBool;
}

pub struct Uptime;
impl TypeMapKey for Uptime {
    type Value = HashMap<String, DateTime<Utc>>;
}

pub struct Data {
    pub stock: i64,
    pub image_url: String,
}

#[derive(Serialize, Deserialize, sqlx::FromRow)]
pub struct Component {
    pub name: String,
    pub lcsc: String,
    pub enabled: bool,
    pub channel_id: i64,
    pub prev_stock: i64,
    pub role_id: i64,
}

#[derive(Serialize, Deserialize)]
pub struct Components {
    pub components: Vec<Component>,
}

#[derive(Serialize, Deserialize)]
pub struct Role {
    pub role_name: String,
    pub role_id: u64,
}

#[derive(Serialize, Deserialize)]
pub struct Roles {
    pub roles: Vec<Role>,
}

#[derive(Serialize, Deserialize, sqlx::FromRow)]
pub struct Datasheet {
    pub name: String,
    pub link: String,
}

#[derive(Serialize, Deserialize)]
pub struct Datasheets {
    pub datasheets: Vec<Datasheet>,
}

pub struct DatabasePool;
impl TypeMapKey for DatabasePool {
    type Value = PgPool;
}
<reponame>ericrobolson/g_network
use crate::{
    packet::Packet,
    packet_id::{self, PacketId},
    ring_buffer::RingBuffer,
    socket::{Socket, SocketErr},
    types::*,
    PacketErr,
};

#[derive(Copy, Clone, Debug, PartialEq)]
enum DeliveryStatus {
    Delivered { notified: bool },
    Dropped { notified: bool },
    InFlight,
}

#[derive(Copy, Clone, Debug, PartialEq)]
pub struct Notification {
    pub packet: PacketId,
    pub status: AckStatus,
}

const BUFFER_SIZE: usize = 1024;

/// An abstraction for a connection.
/// Inspired by https://gafferongames.com/post/reliable_ordered_messages/
pub struct Connection<TSocket>
where
    TSocket: Socket,
{
    received_packet_buffer: RingBuffer<bool, BUFFER_SIZE>,
    sent_packet_sequence_buffer: RingBuffer<Option<DeliveryStatus>, BUFFER_SIZE>,


deword, correcting up to 8
    /// hexbit errors (up to 48 bit errors.)
    ///
    /// If decoding was successful, return `Some((data, err))`, where `data` is the 20
    /// data hexbits and `err` is the number of corrected hexbits. Otherwise, return
    /// `None` to indicate an unrecoverable error.
    pub fn decode(buf: &mut [Hexbit; 36]) -> Option<(&[Hexbit], usize)> {
        super::decode::<super::LongCoefs>(buf).map(move |(poly, err)| {
            (super::extract_data(poly, &mut buf[..20]), err)
        })
    }
}

/// Encode the given data with the given generator matrix and place the resulting parity
/// symbols in the given destination.
fn encode<'g, G>(data: &[Hexbit], parity: &mut [Hexbit], gen: G)
    where G: Iterator<Item = &'g [u8]>
{
    gen.map(|row| {
        row.iter()
           .zip(data.iter())
           .fold(P25Codeword::default(), |s, (&col, &d)| {
               s + P25Codeword::new(d.bits()) * P25Codeword::new(col)
           }).bits()
    }).map(Hexbit::new).collect_slice_checked(parity);
}

/// Try to fix any errors in the given word.
///
/// On success, return `Some((poly, err))`, where `poly` is the polynomial representation
/// of the corrected word (with the last data symbol as the degree-0 coefficient) and
/// `err` is the number of corrected hexbit symbols. Otherwise, return `None` to indicate
/// an unrecoverable error.
fn decode
(word: &[Hexbit]) -> Option<(Polynomial
, usize)> {
    // In the polynomial representation, the first received symbol corresponds to the
    // coefficient of the highest-degree term.
    let mut poly = Polynomial::new(word.iter().rev().map(|&b|
        P25Codeword::new(b.bits())
    ));

    bmcf::Errors::new(syndromes(&poly)).and_then(|(nerr, errs)| {
        for (loc, pat) in errs {
            match poly.get_mut(loc) {
                Some(coef) => *coef = *coef + pat,
                None => return None,
            }
        }

        Some((poly, nerr))
    })
}

/// Generate the syndrome polynomial s(x) from the given received word r(x).
///
/// The resulting polynomial has the form s(x) = s1 + s2x + ··· +
/// s2tx2t, where si = r(αi</


Items" role="menuitemcheckbox" aria-checked="false" aria-label="eyes" type="submit" data-view-component="true" class="dropdown-item dropdown-item-reaction btn-invisible btn d-flex no-underline color-fg-muted flex-justify-center flex-items-center rounded-2" style="">    <g-emoji alias="eyes" fallback-src="https://github.githubassets.com/assets/1f440-ee44e91e92a7.png" class="d-flex" style="">👀</g-emoji>
</button>

</form>

  </reactions-menu>

  <form class="js-pick-reaction" data-turbo="false" action="https://github.com/funige/neo/reactions" accept-charset="UTF-8" method="post" style="">

</form>

<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo-push" style="">
    <path d="M1 2.5A2.5 2.5 0 0 1 3.5 0h8.75a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0V1.5h-8a1 1 0 0 0-1 1v6.708A2.493 2.493 0 0 1 3.5 9h3.25a.75.75 0 0 1 0 1.5H3.5a1 1 0 0 0 0 2h5.75a.75.75 0 0 1 0 1.5H3.5A2.5 2.5 0 0 1 1 11.5Zm13.23 7.79h-.001l-1.224-1.224v6.184a.75.75 0 0 1-1.5 0V9.066L10.28 10.29a.75.75 0 0 1-1.06-1.061l2.505-2.504a.75.75 0 0 1 1.06 0L15.29 9.23a.751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018Z" style=""></path>
</svg>

          satopian

        added 2 commits

          <relative-time tense="past" datetime="2024-02-13T02:51:06+09


px}body.en_GB .dydl .cap{background-image:url("//ir.ebaystatic.com/pictures/aw/home/feed/ebay_uk_deals.png");height:60px;width:156px}body.de_DE .dydl .cap{background-image:url("//ir.ebaystatic.com/pictures/aw/home/feed/ebay_de_deals.png");height:60px;width:156px}body.de_DE .ddcrd .prom .gspr,body.en_GB .ddcrd .prom .gspr,body.fr_FR .ddcrd .prom .gspr,body.it_IT .ddcrd .prom .gspr{background-image:none!important;background-color:#e60037}.dydl .ddcrd{border-bottom:1px solid #CCC;max-height:284px;padding:15px 5px 10px 5px}.all{display:block;font-size:13px;font-weight:normal;padding:10px 0;text-align:center}.dhr{color:#CCC;height:1px;margin:8px 0 0 0}.horizontal-daily-deals{display:block;height:278px;overflow:hidden;padding:13px 0}.horizontal-daily-deals a{color:#0654ba}.horizontal-daily-deals .deals{height:233px;margin-top:10px;padding-left:24px;width:9999px}.horizontal-daily-deals .ddcrd{border-bottom:0;float:left;height:auto;padding:0}.horizontal-daily-deals .ddcrd .prom140{top:1px}.horizontal-daily-deals .ddcrd .tl{font-size:14px;line-height:1.2;height:32px;margin:0;margin-left:3px;width:180px}.horizontal-daily-deals .ddcrd .icon{-moz-border-radius:2px;-webkit-border-radius:2px;border:1px solid #ddd;border-radius:2px;line-height:145px;height:146px;margin:6px 0 7px 0;width:169px}.horizontal-daily-deals .ddcrd .icon img{display:none}.horizontal-daily-deals .ddcrd .icon:hover{border:1px solid #aaa}.horizontal-daily-deals .ddcrd .info{margin-left:3px}.horizontal-daily-deals .daily-deals-title{font-weight:bold;margin-left:15px}.horizontal-daily-deals .daily-deals-link{display:none}.horizontal-daily-deals .pagination{border-top:1px solid #CCC;height:35px;text-align:center;white-space:nowrap;width:100%}.horizontal-daily-deals .pagination .page{-moz-border-radius:5px;-webkit-border-radius:5px;background:#ccc;border:1px solid transparent;border-radius:5px;color:transparent;cursor:pointer;display:inline-block;font-size:0;height:12px;margin:0 10px 0;position:relative;top:10px;vertical-align:top;width:12px}.horizontal-daily-deals .pagination .page.selected{background:#777}.horizontal-daily-deals .pagination .arrow{background:url('//ir.ebaystatic.com/pictures/aw/home/feed/sprite_201505141202_opt.png') no-repeat 0 0;display:inline-block;height:16px;margin:0 30px;position:relative;top:9px;vertical-align:top;width:10px}.horizontal-daily-deals .pagination .left-arrow{background-position:-378px -512px}.horizontal-daily-deals .pagination .left-arrow:hover{background-position:-396px -512px;cursor:pointer}.horizontal-daily-deals .pagination .right-arrow{background-position:-378px -534px}.horizontal-daily-deals .pagination .right-arrow:hover{background-position:-396px -534px;cursor:pointer}.top-deals .h


ORAGE_KEY.adminToken)
  }
  const url = moduleName + '/fetching'
  return new Promise((resolve, reject) => {
    apiRequest.Post(url, data, adminToken).then(
      r => {
        resolve(r)
      },
      e => {
        reject(e)
      }
    )
  })
}

/**
 * 根据id删除主题
 */
function adminDeleteTheme(thmemId) {
  const adminToken = {
    admin_token: wx.getStorageSync(STORAGE_KEY.adminToken)
  }
  const url = moduleName + '/' + thmemId
  return new Promise((resolve, reject) => {
    apiRequest.Delete(url, adminToken).then(
      r => {
        resolve(r)
      },
      e => {
        reject(e)
      }
    )
  })
}

/**
 * 根据id在线更新主题
 */
function adminFetchingTheme(thmemId) {
  const adminToken = {
    admin_token: wx.getStorageSync(STORAGE_KEY.adminToken)
  }
  const url = moduleName + '/fetching/' + thmemId
  return new Promise((resolve, reject) => {
    apiRequest.Put(url, {}, adminToken).then(
      r => {
        resolve(r)
      },
      e => {
        reject(e)
      }
    )
  })
}

module.exports = {
  adminGetTheme,
  adminActivatesTheme,
  adminDeleteTheme,
  adminFetchingTheme,
  adminFetchingNewTheme
}
import apiRequest from './../../../utils/api-request'
import { ApiBaseUrl } from '../../../config/api'
import { STORAGE_KEY } from '../../const-data/const-data'
const moduleName = ApiBaseUrl + '/api/admin/menus'

/**
 * 获取菜单列表
 */
function adminGetMenu(param) {
  const adminToken = {
    admin_token: wx.getStorageSync(STORAGE_KEY.adminToken)
  }
  return new Promise((resolve, reject) => {
    apiRequest.Get(moduleName, Object.assign(adminToken, param)).then(
      r => {
        resolve(r)
      },
      e => {
        reject(e)
      }
    )
  })
}

/**
 * 添加菜单
 */
function adminAddMenu(data) {
  const adminToken = {
    admin_token: wx.getStorageSync(STORAGE_KEY.adminToken)
  }
  return new Promise((resolve, reject) => {
    apiRequest.Post(moduleName, data, adminToken).then(
      r => {
        resolve(r)
      },
      e => {
        reject(e)
      }
    )
  })
}

/**
 * 根据id编辑菜单
 */
function adminEditMenu(menuId, param) {
  const adminToken = {
    admin_token: wx.getStorageSync(STORAGE_KEY.adminToken)
  }
  const url = moduleName + '/' + menuId
  return new Promise((resolve, reject) => {
    apiRequest.Put(url, param, adminToken).then(
      r => {
        resolve(r)
      },
      e => {
        reject(e)
      }
    )
  })
}

/**
 * 根据id删除菜单
 */
function adminDeleteMenu(menuId) {
  const adminToken = {
    admin_token: wx.getStorageSync(STORAGE_KEY.adminToken)
  }
  const url = moduleName + '/' + menuId
  return new Promise((resolve, reject) => {
    apiRequest.Delete(url, adminToken).then(
      r => {
        resolve(r)
      },
      e => {
        reject(e)
      }
    )
  })
}

module.exports = {
  adminGetMenu,
  adminAddMenu,


newcombattarget", OnNewTarget)

    inst.buzzing = true
    inst.sounds = normalsounds
    inst.EnableBuzz = EnableBuzz
    inst.IsFriendly = IsFriendly
    inst.MakeFriendly = MakeFriendly
    inst.StartFindingPlayerQueenTasks = StartFindingPlayerQueenTasks
    inst.GetQueen = GetQueen
    inst.MakeHostile = MakeHostile
    inst.AddToArmy = Add


/* This routine recursively performs the
** separation recursion.
** It returns:
** - 0   : if separator could be computed.
** - !0  : on error.
*/

static
int
vgraphSeparateMl2 (
Vgraph * restrict const             grafptr,      /* Vertex-separation graph */
const VgraphSeparateMlParam * const paraptr)      /* Method parameters       */
{
  Vgraph                        coargrafdat;
  GraphCoarsenMulti * restrict  coarmulttab;
  int                           o;

  if (vgraphSeparateMlCoarsen (grafptr, &coargrafdat, &coarmulttab, paraptr) == 0) {
    if (((o = vgraphSeparateMl2         (&coargrafdat, paraptr))              == 0) &&
        ((o = vgraphSeparateMlUncoarsen (grafptr, &coargrafdat, coarmulttab)) == 0) &&
        ((o = vgraphSeparateSt          (grafptr, paraptr->stratasc))         != 0)) /* Apply ascending strategy */
      errorPrint ("vgraphSeparateMl2: cannot apply ascending strategy");
    coargrafdat.frontab = NULL;                   /* Prevent frontab of fine graph from being freed */
    vgraphExit (&coargrafdat);
  }
  else {                                          /* Cannot coarsen due to lack of memory or error */
    if (((o = vgraphSeparateMlUncoarsen (grafptr, NULL, NULL)) == 0) && /* Finalize graph          */
        ((o = vgraphSeparateSt          (grafptr, paraptr->stratlow)) != 0)) /* Apply low strategy */
      errorPrint ("vgraphSeparateMl2: cannot apply low strategy");
  }

  return (o);
}

/*****************************/
/*                           */
/* This is the main routine. */
/*                           */
/*****************************/

/* This routine performs the muti-level separation.
** It returns:
** - 0 : if separator could be computed.
** - 1 : on error.
*/

int
vgraphSeparateMl (
Vgraph * const                      grafptr,      /*+ Vertex-separation graph +*/
const VgraphSeparateMlParam * const paraptr)      /*+ Method parameters       +*/
{
  Gnum                levlnum;                    /* Save value for graph level */
  int                 o;

  levlnum = grafptr->levlnum;                     /* Save graph level               */
  grafptr->levlnum = 0;                           /* Initialize coarsening level    */
  o = vgraphSeparateMl2 (grafptr, paraptr);       /* Perform multi-level separation */
  grafptr->levlnum = levlnum;                     /* Restore graph level            */

  return (o);
}


o mate with the specified mob.
     */
    public boolean canMateWith(EntityAnimal p_70878_1_)
    {
        if (p_70878_1_ == this)
        {
            return false;
        }
        else if (!this.isTamed())
        {
            return false;
        }
        else if (!(p_70878_1_ instanceof EntityOcelot))
        {
            return false;
        }
        else
        {
            EntityOcelot var2 = (EntityOcelot)p_70878_1_;
            return !var2.isTamed() ? false : this.isInLove() && var2.isInLove();
        }
    }

    public int getTameSkin()
    {
        return this.dataWatcher.getWatchableObjectByte(18);
    }

    public void setTameSkin(int p_70912_1_)
    {
        this.dataWatcher.updateObject(18, Byte.valueOf((byte)p_70912_1_));
    }

    /**
     * Checks if the entity's current position is a valid location to spawn this entity.
     */
    public boolean getCanSpawnHere()
    {
        if (this.worldObj.rand.nextInt(3) == 0)
        {
            return false;
        }
        else
        {
            if (this.worldObj.checkNoEntityCollision(this.boundingBox) && this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox).isEmpty() && !this.worldObj.isAnyLiquid(this.boundingBox))
            {
                int var1 = MathHelper.floor_double(this.posX);
                int var2 = MathHelper.floor_double(this.boundingBox.minY);
                int var3 = MathHelper.floor_double(this.posZ);

                if (var2 < 63)
                {
                    return false;
                }

                Block var4 = this.worldObj.getBlock(var1, var2 - 1, var3);

                if (var4 == Blocks.grass || var4.getMaterial() == Material.leaves)
                {
                    return true;
                }
            }

            return false;
        }
    }

    /**
     * Gets the name of this command sender (usually username, but possibly "Rcon")
     */
    public String getCommandSenderName()
    {
        return this.hasCustomNameTag() ? this.getCustomNameTag() : (this.isTamed() ? StatCollector.translateToLocal("entity.Cat.name") : super.getCommandSenderName());
    }

    public IEntityLivingData onSpawnWithEgg(IEntityLivingData p_110161_1_)
    {
        p_110161_1_ = super.onSpawnWithEgg(p_110161_1_);

        if (this.worldObj.rand.nextInt(7) == 0)
        {
            for (int var2 = 0; var2 < 2; ++var2)
            {
                EntityOcelot var3 = new EntityOcelot(this.worldObj);
                var3.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, 0.0F);
                var3.setGrowingAge(-24000);
                this.worldObj.spawnEntityInWorld(var3);
            }
        }

        return p_110161_1_;
    }
}
package net.minecraft.entity.passive;

import net.minecraft.block.Block;
import net.minecraft.entity.EntityAgeable;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.ai.EntityAIFollowParent;
import net.minecraft.entity.ai.EntityAILookIdle;
import net.minecraft.entity.ai.EntityAIMate;
import net.minecraft.entity.ai.EntityAIPanic;
import net.minecraft.entity.ai.EntityAISwimming;
import net.minecraft.entity.ai.EntityAITempt;
import net.minecraft


idTokenClaims.AuthenticationMethodsReferences,
		"nonce":     idTokenClaims.Nonce,
	}, idTokenClaims.ToMap())
}
// Copyright © 2025 Ory Corp
// SPDX-License-Identifier: Apache-2.0

package jwt

import (
	"time"

	"github.com/google/uuid"
)

// IDTokenClaims represent the claims used in open id connect requests
type IDTokenClaims struct {
	JTI                                 string                 `json:"jti"`
	Issuer                              string                 `json:"iss"`
	Subject                             string                 `json:"sub"`
	Audience                            []string               `json:"aud"`
	Nonce                               string                 `json:"nonce"`
	ExpiresAt                           time.Time              `json:"exp"`
	IssuedAt                            time.Time              `json:"iat"`
	RequestedAt                         time.Time              `json:"rat"`
	AuthTime                            time.Time              `json:"auth_time"`
	AccessTokenHash                     string                 `json:"at_hash"`
	AuthenticationContextClassReference string                 `json:"acr"`
	AuthenticationMethodsReferences     []string               `json:"amr"`
	CodeHash                            string                 `json:"c_hash"`
	Extra                               map[string]interface{} `json:"ext"`
}

// ToMap will transform the headers to a map structure
func (c *IDTokenClaims) ToMap() map[string]interface{} {
	var ret = Copy(c.Extra)

	if c.Subject != "" {
		ret["sub"] = c.Subject
	} else {
		delete(ret, "sub")
	}

	if c.Issuer != "" {
		ret["iss"] = c.Issuer
	} else {
		delete(ret, "iss")
	}

	if c.JTI != "" {
		ret["jti"] = c.JTI
	} else {
		ret["jti"] = uuid.New().String()
	}

	if len(c.Audience) > 0 {
		ret["aud"] = c.Audience
	} else {
		ret["aud"] = []string{}
	}

	if !c.IssuedAt.IsZero() {
		ret["iat"] = c.IssuedAt.Unix()
	} else {
		delete(ret, "iat")
	}

	if !c.ExpiresAt.IsZero() {
		ret["exp"] = c.ExpiresAt.Unix()
	} else {
		delete(ret, "exp")
	}

	if !c.RequestedAt.IsZero() {
		ret["rat"] = c.RequestedAt.Unix()
	} else {
		delete(ret, "rat")
	}

	if len(c.Nonce) > 0 {
		ret["nonce"] = c.Nonce
	} else {
		delete(ret, "nonce")
	}

	if len(c.AccessTokenHash) > 0 {
		ret["at_hash"] = c.AccessTokenHash
	} else {
		delete(ret, "at_hash")
	}

	if len(c.CodeHash) > 0 {
		ret["c_hash"] = c.CodeHash
	} else {
		delete(ret, "c_hash")
	}

	if !c.AuthTime.IsZero() {
		ret["auth_time"] = c.AuthTime.Unix()
	} else {
		delete(ret, "auth_time")
	}

	if len(c.AuthenticationContextClassReference) > 0 {
		ret["acr"] = c.AuthenticationContextClassReference
	} else {
		delete(ret, "acr")
	}

	if len(c.AuthenticationMethodsReferences) > 0 {
		ret["amr"] = c.AuthenticationMethodsReferences
	} else {
		delete(ret, "amr")
	}

	return ret

}

// Add will add a key-value pair to the extra field
func (c *IDTokenClaims) Add(key string,


,0,LOCATION_MZONE,nil)
	if chk==0 then return #g>0 end
	Duel.SetOperationInfo(0,CATEGORY_ATKCHANGE,g,#g,tp,#g*700)
	Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,#g*700)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
	--Requirement
	Duel.DiscardDeck(tp,1,REASON_COST)
	--Effect
	local sg=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil)
	local ct=Duel.GetFieldGroupCountRush(tp,0,LOCATION_MZONE)
	local c=e:GetHandler()
	if #sg>0 then
		for tc in sg:Iter() do
			--Decrease ATK
			local e1=Effect.CreateEffect(c)
			e1:SetType(EFFECT_TYPE_SINGLE)
			e1:SetCode(EFFECT_UPDATE_ATTACK)
			e1:SetValue(-ct*700)
			e1:SetReset(RESETS_STANDARD_PHASE_END)
			tc:RegisterEffect(e1)
		end
		Duel.Recover(tp,ct*700,REASON_EFFECT)
	end
end


// *************************************************************
// project:  graphql-aspnet
// --
// repo: https://github.com/graphql-aspnet
// docs: https://graphql-aspnet.github.io
// --
// License:  MIT
// *************************************************************

namespace GraphQL.AspNet.Execution
{
    using System;
    using System.Diagnostics;
    using GraphQL.AspNet.Common;
    using GraphQL.AspNet.Execution.Variables;
    using GraphQL.AspNet.Interfaces.Execution;
    using GraphQL.AspNet.Interfaces.Execution.Variables;

    /// <summary>
    /// A request to execute a graphql query.
    /// </summary>
    [DebuggerDisplay("Query Length = {QueryLength} (Operation = {OperationName})")]
    public class QueryExecutionRequest : IQueryExecutionRequest
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="QueryExecutionRequest"/> class.
        /// </summary>
        /// <param name="queryData">The raw query data to process.</param>
        public QueryExecutionRequest(GraphQueryData queryData)
        {
            this.Id = Guid.NewGuid();
            this.OperationName = queryData.OperationName?.Trim();
            this.QueryText = queryData.Query;
            this.VariableData = queryData.Variables ?? new InputVariableCollection();

            this.StartTimeUTC = DateTimeOffset.UtcNow;
            this.Items = new MetaDataCollection();
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="QueryExecutionRequest"/> class.
        /// </summary>
        /// <


    ['false', false],
    ['"foo"', 'foo'],
    ['["foo"]', ['foo']],
    ['{ "foo": "bar" }', { foo: 'bar' }],
    [Buffer.from('{ "foo": "bar" }', 'utf8'), { foo: 'bar' }]
  ])('json', async (body, expectedJson) => {
    expect.assertions(1);
    const response = new GotFetchResponse(body, {});

    await expect(response.json()).resolves.toEqual(expectedJson);
  });

  it('formData', async () => {
    expect.assertions(2);
    const response = new GotFetchResponse('foo=1&bar=2');
    const formData = await response.formData();

    expect(formData.get('foo')).toEqual('1');
    expect(formData.get('bar')).toEqual('2');
  });

  it.each<[number, boolean]>([
    [200, true],
    [201, true],
    [301, false],
    [400, false],
    [500, false]
  ])('ok', (status, ok) => {
    expect.assertions(2);
    const response = new GotFetchResponse(null, { status });

    expect(response.status).toEqual(status);
    expect(response.ok).toEqual(ok);
  });
});
/**
 * ServiceError class
 */

// tslint:disable:no-any

export class ServiceError implements Error {
  public readonly name: string;
  public readonly message: string;
  public readonly otherInfo: any;

  constructor(error: ServiceError);
  constructor(message: string, otherInfo?: any);

  constructor(messageOrError: string | ServiceError, otherInfo?: any) {
    this.name = this.constructor.name;
    if (arguments.length === 1) {
      const error: ServiceError = messageOrError as ServiceError;
      this.message = error.message;
      this.otherInfo = error.otherInfo;
    } else {
      this.message = messageOrError as string;
      this.otherInfo = otherInfo;
    }

  }

  public toString(): string {
    return "Error " + this.name + ": " + this.message + (this.otherInfo ? " - " + JSON.stringify(this.otherInfo, null, 4) : "");
  }
}
///<reference path="node_modules/@types/jquery/jquery.d.ts" />

interface City {
  name: string;
  coord: Coords;
}

interface Coords {
  lat: number;
  lon: number;
}

$(document).ready(() => {

  const $cityList = $('#cityList');
  const $cityContent = $('#cityContent');

  // 1) make a call using the "fetch" method to the URL:
  // hint: https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch
  fetch('http://api.openweathermap.org/data/2.5/find?lat=-31&lon=115&cnt=10&appid=81f82b18f84330242679a2cc0041a426')
  .then(function(response) {
    return response.json();
  })
  .then(function(myJson) {
    console.log(myJson);

      // 2a) iterate over the returned results in myJson.list
      //     create a new 'li' element for each result
      //     insert the new elements into the $cityList ('ul') element
      // hint1: forEach
      // hint2: <HTMLLIElement>document.createElement('li')
      // hint3: jquery append

    myJson.list.forEach((element:City) => {
      let li = <HTMLLIElement>document.createElement('li') // make sure you're castin to the most logical type
      $cityList.append(li)

      console.log(element);

      // 2b) create a new 'a' tag element and insert it into the new 'li' element

      let a = <HTMLAnchorElement>document.createElement('a')
      li.append(a)
      $c


  row-gap: var(--ds-space-500, 40px);
}
._1p57oahv {
  row-gap: var(--ds-space-600, 3pc);
}
._1p57pxbi {
  row-gap: var(--ds-space-200, 1pc);
}
._1p57u2gc {
  row-gap: var(--ds-space-100, 8px);
}
._1p57utpp {
  row-gap: var(--ds-space-150, 9pt);
}
._1p57v47k {
  row-gap: var(--ds-space-250, 20px);
}
._1p57v77o {
  row-gap: var(--ds-space-025, 2px);
}
._1p57xncg {
  row-gap: var(--ds-space-800, 4pc);
}
._1p57xy5q {
  row-gap: var(--ds-space-400, 2pc);
}
._1p57ze3t {
  row-gap: var(--ds-space-0, 0);
}
._2lx21bp4 {
  flex-direction: column;
}
._2lx2vrvc {
  flex-direction: row;
}
._4cvr1fhb {
  align-items: stretch;
}
._4cvr1q9y {
  align-items: baseline;
}
._4cvrh9n0 {
  align-items: end;
}
._4cvrv2br {
  align-items: start;
}
._gy1p12x7 {
  column-gap: var(--ds-space-075, 6px);
}
._gy1p1b66 {
  column-gap: var(--ds-space-050, 4px);
}
._gy1p1ejb {
  column-gap: var(--ds-space-300, 24px);
}
._gy1p1epz {
  column-gap: var(--ds-space-1000, 5pc);
}
._gy1p1jfw {
  column-gap: var(--ds-space-500, 40px);
}
._gy1poahv {
  column-gap: var(--ds-space-600, 3pc);
}
._gy1ppxbi {
  column-gap: var(--ds-space-200, 1pc);
}
._gy1pu2gc {
  column-gap: var(--ds-space-100, 8px);
}
._gy1putpp {
  column-gap: var(--ds-space-150, 9pt);
}
._gy1pv47k {
  column-gap: var(--ds-space-250, 20px);
}
._gy1pv77o {
  column-gap: var(--ds-space-025, 2px);
}
._gy1pxncg {
  column-gap: var(--ds-space-800, 4pc);
}
._gy1pxy5q {
  column-gap: var(--ds-space-400, 2pc);
}
._gy1pze3t {
  column-gap: var(--ds-space-0, 0);
}
._11c81ixg {
  font: var(
    --ds-font-body-large,
    normal 400 1pc/24px ui-sans-serif,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Ubuntu,
    "Helvetica Neue",
    sans-serif
  );
}
._11c82smr {
  font: var(
    --ds-font-body,
    normal 400 14px/20px ui-sans-serif,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Ubuntu,
    "Helvetica Neue",
    sans-serif
  );
}
._18u0idpf {
  margin-left: 0;
}
._19pkidpf {
  margin-top: 0;
}
._


ить количество выгружаемых версий за один запуск, а так же указать минимальную и/или максимальную версию хранилища для выгрузки
4. `check-authors` - блокирует выгрузку версии, если автор версии хранилища отсутствует в файле `AUTHORS`
5. `check-comments` - добавляет опции команды  `sync` для проверки наличия комментария у версии хранилища, а также для проверки заполнения комментария
6. `smart-tags` - устанавливает тег равный версии конфигурации при смене версии конфигурации (не путать с версией хранилища). А также добавляет опции команды  `sync` для автоматической установки метки git (команда `git tag`) равной версии хранилища (в формате "v.номер").
7. `unpackForm` - выполняет распаковку обычных форм на исходники. Добавляет опции команды  `sync` для переименования объектов обычных форм.
8. `tool1CD` - заменяет использование штатных механизмов 1С на приложение `tool1CD` при выгрузке
9. `disable-support` - снимает конфигурацию с поддержки перед выгрузкой в исходники
10. `edtExport` - добавляет возможность выгрузки в формате EDT. Для работы плагина необходимо установить EDT.

## Использование библиотеки `gitsync`

> Раздел документации в разработке

## Доработка и разработка плагинов

* [Как создать свой плагин](./create-new-plugin.md)
* Доработка предустановленных плагинов производится в отдельном репозитории [gitsync-plugins](https://github.com/khorevaa/gitsync-plugins)

## Механизм подписок на события

> Раздел документации в разработке

Проект `gitsync` поддерживает ряд подписок на события

## Сборка проекта

Сборка производится в 2-х режимах:

1. Сборка обычного пакета (без зависимостей)

    `opm build .`

    В этом варианте в сборку не добавляются предустановленные пакеты. Их надо будет устанавливать отдельно.

2. Сборка пакета с зависимостями

    `opm build -mf ./build_packagedef .`

    В сборку будут добавлены пакеты из репозиториев:

    * `opm` - из ветки develop
    * `gitsync-pre-plugins` - из ветки develop

<a id="markdown-доработка" name="доработк


sence of|TG God, Presence of]] ^note-45c

45d. [[Old Testament/Ezekiel/Ezekiel 34#^verse-24|Ezek. 34:24 (20-31)]] ^note-45d### Chapter 13

[[Old Testament/Exodus/Exodus 12|Previous Entry]]  ||  [[Old Testament/Exodus/Exodus 14|Next Entry]]

*The firstborn of man and of beasts are to be sanctified unto the Lord—The Feast of Unleavened Bread is to be kept in the land of Canaan—Moses takes Joseph's bones out of Egypt—The Lord attends Israel in a pillar of cloud by day and a pillar of fire by night.*

**1**  And the Lord spake unto Moses, saying, ^verse-1

**2**  [[#^note-2a|Sanctify]] unto me all the [[#^note-2b|firstborn]], whatsoever [[#^note-2c|openeth]] the [[#^note-2d|womb]] among the children of Israel, both of man and of beast: it is mine. ^verse-2

**3**  ¶ And Moses said unto the people, Remember this day, in which ye came out from [[#^note-3a|Egypt]], out of the house of bondage; for by strength of hand the Lord brought you out from this place: there shall no leavened bread be eaten. ^verse-3

**4**  This day [[#^note-4a|came ye out]] in [[#^note-4b|the]] month [[#^note-4c|Abib]]. ^verse-4

**5**  ¶ And it shall be when the Lord shall [[#^note-5a|bring]] thee into the land of the [[#^note-5b|Canaanites]], and the Hittites, and the Amorites, and the Hivites, and the Jebusites, which he [[#^note-5c|sware]] unto thy fathers to give thee, a land [[#^note-5d|flowing]] with milk and honey, that thou shalt keep this service in this month. ^verse-5

**6**  Seven days thou shalt eat unleavened bread, and in the seventh day shall be a feast to the Lord. ^verse-6

**7**  Un[[#^note-7a|leavened]] bread shall be eaten seven days; and there shall no [[#^note-7b|leaven]]ed bread be seen with thee, neither shall there be leaven seen with thee [[#^note-7c|in all thy quarters]]. ^verse-7

**8**  ¶ And thou shalt [[#^note-8a|shew]] thy son in that day, saying, This is done because of that which the Lord did unto me when I came forth out of Egypt. ^verse-8

**9**  And it shall be for a [[#^note-9a|sign]] unto thee upon thine hand, and for a [[#^note-9b|memorial]] between thine eyes, that the Lord's law may be in thy mouth: for with a strong hand hath the Lord brought thee out of Egypt. ^verse-9

**10**  Thou shalt therefore keep this ordinance [[#^note-10a|in his season]] from year to year. ^verse-10

**11**  ¶ And it shall be when the Lord shall bring thee into the land of the [[#^note-11a|Canaanites]], as he [[#^note-11b|sware]] unto thee and to thy fathers, and shall give it thee, ^verse-11

**12**  That thou shalt set apart unto the Lord [[#^note-12a|all]] that open


s Максимальная длина поля 64 символов.
   */
  wsb_order_tag?: string;

  /** Электронный адрес покупателя.
   * @remarks Значение данного поля будет автоматически подставлено в соответствующее поле формы оплаты.
   */
  wsb_email?: string;

  /** Номер телефона покупателя.  */
  wsb_phone?: string;

  /** Номер договора с заказчиком услуги/плательщиком.  */
  wsb_order_contract?: string;

  /** Определение активной вкладки с нужным платежным инструментом (оплата картой/ЕРИП).
   * @remarks Возможные значения: **erip**, **cardPayment**. При отсутствии поля порядок вкладок стандартный — оплата картой, потом ЕРИП.
   */
  wsb_tab?: string;
}

/** Поля формы оплаты */
export interface _IFormFields
  extends _IFormFieldsMain,
    _IFormFieldsCart,
    _IFormFieldsAdditional {}
export function elementRemoveClass(element: Element, className: string) {
  if (!element.classList.contains(className)) {
    return;
  }
  element.classList.remove(className);
}
export const easeExponentialOutIn = {
	/**
	 * @param time [0, 1]
	 */
	easing: (time: number) => {
		if (time == 0 || time == 1) {
			return time;
		} else if (time < 0.5) {
			return 0.5 * (1 - Math.pow(2, -10 * (time / 0.5)));
		} else if (time == 0.5) {
			return 0.5;
		} else {
			return 0.5 + 0.5 * Math.pow(2, 10 * ((time - 0.5) / 0.5 - 1));
		}
	},
	reverse: () => {
		cc.easeCircleActionOut;
		return cc.easeExponentialInOut();
	}
};

export const easeCircleOutIn = {
	/**
	 * @param time [0, 1]
	 */
	easing: (time: number) => {
		if (time >= 0 && time <= 0.5) {
			return 0.5 * Math.sqrt(1 - Math.pow(time / 0.5 - 1, 2));
		} else {
			return 0.5 + 0.5 * (1 - Math.sqrt(1 - Math.pow((time - 0.5) / 0.5, 2)));
		}
	},
	reverse: () => {
		// return _easeCircleActionInOut;
	}
};

export const easeBoomEffect = {
	/**
	 * @param time [0, 1]
	 */
	easing: (time: number) => {
		let bp1 = 0.3,
			bp2 = 0.8,
			x1 = 0.3,
			y1 = 0.5 * (1 - Math.pow(2, -10 * (0.3 / 0.5))),
			x2 = 0.31,
			y2 = 0.5 * (1 - Math.pow(2, -10 * (0.31 / 0.5))),
			a = (y2 - y1) / (x2 - x1),
			b = y1 - a * x1;

		if (time == 0 || time == 1) {
			return time;
		} else if (time < bp1) {
			return 0.5 * (1 - Math.pow(2, -10 * (time / 0.5)));
		} else if (time


полнить" ,
    item_Teleport_BonusJohnnyInterrogationRoom_name             = "Комната Джонни для допросов" ,
    item_Teleport_BonusJohnnyInterrogationRoom_tip              = "Переместиться к комнате Джонни для допросов" ,
    item_Teleport_BonusJohnnyInterrogationRoom_btn              = "Выполнить" ,
    item_Teleport_BonusKonpekiPlazaHotelSuite_name              = "Люкс Компеки Плаза" ,
    item_Teleport_BonusKonpekiPlazaHotelSuite_tip               = "Переместиться в гостиничный номер Компеки Плаза" ,
    item_Teleport_BonusKonpekiPlazaHotelSuite_btn               = "Выполнить" ,
    item_Teleport_BonusKonpekiPlazaPool_name                    = "Бассейн Компеки Плаза" ,
    item_Teleport_BonusKonpekiPlazaPool_tip                     = "Переместиться к бассейну Компеки Плаза" ,
    item_Teleport_BonusKonpekiPlazaPool_btn                     = "Выполнить" ,
    item_Teleport_BonusKonpekiPlazaYorinobuRoom_name            = "Компеки Плаза: Номер Йоринобу" ,
    item_Teleport_BonusKonpekiPlazaYorinobuRoom_tip             = "Переместиться в номер Йоринобу в Компеки Плаза" ,
    item_Teleport_BonusKonpekiPlazaYorinobuRoom_btn             = "Выполнить" ,
    item_Teleport_BonusMegaH8Top_name                           = "Верх Megabuilding H8" ,
    item_Teleport_BonusMegaH8Top_tip                            = "Переместиться на верх Megabuilding H8" ,
    item_Teleport_BonusMegaH8Top_btn                            = "Выполнить" ,
    item_Teleport_BonusMegaH10Top_name                          = "Верх Megabuilding H10" ,
    item_Teleport_BonusMegaH10Top_tip                           = "Переместиться на верх Megabuilding H10" ,
    item_Teleport_BonusMegaH10Top_btn                           = "Выполнить" ,
    item_Teleport_BonusNCPDRoom_name                            = "Номер NCPD" ,
    item_Teleport_BonusNCPDRoom_tip                             = "Переместиться в номер NCPD" ,
    item_Teleport_BonusNCPDRoom_btn                             = "Выполнить" ,
    item_Teleport_BonusNomadStartLocationAWACS_name             = "Стартовая локация кочевника" ,
    item_Teleport_BonusNomadStartLocationAWACS_tip              = "Переместиться к стартовой локации кочевника (зона AWACS)" ,
    item_Teleport_BonusNomadStartLocationAWACS_btn              = "Выполнить" ,
    item_Teleport_BonusPeralezApartment_name                    = "Квартира Пералеса" ,
    item_Teleport_BonusPeralezApartment_tip                     = "Переместиться внутрь квартиры Пералеса" ,
    item_Teleport_BonusPeralezApartment_btn                     = "Выполнить" ,
    item_Teleport_BonusRiverBraindanceRandyKutcher_name         = "River's Newphew BD" ,
    item_Teleport_BonusRiverBraindanceRandyKutcher_tip          = "Переместиться к локации брейнданса\nиз квеста Ри


atency in seconds",
	// 		Buckets: prometheus.DefBuckets,
	// 	},
	// 	[]string{"cache_type", "operation"},
	// )

	errorTotal = promauto.NewCounterVec(
		prometheus.CounterOpts{
			Name: "gateway_errors_total",
			Help: "Total number of errors",
		},
		[]string{"namespace", "model", "error_type"},
	)
)
/*
Copyright 2024 The Scitix Authors.

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

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

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

import (
	"context"
	"fmt"
	"os"
	"path/filepath"
	"runtime"

	"github.com/scitix/sichek/pkg/systemd"

	sd "github.com/coreos/go-systemd/v22/daemon"
	"github.com/sirupsen/logrus"
	"golang.org/x/sys/unix"
)

var AllowedSignals = []os.Signal{
	unix.SIGTERM,
	unix.SIGINT,
	unix.SIGUSR1,
	unix.SIGPIPE,
}

func HandleSignals(cancel context.CancelFunc, signals chan os.Signal, serverC chan Service) chan struct{} {
	done := make(chan struct{}, 1)
	go func() {
		defer func() {
			if err := recover(); err != nil {
				fmt.Printf("[HandleSignals] panic err is %s\n", err)
			}
		}()
		var server Service
		for {
			select {
			case s := <-serverC:
				server = s
			case s := <-signals:

				// Do not print message when deailing with SIGPIPE, which may cause
				// nested signals and consume lots of cpu bandwidth.
				if s == unix.SIGPIPE {
					continue
				}

				logrus.Debugf("received signal: %v", s)
				switch s {
				case unix.SIGUSR1:
					dumpStacks(true)
				default:
					cancel()

					if exist, _ := systemd.SystemctlExists(); exist {
						if err := NotifyStopping(); err != nil {
							logrus.Error("notify stopping failed")
						}
					}

					if server == nil {
						close(done)
						return
					}

					err := server.Stop()
					if err != nil {
						logrus.Errorf("server.Stop: %v", err)
					}
					close(done)
					return
				}
			}
		}
	}()
	return done
}

// NotifyReady notifies systemd that the daemon is ready to serve requests
func NotifyReady() error {
	return sdNotify(sd.SdNotifyReady)
}

// NotifyStopping notifies systemd that the daemon is about to be stopped
func NotifyStopping() error {
	return sdNotify(sd.SdNotifyStopping)
}

func sdNotify(state string) error {
	notified, err := sd.SdNotify(false, state)
	logrus.Debugf("sd notification: %v %v %v", state, notified, err)
	return err
}

func dumpStacks(writeToFile bool) {
	var (
		buf       []byte
		stackSize int
	)
	bufferLen := 16384
	for stackSize == len(buf) {
		buf = make([]byte, bufferLen)


。特に、小玉さんからのご意見にあったように、個々人の内発的な動機や「魂」とも呼べるような深い自己理解こそが、これからの時代を生き抜く上で重要になるという考えを反映しています。

具体的には、AIが一般的な情報処理や定型的な業務をこなせるようになるほど、人間はより創造的で、他者と共感し、協力し合いながら新しい価値を生み出す活動に注力できるようになります。そのため、教育においても、単に知識を詰め込むだけでなく、子どもたちが自らの興味関心を探求し、他者との関わりの中で学びを深め、失敗を恐れずに挑戦できるような環境を提供することが不可欠です。

今回の更新により、本マニフェストが目指す教育の方向性がより明確になり、AI時代における「人間らしい力」の育成というテーマがより具体的に示されたと考えています。この変更が、今後の教育政策に関する議論を深める一助となることを期待しています。

ご意見・ご指摘をお待ちしております。

小玉祥平

#### 変更ファイル

- 32_ステップ３教育.md

---

### #249: 【匿名ユーザー提案】デジタル機器の健康的な利用に関する記述追加

#### 説明

匿名ユーザーからの提案に基づき、政策案「１．教育」の「２）子どものAIリテラシーを育み、AIと共生する未来を切り拓きます」の項目に、デジタル機器の健康的な利用に関する記述を追加しました。

**変更内容:**
*   「現状認識・課題分析」に、AI利用増に伴うデジタル機器の長時間利用による、子どもの視力低下など健康面への影響懸念を明記しました。
*   「政策概要」の小学校で行う授業内容に、生成AIの倫理等に関する学習コンテンツに加え、「デジタル機器の適切な利用時間・休憩の取り方・正しい姿勢といった健康面への配慮について学ぶコンテンツ」を政府が開発し、学校に提供する旨を追記しました。

**変更の意図・目的:**
現在の情報化社会において、子どもたちがAIやデジタル機器を学習や生活の中で活用していくことは不可欠です。一方で、これらの機器の長時間利用や不適切な利用は、視力低下や姿勢の悪化など、子どもたちの健康に悪影響を及ぼす可能性も指摘されています。
今回の変更は、AIリテラシー教育を推進すると同時に、子どもたちがデジタル機器と心


4,0x0e,0x04]

v_alignbyte_b32 v5, vcc_lo, v2, v3
// CHECK: [0x05,0x00,0x9e,0xd2,0x6a,0x04,0x0e,0x04]

v_alignbyte_b32 v5, vcc_hi, v2, v3
// CHECK: [0x05,0x00,0x9e,0xd2,0x6b,0x04,0x0e,0x04]

v_alignbyte_b32 v5, tba_lo, v2, v3
// CHECK: [0x05,0x00,0x9e,0xd2,0x6c,0x04,0x0e,0x04]

v_alignbyte_b32 v5, tba_hi, v2, v3
// CHECK: [0x05,0x00,0x9e,0xd2,0x6d,0x04,0x0e,0x04]

v_alignbyte_b32 v5, tma_lo, v2, v3
// CHECK: [0x05,0x00,0x9e,0xd2,0x6e,0x04,0x0e,0x04]

v_alignbyte_b32 v5, tma_hi, v2, v3
// CHECK: [0x05,0x00,0x9e,0xd2,0x6f,0x04,0x0e,0x04]

v_alignbyte_b32 v5, ttmp11, v2, v3
// CHECK: [0x05,0x00,0x9e,0xd2,0x7b,0x04,0x0e,0x04]

v_alignbyte_b32 v5, m0, v2, v3
// CHECK: [0x05,0x00,0x9e,0xd2,0x7c,0x04,0x0e,0x04]

v_alignbyte_b32 v5, exec_lo, v2, v3
// CHECK: [0x05,0x00,0x9e,0xd2,0x7e,0x04,0x0e,0x04]

v_alignbyte_b32 v5, exec_hi, v2, v3
// CHECK: [0x05,0x00,0x9e,0xd2,0x7f,0x04,0x0e,0x04]

v_alignbyte_b32 v5, 0, v2, v3
// CHECK: [0x05,0x00,0x9e,0xd2,0x80,0x04,0x0e,0x04]

v_alignbyte_b32 v5, -1, v2, v3
// CHECK: [0x05,0x00,0x9e,0xd2,0xc1,0x04,0x0e,0x04]

v_alignbyte_b32 v5, 0.5, v2, v3
// CHECK: [0x05,0x00,0x9e,0xd2,0xf0,0x04,0x0e,0x04]

v_alignbyte_b32 v5, -4.0, v2, v3
// CHECK: [0x05,0x00,0x9e,0xd2,0xf7,0x04,0x0e,0x04]

v_alignbyte_b32 v5, v1, v255, v3
// CHECK: [0x05,0x00,0x9e,0xd2,0x01,0xff,0x0f,0x04]

v_alignbyte_b32 v5, v1, s2, v3
// CHECK: [0x05,0x00,0x9e,0xd2,0x01,0x05,0x0c,0x04]

v_alignbyte_b32 v5, v1, s103, v3
// CHECK: [0x05,


, 'p1')

      const playerTwo: GamePlayer = new GamePlayer({
         playerId: 'doesnotmatter',
         name: 'AI Player',
      })
      playerTwo.addUnit(slimeUnit)
      playerTwo.addUnit(parentSlimeUnit)

      assertThrows(
         (): void => {
            createNonTutorialBattle(
               game,
               newPlayerId,
               undefined,
               playerTwo,
               randomCounterAttackFunction,
            )
         },
         Error,
         'Access token needs to be provided in order to create a non-tutorial battle',
      )
   },
)

Deno.test(
   'An error is thrown if a non-tutorial battle is created and no ' +
      'playerOneId is provided',
   async () => {
      const game = new PlayerAgainstAIGame()
      const playerOne: GamePlayer = new GamePlayer({
         playerId: 'doesnotmatter',
         name: 'Test Player',
      })
      playerOne.addUnit(slimeUnit)
      playerOne.addUnit(parentSlimeUnit)

      const newPlayerId = await game.registerPlayer(
         playerOne,
         'Test Player',
         'tp',
         '12345',
      )
      assertEquals(newPlayerId, 'p1')

      const playerTwo: GamePlayer = new GamePlayer({
         playerId: 'doesnotmatter',
         name: 'AI Player',
      })
      playerTwo.addUnit(slimeUnit)
      playerTwo.addUnit(parentSlimeUnit)

      assertThrows(
         (): void => {
            createNonTutorialBattle(
               game,
               undefined,
               'doesnotmatter',
               playerTwo,
               randomCounterAttackFunction,
            )
         },
         Error,
         'playerOneId needs to be provided to create non-tutorial battle.',
      )
   },
)

Deno.test(
   'An error is thrown if a non-tutorial battle is created and wrong ' +
      'playerOneAccessToken is provided',
   async () => {
      const game = new PlayerAgainstAIGame()
      const playerOne: GamePlayer = new GamePlayer({
         playerId: 'doesnotmatter',
         name: 'Test Player',
      })
      playerOne.addUnit(slimeUnit)
      playerOne.addUnit(parentSlimeUnit)

      const newPlayerId = await game.registerPlayer(
         playerOne,
         'Test Player',
         'tp',
         '12345',
      )
      assertEquals(newPlayerId, 'p1')

      const playerTwo: GamePlayer = new GamePlayer({
         playerId: 'doesnotmatter',
         name: 'AI Player',
      })
      playerTwo.addUnit(slimeUnit)
      playerTwo.addUnit(parentSlimeUnit)

      //Login so playerOne would have accessToken available
      await game.login('tp', '12345')

      assertThrows(
         (): void => {
            createNonTutorialBattle(
               game,
               newPlayerId,
               'wrongToken',
               playerTwo,
               randomCounterAttackFunction,
            )
         },
         Error,
         'Non-tutorial battle cannot be created. Reason: Invalid credentials',
      )
   },
)
import HttpError from "./http-error";

export default class NotImplemented extends HttpError {
  code = 501;
  name = 'NotImplemented';

  constructor(message?: string) {
    super(message);
    Object.setPrototypeOf(this, NotImplemented.prototype);
  }
}
//    Copyright 2016, 2017 Yoshi Yamaguchi
//
//    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.


    val cachedValue = getProfileInformation(accessToken)
    if (cachedValue != null) {
      return cachedValue
    }
    val graphRequest = getGraphMeRequestWithCache(accessToken)
    val response = graphRequest.executeAndWait()
    return if (response.error != null) {
      null
    } else response.jsonObject
  }

  private fun getGraphMeRequestWithCache(accessToken: String): GraphRequest {
    val parameters = Bundle()
    parameters.putString(
        GraphRequest.FIELDS_PARAM,
        getProfileFieldsForGraphDomain(getCurrentTokenDomainWithDefault()))
    parameters.putString("access_token", accessToken)
    val request = GraphRequest.newMeRequest(null, null)
    request.parameters = parameters
    request.httpMethod = HttpMethod.GET
    return request
  }

  private fun getProfileFieldsForGraphDomain(graphDomain: String?): String {
    return if (graphDomain == FacebookSdk.INSTAGRAM) {
      INSTAGRAM_PROFILE_FIELDS
    } else FACEBOOK_PROFILE_FIELDS
  }

  private fun getCurrentTokenDomainWithDefault(): String? {
    val accessToken = AccessToken.getCurrentAccessToken()
    return if (accessToken != null && accessToken.graphDomain != null) {
      accessToken.graphDomain
    } else AccessToken.DEFAULT_GRAPH_DOMAIN
  }

  /**
   * Return our best guess at the available number of cores. Will always return at least 1.
   *
   * @return The minimum number of CPU cores
   */
  private fun refreshBestGuessNumberOfCPUCores(): Int {
    // If we have calculated this before, return that value
    if (numCPUCores > 0) {
      return numCPUCores
    }

    // Enumerate all available CPU files and try to count the number of CPU cores.
    try {
      val cpuDir = File("/sys/devices/system/cpu/")
      val cpuFiles = cpuDir.listFiles { dir, fileName -> Pattern.matches("cpu[0-9]+", fileName) }
      if (cpuFiles != null) {
        numCPUCores = cpuFiles.size
      }
    } catch (e: Exception) {}

    // If enumerating and counting the CPU cores fails, use the runtime. Fallback to 1 if
    // that returns bogus values.
    if (numCPUCores <= 0) {
      numCPUCores = Math.max(Runtime.getRuntime().availableProcessors(), 1)
    }
    return numCPUCores
  }

  private fun refreshPeriodicExtendedDeviceInfo(appContext: Context) {
    if (timestampOfLastCheck == -1L ||
        System.currentTimeMillis() - timestampOfLastCheck >=
            REFRESH_TIME_FOR_EXTENDED_DEVICE_INFO_MILLIS) {
      timestampOfLastCheck = System.currentTimeMillis()
      refreshTimezone()
      refreshCarrierName(appContext)
      refreshTotalExternalStorage()
      refreshAvailableExternalStorage()
    }
  }

  private fun refreshTimezone() {
    try {
      val tz = TimeZone.getDefault()
      deviceTimezoneAbbreviation = tz.getDisplayName(tz.inDaylightTime(Date()), TimeZone.SHORT)
      deviceTimeZoneName = tz.id
    } catch (e: AssertionError) {
      // Workaround for a bug in Android that can cause crashes on Android 8.0 and 8.1
    } catch (e: Exception) {}
  }

  /**
   * Get and cache the carrier name since this won't change during the lifetime of the app.
   *
   * @return The carrier name
   */
  private fun refreshCarrierName(appContext: Context) {
    if (carrierName == NO_CARRIER) {
      try {
        val telephonyManager =
            appContext.getSystemService(Context.TELEPHONY_SERVICE) as TelephonyManager
        carrierName = telephonyManager.networkOperatorName
      } catch (e: Exception) {}
    }
  }

  /** @return whether there is external storage: */
  private fun externalStorageExists(): Boolean {
    return Environment.MEDIA_MOUNTED == Environment.getExterna


          Child.m_Parent = this;
            Child.m_Index = cnt;
        }

        public PolyNode GetNext()
        {
            if (m_Childs.Count > 0)
                return m_Childs[0];
            else
                return GetNextSiblingUp();
        }

        internal PolyNode GetNextSiblingUp()
        {
            if (m_Parent == null)
                return null;
            else if (m_Index == m_Parent.m_Childs.Count - 1)
                return m_Parent.GetNextSiblingUp();
            else
                return m_Parent.m_Childs[m_Index + 1];
        }

        public List<PolyNode> Childs
        {
            get { return m_Childs; }
        }

        public PolyNode Parent
        {
            get { return m_Parent; }
        }

        public bool IsHole
        {
            get { return IsHoleNode(); }
        }

        public bool IsOpen { get; set; }
    }
}


 otl_gsub {
    pub(crate) select: Option<usize>,
    pub(crate) first: *mut gsub_entry,
    pub(crate) gsubs: ArrayVec<[otl_gsub_tab; 32]>,
    /* _TT_GSUB_H_ */
}
#[derive(Clone)]
#[repr(C)]
pub(crate) struct otl_gsub_tab {
    pub(crate) script: String,
    pub(crate) language: String,
    pub(crate) feature: String,
    pub(crate) subtables: Vec<SubTable>,
}

#[derive(Clone)]
pub(crate) enum SingleSubTable {
    Single1(otl_gsub_single1),
    Single2(otl_gsub_single2),
}
#[derive(Clone)]
pub(crate) enum SubTable {
    Single(SingleSubTable),
    Alternate1(otl_gsub_alternate1),
    Ligature1(otl_gsub_ligature1),
}

#[derive(Clone)]
pub(crate) struct otl_gsub_ligature1 {
    pub(crate) LigatureSet: Vec<otl_gsub_ligset>,
    pub(crate) coverage: Coverage,
}

#[derive(Clone)]
pub(crate) enum Coverage {
    Format1(Vec<GlyphID>),
    Format2(Vec<Range>),
}

#[derive(Copy, Clone)]
pub(crate) struct Range {
    start: GlyphID,
    end: GlyphID,
    start_coverage_index: u16,
}

pub(crate) type GlyphID = u16;
#[derive(Clone)]
#[repr(C)]
pub(crate) struct otl_gsub_ligset {
    pub(crate) Ligature: Vec<otl_gsub_ligtab>,
}
#[derive(Clone)]
#[repr(C)]
pub(crate) struct otl_gsub_ligtab {
    pub(crate) LigGlyph: GlyphID,
    pub(crate) Component: Vec<GlyphID>,
}
#[derive(Clone)]
pub(crate) struct otl_gsub_alternate1 {
    pub(crate) AlternateSet: Vec<otl_gsub_altset>,
    pub(crate) coverage: Coverage,
}
#[derive(Clone)]
#[repr(C)]
pub(crate) struct otl_gsub_altset {
    pub(crate) Alternate: Vec<GlyphID>,
}
#[derive(Clone)]
pub(crate) struct otl_gsub_single2 {
    pub(crate) Substitute: Vec<GlyphID>,
    pub(crate) coverage: Coverage,
}
#[derive(Clone)]
pub(crate) struct otl_gsub_single1 {
    pub(crate) DeltaGlyphID: i16,
    pub(crate) coverage: Coverage,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub(crate) struct gsub_entry {
    pub(crate) index: i32,
    pub(crate) next: *mut gsub_entry,
}
#[derive(Copy, Clone)]
#[repr(C)]
pub(crate) struct clt_record {
    pub(crate) tag: [i8; 5],
    pub(crate) offset: Offset,
}
pub(crate) type Offset = u16;
#[derive(Clone)]
#[repr(C)]
pub(crate) struct clt_record_list {
    pub(crate) record: Vec<clt_record>,
}
#[derive(Clone)]
#[repr(C)]
pub(crate) struct clt_number_list {
    pub(crate) value: Vec<u16>,
}
#[derive(Clone)]
#[repr(C)]
pub(crate) struct clt_feature_table {
    pub(crate) FeatureParams: Offset,
    pub(crate) LookupListIndex: clt_number_list,
}
#[derive(Clone)]
#[repr(C)]
pub(crate) struct clt_lookup_table {
    pub(crate) LookupType: u16,
    pub(crate) LookupFlag: u16,
    pub(crate) SubTableList: clt_number_list,
}
#[derive(Copy, Clone)]
#


con5GridShiftOperation(final String sourceDatumName, final String targetDatumName) {
    this.sourceDatumName = sourceDatumName;
    this.targetDatumName = targetDatumName;
    for (int regionIndex = 0; regionIndex < Nadcon5Region.REGIONS.size(); regionIndex++) {
      final Nadcon5Region region = Nadcon5Region.REGIONS.get(regionIndex);
      final int sourceDatumIndex = region.getDatumIndex(this.sourceDatumName);
      final int targetDatumIndex = region.getDatumIndex(this.targetDatumName);
      this.REGION_INVERSE[regionIndex] = sourceDatumIndex > targetDatumIndex;
      this.REGION_GRIDS.add(region.getGrids(sourceDatumIndex, targetDatumIndex));
    }
  }

  @Override
  public boolean horizontalShift(final CoordinatesOperationPoint point) {
    final double x = point.x;
    final double y = point.y;
    final double z = point.z;
    if (point.x < 0) {
      point.x += 360;
    }
    for (final Nadcon5Region region : Nadcon5Region.REGIONS) {
      if (region.covers(point)) {
        final int index = region.getIndex();
        final List<Nadcon5RegionDatumGrids> grids = this.REGION_GRIDS.get(index);
        final boolean inverse = this.REGION_INVERSE[index];
        if (inverse) {
          for (final Nadcon5RegionDatumGrids grid : grids) {
            if (!grid.shiftInverse(point)) {
              point.resetPoint(x, y, z);
              return false;
            }
          }
        } else {
          for (final Nadcon5RegionDatumGrids grid : grids) {
            if (!grid.shiftForward(point)) {
              point.resetPoint(x, y, z);
              return false;
            }
          }
        }
        if (point.x > 180) {
          point.x = point.x - 360;
        }
        return true;
      }
    }
    point.resetPoint(x, y, z);
    return false;
  }

  @Override
  public String toString() {
    return "Nadcon5: " + this.sourceDatumName + " -> " + this.targetDatumName;
  }
}
package com.revolsys.gdal.record;

import java.sql.Date;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.GregorianCalendar;
import java.util.List;
import java.util.NoSuchElementException;
import java.util.TimeZone;

import org.gdal.ogr.DataSource;
import org.gdal.ogr.Feature;
import org.gdal.ogr.Layer;

import com.revolsys.collection.iterator.AbstractIterator;
import com.revolsys.geometry.model.Geometry;
import com.revolsys.geometry.model.GeometryFactory;
import com.revolsys.geometry.model.LineString;
import com.revolsys.geometry.model.LinearRing;
import com.revolsys.record.Record;
import com.revolsys.record.RecordFactory;
import com.revolsys.record.RecordState;
import com.revolsys.record.query.Query;
import com.revolsys.record.schema.RecordDefinition;
import com.revolsys.util.count.LabelCounters;

public class OgrQueryIterator extends AbstractIterator<Record> {

  private int count;

  private GeometryFactory geometryFactory;

  private final String idFieldName;

  private Layer layer;

  private final int limit;

  private final int offset;

  private Query query;

  private RecordDefinition recordDefinition;

  private RecordFactory<Record> recordFactory;

  private OgrRecordStore recordStore;

  private LabelCounters labelCountMap;

  protected OgrQueryIterator(final OgrRecordStore recordStore, final Query query) {
    this.recordStore = recordStore;
    this.query = query;
    RecordFactory<Record> recordFactory = query.getRecordFactory()


s4)
/* 0FE9C8 80157498 AE220000 */  sw          $v0, 0x0($s1)
/* 0FE9CC 8015749C 26310004 */  addiu       $s1, $s1, 0x4
/* 0FE9D0 801574A0 448D2000 */  mtc1        $t5, $f4
/* 0FE9D4 801574A4 26D60004 */  addiu       $s6, $s6, 0x4
/* 0FE9D8 801574A8 26520004 */  addiu       $s2, $s2, 0x4
/* 0FE9DC 801574AC 468021A0 */  cvt.s.w     $f6, $f4
/* 0FE9E0 801574B0 26730018 */  addiu       $s3, $s3, 0x18
/* 0FE9E4 801574B4 26F70004 */  addiu       $s7, $s7, 0x4
/* 0FE9E8 801574B8 26940018 */  addiu       $s4, $s4, 0x18
/* 0FE9EC 801574BC E4460020 */  swc1        $f6, 0x20($v0)
/* 0FE9F0 801574C0 8E8EFFEC */  lw          $t6, -0x14($s4)
/* 0FE9F4 801574C4 8E2FFFFC */  lw          $t7, -0x4($s1)
/* 0FE9F8 801574C8 448E4000 */  mtc1        $t6, $f8
/* 0FE9FC 801574CC 00000000 */  nop
/* 0FEA00 801574D0 468042A0 */  cvt.s.w     $f10, $f8
/* 0FEA04 801574D4 1630FFDD */  bne         $s1, $s0, L8015744C
/* 0FEA08 801574D8 E5EA0024 */   swc1       $f10, 0x24($t7)
/* 0FEA0C 801574DC 3C1E8016 */  lui         $fp, %hi(D_8015C6DC)
/* 0FEA10 801574E0 3C16800D */  lui         $s6, %hi(D_800D6B88)
/* 0FEA14 801574E4 26D66B88 */  addiu       $s6, $s6, %lo(D_800D6B88)
/* 0FEA18 801574E8 27DEC6DC */  addiu       $fp, $fp, %lo(D_8015C6DC)
/* 0FEA1C 801574EC 24170001 */  addiu       $s7, $zero, 0x1
/* 0FEA20 801574F0 24140006 */  addiu       $s4, $zero, 0x6
/* 0FEA24 801574F4 27B3006C */  addiu       $s3, $sp, 0x6C
/* 0FEA28 801574F8 2412FFF7 */  addiu       $s2, $zero, -0x9
/* 0FEA2C 801574FC 27B10084 */  addiu       $s1, $sp, 0x84
/* 0FEA30 80157500 8ED80000 */  lw          $t8, 0x0($s6)
glabel L80157504
/* 0FEA34 80157504 00002025 */  move        $a0, $zero
/* 0FEA38 80157508 3C058005 */  lui         $a1, %hi(D_8004A7C4)
/* 0FEA3C 8015750C 16B80029 */  bne         $s5, $t8, L801575B4
/* 0FEA40 80157510 00000000 */   nop
/* 0FEA44 80157514 8FD90000 */  lw          $t9, 0x0($fp)
/* 0FEA48 80157518 16F90026 */  bne         $s7, $t9, L801575B4
/* 0FEA4C 8015751C 00000000 */   nop
/*


           }
        ));
    }
}
//! EDNS Options from RFC 7314

use bytes::BufMut;
use ::bits::compose::Compose;
use ::bits::message_builder::OptBuilder;
use ::bits::parse::{ParseAll, Parser, ParseAllError, ShortBuf};
use ::iana::OptionCode;
use super::CodeOptData;

//------------ Expire --------------------------------------------------------

#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct Expire(Option<u32>);

impl Expire {

    pub fn new(expire: Option<u32>) -> Self {
        Expire(expire)
    }

    pub fn push(builder: &mut OptBuilder, expire: Option<u32>)
                -> Result<(), ShortBuf> {
        builder.push(&Self::new(expire))
    }

    pub fn expire(self) -> Option<u32> {
        self.0
    }
}

//--- ParseAll and Compose

impl ParseAll for Expire {
    type Err = ParseAllError;

    fn parse_all(parser: &mut Parser, len: usize) -> Result<Self, Self::Err> {
        if len == 0 {
            Ok(Expire::new(None))
        }
        else {
            u32::parse_all(parser, len).map(|res| Expire::new(Some(res)))
        }
    }
}

impl Compose for Expire {
    fn compose_len(&self) -> usize {
        match self.0 {
            Some(_) => 4,
            None => 0,
        }
    }

    fn compose<B: BufMut>(&self, buf: &mut B) {
        if let Some(value) = self.0 {
            value.compose(buf)
        }
    }
}

//--- OptData

impl CodeOptData for Expire {
    const CODE: OptionCode = OptionCode::Expire;
}

use crate::io::Encode;
use crate::mysql::protocol::Capabilities;

// https://dev.mysql.com/doc/internals/en/com-stmt-close.html

#[derive(Debug)]
pub struct StmtClose {
    pub statement: u32,
}

impl Encode<'_, Capabilities> for StmtClose {
    fn encode_with(&self, buf: &mut Vec<u8>, _: Capabilities) {
        buf.push(0x19); // COM_STMT_CLOSE
        buf.extend(&self.statement.to_le_bytes());
    }
}
<reponame>jrhea/lighthouse
use crate::checks::{epoch_delay, verify_all_finalized_at};
use crate::local_network::LocalNetwork;
use futures::{Future, IntoFuture};
use node_test_rig::ClientConfig;
use std::time::Duration;
use types::{Epoch, EthSpec};

pub fn pick_strategy<E: EthSpec>(
    strategy: &str,
    network: LocalNetwork<E>,
    beacon_config: ClientConfig,
    slot_duration: Duration,
    initial_delay: u64,
    sync_delay: u64,
) -> Box<dyn Future<Item = (), Error = String> + Send + 'static> {
    match strategy {
        "one-node" => Box::new(verify_one_node_sync(
            network,
            beacon_config,
            slot_duration,
            initial_delay,
            sync_delay,
        )),
        "two-nodes" => Box::new(verify_two_nodes_sync(
            network,
            beacon_config,
            slot_duration,
            initial_delay,
            sync_delay,
        )),
        "mixed" => Box::new(verify_in_between_sync(
            network,
            beacon_config,
            slot_duration,
            initial_delay,
            sync_delay,
        )),
        "all" => Box::new(verify_syncing(
            network,
            beacon_config


ay', '0.5s');
				opacity: 1;
			}

			.logo {
				@include vendor('transition', (
					'opacity 1.25s ease',
					'transform 0.5s ease'
				));
				@include vendor('transition-delay', '0s');
				display: block;
				margin: 0 0 (_size(element-margin) * 0.75) 0;

				img {
					display: block;
					margin: 0 auto;
					max-width: 75%;
				}
			}
		}

		@include breakpoint('<=large') {
			@include padding(4em, 4em, (0, 0, -2em, 0));

			&.alt {
				@include padding(5em, 4em, (1em, 0, 0, 0));
			}
		}

		@include breakpoint('<=medium') {
			@include padding(4em, 3em, (0, 0, -2em, 0));

			&.alt {
				@include padding(4em, 3em, (1em, 0, 0, 0));
			}
		}

		@include breakpoint('<=small') {
			@include padding(3em, 2em, (0, 0, -1em, 0));

			p {
				font-size: 1em;
				letter-spacing: 0;

				br {
					display: none;
				}
			}

			&.alt {
				@include padding(3em, 2em, (1em, 0, 0, 0));

				h1 {
					font-size: 2.5em;
				}
			}
		}

		@include breakpoint('<=xsmall') {
			@include padding(3em, 1.5em, (0, 0, -1em, 0));

			&.alt {
				@include padding(3em, 1.5em, (1em, 0, 0, 0));
			}
		}

		@include breakpoint('<=xxsmall') {
			@include padding(2.5em, 1em, (0, 0, -1em, 0));

			&.alt {
				@include padding(2.5em, 1em, (1em, 0, 0, 0));
			}
		}

		body.is-preload & {
			&.alt {
				> * {
					opacity: 0;
				}

				.logo {
					@include vendor('transform', 'scale(0.8) rotate(-30deg)');
				}
			}
		}
	}@charset "UTF-8";
/*
 * jQuery File Upload UI Plugin CSS 9.0.0
 * https://github.com/blueimp/jQuery-File-Upload
 *
 * Copyright 2010, Sebastian Tschan
 * https://blueimp.net
 *
 * Licensed under the MIT license:
 * http://www.opensource.org/licenses/MIT
 */

.fileupload-buttonbar .btn,
.fileupload-buttonbar .toggle {
  margin-bottom: 5px;
}
.progress-animated .progress-bar,
.progress-animated .bar {
  background: url("../img/progressbar.gif") !important;
  filter: none;
}
.fileupload-process {
  float: right;
  display: none;
}
.fileupload-processing .fileupload-process,
.files .processing .preview {
  display: block;
  width: 32px;
  height: 32px;
  background: url("../img/loading.gif") center no-repeat;
  background-size: contain;
}
.files audio,
.files video {
  max-width: 300px;
}

@media (max-width: 767px) {
  .fileupload-buttonbar .toggle,
  .files .toggle,
  .files .btn span {
    display: none;
  }
  .files .name {
    width: 80px;
    word-wrap: break-word;
  }
  .files audio,
  .files video {
    max-width: 80px;
  }
  .files img,
  .files canvas {
    max-width: 100%;
  }
}

 .role-search {
    font-size: 14px;
    font


F
        csrw medeleg, t0
        li t0, 0xFFFF
        csrw mideleg, t0

        # enable intr
        # M mode
        csrr t0, mie
        li t1, MIE_MEIE  | MIE_MSIE | MIE_MTIE
        or t0, t0, t1
        csrw mie, t0
        # S mode
        csrr t0, sie
        li t1, SIE_SEIE | SIE_SSIE | SIE_STIE
        or t0, t0, t1
        csrw sie, t0

        # prepare returning
        # set MPP to S
        csrr t0, mstatus
        li t1, MSTATUS_MPP_S
        or t0, t0, t1
        csrw mstatus, t0

        # set pmpcfg0 & pmpaddr0 let S mode access all memory
        li t0, 0x3fffffffffffff
        csrw pmpaddr0, t0
        li t1, 0xf
        csrw pmpcfg0, t1

        la a0, _entry
        csrw mepc, a0
        mret

_entry:
        # jump here in S mode
        # procedures prior to jumping to higher half of rust kernel code
        #       by default we use SV39, three level paging
        #       prematurely mapped the entire elf with all rights & device mapped region
        # no fine-grained rights control over sections in the elf
        # after jumping out of .boot, one should replace this premature init pagetable
        # with their own well-designed kernel page table

        # macro takes pt addr in t0
        # identity mapping of elf (1G)
        la t0, __init_pt_lvl3
        PT_MAP t0, RAM_BASE, RAM_BASE, 3, 0xf
        la t0, __init_pt_lvl3
        PT_MAP_FAR t0, KERNEL_BASE_VIR, RAM_BASE, 3, 0xf

        # identity mapping of lower device region from [0x0, 0x4000_0000]
        la t0, __init_pt_lvl3
        PT_MAP t0, 0x0, 0x0, 3, 0xf

        # load init table
        SET_SATP __init_pt_lvl3
        sfence.vma zero, zero

        # set up a stack for C.
        # kernel_stack is declared in start_rust.c,
        # with a 4096-byte stack per CPU.
        # sp = kernel_stack + (hartid * 4096)
        li x1, 0
        li x2, 0
        li x3, 0
        li x4, 0
        li x5, 0
        li x6, 0
        li x7, 0
        li x8, 0
        li x9, 0
        # skip a0 and a1; arguments from previous boot loader stage:
        li x12, 0
        li x13, 0
        li x14, 0
        li x15, 0
        li x16, 0
        li x17, 0
        li x18, 0
        li x19, 0
        li x20, 0
        li x21, 0
        li x22, 0
        li x23, 0
        li x24, 0
        li x25, 0
        li x26, 0
        li x27, 0
        li x28, 0
        li x29, 0
        li x30, 0
        li x31, 0

        LA_FAR sp, kernel_stack_end

        # jump to rust code
        LA_FAR a0, bootstrap
        jalr x0, 0(a0)
spin:
        j spin


	ldmfd	sp, {r4, r5, fp, sp, pc}
.L69:
	.align	2
.L68:
	.word	vfmw_Osal_Func_Ptr_S
	UNWIND(.fnend)
	.size	InsertRawPacket, .-InsertRawPacket
	.align	2
	.global	GetRawState
	.type	GetRawState, %function
GetRawState:
	UNWIND(.fnstart)
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 1, uses_anonymous_args = 0
	UNWIND(.movsp ip)
	mov	ip, sp
	stmfd	sp!, {fp, ip, lr, pc}
	UNWIND(.pad #4)
	UNWIND(.save {fp, ip, lr})
	UNWIND(.setfp fp, ip, #-4)
	sub	fp, ip, #4
	cmp	r0, #15
	bhi	.L73
	ldr	r3, .L75
	mov	r2, r0, asl #6
	sub	r0, r2, r0, asl #4
	add	r0, r3, r0
	ldr	r3, [r0, #48]
	cmp	r3, #0
	beq	.L73
	add	r2, r3, #98304
	ldr	r3, [r2, #108]
	ldr	r1, [r2, #112]
	add	r3, r3, #1
	mov	r2, r3, asr #31
	mov	r2, r2, lsr #22
	add	r3, r3, r2
	ubfx	r3, r3, #0, #10
	rsb	r3, r2, r3
	cmp	r3, r1
	mvneq	r0, #3
	movne	r0, #0
	ldmfd	sp, {fp, sp, pc}
.L73:
	mvn	r0, #3
	ldmfd	sp, {fp, sp, pc}
.L76:
	.align	2
.L75:
	.word	.LANCHOR0
	UNWIND(.fnend)
	.size	GetRawState, .-GetRawState
	.align	2
	.global	ShowFirstRawPacket
	.type	ShowFirstRawPacket, %function
ShowFirstRawPacket:
	UNWIND(.fnstart)
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 1, uses_anonymous_args = 0
	UNWIND(.movsp ip)
	mov	ip, sp
	stmfd	sp!, {r4, r5, fp, ip, lr, pc}
	UNWIND(.pad #4)
	UNWIND(.save {r4, r5, fp, ip, lr})
	UNWIND(.setfp fp, ip, #-4)
	sub	fp, ip, #4
	cmp	r1, #0
	cmpne	r0, #0
	mov	lr, r0
	moveq	r4, #1
	movne	r4, #0
	beq	.L79
	add	r2, r0, #98304
	ldr	r3, [r2]
	ldr	r0, [r2, #4]
	cmp	r3, r0
	beq	.L80
	ldr	r5, .L81
	mov	ip, r3, asl #7
	sub	ip, ip, r3, asl #5
	str	r3, [r2, #16]
	mov	r0, r1
	mov	r2, #96
	add	r1, lr, ip
	ldr	r3, [r5, #52]
	blx	r3
	mov	r0, r4
	ldmfd	sp, {r4, r5, fp, sp, pc}
.L79:
	mvn	r0, #0
	ldmfd	sp, {


 bgPalette[(tileword & 0x00C0) >>  6];
			dst[4] = bgPalette[(tileword & 0x0300) >>  8];
			dst[5] = bgPalette[(tileword & 0x0C00) >> 10];
			dst[6] = bgPalette[(tileword & 0x3000) >> 12];
			dst[7] = bgPalette[ tileword           >> 14];

			int i = nextSprite - 1;

			if (!lcdcObjEn(p)) {
				do {
					int pos = int(p.spriteList[i].spx) - xpos;
					p.spwordList[i] >>= pos * 2 >= 0 ? 16 - pos * 2 : 16 + pos * 2;
					--i;
				} while (i >= 0 && int(p.spriteList[i].spx) > xpos - 8);
			} else {
				unsigned char idtab[8] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF };
				unsigned const bgprioritymask = p.lcdc << 7;

				do {
					int n;
					int pos = int(p.spriteList[i].spx) - xpos;

					if (pos < 0) {
						n = pos + 8;
						pos = 0;
					} else
						n = 8 - pos;

					unsigned char const id = p.spriteList[i].oampos;
					unsigned const sattrib = p.spriteList[i].attrib;
					unsigned spword        = p.spwordList[i];
               video_pixel_t const * spPalette;
               if(p.dmgMode)//support gb games in gbc mode
                  spPalette = p.spPalette + (sattrib >> 2 & 4);
               else
                  spPalette = p.spPalette + (sattrib & 7) * 4;

					if (!((attrib | sattrib) & bgprioritymask)) {
						unsigned char  *const idt = idtab + pos;
						video_pixel_t *const   d =   dst + pos;

						switch (n) {
						case 8: if ((spword >> 14    ) && id < idt[7]) {
						        	idt[7] = id;
						        	  d[7] = spPalette[spword >> 14    ];
						        }
						case 7: if ((spword >> 12 & 3) && id < idt[6]) {
						        	idt[6] = id;
						        	  d[6] = spPalette[spword >> 12 & 3];
						        }
						case 6: if ((spword >> 10 & 3) && id < idt[5]) {
						        	idt[5] = id;
						        	  d[5] = spPalette[spword >> 10 & 3];
						        }
						case 5: if ((spword >>  8 & 3) && id < idt[4]) {
						        	idt[4] = id;
						        	  d[4] = spPalette[spword >>  8 & 3];
						        }
						case 4: if ((spword >>  6 & 3) && id < idt[3]) {
						        	idt[3] = id;
						        	  d[3] = spPalette[spword >>  6 & 3];
						        }
						case 3: if ((spword >>  4 & 3) && id < idt[2]) {
						        	idt[2] = id;
						        	  d[2] = spPalette[spword >>  4 & 3];
						        }
						case 2: if ((spword >>  2 & 3) && id < idt[1]) {
						        	idt[1] = id;
						        	  d[1] = spPalette[spword >>  2 & 3];
						        }
						case 1: if ((spword       & 3) && id < idt[0]) {
						        	idt[0] = id;
						        	  d[0] = spPalette[spword       & 3];
						        }


to_pdb_symbols(
        self,
        dumper: TypeDumper,
        address_map: &AddressMap,
        frame_table: FrameTable,
    ) -> PDBSymbols {
        if self.map.is_empty() {
            return PDBSymbols::default();
        }

        let (all_syms, ranges) = self.split_and_collect(dumper, address_map, frame_table);
        Self::fill_the_gaps(all_syms, ranges)
    }
}

pub(super) fn append_dummy_symbol(mut syms: PDBSymbols, name: &str) -> PDBSymbols {
    let (rva, len, id) = if let Some((_, last_sym)) = syms.iter().next_back() {
        (last_sym.rva, last_sym.len, last_sym.id)
    } else {
        return syms;
    };

    let rva = if len == 0 { rva + len + 1 } else { rva + len };

    let name = if name.is_empty() {
        String::from("<unknown>")
    } else {
        format!("<unknown in {}>", name)
    };

    syms.insert(
        rva,
        PDBSymbol {
            name,
            is_public: true,
            is_multiple: false,
            rva,
            len: 0,
            parameter_size: 0,
            source: Rc::new(Lines::new()),
            id: id + 1,
        },
    );

    syms
}

pub(super) fn symbolic_to_pdb_symbols(
    syms: PeSymbolIterator,
    exception_data: Option<&ExceptionData<'_>>,
    module_name: &str,
) -> PDBSymbols {
    let mut pdb_syms = PDBSymbols::default();

    let module_name = if module_name.is_empty() {
        String::from("<unknown>")
    } else {
        format!("<unknown in {}>", module_name)
    };

    if let Some(data) = exception_data {
        data.into_iter()
            .filter_map(|result| result.ok())
            .filter(|function| function.end_address > function.begin_address)
            .for_each(|function| {
                pdb_syms.insert(
                    function.begin_address,
                    PDBSymbol {
                        name: module_name.clone(),
                        is_public: false,
                        is_multiple: false,
                        rva: function.begin_address,
                        len: function.end_address - function.begin_address,
                        parameter_size: 0,
                        source: Rc::new(Lines::new()),
                        id: 0,
                    },
                );
            });
    };

    for sym in syms {
        if let Some(name) = sym.name() {
            let demangled_name = TypeDumper::demangle(name);
            let (name, parameter_size) = match demangled_name {
                FuncName::Undecorated(name) => (name, 0),
                FuncName::Unknown((name, parameter_size)) => (name, parameter_size),
            };
            let rva = sym.address as u32;
            pdb_syms
                .entry(rva)
                .and_modify(|e| {
                    e.name = name.clone();
                    e.parameter_size = parameter_size;
                })
                .or_insert(PDBSymbol {
                    name,
                    is_public: true,
                    is_multiple: false,
                    rva: sym.address as u32,
                    len: 0,
                    parameter_size,
                    source: Rc::new(Lines::new()),
                    id: 0,
                });
        }
    }

    pdb_syms
}
// Copyright 2018 Google Inc.
//
// 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