::Error),
}

impl From<IoError> for ParseErrors {
    fn from(error: IoError) -> Self {
        ParseErrors::IO(error)
    }
}

impl From<JsonError> for ParseErrors {
    fn from(error: JsonError) -> Self {
        ParseErrors::Json(error)
    }
}

fn make_json(input_path: &str) -> Result<HarFile, ParseErrors> {
    let mut file = File::open(input_path)?;
    let mut contents = String::new();
    file.read_to_string(&mut contents)?;

    let v: HarFile = serde_json::from_str(&contents)?;
    return Ok(v);
}
use std::collections::{BTreeMap, HashMap, HashSet};
use std::error::Error;
use std::io::{BufRead, BufReader, Read};

use itertools::Itertools;
use regex::Regex;

#[derive(Debug, Hash, Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
pub struct Point {
    x: usize,
    y: usize,
}

type Centroid = usize;
type Grid = HashMap<Point, Centroid>;

/// compute Manhatten distance for 2 Points
fn manhatten(a: &Point, b: &Point) -> usize {
    ((a.x as isize - b.x as isize).abs() + (a.y as isize - b.y as isize).abs()) as usize
}

/// visualize
#[allow(dead_code)]
fn visualize(grid: &Grid, centroids: &[Point], n: usize) {
    let mut matrix = vec![vec!['.'; n]; n];

    // map the grid onto a 2D matrix
    for (&coord, &centroid) in grid.into_iter() {
        if centroid > 0 && coord.x < n && coord.y < n {
            let mut c = (b'a' + (centroid - 1) as u8) as char;

            if centroids.contains(&coord) {
                c = c.to_ascii_uppercase();
            }

            matrix[coord.y as usize][coord.x as usize] = c;
        }
    }

    // visualize the 2D matrix
    for vector in matrix.into_iter() {
        println!("{}", vector.into_iter().join(""));
    }
}

pub fn part1(input: &[Point]) -> usize {
    let mut area: HashMap<Centroid, usize> = HashMap::new();
    let mut unbounded: HashSet<Centroid> = HashSet::new();

    // determine the min/max of X and Y
    let mut min_x = std::usize::MAX;
    let mut min_y = std::usize::MAX;
    let mut max_x = 0;
    let mut max_y = 0;

    for point in input.into_iter() {
        if point.x < min_x {
            min_x = point.x;
        }
        if point.y < min_y {
            min_y = point.y;
        }
        if point.x > max_x {
            max_x = point.x;
        }
        if point.y > max_y {
            max_y = point.y;
        }
    }

    // scan grid pattern from min X+Y to max X+Y
    for x in min_x..=max_x {
        for y in min_y..=max_y {
            let point = Point { x, y };

            // compute Manhatten distance against all neighbours
            let mut neighbours: BTreeMap<usize, Vec<Centroid>> = BTreeMap::new();

            for (centroid, neighbour) in input.into_iter().enumerate() {
                let centroid = centroid + 1;
                let distance = manhatten(&point, neighbour);

                let nn = neighbours.entry(distance).or_insert_with(Vec::new);
                nn.push(centroid);
            }

            // find the nearest neighbour
            let (_, nn) = neighbours
                .into_iter()
                .min_by_key(|&(distance, _)| distance)
                .expect("unable to find nearest neighbour!");

            if nn.len() == 1 {
                let &


div class="spirit-nav">

basic_socket_streambuf::time_type

(Deprecated:
          Use time_point.) The time type.

typedef WaitTraits::time_type time_type;

          Requirements

          Header: asio/basic_socket_streambuf.hpp

          Convenience header: asio.hpp

Copyright © 2003-2020 Christopher M.
      Kohlhoff

        Distributed under the Boost Software License, Version 1.0. (See accompanying
        file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>basic_socket_streambuf::close</title>
<link rel="stylesheet" href="../../../boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
<link rel="home" href="../../../index.html" title="Asio">
<link rel="up" href="../basic_socket_streambuf.html" title="basic_socket_streambuf">
<link rel="prev" href="clock_type.html" title="basic_socket_streambuf::clock_type">
<link rel="next" href="connect.html" title="basic_socket_streambuf::connect">

<body bgcolor="white" text="black" link="#0000FF" vlink="#


NaturalBuild => "Natural/build",
            NaturalEven => "Natural/even",
            NaturalFold => "Natural/fold",
            NaturalIsZero => "Natural/isZero",
            NaturalOdd => "Natural/odd",
            OptionalFold => "Optional/fold",
        })
    }
}

impl<'i> Display for V<'i> {
    fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
        let V(x, n) = *self;
        f.write_str(x)?;
        if n != 0 {
            write!(f, "@{}", n)?;
        }
        Ok(())
    }
}

pub fn pi<'i, S, A, Name, Et, Ev>(var: Name, ty: Et, value: Ev) -> Expr<'i, S, A>
where
    Name: Into<&'i str>,
    Et: Into<Expr<'i, S, A>>,
    Ev: Into<Expr<'i, S, A>>,
{
    Expr::Pi(var.into(), bx(ty.into()), bx(value.into()))
}

pub fn app<'i, S, A, Ef, Ex>(f: Ef, x: Ex) -> Expr<'i, S, A>
where
    Ef: Into<Expr<'i, S, A>>,
    Ex: Into<Expr<'i, S, A>>,
{
    Expr::App(bx(f.into()), bx(x.into()))
}

pub type Builder = String;
pub type Double = f64;
pub type Int = isize;
pub type Integer = isize;
pub type Natural = usize;

/// A void type
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
pub enum X {}

impl Display for X {
    fn fmt(&self, _: &mut fmt::Formatter) -> Result<(), fmt::Error> {
        match *self {}
    }
}

pub fn bx<T>(x: T) -> Box<T> {
    Box::new(x)
}

fn add_ui(u: usize, i: isize) -> usize {
    if i < 0 {
        u.checked_sub(i.checked_neg().unwrap() as usize).unwrap()
    } else {
        u.checked_add(i as usize).unwrap()
    }
}

fn map_record_value<'a, I, K, V, U, F>(it: I, f: F) -> BTreeMap<K, U>
where
    I: IntoIterator<Item = (&'a K, &'a V)>,
    K: Eq + Ord + Copy + 'a,
    V: 'a,
    F: Fn(&V) -> U,
{
    it.into_iter().map(|(&k, v)| (k, f(v))).collect()
}

fn map_op2<T, U, V, F, G>(f: F, g: G, a: T, b: T) -> V
where
    F: FnOnce(U, U) -> V,
    G: Fn(T) -> U,
{
    f(g(a), g(b))
}

/// `shift` is used by both normalization and type-checking to avoid variable
/// capture by shifting variable indices
///
/// For example, suppose that you were to normalize the following expression:
///
/// ```c
/// λ(a : Type) → λ(x : a) → (λ(y : a) → λ(x : a) → y) x
/// ```
///
/// If you were to substitute `y` with `x` without shifting any variable
/// indices, then you would get the following incorrect result:
///
/// ```c
/// λ(a : Type) → λ(x : a) → λ(x : a) → x  -- Incorrect normalized form
/// ```
///
/// In order to substitute `x` in place of `y` we need to `shift` `x` by `1` in
/// order to avoid being misinterpreted as the `x` bound by the innermost
/// lambda.  If we perform that `shift` then we get the correct result:
///
/// ```c
/// λ(a : Type) → λ(x : a) → λ(x : a) → x@1
/// ```
///
/// As a m


tDefault()):s.ui.keyCode.ENTER===e.keyCode&&(window.tagBox&&(window.tagBox.userAction="add",window.tagBox.flushTags(s(this).closest(".tagsdiv"))),e.preventDefault(),e.stopPropagation()),!1},open:function(){r.attr("aria-expanded","true")},close:function(){r.attr("aria-expanded","false")},minLength:2,position:{my:"left top+2",at:"left bottom",collision:"none"},messages:{noResults:t("No results found."),results:function(e){return l(d("%d result found. Use up and down arrow keys to navigate.","%d results found. Use up and down arrow keys to navigate.",e),e)}}},e),r.on("keydown",function(){r.removeAttr("aria-activedescendant")}),r.autocomplete(e),r.autocomplete("instance"))&&(r.autocomplete("instance")._renderItem=function(e,t){return s('<li role="option" id="wp-tags-autocomplete-'+t.id+'">').text(t.name).appendTo(e)},r.attr({role:"combobox","aria-autocomplete":"list","aria-expanded":"false","aria-owns":r.autocomplete("widget").attr("id")}).on("focus",function(){p(r.val()).pop()&&r.autocomplete("search")}),r.autocomplete("widget").addClass("wp-tags-autocomplete").attr("role","listbox").removeAttr("tabindex").on("menufocus",function(e,t){t.item.attr("aria-selected","true")}).on("menublur",function(){s(this).find('[aria-selected="true"]').removeAttr("aria-selected")})),this}}(jQuery);/**
 * WordPress Administration Navigation Menu
 * Interface JS functions
 *
 * @version 2.0.0
 *
 * @package WordPress
 * @subpackage Administration
 * @output wp-admin/js/nav-menu.js
 */

/* global menus, postboxes, columns, isRtl, ajaxurl, wpNavMenu */

(function($) {

	var api;

	/**
	 * Contains all the functions to handle WordPress navigation menus administration.
	 *
	 * @namespace wpNavMenu
	 */
	api = window.wpNavMenu = {

		options : {
			menuItemDepthPerLevel : 30, // Do not use directly. Use depthToPx and pxToDepth instead.
			globalMaxDepth:  11,
			sortableItems:   '> *',
			targetTolerance: 0
		},

		menuList : undefined,	// Set in init.
		targetList : undefined, // Set in init.
		menusChanged : false,
		isRTL: !! ( 'undefined' != typeof isRtl && isRtl ),
		negateIfRTL: ( 'undefined' != typeof isRtl && isRtl ) ? -1 : 1,
		lastSearch: '',

		// Functions that run on init.
		init : function() {
			api.menuList = $('#menu-to-edit');
			api.targetList = api.menuList;

			this.jQueryExtensions();

			this.attachMenuEditListeners();

			this.attachBulkSelectButtonListeners();
			this.attachMenuCheckBoxListeners();
			this.attachMenuItemDeleteButton();
			this.attachPendingMenuItemsListForDeletion();

			this.attachQuickSearchListeners();
			this.attachThemeLocationsListeners();
			this.attachMenuSaveSubmitListeners();

			this.attachTabsPanelListeners();

			this.attachUnsavedChangesListener();

			if ( api.menuList.length )
				this.initSortables();

			if ( menus


9?
  ble.s	.poly_clipping
.poly_invisible:	; Poly out of the screen, so...
  movem.l	(sp)+,d0-a6
  rts

.poly_clipping:		; The poly is (partly?) visible.
  moveq.l	#$0,d0	; d0=nb h_lines to pass at the beginning.
  move.w	d7,d1
  sub.w	d6,d1	; d1=ymax-ymin=nb h_lines to draw-1.
  tst.w	d6	; ymin<0?
  bge.s	.no_clip_up
.clip_up:		; Yes, so cut the first -ymin h_lines.
  move.w	d6,d0	; Pass -ymin h_lines at the beginning.
  neg.w	d0
  move.w	d7,d1	; Nb lines to draw=ymax-0.
  bra.s	.no_clip_down	; I assume the poly is not that big.
.no_clip_up:
  cmp.w	#199,d7	; ymax>199.
  ble.s	.no_clip_down
.clip_down:
  move.w	#199,d1	; Yes, so reduce the nb of h_lines.
  sub.w	d6,d1
.no_clip_down:
  move.w	d0,.nb_lines_2_pass
  addq.w	#$1,d1
  move.w	d1,.nb_lines_2_draw

; *************************************************************************
; * Not very hard or important, but we must do it, so....

  move.l	#.y_table,a2	; The faster way to multiply by 160???
  move.w	d6,d5
  add.w	d0,d5	; d5=first seen y.
  add.w	d5,d5	; One word per y.
  add.w	(a2,d5.w),a0	; a0 points on first line.

; *************************************************************************
; * Now, the first important part. We "track" the max_lines, which are on
; * the right of the poly and calculate xmax,source_x_max and source_y_max
; * for each y between ymin-ymax by using linear interpolations.

.xmax_tracking:		; First, search the upper right brow.
  subq.w	#$8,a3	; Next point in clockwise cycle.
  cmp.w	$2(a3),d6	; y=ymin?
  bne.s	.xmax_tracking
.xmax_ymin_found:	; If the next brow=ymin, then it' s more
  cmp.w	-$6(a3),d6	; on the right...
  bne.s	.xmax_ymin_ok
  subq.w	#$8,a3	; It is the upper right brow.
.xmax_ymin_ok:		; a3 points on the good brow.

  move.l	#.xmax_buffer,a2 ; Store source_x&y maxs and xmaxs here.
  move.l	#.inverses,a4	; Inverse table.
  move.l	#.xmax_ad,a5	; The adresses for the jump.
  move.w	d6,.ymin
  move.w	d7,.ymax
.xmax_one_line:		; Interpolate on one line.
  move.w	(a3),d0	; d0=x1.
  move.w	$2(a3),d1	; d1=y1.
  cmp.w	.ymax,d1	; y1=ymax?
  beq	.xmax_end	; Yes, then it' s finished.
  move.w	$4(a3),d2	; d2=source_x1.
  move.w	$6(a3),d3	; d3=source_y1.
  subq.l	#$8,a3	; Next brow.
  move.w	(a3),d4	; d4=x2.
  move.w	$2(a3),d5	; d5=y2.
  move.w	$4(a3),d6	; d6=source_x2.
  move.w	$6(a3),d7	; d7=source_y2.
  sub.w	d1,d5	; d5=y2-y1


1286] = {"Die Deserteure", nil, {"Sammelt Informationen über Reethe von Balos Jacken und den Deserteuren in den Düstermarschen."}},
[1287] = {"Die Deserteure", nil, {"Sprecht mit Hauptmann Garran Mumm in Theramore über Reethe."}},
[1301] = {"James Hyal", nil, {"Sprecht mit Vincent Hyal im Hafen von Menethil."}},
[1302] = {"James Hyal", nil, {"Sprecht mit Amtmann Lendry bei der Wehrzitadelle in Theramore."}},
[1322] = {"[DEPRECATED] Der schwarze Schild", nil, {"Bringt 5 säurehaltige Giftbeutel zu Do'gol in Brackenwall."}},
[1338] = {"Sturmlanzes Bestellung", nil, {"Bringt Sturmlanzes Anforderung zu Furen Langbart in Sturmwind."}},
[1339] = {"Gebirgsjäger Sturmlanzes Aufgabe", nil, {"Sprecht mit Gebirgsjäger Sturmlanze."}},
[1358] = {"Probe für Helbrim", nil, {"Bringt die Wolfherzprobe zu Apotheker Helbrim ins Brachland."}},
[1359] = {"Zinges Lieferung", nil, {"Bringt die Wolfherzproben zu Apothekerin Zinge nach Unterstadt."}},
[1360] = {"Wiederbeschaffte Schätze", nil, {"Holt Krom Starkarms wertvollen Besitz aus seiner Truhe in der Nördlichen Bankenhalle von Uldaman und bringt den Schatz zu ihm nach Eisenschmiede."}},
[1361] = {"Regthar Totenfurt", nil, {"Sprecht mit Regthar Totenfurt."}},
[1362] = {"Die Kolkar von Desolace", nil, {"Sprecht mit Felgur Zweischneid beim Geistwandlerposten in Desolace."}},
[1364] = {"Mazens Befehl", nil, {"Rettet Khadgars 'Abhandlungen über dimensionale Konvergenz' und bringt sie zu Behüter Mahar Ba in der Burg Nethergarde."}},
[1365] = {"Khan Dez'hepah", nil, {"Bringt Khan Dez'hepahs Kopf zu Felgur Zweischneid in Desolace."}},
[1366] = {"Zentaurenkopfgeld", nil, {"Bringt 15 Zentaurenohren zu Felgur Zweischneid in Desolace."}},
[1367] = {"Allianz mit den Magram", nil, {"Baut Euch einen freundlichen Ruf bei den Magram auf und sprecht dann mit Warug."}},
[1368] = {"Allianz mit den Gelkis", nil, {"Baut Euch einen freundlichen Ruf bei den Gelkis auf und sprecht dann mit Uthek der Weisen."}},
[1369] = {"Zerbrochene Tränen", nil, {"Wahrt Euren Ruf bei den Magram und bringt 3 zerbrochene Tränen zu Warug im Dorf Magram."}},
[1370] = {"Diebstahl von Vorräten", nil, {"Bringt 6 Taschen primitiv getrocknetes Fleisch zu Uthek der Weisen im Dorf der Gelkis."}},
[1373] = {"Ongeku", nil, {"Wahrt Euren Ruf bei den Gelkis und bringt einen Draenethystsplitter zu Uthek der Weisen im Dorf der Gelkis in Desolace."}},
[1381] = {"Khan Hratha", nil, {"Wahrt Euren Ruf bei den Magram und bringt das Schlüsselfragment der Maraudine zu Warug im Dorf Magram in Desolace."}},
[1382] = {"Seltsame Allianz", nil, {"Baut eine freundliche Beziehung zu den Gelkis auf und sprecht dann mit Uthek der Weisen."}},
[1383] = {"Nichts als die Wahrheit


FF4
_060098C0:	.word	0x0000FFFF

	arm_func_start SendFatalErrMsgTask
SendFatalErrMsgTask: ; 0x060098C4
	stmdb	sp!, {r4, r5, lr}
	sub	sp, sp, #4
	ldr	r0, _06009944	; =0x0380FFF4
	ldr	r1, [r0]
	add	r5, r1, #836	; 0x344
	ldrh	r0, [r5, #176]	; 0xb0
	cmp	r0, #0
	beq	_06009938
	add	r0, r1, #392	; 0x188
	mov	r1, #18
	bl	AllocateHeapBuf
	movs	r4, r0
	beq	_06009938
	ldr	r0, _06009948	; =0x00000186
	strh	r0, [r4, #12]
	mov	r0, #1
	strh	r0, [r4, #14]
	mov	r0, #16777216	; 0x1000000
	bl	sub_06009068
	ldrh	r1, [r5, #176]	; 0xb0
	strh	r1, [r4, #16]
	mov	r1, #0
	strh	r1, [r5, #176]	; 0xb0
	bl	sub_06009070
	ldr	r0, _06009944	; =0x0380FFF4
	ldr	r0, [r0]
	add	r0, r0, #392	; 0x188
	mov	r1, r4
	bl	SendMessageToWmDirect
_06009938:
	add	sp, sp, #4
	ldmia	sp!, {r4, r5, lr}
	bx	lr
_06009944:	.word	0x0380FFF4
_06009948:	.word	0x00000186

	arm_func_start SetFatalErr
SetFatalErr: ; 0x0600994C
	stmdb	sp!, {r4, lr}
	mov	r4, r0
	mov	r0, #16777216	; 0x1000000
	bl	sub_06009068
	ldr	r1, _0600998C	; =0x0380FFF4
	ldr	r1, [r1]
	add	r1, r1, #768	; 0x300
	ldrh	r2, [r1, #244]	; 0xf4
	orr	r2, r2, r4
	strh	r2, [r1, #244]	; 0xf4
	bl	sub_06009070
	mov	r0, #2
	mov	r1, #21
	bl	AddTask
	ldmia	sp!, {r4, lr}
	bx	lr
_0600998C:	.word	0x0380FFF4

	arm_func_start WCheckTxBuf
WCheckTxBuf: ; 0x06009990
	stmdb	sp!, {r4, r5, lr}
	sub	sp, sp, #4
	ldr	r0, _06009A8C	; =0x0380FFF4
	ldr	r1, [r0]
	add	r5, r1, #836	; 0x344
	ldr	r0, _06009A90	; =0x0000042C
	add	r4, r1, r0
	add	r0, r1, #768	; 0x300
	ldrh	r0, [r0, #80]	; 0x50
	cmp	r0, #1
	beq	_060099CC
	cmp	r0, #2
	beq	_06009A00
	cmp	r


dataTransfer.getData('text/plain')
      data.dropData = JSON.parse(dataString)
    }
    CoC7ChaseParticipantImporter.create(data)
  }

  async _onRollParticipant (event) {
    const target = event.currentTarget
    const participantElement = target.closest('.participant')
    const uuid = participantElement.dataset.uuid
    const index = this.findParticipantIndex(uuid)
    const participants = this.item.system.participants
      ? foundry.utils.duplicate(this.item.system.participants)
      : []

    const participant = new _participant(participants[index])
    if (participant.speedCheck.refSet) {
      const roll = new CoC7Check()
      roll.parent = this.item.uuid
      participant.data.rolled = true
      participant.data.rollUuid = roll.uuid
      roll.actor = participant.actor.actorKey
      if (!event.shiftKey && participant.actor.player) {
        roll.standby = true
        roll.standbyText = 'CoC7.Chase'
        roll.standbyRightIcon = 'systems/CoC7/assets/icons/running-solid.svg'
      }

      if (participant.speedCheck.isCharacteristic) {
        await roll.rollCharacteristic(participant.speedCheck.ref.key)
        await roll.toMessage()
        participant.data.speedCheck.rollDataString = roll.JSONRollString
      } else if (participant.speedCheck.isSkill) {
        roll.skill = participant.speedCheck.ref
        await roll.roll()
        await roll.toMessage()
        participant.data.speedCheck.rollDataString = roll.JSONRollString
      } else if (participant.speedCheck.isAttribute) {
        await roll.rollAttribute(participant.speedCheck.ref.key)
        await roll.toMessage()
        participant.data.speedCheck.rollDataString = roll.JSONRollString
      }
    } else if (participant.speedCheck.score) {
      const rollData = {
        rawValue: participant.speedCheck.score,
        displayName: participant.speedCheck.name,
        actorName: participant.name ? participant.name : undefined
      }
      if (participant.hasActor) rollData.actor = participant.actor.actorKey
      const roll = CoC7Check.create(rollData)
      roll.parent = this.item.uuid
      await roll.roll()
      await roll.toMessage()
      participant.data.speedCheck.rollDataString = roll.JSONRollString
      participant.data.rolled = true
      participant.data.rollUuid = roll.uuid
    }

    await this.item.update({ 'system.participants': participants })
  }

  _onDragEnterParticipant (event) {
    const target = event.currentTarget
    target.classList.add('drag-over')
  }

  _onDragLeaveParticipant (event) {
    const target = event.currentTarget
    target.classList.remove('drag-over')
  }

  async _onChangeSide (event) {
    // const test = await fromUuid( 'Scene.wh7SLuvIOpcQyb8S.Token.nCdoCyoiudtjrNku');
    // const itemTest = await fromUuid( 'Item.plIEmNRP6O7PveNv.roll.q2sAzsHt4FsqsdfD');

    const target = event.currentTarget
    const participant = target.closest('.participant')
    const uuid = participant.dataset.uuid
    const index = this.findParticipantIndex(uuid)
    const participants = this.item.system.participants
      ? foundry.utils.duplicate(this.item.system.participants)
      : []
    participants[index].chaser = !participants[index].chaser
    await this.item.update({ 'system.participants': participants })
  }

  async _onDeleteDriver (event) {
    const target = event.currentTarg


tps://pypi.python.org/pypi/xlwt)
* [Python xlrd、xlwt、xlutils修改Excel文件 - tianzhu123的专栏 - 博客频道 - CSDN.NET](http://blog.csdn.net/tianzhu123/article/details/7225809)
* [【django】生成 excel 文件 --xlwt - Magicbo-\_-南极.北极 - 51Testing软件测试网 51Testing软件测试网-中国软件测试人的精神家园](http://www.51testing.com/html/17/527817-817449.html)

## 实验室

* [浙江大华技术股份有限公司](http://www.dahuatech.com/support_down-1094.html)
* [内容服务提供商](http://www.hikvision.com/cn/download_more_407.html)
* [MP4文件两种格式AVC1和H264的区别及利用FFMPEG demux为h264码流事项 \| 三棵杏软件工作室](http://www.mworkbox.com/wp/work/314.html)
* [ASP.NET WEBAPI异步视频流实现 - greystar的专栏 - 博客频道 - CSDN.NET](http://blog.csdn.net/greystar/article/details/46652467)
* [海康大华网络监控摄像头web端无插件观看，支持安卓和苹果观看\_极酷播放器官方网站](http://www.cuplayer.com/player/PlayerCode/RTMP/2015/10082101.html)

## go

* \[Go 语言的包依赖管理 \| IO-meter\]\([http://io-meter.com/2014/07/30/go's-package-management/](http://io-meter.com/2014/07/30/go's-package-management/)\)

## Java

## 反射

* [Java反射之访问私有属性或方法 - Walkingdog - 博客频道 - CSDN.NET](http://blog.csdn.net/vipwalkingdog/article/details/7684349)
* [javadoc注释规范 - kelaocai - ITeye技术网站](http://kelaocai.iteye.com/blog/227822)

## book

* [ Book Support](http://www.mindview.net/Books)

## solution

* [JAVA中判断char是否是中文的几种方法 - liqipan - ITeye技术网站](http://liqipan.iteye.com/blog/1564081)
* [【JAVA】Java编程思想第四版源代码编译问题-mandagod-ChinaUnix博客](http://blog.chinaunix.net/uid-20758197-id-4843873.html)
* [java 中args 参数如何传递（Eclipse）不用cmd\_百度知道](http://zhidao.baidu.com/link?url=BRv26rlhQdRFobrttMEKMPG5sR-dulkJro3YS4zmE-KCdNMOZNCXTOFnZFwcf3JVd42pSrq_CIPQ0ld200tecq)

## 并发

* [java.util.ConcurrentModificationException - 我的JAVA学习笔记 - BlogJava](http://www.blogjava.net/EvanLiu/archive/2008/08/31/224453.html)
* [聊聊并发（一）——深入分析Volatile的实现原理](http://www.infoq.com/cn/articles/ftf-java-volatile)
* [Java多线程-新特征-信


ble changes: field addition / removal / type changes).
//!
//! The canonical CBOR representation uses the "packed" CBOR format, where field
//! names are replaced by indices (similar to protocol buffers), for more
//! concise encoding. This is safe to do given the use of canonical types
//! covered by compatibility tests.

use ic_protobuf::proxy::ProxyDecodeError;
use ic_replicated_state::metadata_state::SystemMetadata;
use ic_types::{messages::RequestOrResponse, xnet::StreamHeader};
use std::convert::TryInto;

pub(crate) mod types;

#[cfg(test)]
mod tests {
    mod compatibility;
    mod conversion;
    mod encoding;
    mod test_fixtures;
}

/// Allows a canonical type to act as a proxy for encoding a Rust type `T` as
/// canonical CBOR, provided an `Into` implementation for `T`.
pub trait CborProxyEncoder<T> {
    /// Encodes `t` into a vector via this proxy.
    fn proxy_encode(t: T) -> Result<Vec<u8>, serde_cbor::Error>;
}

/// Allows a canonical type to act as a proxy for encoding a Rust type `T` as
/// canonical CBOR, provided a `TryInto<T>` implementation for the canonical
/// type.
pub trait CborProxyDecoder<'de, T> {
    /// Decodes a `T` from a slice via this proxy.
    fn proxy_decode(bytes: &'de [u8]) -> Result<T, ProxyDecodeError>;
}

impl<T, M> CborProxyEncoder<T> for M
where
    T: Into<M>,
    M: serde::Serialize,
{
    fn proxy_encode(t: T) -> Result<Vec<u8>, serde_cbor::Error> {
        serde_cbor::ser::to_vec_packed(&t.into())
    }
}

impl<'de, T, M> CborProxyDecoder<'de, T> for M
where
    M: serde::Deserialize<'de> + TryInto<T>,
    M::Error: Into<ProxyDecodeError>,
{
    fn proxy_decode(bytes: &'de [u8]) -> Result<T, ProxyDecodeError> {
        let m: M = serde_cbor::from_slice(bytes)
            .map_err(|err| ProxyDecodeError::CborDecodeError(Box::new(err)))?;
        m.try_into().map_err(|e| e.into())
    }
}

/// Encodes a `RequestOrResponse` into canonical CBOR representation.
pub fn encode_message(msg: &RequestOrResponse) -> Vec<u8> {
    types::RequestOrResponse::proxy_encode(msg).unwrap()
}

/// Decodes a `RequestOrResponse` from canonical CBOR representation.
pub fn decode_message(bytes: &[u8]) -> Result<RequestOrResponse, ProxyDecodeError> {
    types::RequestOrResponse::proxy_decode(bytes)
}

/// Encodes a `StreamHeader` into canonical CBOR representation.
pub fn encode_stream_header(header: &StreamHeader) -> Vec<u8> {
    types::StreamHeader::proxy_encode(header).unwrap()
}

/// Decodes a `StreamHeader` from canonical CBOR representation.
pub fn decode_stream_header(bytes: &[u8]) -> Result<StreamHeader, ProxyDecodeError> {
    types::StreamHeader::proxy_decode(bytes)
}

/// Encodes a `SystemMetadata` into canonical CBOR representation.
pub fn encode_metadata(msg: &SystemMetadata) -> Vec<u8> {
    types::SystemMetadata::proxy_encode(msg).unwrap()
}
// src/mt19937.rs
//
// Copyright (c) 2015,2017 rust-mersenne-twister developers
//
// Licensed under the Apache License, Version 2.0
// <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0> or the MIT
// license <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. All files in the project carrying such notice may not be copied,
// modified, or distributed except according to those terms.

use std::cmp::Ordering;
use std::default::Default;
use std::fmt::{self, Debug};
use std::hash::{Hash, Hasher};
use std::num::Wrapping;

use rand::


	ST	b2,  0 * SIZE(C2)
	fclr	c01
 	ST	b3,  1 * SIZE(C2)
	fclr	c05

	ST	a4,  2 * SIZE(C2)
	lda	C1,  4 * SIZE(C1)
	ST	a3,  3 * SIZE(C2)
	lda	C2,  4 * SIZE(C2)

#if (defined(TRMMKERNEL) &&  defined(LEFT) &&  defined(TRANSA)) || \
    (defined(TRMMKERNEL) && !defined(LEFT) && !defined(TRANSA))
	subq	K, KK, TMP1
#ifdef LEFT
	subq	TMP1, 2, TMP1
#else
	subq	TMP1, 2, TMP1
#endif
	sll	TMP1, ZBASE_SHIFT + 1, TMP1
	addq	AO, TMP1, AO
	addq	BO, TMP1, BO
#endif

#if defined(TRMMKERNEL) && defined(LEFT)
	addq	KK, 2, KK
#endif
	bgt	I, $L11
	.align 4

$L20:
	and	M,  1, I
	ble	I, $L29

#if !defined(TRMMKERNEL) || \
	(defined(TRMMKERNEL) &&  defined(LEFT) &&  defined(TRANSA)) || \
	(defined(TRMMKERNEL) && !defined(LEFT) && !defined(TRANSA))

#ifdef TRMMKERNEL
#ifdef LEFT
	addq	KK, 1, TMP1
#else
	addq	KK, 2, TMP1
#endif
#endif

	LD	a1,  0 * SIZE(AO)
 	fclr	c09
	LD	a2,  1 * SIZE(AO)
	fclr	c13

	LD	a3,  2 * SIZE(AO)
	fclr	c02
	LD	a4,  3 * SIZE(AO)
	fclr	c06

	LD	b1,  0 * SIZE(B)
	fclr	c10
	LD	b2,  1 * SIZE(B)
	fclr	c14

	LD	b3,  2 * SIZE(B)
	lda	AO,  2 * SIZE(AO)
	LD	b4,  3 * SIZE(B)
	lda	BO,  4 * SIZE(B)

#ifndef TRMMKERNEL
	lda	L,        -2(K)
#else
	lda	L,        -2(TMP1)
#endif
	ble	L, $L25
#else
	sll	KK, ZBASE_SHIFT + 0, TMP1
	addq	AO, TMP1, AO
	sll	KK, ZBASE_SHIFT + 1, TMP1
	addq	B,  TMP1, BO
	subq	K, KK, TMP1

	LD	a1,  0 * SIZE(AO)
 	fclr	c09
	LD	a2,  1 * SIZE(AO)
	fclr	c13

	LD	a3,  2 * SIZE(AO)
	fclr	c02
	LD	a4,  3 * SIZE(AO)
	fclr	c06

	LD	b1,  0 * SIZE(BO)
	fclr	c10
	LD	b2,  1 * SIZE(BO)
	fclr	c14

	LD	b3,  2 * SIZE(BO)
	lda	AO,  2 * SIZE(AO)
	LD	b4,  3 * SIZE(BO)
	lda	BO,  4 * SIZE(BO)

	lda	L,        -2


    .baseUrl(mockWebServer.url("/"))
      .addConverterFactory(MoshiConverterFactory.create())
      .addCallAdapterFactory(ResultCallAdapterFactory.create(testScope))
      .build()

    val service = retrofit.create(PokemonService::class.java)
    mockWebServer.enqueue(MockResponse().setResponseCode(204).setBody(""))

    val result = service.fetchPokemonListEmptyBody()
    assertThat(result.isSuccess, `is`(true))
    assertThat(result.getOrNull(), `is`(Unit))
  }

  @Test
  fun `fetch items as Call type of Result successfully`() = runTest {
    enqueueResponse("/PokemonResponse.json")

    val result = service.fetchPokemonListAsCall().awaitResponse().body()!!
    assertThat(result.isSuccess, `is`(true))

    val data = result.getOrNull()!!
    assertThat(data.count, `is`(964))
    assertThat(data.results[0].name, `is`("bulbasaur"))
    assertThat(data.results[0].url, `is`("https://pokeapi.co/api/v2/pokemon/1/"))
  }

  @Test
  fun `fetch items as Result type suspend function with optional body`() = runTest {
    enqueueResponse("/PokemonResponse.json")

    val result = service.fetchPokemonListOptional()
    assertThat(result.isSuccess, `is`(true))

    val data = result.getOrNull()!!
    assertThat(data.count, `is`(964))
    assertThat(data.results[0].name, `is`("bulbasaur"))
    assertThat(data.results[0].url, `is`("https://pokeapi.co/api/v2/pokemon/1/"))

    mockWebServer.enqueue(MockResponse().setResponseCode(204))

    val resultNull = service.fetchPokemonListOptional()
    assertThat(resultNull.isSuccess, `is`(true))
    Assert.assertNull(resultNull.getOrNull())
  }
}
/*
 * Copyright (C) 2022 skydoves (Jaewoong Eum)
 *
 * 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 com.skydoves.retrofit.adapters.arrow

import arrow.core.Either
import com.skydoves.retrofit.adapters.test.PokemonResponse
import retrofit2.Call
import retrofit2.http.GET
import retrofit2.http.Query

internal interface PokemonService {

  @GET("pokemon")
  suspend fun fetchPokemonList(
    @Query("limit") limit: Int = 20,
    @Query("offset") offset: Int = 0,
  ): Either<Throwable, PokemonResponse>

  @GET("pokemon")
  fun fetchPokemonListAsCall(
    @Query("limit") limit: Int = 20,
    @Query("offset") offset: Int = 0,
  ): Call<Either<Throwable, PokemonResponse>>

  @GET("pokemon")
  suspend fun fetchPokemonListEmptyBody(): Either<Throwable, Unit>

  @GET("pokemon")
  suspend fun fetchPokemonListOptional(
    @Query("limit") limit: Int = 20,
    @Query("offset") offset: Int = 0,
  ): Either<Throwable, PokemonResponse?>
}
/*
 * Copyright (C) 2022 skydoves (Jaewoong Eum)
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file


}-offset-@{index} {
    margin-left: percentage((@index / @grid-columns));
  }
}

// Basic looping in LESS
.loop-grid-columns(@index, @class, @type) when (@index >= 0) {
  .calc-grid-column(@index, @class, @type);
  // next iteration
  .loop-grid-columns((@index - 1), @class, @type);
}

// Create grid for specific class
.make-grid(@class) {
  .float-grid-columns(@class);
  .loop-grid-columns(@grid-columns, @class, width);
  .loop-grid-columns(@grid-columns, @class, pull);
  .loop-grid-columns(@grid-columns, @class, push);
  .loop-grid-columns(@grid-columns, @class, offset);
}
// Button variants
//
// Easily pump out default styles, as well as :hover, :focus, :active,
// and disabled options for all buttons

.button-variant(@color; @background; @border) {
  color: @color;
  background-color: @background;
  border-color: @border;

  &:hover,
  &:focus,
  &.focus,
  &:active,
  &.active,
  .open > .dropdown-toggle& {
    color: @color;
    background-color: darken(@background, 10%);
        border-color: darken(@border, 12%);
  }
  &:active,
  &.active,
  .open > .dropdown-toggle& {
    background-image: none;
  }
  &.disabled,
  &[disabled],
  fieldset[disabled] & {
    &,
    &:hover,
    &:focus,
    &.focus,
    &:active,
    &.active {
      background-color: @background;
          border-color: @border;
    }
  }

  .badge {
    color: @background;
    background-color: @color;
  }
}

// Button sizes
.button-size(@padding-vertical; @padding-horizontal; @font-size; @line-height; @border-radius) {
  padding: @padding-vertical @padding-horizontal;
  font-size: @font-size;
  line-height: @line-height;
  border-radius: @border-radius;
}
html{box-sizing:border-box}*,:after,:before{box-sizing:inherit}article,aside,details,figcaption,figure,footer,header,hgroup,nav,section{display:block}audio,canvas,video{display:inline-block;*display:inline;*zoom:1}[hidden],audio:not([controls]){display:none}*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}html{font-size:100%;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}body{margin:0}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:700}blockquote{margin:0}dfn{font-style:italic}ins{background:#ff9;text-decoration:none}ins,mark{color:#000}mark{background:#ff0;font-style:italic;font-weight:700}.rst-content code,.rst-content tt,code,kbd,pre,samp{font-family:monospace,serif;_font-family:courier new,monospace;font-size:1em}pre{white-space:pre}q{quotes:none}q:after,q:before{content:"";content:none}small{font-size:85%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}dl,ol,ul{margin:0;padding:0;list-style:none;list-style-image:none}li{list-style:none}dd{margin:0}img{border:0;-ms-interpolation-mode:bicubic;vertical-align:middle;max-width:100%}svg:not(:root){overflow:hidden}figure,form{margin:0}label{cursor:pointe


935 3.098 3.098 0 00-.314-1.563M40.022 14.75a4.205 4.205 0 001.934.373 3.098 3.098 0 001.563-.314M33.25 40.022a4.205 4.205 0 00-.373 1.934 3.098 3.098 0 00.314 1.563M7.979 33.25a4.205 4.205 0 00-1.935-.373 3.098 3.098 0 00-1.563.314M7.979 14.75a4.204 4.204 0 00-.645-1.862 3.098 3.098 0 00-1.053-1.197M33.25 7.979a4.204 4.204 0 001.862-.645 3.098 3.098 0 001.197-1.053m3.713 26.969a4.204 4.204 0 00.644 1.862 3.098 3.098 0 001.054 1.197m-26.97 3.713a4.204 4.204 0 00-1.862.644 3.098 3.098 0 00-1.197 1.054M24 19.506v-14M28.51 24h14m-18.491 4.512v14M19.51 24h-14"/></svg>';
  static const String watchmaker =
      '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="48" height="48" preserveAspectRatio="xMidYMid meet" viewBox="0 0 48 48"><circle cx="23.831" cy="24" r="13.771" fill="currentColor" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/><path fill="currentColor" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" d="M23.831 14.003V24h-9.997m23.458 2.914h3.97v-5.828H37.29m-5.67-8.441L30.441 4.5h-13.22l-1.179 8.145m0 22.71 1.179 8.145h13.22l1.179-8.145"/></svg>';
  static const String water_me =
      '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="48" height="48" preserveAspectRatio="xMidYMid meet" viewBox="0 0 48 48"><path fill="currentColor" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" d="M24 7.619 4.5 24.964h5.85V40.38h27.3V24.964h5.85Z"/><path fill="currentColor" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" d="M27.901 28.817a3.9 3.9 0 01-7.8 0c0-2.12 3.9-7.708 3.9-7.708s3.9 5.589 3.9 7.708Z"/></svg>';
  static const String waterdrinkreminder =
      '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="48" height="48" preserveAspectRatio="xMidYMid meet" viewBox="0 0 48 48"><path fill="currentColor" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" d="M32.55 29.61a7.95 7.95 0 108 7.94h0a7.94 7.94 0 00-8-7.93Z"/><path fill="currentColor" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" d="M27.29 43.5H17.12a2.34 2.34 0 01-2.33-2.08L10.8 5.8A1.17 1.17 0 0112 4.5h24a1.17 1.17 0 011.2 1.3l-2.67 23.81"/><path fill="currentColor" stroke="currentColor" stroke-linecap="round" stroke-li


 = innerProviders.shift();
      if (!prov) {
        return Promise.reject('Cannot load config.');
      }
      return prov(next);
    };
    return next();
  }
}

export default DataFactory;
export interface DeviceLog {
    date: string;
    level: LogLevel;
    message: string;
}

export enum LogLevel {
    Verbose = "Verbose",
    Info = "Info",
    Warning = "Warning",
    Error = "Error",
}
const colorSet = {
  "#DF4141": ["A", "B", "C", "D"],
  "#61CE5E": ["E", "F", "G", "H"],
  "#6073E2": ["I", "J", "K", "L"],
  "#F89825": ["M", "N", "O", "P"],
  "#2EB5C0": ["Q", "R", "S", "T"],
  "#BB58D0": ["U", "V", "W", "X"],
  "#00A5FF": ["Y", "Z"],
};

export const generateColorFromString = (str: string): string => {
  const firstChar = str[0] || "";
  const normalizedFirstChar = firstChar.toUpperCase();

  let color = "inherit";
  for (const [hex, chars] of Object.entries(colorSet)) {
    if (chars.includes(normalizedFirstChar)) {
      color = hex;
      break;
    }
  }

  return color;
};

export default generateColorFromString;
import { AfterViewChecked, Directive, ElementRef, EventEmitter, HostListener, Input, OnInit, Output } from '@angular/core';
import { TaskRunnerService } from './task-runner.service';

/**
 * The multiline ellipsis directive can be used to display multi-line
 * text with an ellipsis character at the end if the text is too long.
 *
 ```ts
 import { MultilineEllipsisModule } from 'iwerk-angular-ui';
 ```
 */
@Directive({
  selector: '[iwMultilineEllipsis]'
})
export class MultilineEllipsisDirective implements AfterViewChecked, OnInit {

  /**
   * The text to display.
   */
  @Input() iwMultilineEllipsis: string;
  /**
   * An event that is emitted that indicates whether the text is truncated.
   */
  @Output() truncated = new EventEmitter<boolean>();

  /**
   * A boolean that indicates if the text overflows.
   */
  get isOverflowing(): boolean {
    return this.__isOverflowing;
  }

  private __isOverflowing: boolean;
  private needsAdjust: boolean;
  private oldText: string;
  private oldHeight: number;
  private oldWidth: number;

  constructor(
    private elementRef: ElementRef,
    private taskRunner: TaskRunnerService
  ) {
  }

  /**
   * @ignore
   */
  ngOnInit() {
    const self: HTMLElement = this.elementRef.nativeElement;
    self.classList.add('multiline-ellipsis');
  }

  /**
   * @ignore
   */
  ngAfterViewChecked() {
    const self: HTMLElement = this.elementRef.nativeElement;
    if (this.iwMultilineEllipsis !== this.oldText || this.oldHeight !== self.offsetHeight || this.oldWidth !== self.offsetWidth) {
      this.oldText = this.iwMultilineEllipsis;
      this.oldHeight = self.offsetHeight;
      this.oldWidth = self.offsetWidth;
      this.needsAdjust = true;
    }
    this.adjustInner();
  }

  /**
   * @ignore
   */
  @HostListener('window:resize', [])
  onResize() {
    this.needsAdjust = true;
    this.adjustInner();
  }

  /**
   * @ignore
   */
  private adjustInner() {
    if (!this.needsAdjust) {
      return;
    }
    this.needsAdjust = false;
    const self: HTMLElement = this.elementRef.nativeElement;
    self.innerHTML = this.iwMulti


dr); v != (common.Hash{}) {
		t.Errorf("wrong committed storage value %v, want %v", v, common.Hash{})
	}
}

func TestSnapshotEmpty(t *testing.T) {
	s := newStateTest()
	s.state.RevertToSnapshot(s.state.Snapshot())
}

func TestSnapshot2(t *testing.T) {
	state, _ := New(common.Hash{}, NewDatabase(rawdb.NewMemoryDatabase()), nil)

	stateobjaddr0 := common.BytesToAddress([]byte("so0"))
	stateobjaddr1 := common.BytesToAddress([]byte("so1"))
	var storageaddr common.Hash

	data0 := common.BytesToHash([]byte{17})
	data1 := common.BytesToHash([]byte{18})

	state.SetState(stateobjaddr0, storageaddr, data0)
	state.SetState(stateobjaddr1, storageaddr, data1)

	// db, trie are already non-empty values
	so0 := state.getStateObject(stateobjaddr0)
	so0.SetBalance(big.NewInt(42))
	so0.SetNonce(43)
	so0.SetCode(crypto.Keccak256Hash([]byte{'c', 'a', 'f', 'e'}), []byte{'c', 'a', 'f', 'e'})
	so0.suicided = false
	so0.deleted = false
	state.setStateObject(so0)

	root, _ := state.Commit(false)
	state, _ = New(root, state.db, state.snaps)

	// and one with deleted == true
	so1 := state.getStateObject(stateobjaddr1)
	so1.SetBalance(big.NewInt(52))
	so1.SetNonce(53)
	so1.SetCode(crypto.Keccak256Hash([]byte{'c', 'a', 'f', 'e', '2'}), []byte{'c', 'a', 'f', 'e', '2'})
	so1.suicided = true
	so1.deleted = true
	state.setStateObject(so1)

	so1 = state.getStateObject(stateobjaddr1)
	if so1 != nil {
		t.Fatalf("deleted object not nil when getting")
	}

	snapshot := state.Snapshot()
	state.RevertToSnapshot(snapshot)

	so0Restored := state.getStateObject(stateobjaddr0)
	// Update lazily-loaded values before comparing.
	so0Restored.GetState(state.db, storageaddr)
	so0Restored.Code(state.db)
	// non-deleted is equal (restored)
	compareStateObjects(so0Restored, so0, t)

	// deleted should be nil, both before and after restore of state copy
	so1Restored := state.getStateObject(stateobjaddr1)
	if so1Restored != nil {
		t.Fatalf("deleted object not nil after restoring snapshot: %+v", so1Restored)
	}
}

func compareStateObjects(so0, so1 *stateObject, t *testing.T) {
	if so0.Address() != so1.Address() {
		t.Fatalf("Address mismatch: have %v, want %v", so0.address, so1.address)
	}
	if so0.Balance().Cmp(so1.Balance()) != 0 {
		t.Fatalf("Balance mismatch: have %v, want %v", so0.Balance(), so1.Balance())
	}
	if so0.Nonce() != so1.Nonce() {
		t.Fatalf("Nonce mismatch: have %v, want %v", so0.Nonce(), so1.Nonce())
	}
	if so0.data.Root != so1.data.Root {
		t.Errorf("Root mismatch: have %x, want %x", so0.data.Root[:], so1.data.Root[:])
	}
	if !bytes.Equal(so0.CodeHash(), so1.CodeHash()) {
		t.Fatalf("CodeHash mismatch: have %v, want %v", so0.CodeHash(), so1.CodeHash())


���DC
15
춨ֱͬʱתܽ1Ӣߡһ2ӢߣСPCͿԼ£PCҪ3ӢߵĿռ䡣ͬʱ΢Сķڴ컨ϵĶÿ岻á
DC17
е
λʹȹ+1
Чÿÿ1D4ڣԶ̹+21D4˺
ʱ䣺9֡
ƻAC12HP5컨ÿ
壺DC17컨ÿ

ʮַɵCR
4
35ƽӢߵķһ߸ߵӡذϵϸۣ5Ӣߣᴩ䣬ۺᴩ䣬γһʮ񡣽뷿ᴥ壬عϡÿһ֣Ѵ󵶴һѴһȷѴ󵶶ᴩ䣬ǵǽʱˡһĿпһбƬƬ
DC
19
е
ӽʹȹ+2
ЧÿÿһѴ󵶣+42D6˺
ʱ䣺7֡
ƻAC14HP10Ӳ10ÿѴ󵶣
壺DC19ÿѴ󵶣
ࣺDC23壩

ˮɵCR
4
εķֻһڡÿ䶼һ΢΢ɫˮһˮ䣨ڵذϣװһ޴ıءPC뷿ʱ弤ˮʼ򷿼ħɵÿĿÿˮһöɵˮݻ֮ǰÿһֶÿһĳʱҪ1Ӳܳܡˮ䱻ݻ٣ͻ̶ֹͣҿͨγɹDC
25춨򿪡
DC 19
ħ
ӽʹȹ+2<BR


get the result (see constants)
        game_result_type = play_game()

        # Update shared_data variables between the processes: wins, losses, draws, etc
        shared_data["games"].value += 1
        # If game over due to out of time or illegal move
        if game_result_type != GAME_RESULT_NORMAL:
            # if red lost
            if eng_to_play == eng_red:
                shared_data["l_red"].value += 1
            # else blue lost
            else:
                assert eng_to_play == eng_blue
                shared_data["w_red"].value += 1
            # if eng1 lost
            if eng_to_play == eng1:
                shared_data["l"].value += 1
            # else eng1 won
            else:
                assert eng_to_play == eng2
                shared_data["w"].value += 1
        # Else game is over naturally
        else:
            str_result = board.result().strip()
            # if red won
            if str_result == "1-0":
                shared_data["w_red"].value += 1
                # if eng1 won as red
                if eng1 == eng_red:
                    shared_data["w"].value += 1
                # else eng1 lost as blue
                else:
                    assert eng1 == eng_blue and eng2 == eng_red
                    shared_data["l"].value += 1
            # else if blue won
            elif str_result == "0-1":
                shared_data["l_red"].value += 1
                # if eng1 won as blue
                if eng1 == eng_blue:
                    shared_data["w"].value += 1
                # else eng1 lost as red
                else:
                    assert eng1 == eng_red and eng2 == eng_blue
                    shared_data["l"].value += 1
            # else its a draw
            else:
                shared_data["d"].value += 1

        # Grab info from the shared data
        games = shared_data["games"].value
        w = shared_data["w"].value
        l = shared_data["l"].value
        d = shared_data["d"].value
        w_red = shared_data["w_red"].value
        l_red = shared_data["l_red"].value

        # Print new WDL
        print("({} vs {}, worker {})".format(eng1.name, eng2.name, process_id), end="")
        print(" Total w-l-d {}-{}-{} ({})".format(w, l, d, games), end="")
        if game_result_type == GAME_RESULT_OUT_OF_TIME:
            print("", eng_to_play.name, "out of time", end="")
        elif game_result_type == GAME_RESULT_ILLEGAL_MOVE:
            print("", eng_to_play.name, "illegal move", end="")
        print()

        # Every rating_interval games, print current sprt results
        if games % rating_interval == 0:
            print("Red w-l {}-{} | Blue w-l {}-{}".format(w_red, l_red, l_red, w_red))
            e1, e2, e3 = sprt.elo_wld(w, l, d)
            print(f"ELO: {round(e2, 1)} +- {round((e3 - e1) / 2, 1)} ({round(e1, 1)}, {round(e3, 1)})")
            llr = sprt.get_llr(w, l, d)
            print(f"LLR: {llr:.3} ({sprt.lower:.3}, {sprt.upper:.3})")
            sprt.print_result(llr)


case 'max':
            formValidators.push(Validators.max(validation.parameters));
            break;
          case 'minLength':
            formValidators.push(Validators.minLength(validation.parameters));
            break;
          case 'maxLength':
            formValidators.push(Validators.maxLength(validation.parameters));
            break;
          case 'pattern':
            formValidators.push(Validators.pattern(validation.parameters));
            break;
          case 'email':
            formValidators.push(Validators.email);
            break;
        }
      }
    }
    return formValidators;
  }

  public compareObjects(o1: any, o2: any) {
    return typeof o2 === 'number' ?
      o1 === o2.toString() :
      o1 === o2;
  }

  public hasErrors(key: string): boolean {
    const control = this.form.controls[key];
    return control.invalid && (control.dirty || control.touched);
  }

  public getErrorMessage(key: string, label?: string): string {
    const control = this.form.controls[key];
    const keyName = label || this.toCapitalFirst(key);

    let errorMessage = `Errors with ${keyName}`;
    if (control.errors.required)  { errorMessage = `${keyName} is required`; }
    if (control.errors.min)       { errorMessage = `${keyName} must be more than ${control.errors.min.min}`; }
    if (control.errors.max)       { errorMessage = `${keyName} must be less than ${control.errors.max.max}`; }
    if (control.errors.minLength) { errorMessage = `${keyName} must be more than ${control.errors.min.minLength} characters`; }
    if (control.errors.maxLength) { errorMessage = `${keyName} must be less than ${control.errors.max.maxLength} characters`; }
    if (control.errors.pattern)   { errorMessage = `${keyName} does not match required pattern`; }
    if (control.errors.email)     { errorMessage = `${keyName} is not a valid email`; }

    return errorMessage;
  }

  private toCapitalFirst(text: string): string {
    return text.charAt(0).toUpperCase() + text.slice(1);
  }

  public currentValue() { return this.form.getRawValue(); }
  public setModel(value: any) {
    this.model = value;
    this.form.patchValue(this.model);
    // TODO Maybe this is needed >>
    // this.form.markAllAsTouched();
  }
}

export interface DynamicForm {
  readonly currentValue: any;
  setModel(value: any): void;
}
import { Component,Input, EventEmitter,
  Output,OnChanges,SimpleChanges} from '@angular/core';
import {WeatherCard} from '../components/weatherCard/weatherCard.component';

@Component({
  selector: 'card-display',
  template: `

Nothing to show yet. Type in city name and click create button.

  <weather-card (eventClick)="handleClick($event)" [card]="card"></weather-card>

  <weather-cardboard (eventClick)="handleShowLess($event)" [card]="currentCard"></weather-cardboard>

  `,
  styles:[`
  .card-display: {width: 800px !important;}
  h3{text-align:center}`]
})

export class CardDisplay implements OnChanges {
  @Input() card:Object
  @Output() cardsCopy = new EventEmitter();


            i2[(k[a2 + 8 >> 2] | 0) + d2 >> 0] = b3;
            return;
          }
          c2 = Va(16) | 0;
          x = 0;
          d2 = Da(1) | 0;
          b3 = x;
          x = 0;
          if (b3 & 1) {
            b3 = Wa() | 0;
            Ua(c2 | 0);
            fb(b3 | 0);
          }
          x = 0;
          Fa(7, c2 | 0, 4, d2 | 0);
          b3 = x;
          x = 0;
          if (b3 & 1) {
            b3 = Wa() | 0;
            Ua(c2 | 0);
            fb(b3 | 0);
          } else
            ub(c2 | 0, 824, 96);
        }
        function Oi(a2, b3, c2) {
          a2 = a2 | 0;
          b3 = b3 | 0;
          c2 = c2 | 0;
          var d2 = 0, e2 = 0, f2 = 0;
          k[a2 >> 2] = 0;
          k[a2 + 4 >> 2] = 0;
          k[a2 + 8 >> 2] = 0;
          k[a2 + 12 >> 2] = 0;
          e2 = (b3 | 0) < 4095 ? (b3 + 128 | 0) / 256 | 0 : 16;
          f2 = (c2 * 3 | 0) + 2 + e2 | 0;
          d2 = c2 + 1 | 0;
          f2 = (f2 | 0) < (d2 | 0) | (f2 | 0) > (b3 | 0) ? d2 : f2;
          k[a2 + 4 >> 2] = f2;
          d2 = (e2 << 2 | 3) + (c2 * 5 | 0) | 0;
          d2 = (d2 | 0) > (b3 | 0) | (d2 | 0) < (f2 | 0) ? f2 : d2;
          k[a2 + 8 >> 2] = d2;
          c2 = (c2 * 7 | 0) + 4 + (e2 * 17 | 0) | 0;
          k[a2 + 12 >> 2] = (c2 | 0) > (b3 | 0) | (c2 | 0) < (d2 | 0) ? d2 : c2;
          k[a2 >> 2] = b3;
          k[a2 + 16 >> 2] = 64;
          return;
        }
        function Pi(a2, b3) {
          a2 = a2 | 0;
          b3 = b3 | 0;
          var c2 = 0, d2 = 0, e2 = 0, f2 = 0, g2 = 0, h2 = 0, j2 = 0, l2 = 0, m2 = 0;
          l2 = r;
          r = r + 128 | 0;
          h2 = l2 + 100 | 0;
          d2 = l2 + 16 | 0;
          c2 = l2 + 112 | 0;
          j2 = l2 + 4 | 0;
          m2 = l2;
          e2 = d2;
          f2 = a2 + 20 | 0;
          g2 = e2 + 84 | 0;
          do {
            k[e2 >> 2] = k[f2 >> 2];
            e2 = e2 + 4 | 0;
            f2 = f2 + 4 | 0;
          } while ((e2 | 0) < (g2 | 0));
          k[d2 + 16 >> 2] = k[a2 + 4 >> 2];
          f2 = zc(c2, d2, a2 + 56 | 0) | 0;
          c2 = k[(k[f2 >> 2] | 0) + 16 >> 2] | 0;
          a2 = a2 + 8 | 0;
          x = 0;
          k[h2 >> 2] = k[a2 >> 2];
          k[h2 + 4 >> 2] = k[a2 + 4 >> 2];
          k[h2 + 8 >> 2] = k[a2 + 8 >> 2];
          c2 = Aa(c2 | 0, f


\\(\\[].*?[\\)\\]]",rB:!0,c:[{cN:"string",b:"\\[",e:"\\]",eB:!0,rE:!0,r:0},{cN:"link",b:"\\]\\(",e:"\\)",eB:!0,eE:!0},{cN:"symbol",b:"\\]\\[",e:"\\]",eB:!0,eE:!0}],r:10},{b:/^\[[^\n]+\]:/,rB:!0,c:[{cN:"symbol",b:/\[/,e:/\]/,eB:!0,eE:!0},{cN:"link",b:/:\s*/,e:/$/,eB:!0}]}]}}),e.registerLanguage("nginx",function(e){var t={cN:"variable",v:[{b:/\$\d+/},{b:/\$\{/,e:/}/},{b:"[\\$\\@]"+e.UIR}]},r={eW:!0,l:"[a-z/_]+",k:{literal:"on off yes no true false none blocked debug info notice warn error crit select break last permanent redirect kqueue rtsig epoll poll /dev/poll"},r:0,i:"=>",c:[e.HCM,{cN:"string",c:[e.BE,t],v:[{b:/"/,e:/"/},{b:/'/,e:/'/}]},{b:"([a-z]+):/",e:"\\s",eW:!0,eE:!0,c:[t]},{cN:"regexp",c:[e.BE,t],v:[{b:"\\s\\^",e:"\\s|{|;",rE:!0},{b:"~\\*?\\s+",e:"\\s|{|;",rE:!0},{b:"\\*(\\.[a-z\\-]+)+"},{b:"([a-z\\-]+\\.)+\\*"}]},{cN:"number",b:"\\b\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}(:\\d{1,5})?\\b"},{cN:"number",b:"\\b\\d+[kKmMgGdshdwy]*\\b",r:0},t]};return{aliases:["nginxconf"],c:[e.HCM,{b:e.UIR+"\\s+{",rB:!0,e:"{",c:[{cN:"section",b:e.UIR}],r:0},{b:e.UIR+"\\s",e:";|{",rB:!0,c:[{cN:"attribute",b:e.UIR,starts:r}],r:0}],i:"[^\\s\\}]"}}),e.registerLanguage("objectivec",function(e){var t={cN:"built_in",b:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},r={keyword:"int float while char export sizeof typedef const struct for union unsigned long volatile static bool mutable if do return goto void enum else break extern asm case short default double register explicit signed typename this switch continue wchar_t inline readonly assign readwrite self @synchronized id typeof nonatomic super unichar IBOutlet IBAction strong weak copy in out inout bycopy byref oneway __strong __weak __block __autoreleasing @private @protected @public @try @property @end @throw @catch @finally @autoreleasepool @synthesize @dynamic @selector @optional @required @encode @package @import @defs @compatibility_alias __bridge __bridge_transfer __bridge_retained __bridge_retain __covariant __contravariant


C67F0D08134B1C8B97989149B609E0BE3BAB63D47548381DBC5B1FC764E3F" +
			"4B53DD9DA1158BFD3E2B9C8CF56EDF019539349627DB2FD53D24B7C48665772E43" +
			"7D6C7F8CE442734AF7CCB7AE837C264AE3A9BEB87F8A2FE9B8B5292E5A021FFF5E" +
			"91479E8CE7A28C2442C6F315180F93499A234DCF76E3FED135F9BB",
			"AC6BDB41324A9A9BF166DE5E1389582FAF72B6651987EE07FC3192943DB56050A3" +
			"7329CBB4A099ED8193E0757767A13DD52312AB4B03310DCD7F48A9DA04FD50E808" +
			"3969EDB767B0CF6095179A163AB3661A05FBD5FAAAE82918A9962F0B93B855F979" +
			"93EC975EEAA80D740ADBF4FF747359D041D5C33EA71D281E446B14773BCA97B43A" +
			"23FB801676BD207A436C6481F1D2B9078717461A5B9D32E688F87748544523B524" +
			"B0D57D5EA77A2775D2ECFA032CFBDBF52FB3786160279004E57AE6AF874E7303CE" +
			"53299CCC041C7BC308D82A5698F3A8D0C38271AE35F8E9DBFBB694B5C803D89F7A" +
			"E435DE236D525F54759B65E372FCD68EF20FA7111F9E4AFF73"
		};
		#endregion
	}
}


                setLayoutParams(params);
            }
            mParentLayout.updateContentViewTranslateY();
        }
        mCurrentViewHeight = CalendarUtil.getMonthViewHeight(year, month,
                mDelegate.getCalendarItemHeight(), mDelegate.getWeekStart(),
                mDelegate.getMonthViewShowMode());
        if (month == 1) {
            mPreViewHeight = CalendarUtil.getMonthViewHeight(year - 1, 12,
                    mDelegate.getCalendarItemHeight(), mDelegate.getWeekStart(),
                    mDelegate.getMonthViewShowMode());
            mNextViewHeight = CalendarUtil.getMonthViewHeight(year, 2,
                    mDelegate.getCalendarItemHeight(), mDelegate.getWeekStart(),
                    mDelegate.getMonthViewShowMode());
        } else {
            mPreViewHeight = CalendarUtil.getMonthViewHeight(year, month - 1,
                    mDelegate.getCalendarItemHeight(), mDelegate.getWeekStart(),
                    mDelegate.getMonthViewShowMode());
            if (month == 12) {
                mNextViewHeight = CalendarUtil.getMonthViewHeight(year + 1, 1,
                        mDelegate.getCalendarItemHeight(), mDelegate.getWeekStart(),
                        mDelegate.getMonthViewShowMode());
            } else {
                mNextViewHeight = CalendarUtil.getMonthViewHeight(year, month + 1,
                        mDelegate.getCalendarItemHeight(), mDelegate.getWeekStart(),
                        mDelegate.getMonthViewShowMode());
            }
        }
    }

    /**
     * 刷新
     */
    void notifyDataSetChanged() {
        mMonthCount = 12 * (mDelegate.getMaxYear() - mDelegate.getMinYear())
                - mDelegate.getMinYearMonth() + 1 +
                mDelegate.getMaxYearMonth();
        notifyAdapterDataSetChanged();
    }

    /**
     * 更新月视图Class
     */
    void updateMonthViewClass() {
        isUpdateMonthView = true;
        notifyAdapterDataSetChanged();
        isUpdateMonthView = false;
    }

    /**
     * 更新日期范围
     */
    final void updateRange() {
        isUpdateMonthView = true;
        notifyDataSetChanged();
        isUpdateMonthView = false;
        if (getVisibility() != VISIBLE) {
            return;
        }
        isUsingScrollToCalendar = false;
        Calendar calendar = mDelegate.mSelectedCalendar;
        int y = calendar.getYear() - mDelegate.getMinYear();
        int position = 12 * y + calendar.getMonth() - mDelegate.getMinYearMonth();
        setCurrentItem(position, false);
        BaseMonthView view = findViewWithTag(position);
        if (view != null) {
            view.setSelectedCalendar(mDelegate.mIndexCalendar);
            view.invalidate();
            if (mParentLayout != null) {
                mParentLayout.updateSelectPosition(view.getSelectedIndex(mDelegate.mIndexCalendar));
            }
        }
        if (mParentLayout != null) {
            int week = CalendarUtil.getWeekFromDayInMonth(calendar, mDelegate.getWeekStart());
            mParentLayout.updateSelectWeek(week);
        }

        if (mDelegate.mInnerListener != null) {
            mDelegate.mInnerListener.onMonthDateSelected(calendar, false);
        }

        if (mDelegate.mCalendarSelectListener != null) {
            mDelegate.mCalendarSelectListener.onCalendarSelect(calendar, false);
        }
        updateSelected();
    }

    /**
     * 滚动到指定日期
     *
     * @param year           年
     * @param month          月
     * @param day            日
     * @param invokeListener 调用日期事件
     */
    void scrollToCalendar(int year, int month, int day, boolean smoothScroll, boolean invokeListener) {
        isUsingScrollToCalendar = true;
        Calendar calendar = new Calendar();
        calendar.setYear(year);
        calendar.setM


-right: 2%
}

.gcp .add-emp-cards .edit-emp-cards .showDetails input {
	width: 18%;
	margin-right: 2%
}

.gcp .add-emp-cards .edit-emp-cards .buttons-section {
	padding: 0;
	background-color: inherit;
	border-top: none;
	text-align: center
}

.gcp .add-emp-cards .edit-emp-cards .buttons-section button {
	width: 100px;
	height: 50px
}

.gcp .add-emp-cards .select-dropdown {
	background: rgba(0, 0, 0, 0);
	border: 1px solid #bcbcbc;
	font-size: 1em;
	margin: 0 auto 20px
}

.nameItem.ng-hide-remove,
.show-emp-card input.ng-hide-add {
	transition: all linear .1ms
}

.gcp .add-emp-cards .multicolor-suppfee {
	float: none;
	width: auto;
	white-space: normal;
	line-height: 1.4em
}

.gcp .show-emp-card .cardTypeDisp {
	width: auto;
	word-break: break-word
}

.gcp .show-emp-card .showDetails input.email {
	width: 96%;
	margin-bottom: 5%
}

.gcp .show-emp-card .showDetails div.multicolorsupp {
	display: inline-block;
	width: 96%
}

.gcp .show-emp-card .showDetails div.multicolorsupp .select-dropdown {
	background: #fff
}

.gcp .add-emp-cards #oce-gcp-emp-email-error,
.gcp .add-emp-cards #oce-gcp-emp-firstname-error,
.gcp .add-emp-cards #oce-gcp-emp-lastname-error,
.gcp .add-emp-cards #oce-gcp-emp-nameoncard-error {
	white-space: normal;
	top: -70px;
	min-height: 65px
}

.gcp .add-emp-cards .open-info #oce-gcp-emp-email-error,
.gcp .add-emp-cards .open-info #oce-gcp-emp-firstname-error,
.gcp .add-emp-cards .open-info #oce-gcp-emp-lastname-error,
.gcp .add-emp-cards .open-info #oce-gcp-emp-nameoncard-error {
	white-space: normal;
	top: -60px;
	min-height: 41px
}

.supp-info-error {
	white-space: normal;
	top: -55px !important;
	min-height: 42px !important
}

#oce-open-emp-firstname-error {
	white-space: normal;
	top: -70px;
	min-height: 65px
}

.gcp .add-emp-cards #oce-gcp-emp-nameoncard-error {
	top: -75px
}

.gcp .add-emp-cards #oce-gcp-emp-middlename-error {
	white-space: normal;
	top: -70px
}

.gcp .add-emp-cards #oce-gcp-emp-email-error {
	top: -32px;
	min-height: 22px;
	left: 0
}

.gcp .add-emp-cards #oce-gcp-emp-email-error .arrow-left-info,
.gcp .add-emp-cards #oce-gcp-emp-firstname-error .arrow-left-info,
.gcp .add-emp-cards #oce-gcp-emp-lastname-error .arrow-left-info,


E34 00256D74  D0 3F 00 0C */	stfs f1, 0xc(r31)
/* 80259E38 00256D78  D0 1F 00 10 */	stfs f0, 0x10(r31)
/* 80259E3C 00256D7C  D0 3F 00 14 */	stfs f1, 0x14(r31)
/* 80259E40 00256D80  80 1E 01 E4 */	lwz r0, 0x1e4(r30)
/* 80259E44 00256D84  54 00 07 FF */	clrlwi. r0, r0, 0x1f
/* 80259E48 00256D88  41 82 00 10 */	beq .L_80259E58
/* 80259E4C 00256D8C  C0 02 C7 E4 */	lfs f0, lbl_8051AB44@sda21(r2)
/* 80259E50 00256D90  D0 1F 00 18 */	stfs f0, 0x18(r31)
/* 80259E54 00256D94  48 00 00 0C */	b .L_80259E60
.L_80259E58:
/* 80259E58 00256D98  C0 02 C7 E8 */	lfs f0, lbl_8051AB48@sda21(r2)
/* 80259E5C 00256D9C  D0 1F 00 18 */	stfs f0, 0x18(r31)
.L_80259E60:
/* 80259E60 00256DA0  C0 02 C7 EC */	lfs f0, lbl_8051AB4C@sda21(r2)
/* 80259E64 00256DA4  D0 1F 00 1C */	stfs f0, 0x1c(r31)
/* 80259E68 00256DA8  80 01 00 14 */	lwz r0, 0x14(r1)
/* 80259E6C 00256DAC  83 E1 00 0C */	lwz r31, 0xc(r1)
/* 80259E70 00256DB0  83 C1 00 08 */	lwz r30, 8(r1)
/* 80259E74 00256DB4  7C 08 03 A6 */	mtlr r0
/* 80259E78 00256DB8  38 21 00 10 */	addi r1, r1, 0x10
/* 80259E7C 00256DBC  4E 80 00 20 */	blr
.endfn getShadowParam__Q34Game4Ujib3ObjFRQ24Game11ShadowParam

.fn pressCallBack__Q34Game4Ujib3ObjFPQ24Game8CreaturefP8CollPart, global
/* 80259E80 00256DC0  94 21 FF F0 */	stwu r1, -0x10(r1)
/* 80259E84 00256DC4  7C 08 02 A6 */	mflr r0
/* 80259E88 00256DC8  28 04 00 00 */	cmplwi r4, 0
/* 80259E8C 00256DCC  90 01 00 14 */	stw r0, 0x14(r1)
/* 80259E90 00256DD0  93 E1 00 0C */	stw r31, 0xc(r1)
/* 80259E94 00256DD4  7C 7F 1B 78 */	mr r31, r3
/* 80259E98 00256DD8  41 82 00 64 */	beq .L_80259EFC
/* 80259E9C 00256DDC  7C 83 23 78 */	mr r3, r4
/* 80259EA0 00256DE0  81 84 00 00 */	lwz r12, 0(r4)
/* 80259EA4 00256DE4  81 8C 00 18 */	lwz r12, 0x18(r12)
/* 80259EA8 00256DE8  7D 89 03 A6 */	mtctr r12
/* 80259EAC 00256DEC  4E 80 04 21 */	bctrl
/* 80259EB0 00256DF0  54 60 06 3F */	clrlwi. r0, r3, 0x18
/* 80259EB4


    }
}

impl<'a, W: Write> Encoder for EncoderWriter<'a, W> {
    type Error = EncodingError;

    fn emit_nil(&mut self) -> EncodingResult<()> {
        Ok(())
    }
    fn emit_usize(&mut self, v: usize) -> EncodingResult<()> {
        self.emit_u64(v as u64)
    }
    fn emit_u64(&mut self, v: u64) -> EncodingResult<()> {
        self.writer.write_u64::<BigEndian>(v).map_err(wrap_io)
    }
    fn emit_u32(&mut self, v: u32) -> EncodingResult<()> {
        self.writer.write_u32::<BigEndian>(v).map_err(wrap_io)
    }
    fn emit_u16(&mut self, v: u16) -> EncodingResult<()> {
        self.writer.write_u16::<BigEndian>(v).map_err(wrap_io)
    }
    fn emit_u8(&mut self, v: u8) -> EncodingResult<()> {
        self.writer.write_u8(v).map_err(wrap_io)
    }
    fn emit_isize(&mut self, v: isize) -> EncodingResult<()> {
        self.emit_i64(v as i64)
    }
    fn emit_i64(&mut self, v: i64) -> EncodingResult<()> {
        self.writer.write_i64::<BigEndian>(v).map_err(wrap_io)
    }
    fn emit_i32(&mut self, v: i32) -> EncodingResult<()> {
        self.writer.write_i32::<BigEndian>(v).map_err(wrap_io)
    }
    fn emit_i16(&mut self, v: i16) -> EncodingResult<()> {
        self.writer.write_i16::<BigEndian>(v).map_err(wrap_io)
    }
    fn emit_i8(&mut self, v: i8) -> EncodingResult<()> {
        self.writer.write_i8(v).map_err(wrap_io)
    }
    fn emit_bool(&mut self, v: bool) -> EncodingResult<()> {
        self.writer.write_u8(if v {1} else {0}).map_err(wrap_io)
    }
    fn emit_f64(&mut self, v: f64) -> EncodingResult<()> {
        self.writer.write_f64::<BigEndian>(v).map_err(wrap_io)
    }
    fn emit_f32(&mut self, v: f32) -> EncodingResult<()> {
        self.writer.write_f32::<BigEndian>(v).map_err(wrap_io)
    }
    fn emit_char(&mut self, v: char) -> EncodingResult<()> {
        // TODO: change this back once unicode works
        //let mut cbuf = [0; 4];
        //let sz = v.encode_utf8(&mut cbuf[..]).unwrap_or(0);
        //let ptr = &cbuf[..sz];
        //self.writer.write_all(ptr).map_err(EncodingError::IoError)

        let mut inter = String::with_capacity(1);
        inter.push(v);
        self.writer.write_all(inter.as_bytes()).map_err(EncodingError::IoError)
    }
    fn emit_str(&mut self, v: &str) -> EncodingResult<()> {
        try!(self.emit_usize(v.len()));
        self.writer.write_all(v.as_bytes()).map_err(EncodingError::IoError)
    }
    fn emit_enum<F>(&mut self, __: &str, f: F) -> EncodingResult<()>
        where F: FnOnce(&mut EncoderWriter<'a, W>) -> EncodingResult<()>
    {
        f(self)
    }
    fn emit_enum_variant<F>(&mut self, _: &str, v_


87b1">Cpl::Io::Socket::Listener, Cpl::Io::Socket::Posix::Listener, Cpl::Io::Socket::Win32::Listener

~LookupMAppRequest() : Cpl::MApp::LookupMAppRequest

~Manager() : Cpl::MApp::Manager

~ManagerApi() : Cpl::MApp::ManagerApi

~MAppApi() : Cpl::MApp::MAppApi

~Message() : Cpl::Itc::Message

~ModelDatabase() : Cpl::Dm::ModelDatabase

~ModelDatabaseApi() : Cpl::Dm::ModelDatabaseApi

~ModelPoint() : Cpl::Dm::ModelPoint

~Mutex() : Cpl::System::Mutex

~NotificationApi_() : Cpl::Dm::NotificationApi_

~Null() : <a class="el" href="class_cpl_1_1_io_1_1_file


/******************************************************************************/
/* This source, or parts thereof, may be used in any software as long the     */
/* license of NostalgicPlayer is keep. See the LICENSE file for more          */
/* information.                                                               */
/******************************************************************************/
namespace Polycode.NostalgicPlayer.Ports.LibMpg123.Containers
{
	/// <summary>
	/// Data structure for even more detailed information out of the decoder,
	/// for MPEG layer III only.
	/// This was added to support the frame analyzer by the Lame project and
	/// just follows what was used there before. You know what the fields mean
	/// if you want use this structure
	/// </summary>
	public class Mpg123_MoreInfo
	{
		/// <summary>
		/// Internal data
		/// </summary>
		public readonly c_double[,,] Xr = new c_double[2, 2, 576];
		/// <summary>
		/// [2][2][SBMAX_1]
		/// </summary>
		public readonly c_double[,,] Sfb = new c_double[2, 2, 22];
		/// <summary>
		/// [2][2][3 * SBMAX_s]
		/// </summary>
		public readonly c_double[,,] Sfb_S = new c_double[2, 2, 3 * 13];
		/// <summary>
		/// Inte


DIS_MASK
	beqz reg_spi_ctrl_cfg, end
	nop

/*
 * This is a small hack, needed after setting REMAP_DISABLE bit
 * in SPI_CONTROL_ADDR register.
 *
 * Before that, SPI FLASH is mapped to 0x1FC00000, but just after
 * setting REMAP_DISABLE bit, aliasing is disabled and SPI FLASH
 * is mapped to 0x1F00000, so that the whole 16 MB address space
 * could be used.
 *
 * That means, we need to "fix" return address, stored previously
 * in $ra register, subtracting a value 0x00C00000 from it.
 *
 * Without that, jump would end up somewhere far away on FLASH...
 */
	li   t8, 0x00C00000
	subu ra, ra, t8

end:
	jr ra
	nop

.end lowlevel_init


DeviceType::class.java),
                    architecture = forge.aString(),
                    locale = forge.aNullable { anAlphabeticalString() },
                    locales = forge.aNullable { aList { anAlphabeticalString() } },
                    timeZone = forge.aNullable { anAlphabeticalString() },
                    batteryLevel = forge.aNullable { aDouble(min = 0.0, max = 100.0) },
                    powerSavingMode = forge.aNullable { aBool() },
                    brightnessLevel = forge.aNullable { aDouble(min = 0.0, max = 1.0) }
                )
            },
            context = forge.aNullable {
                LongTaskEvent.Context(
                    additionalProperties = forge.exhaustiveAttributes()
                )
            },
            dd = LongTaskEvent.Dd(
                session = forge.aNullable { LongTaskEvent.DdSession(getForgery()) },
                browserSdkVersion = forge.aNullable { aStringMatching("\\d+\\.\\d+\\.\\d+") }
            ),
            ddtags = forge.aNullable { ddTagsString() }
        )
    }
}
/*
 * Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.
 * This product includes software developed at Datadog (https://www.datadoghq.com/).
 * Copyright 2016-Present Datadog, Inc.
 */

package com.datadog.android.rum

import com.datadog.android.rum.utils.forge.Configurator
import fr.xgouchet.elmyr.Forge
import fr.xgouchet.elmyr.junit5.ForgeConfiguration
import fr.xgouchet.elmyr.junit5.ForgeExtension
import org.assertj.core.api.Assertions.assertThat
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.extension.ExtendWith
import org.junit.jupiter.api.extension.Extensions
import org.mockito.junit.jupiter.MockitoExtension
import org.mockito.junit.jupiter.MockitoSettings
import org.mockito.quality.Strictness

@Extensions(
    ExtendWith(MockitoExtension::class),
    ExtendWith(ForgeExtension::class)
)
@MockitoSettings(strictness = Strictness.LENIENT)
@ForgeConfiguration(Configurator::class)
internal class RumResourceKindTest {

    @Test
    fun `detect image MimeType`(
        forge: Forge
    ) {
        val mimeType = forge.aStringMatching("image/((vnd\\.)|([xX]\\.)|(x\\-)|([a-z]))[a-z]{2,8}")

        val kind = RumResourceKind.fromMimeType(mimeType)

        assertThat(kind)
            .isEqualTo(RumResourceKind.IMAGE)
    }

    @Test
    fun `detect media MimeType { audio }`(
        forge: Forge
    ) {
        val mimeType = forge.aStringMatching(
            "audio/((vnd\\.)|([xX]\\.)|(x\\-)|([a-z]))[a-z]{2,8}"
        )

        val kind = RumResourceKind.fromMimeType(mimeType)

        assertThat(kind)
            .isEqualTo(RumResourceKind.MEDIA)
    }

    @Test
    fun `detect media MimeType { video }`(
        forge: Forge
    ) {
        val mimeType = forge.aStringMatching(
            "video/((vnd\\.)|([xX]\\.)|(x\\-)|([a-z]))[a-z]{2,8}"
        )

        val kind = RumResourceKind.fromMimeType(mimeType)

        assertThat(kind)
            .isEqualTo(RumResourceKind.MEDIA)
    }

    @Test
    fun `detect font MimeType`(
        forge: Forge
    ) {
        val mimeType = forge.aStringMatching("font/((vnd\\.)|([xX]\\.)|(x\\-)|([a-z]))[a-z]{2,8}")

        val kind = RumResourceKind.fromMimeType(mimeType)

        assertThat(kind)
            .isEqualTo(RumResourceKind.FONT)
    }

    @Test
    fun `detect js MimeType`(
        forge: Forge
    ) {
        val mimeType = forge.aString


0JrRgNCw0YE= 171868
IG1vdXJpcg== 171869
ZW1icmll 171870
IM6gzrHOvQ== 171871
IMO+asOzbg== 171872
dGhvcg== 171873
YW5ncmlqaw== 171874
IOCkhuCksuClgA== 171875
IHBpaXJr 171876
INCw0LLRgtC+0L3QvtC8 171877
0rXQsNC90LDQug== 171878
IFJ1bmU= 171879
LmhvdXJz 171880
IGVybWVl 171881
IGFkZGljdGlvbnM= 171882
KFJvb20= 171883
INiz2YTYp9mF2Ko= 171884
IHBzeWNoZWRlbGlj 171885
IOWkp+WPkeaJkeWFiw== 171886
IEFudG9ueQ== 171887
IOCqruCqueCqv+CqsuCqvg== 171888
aW50ZWw= 171889
IHBhcnRlYQ== 171890
IGh1w6lzcGVkZXM= 171891
IHbDoGk= 171892
RElTUExBWQ== 171893
YW5hc2l5YW5h 171894
IHNhbWbDqWw= 171895
IHN3dW5n 171896
SUdF 171897
4oCM4LSq 171898
IG9pcmU= 171899
X2N1YmU= 171900
IGZyaXNzZQ== 171901
ZmVsbA== 171902
INGA0LXRhNC+0YDQvA== 171903
cml1dw== 171904
INC00LjSm9Kb 171905
IHlkaw== 171906
IGN1w6FuZG8= 171907
IGRvcHI= 171908
IOygleyDgQ== 171909
w61zbW8= 171910
aWRhZG9z 171911
4YOY4YOV4YOg4YOq 171912
LmZyaWVuZA== 171913
0LDQu9C40Yc= 171914
IGNvbnNpc3RlbnRl 171915
IOCkpOCliOCkr+CkvuCksOClgA== 171916
6Ieq5ouN6KeG6aKR 171917
IFVudGVybmVobWVy 171918
IE91dHJvcw== 171919
c3BvcnRz 171920
IFBhZ2VhYmxl 171921
U09BUA== 171922
IG1ha2VtYWtl 171923
bGVrZW4= 171924
KHBpeGVs 171925
IExvd2VsbA== 171926
IGVybMOkdXQ= 171927
dXJjaGFzZWQ= 171928
T0NS 171929
INGB06nQuQ== 171930
0L3QvtGB0YLRgtCw 171931
INGH0LDQu9Cw0LLQtdC60LA= 171932
IER1c2NoZQ== 171933
IHZvcmdlc2VoZW4= 171934
IFJhbw== 171935
IHNlcmnFnw== 171936
LkNsYW1w 171937
05nRgNCy05nRgA== 171938
IEhlcmN1bGVz 171939
IGFycXVpdGV0dXJh 171940
IFNwYW5p 171941
IEJPUw== 171942
UG4= 171943
IEVuY291cmFnZQ== 171944
4LCu4LCC4LCk4LGN4LCw4LC/ 171945
IEbDoWNpbA== 171946
SUZFU1Q= 171947
IHNhbml0YXJpbw==


xtBig, MaxUInt)
        )
        assertEquals(
            listOf(S(200.asExtBig, MaxUInt), SFalse, S(0, 99), S(200.asExtBig, MaxUInt)),
            result
        )
    }

    @Test
    fun lor() {
        val result = BiPropagation.or(
            listOf(STrue, SFalse, SFullBool)
        )
        assertEquals(
            listOf(STrue, SFalse, STrue),
            result
        )
    }

    @Test
    fun land() {
        val result = BiPropagation.and(
            listOf(SFalse, STrue, SFullBool)
        )
        assertEquals(
            listOf(SFalse, STrue, SFalse),
            result
        )
    }

    @Test
    fun div0() {
        val result = BiPropagation.div(
            SFull256, S(0, 255), S(0)
        )
        assertEquals(
            listOf(SFull256, S(0, 255), S(0)),
            result
        )
    }

    @Test
    fun signExtend() {
        val result = BiPropagation.signExtend(
            S(0, 10), S(0, 127), fromBit = 8, toBit = 256
        )
        assertEquals(
            listOf(S(0, 10), S(0, 10)),
            result
        )
    }

    @Test
    fun signExtend2() {
        val result = BiPropagation.signExtend(
            SFull256, S(0, 2), fromBit = 2, toBit = 256
        )
        assertEquals(
            listOf(S(0, 1) union S(MAX_UINT - 1), S(0, 2)),
            result
        )
    }

    @Test
    fun bwAndBackward() {
        val result = BiPropagation.bwAnd(
            S(1, 255), S(0, 255), S(255)
        )
        assertEquals(
            listOf(S(1, 255), S(1, 255), S(255)),
            result
        )
    }

    @Test
    fun sdivOverflow() {
        val result = BiPropagation.sDiv(
            SFull, S(MIN_EVM_INT256_2S_COMPLEMENT), S(MAX_UINT), Tag.Bit256
        )
        assertEquals(
            listOf(S(MIN_EVM_INT256_2S_COMPLEMENT), S(MIN_EVM_INT256_2S_COMPLEMENT), S(MAX_UINT)),
            result
        )
    }

    @Test
    fun pow2Limited() {
        val result = BiPropagation.powOf2Limited(
            S(Zero, TwoTo256), S(256), Tag.Bit256
        )
        assertEquals(
            listOf(S(TwoTo256), S(256)),
            result
        )
    }

    @Test
    fun pow2Limited2() {
        val result = BiPropagation.powOf2Limited(
            S(Zero, TwoTo256), S(300), Tag.Bit256
        )
        assertEquals(
            listOf(S(TwoTo256), S(300)),
            result
        )
    }

    @Test
    fun mod0() {
        val result = BiPropagation.unsignedMod(
            SFull256, S(10), S(0)
        )
        assertEquals(
            listOf(S(0), S(10), S(0)),
            result
        )
    }

}
/*
 *     The Certora Prover
 *     Copyright (C) 2025  Certora Ltd.
 *
 *     This program is free software: you can redistribute it and/or modify
 *     it under the terms of the GNU General Public License as published by
 *     the Free Software Foundation, version 3 of the License.
 *
 *     This program is distributed in the hope that it will be useful,
 *     but WITHOUT ANY WARRANTY; without even the implied warranty of
 *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *     GNU General Public License for more details.


means
		/// the ticket is definitely ready to go as soon as it returns. Will return <see langword="null"/> if the callback
		/// times out or returns negatively.
		/// </summary>
		public static async Task<AuthTicket> GetAuthTicketForWebApiAsync( string identity, double timeoutSeconds = 10.0f )
		{
			var result = Result.Pending;
			AuthTicket ticket = null;
			var stopwatch = Stopwatch.StartNew();

			void f( GetTicketForWebApiResponse_t t )
			{
				if ( t.AuthTicket != ticket.Handle ) return;
				result = t.Result;
				ticket.Data = t.GubTicket;
			}

			OnGetTicketForWebApiResponse += f;

			try
			{
				ticket = GetAuthTicketForWebApi( identity );
				if ( ticket == null )
					return null;

				while ( result == Result.Pending )
				{
					await Task.Delay( 10 );

					if ( stopwatch.Elapsed.TotalSeconds > timeoutSeconds )
					{
						ticket.Cancel();
						return null;
					}
				}

				if ( result == Result.OK )
					return ticket;

				ticket.Cancel();
				return null;
			}
			finally
			{
				OnGetTicketForWebApiResponse -= f;
			}
		}

		public static unsafe BeginAuthResult BeginAuthSession( byte[] ticketData, SteamId steamid )
		{
			fixed ( byte* ptr = ticketData )
			{
				return Internal.BeginAuthSession( (IntPtr) ptr, ticketData.Length, steamid );
			}
		}

		public static void EndAuthSession( SteamId steamid ) => Internal.EndAuthSession( steamid );

		// UserHasLicenseForApp - SERVER VERSION ( DLC CHECKING )

		/// <summary>
		/// Checks if the current users looks like they are behind a NAT device.
		/// This is only valid if the user is connected to the Steam servers and may not catch all forms of NAT.
		/// </summary>
		public static bool IsBehindNAT => Internal.BIsBehindNAT();

		/// <summary>
		/// Gets the Steam level of the user, as shown on their Steam community profile.
		/// </summary>
		public static int SteamLevel => Internal.GetPlayerSteamLevel();

		/// <summary>
		/// Requests a URL which authenticates an in-game browser for store check-out, and then redirects to the specified URL.
		/// As long as the in-game browser accepts and handles session cookies, Steam microtransaction checkout pages will automatically recognize the user instead of presenting a login page.
		/// NOTE: The URL has a very short lifetime to prevent history-snooping attacks, so you should only call this API when you are about to launch the browser, or else immediately navigate to the result URL using a hidden browser window.
		/// NOTE: The resulting authorization cookie has an expiration time of one day, so it would be a good idea to request and visit a new auth URL every 12 hours.
		/// </summary>
		public static async Task<string> GetStoreAuthUrlAsync( string url )
		{
			var response = await Internal.RequestStoreAuthURL( url );
			if ( !response.HasValue )
				return null;

			return response.Value.URLUTF8();
		}

		/// <summary>
		/// Checks whether the current user has verified their phone number.
		/// </summary>
		public static bool IsPhoneVerified => Internal.BIsPhoneVerified();

		/// <summary>
		/// Checks whether the current user has Steam Guard two factor authentication enabled on their account.


lsp/snippets.dart';
import 'package:analysis_server/src/protocol_server.dart' as server;
import 'package:test/test.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';

void main() {
  defineReflectiveSuite(() {
    defineReflectiveTests(SnippetsTest);
    defineReflectiveTests(SnippetBuilderTest);
  });
}

@reflectiveTest
class SnippetBuilderTest {
  Future<void> test_appendChoice() async {
    var builder = SnippetBuilder()
      ..appendChoice({r'a'})
      ..appendChoice({r'a', r'b'})
      ..appendChoice({}, placeholderNumber: 6)
      ..appendChoice({r'aaa', r'bbb'}, placeholderNumber: 12)
      ..appendChoice({r'aaa', r'bbb \ bbb $ bbb | bbb , bbb } bbb'});

    expect(
      builder.value,
      r'${1:a}'
      r'${2|a,b|}'
      r'$6'
      r'${12|aaa,bbb|}'
      // Only pipes (delimiter), comma (separator) and backslashes (the escape
      // character) are escaped in choices. Not dollars or braces.
      // https://github.com/microsoft/vscode/issues/201059
      r'${13|aaa,bbb \\ bbb $ bbb \| bbb \, bbb } bbb|}',
    );
  }

  Future<void> test_appendPlaceholder() async {
    var builder = SnippetBuilder()
      ..appendPlaceholder(r'placeholder $ 1')
      ..appendPlaceholder(r'')
      ..appendPlaceholder(r'placeholder } 3', placeholderNumber: 6);

    expect(
      builder.value,
      r'${1:placeholder \$ 1}'
      r'$2'
      r'${6:placeholder \} 3}',
    );
  }

  Future<void> test_appendTabStop() async {
    var builder = SnippetBuilder()
      ..appendTabStop()
      ..appendTabStop(placeholderNumber: 10)
      ..appendTabStop();

    expect(
      builder.value,
      r'$1'
      r'$10'
      r'$11',
    );
  }

  Future<void> test_appendText() async {
    var builder = SnippetBuilder()
      ..appendText(r'text 1')
      ..appendText(r'text ${that needs} escaping $0')
      ..appendText(r'text 2');

    expect(
      builder.value,
      r'text 1'
      r'text \${that needs} escaping \$0'
      r'text 2',
    );
  }

  Future<void> test_extension_appendPlaceholders() async {
    var code = r'''
012345678
012345678
012345678
012345678
012345678
''';

    var placeholders = [
      lsp.SnippetPlaceholder(2, 2),
      lsp.SnippetPlaceholder(32, 2, linkedGroupId: 123),
      lsp.SnippetPlaceholder(12, 2, isFinal: true),
      lsp.SnippetPlaceholder(42, 2, linkedGroupId: 123),
      lsp.SnippetPlaceholder(22, 2, suggestions: ['aaa', 'bbb']),
    ];

    var builder = SnippetBuilder()
      ..appendPlaceholders(code, placeholders, isPreSorted: false);

    expect(builder.value, r'''
01${1:23}45678
01${0:23}45678
01${2|23,aaa,bbb|}45678
01${3:23}45678
01${3:23}45678
''');
  }

  Future<void> test_mixed() async {
    var builder = SnippetBuilder()
      ..appendText('text1')
      ..appendPlaceholder('placeholder')
      ..appendText('text2')
      ..appendChoice({'aaa', 'bbb'})
      ..appendText('text3')
      ..appendTabStop()
      ..appe


NESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
 */
#endregion

using System;
using HeuristicLab.Core;
using HEAL.Attic;

namespace HeuristicLab.Optimization {
  [StorableType("5a9cf334-4815-4f0e-a2f8-f3d4edfcc829")]
  internal interface ISingleObjectiveEvaluationOperator : ISingleObjectiveEvaluator, IEncodingOperator {
    Func<Individual, IRandom, double> EvaluateFunc { get; set; }
  }
}


="6" id="f-575">648</ix:nonFraction>)	(<ix:nonFraction unitRef="usd" contextRef="c-11" decimals="-6" name="us-gaap:InvestmentIncomeInterestAndDividend" scale="6" id="f-576">540</ix:nonFraction>)	(<ix:nonFraction unitRef="usd" contextRef="c-12" decimals="-6" name="us-gaap:InvestmentIncomeInterestAndDividend" scale="6" id="f-577">186</ix:nonFraction>)

Interest expense, net	$	<ix:nonFraction unitRef="usd" contextRef="c-1" decimals="-6" sign="-" name="us-gaap:InterestIncomeExpenseNonoperatingNet" format="ixt:num-dot-decimal" scale="6" id="f-578">2,160</ix:nonFraction> 	<span style="color:#000000;font-family:'Calibri',sans-s


2; i++)
                if (fonts[i])
                    unifont_destroy(fonts[i]);
            return dupprintf("无法加载宽字体 \"%s\"", fs->name);
        }
    } else {
        fonts[2] = NULL;
    }

    fs = conf_get_fontspec(conf, CONF_wideboldfont);
    if (shadowbold || !fs->name[0]) {
        fonts[3] = NULL;
    } else {
        fonts[3] = multifont_create(inst->area, fs->name, true, true,
                                    shadowboldoffset, shadowbold);
        if (!fonts[3]) {
            for (i = 0; i < 3; i++)
                if (fonts[i])
                    unifont_destroy(fonts[i]);
            return dupprintf("无法加载加粗字体 \"%s\"", fs->name);
        }
    }

    /*
     * Now we've got past all the possible error conditions, we can
     * actually update our state.
     */

    for (i = 0; i < 4; i++) {
        if (inst->fonts[i])
            unifont_destroy(inst->fonts[i]);
        inst->fonts[i] = fonts[i];
    }

    if (inst->font_width != inst->fonts[0]->width ||
        inst->font_height != inst->fonts[0]->height) {

        inst->font_width = inst->fonts[0]->width;
        inst->font_height = inst->fonts[0]->height;

        /*
         * The font size has changed, so force the next call to
         * drawing_area_setup to regenerate the backing surface.
         */
        inst->drawing_area_setup_needed = true;
    }

    inst->direct_to_font = init_ucs(&inst->ucsdata,
                                    conf_get_str(inst->conf, CONF_line_codepage),
                                    conf_get_bool(inst->conf, CONF_utf8_override),
                                    inst->fonts[0]->public_charset,
                                    conf_get_int(inst->conf, CONF_vtmode));

    inst->drawtype = inst->fonts[0]->preferred_drawtype;

    return NULL;
}

#if GTK_CHECK_VERSION(3,0,0)
struct find_app_menu_bar_ctx {
    GtkWidget *area, *menubar;
};
static void find_app_menu_bar(GtkWidget *widget, gpointer data)
{
    struct find_app_menu_bar_ctx *ctx = (struct find_app_menu_bar_ctx *)data;
    if (widget != ctx->area && GTK_IS_MENU_BAR(widget))
        ctx->menubar = widget;
}
#endif

static void compute_geom_hints(GtkFrontend *inst, GdkGeometry *geom)
{
    /*
     * Unused fields in geom.
     */
    geom->max_width = geom->max_height = -1;
    geom->min_aspect = geom->max_aspect = 0;

    /*
     * Set up the geometry fields we care about, with reference to
     * just the drawing area. We'll correct for other widgets in a
     * moment.
     */
    geom->min_width = inst->font_width + 2*inst->window_border;
    geom->min_height = inst->font_height + 2*inst->window_border;
    geom->base_width = 2*inst->window_border;
    geom->base_height = 2*inst->window_border;
    geom->width_inc = inst->font_width;
    geom->height_inc = inst->font_height;

    /*
     * If we've got a scrollbar visible, then we must include its
     * width as part of the base and min width, and also ensure that
     * our window's minimum height is at least the height required by
     * the scrollbar.
     *
     * In the latter case, we must also take care to arrange that
     * (geom->min_height - geom->base_height) is an integer multiple of
     * geom->height_inc, because if it's not, then some window managers
     * (we know of xfwm4) get confused, with the effect that they
     * resize our window to a height based on min_height instead of
     * base_height, which we then round down and the window ends up
     * too short.
     */
    if (inst->sbar_visible) {
        GtkRequisition req;
        int min_sb_height;

#if GTK_CHECK_VERSION(3,0,0)
        gtk_widget_get_preferred_size(inst->sbar, &req, NULL);
#else
        gtk_widget_size_request(inst->sbar, &req);
#endif

        /* Compute rounded-up scrollbar height. */
        min_sb_height = req.height;
        min_sb_height += geom->height_inc - 1;
        min_sb_height -= ((min_sb_height - geom->base_height%geom->height_inc)
                          % geom->height_inc);

        geom->min_width += req.width;
        geom->base_width += req.width;
        if (geom->min_height < min_sb_height)
            geom->min_height = min_sb_height;
    }

#if GTK_CHECK_VERSION(3,0,0)
    /*
     * And if we're running a main-gtk-application.c based program and
     * GtkApplicationWindow has given us a menu bar inside the window,
     * then we must take that into account as well.
     *
     * In its unbounded wisdom, GtkApplicationWindow doesn't actually
     * give us a direc


 pem.Encode(&buf, &pem.Block{Type: "CERTIFICATE", Bytes: bs})
	if err != nil {
		return nil, fmt.Errorf("error encoding CA certificate: %v", err)
	}
	return &CaCert{
		PEM:      buf.String(),
		Template: &template,
		Signer:   signer,
	}, nil
}

// privateKey returns a new ECDSA-based private key. Both a crypto.Signer
// and the key in PEM format are returned.
func privateKey() (crypto.Signer, string, error) {
	pk, err := ecdsa.GenerateKey(elliptic.P256(), rand.Reader)
	if err != nil {
		return nil, "", err
	}

	bs, err := x509.MarshalECPrivateKey(pk)
	if err != nil {
		return nil, "", err
	}

	var buf bytes.Buffer
	err = pem.Encode(&buf, &pem.Block{Type: "EC PRIVATE KEY", Bytes: bs})
	if err != nil {
		return nil, "", err
	}

	return pk, buf.String(), nil
}

// serialNumber generates a new random serial number.
func serialNumber() (*big.Int, error) {
	return rand.Int(rand.Reader, (&big.Int{}).Exp(big.NewInt(2), big.NewInt(159), nil))
}
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: BUSL-1.1

package server

import (
	"fmt"
	"reflect"
	"strings"
	"testing"

	"github.com/hashicorp/vault/internalshared/configutil"
	"github.com/stretchr/testify/require"
)

func TestLoadConfigFile(t *testing.T) {
	testLoadConfigFile(t)
}

func TestLoadConfigFile_json(t *testing.T) {
	testLoadConfigFile_json(t)
}

func TestLoadConfigFileIntegerAndBooleanValues(t *testing.T) {
	testLoadConfigFileIntegerAndBooleanValues(t)
}

func TestLoadConfigFileIntegerAndBooleanValuesJson(t *testing.T) {
	testLoadConfigFileIntegerAndBooleanValuesJson(t)
}

func TestLoadConfigFileWithLeaseMetricTelemetry(t *testing.T) {
	testLoadConfigFileLeaseMetrics(t)
}

func TestLoadConfigDir(t *testing.T) {
	testLoadConfigDir(t)
}

func TestConfig_Sanitized(t *testing.T) {
	testConfig_Sanitized(t)
}

func TestParseListeners(t *testing.T) {
	testParseListeners(t)
}

func TestParseUserLockouts(t *testing.T) {
	testParseUserLockouts(t)
}

func TestParseSockaddrTemplate(t *testing.T) {
	testParseSockaddrTemplate(t)
}

func TestConfigRaftRetryJoin(t *testing.T) {
	testConfigRaftRetryJoin(t)
}

func TestParseSeals(t *testing.T) {
	testParseSeals(t)
}

func TestParseStorage(t *testing.T) {
	testParseStorageTemplate(t)
}

// TestParseStorageURLConformance tests that all config attrs whose values can be
// URLs, IP addresses, or host:port addresses, when configured with an IPv6
// address, the normalized to be conformant with RFC-5942 §4
// See: https://rfc-editor.org/rfc/rfc5952.html
func TestParseStorageURLConformance(t *testing.T) {
	testParseStorageURLConformance(t)
}

// TestConfigWithAdministrativeNamespace tests that .hcl and .json configurations are correctly parsed when the administrative_namespace_path is present.
func TestConfigWithAdministrativeNamespace(t *testing.T) {
	testConfigWithAdministrativeNamespaceHcl(t)
	testConfigWithAdministrativeNamespaceJson(t)
}

func TestUnknownFieldValidation(t *testing.T) {
	testUnknownFieldValidatio


ulate factorial w/ recursion".printHeading()
      val arg = 5
      println("${::fact.name}($arg)".magenta() + " = ".yellow() + "${fact(arg)}".cyan())
    }

  }

  /**
   * Use the process of induction to figure the min number of coins it takes to come up with the
   * given [total]. The coin denominations you can used are in [denominations]; this list must
   * be sorted already (in descending order), eg: [11, 7, 5, 1].
   * [coinsUsedMap] has keys that represent the denomination, and value that represent the number of
   * coins used of that denomination.
   */
  fun numCoins(
    total: Int,
    denominations: List<Int>,
    coinsUsedMap: MutableMap<Int, Int>
  ): Int {
    // Show the function call stack.
    println(
      "🪙 numCoins(total=$total, denominations=$denominations) ⇢ ".magenta()
        + " $coinsUsedMap ".bgBrightCyan().black().bold()
    )

    // Stop recursion when these simple exit conditions are met.
    if (total == 0) return 0
    if (denominations.isEmpty()) return 0

    // Breakdown the problem further.
    val coinDenomination = denominations[0]
    val coinsUsed = total / coinDenomination

    // Remember how many coins of which denomination are used.
    if (coinsUsed > 0) coinsUsedMap.computeIfAbsent(coinDenomination) { coinsUsed }

    // Breakdown the problem into smaller chunk using recursion.
    return coinsUsed +
      numCoins(
        total = total - coinsUsed * coinDenomination,
        denominations = with(denominations) { subList(1, size) },
        coinsUsedMap = coinsUsedMap
      )
  }

  /**
   * Brute force version of the recursive function [numCoins] above.
   *
   * - As you can see, there's a lot more code and complexity to compensate
   *   for very simplistic logic.
   * - The coin denominations are hard coded to be 1, 5, 7, 11.
   */
  fun numCoins_nonrecursive(total: Int, coins: Coins) {
    // Exit condition
    if (total == 0) return

    var currencyRemoved = 0

    // Remove all the 11 coins.
    val numberOf11s = (total / 11)
    if (numberOf11s > 0) {
      coins.numberOf11s += numberOf11s
      currencyRemoved += numberOf11s * 11
    }

    // Remove all the 7 coins.
    val numberOf7s = (total - currencyRemoved) / 7
    if (numberOf7s > 0) {
      coins.numberOf7s += numberOf7s
      currencyRemoved += numberOf7s * 7
    }

    // Remove all the 5 coins.
    val numberOf5s = (total - currencyRemoved) / 5
    if (numberOf5s > 0) {
      coins.numberOf5s += numberOf5s
      currencyRemoved += numberOf5s * 5
    }

    // Remove all the 1 coins.
    val numberOf1s = (total - currencyRemoved) / 1
    if (numberOf1s > 0) {
      coins.numberOf1s += numberOf1s
      currencyRemoved += numberOf1s * 1
    }

  }

  data class Coins(
    var numberOf1s: Int = 0,
    var numberOf5s: Int = 0,
    var numberOf7s: Int = 0,
    var numberOf11s: Int = 0
  ) {
    override fun toString() = StringBuilder().apply {
      val result = mutableListOf<String>()
      arrayOf(
        ::numberOf1s,
        ::numberOf5s,
        ::numberOf7s,
        ::numberOf11s
      ).forEach {
        if (it.get() > 0)
          result += it.name.blue() +
            " x ".yellow() +
            " ${it.get()} ".bgBrightYellow().black()
      }
      append(result.joinToString(", ", "{", "}"))
    }.toString()
  }

  fun fact(n: Int): Int = if (n ==


="M-10.7-10.7h61.8v59.6h-61.8z"></path></g></svg>

                        Excellent

            J avais l habitude de faire la ratatouille comme ma belle mère qui était de Grasse. Puis pendant longtemps j ai oublié ce plat et là de nouveau avec la chaleur de cet été rebelotte et j ai suivi votre recette et mon mari conquis car encore mieux que sa maman... C est dire????

                    Signaler

            Chanou94 -  3 juin 2019

                            <svg width="16" height="16" fill="#f6303e" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 39.9 37.7"><defs><path id="aa" d="M13.8 12.3s-7.7.9-12.8 1.4c-.5 0-1 .2-1 .7 0 .5 0 .9.2 1.2 3.9 3.3 9.4 8.5 9.4 8.5S8.2 31.4 7 36.3c0 .5 0 .9.5 1.2.5.2 1 .2 1.4 0 4.3-2.4 11.1-6.1 11.1-6.1s6.8 3.8 11.1 6.1c.5.2 1 .2 1.2 0 .5-.2.5-.7.5-1.2-1-5-2.7-12.3-2.7-12.3s5.8-5 9.4-8.5c.2-.2.5-.7.2-1.2-.2-.5-.5-.7-1-.7-5.1-.5-12.8-1.4-12.8-1.4S22.8 5.4 20.6.9c-.1-.2-.3-.9-.9-1-.5 0-.8.2-1.1.7-1.7 4.8-4.8 11.7-4.8 11.7z"></path></defs><use xlink:href="#aa" overflow="visible"></use><clipPath id="bb"><use xlink:href="#aa" overflow="visible"></use></clipPath><g clip-path="url(#bb)"><defs><path id="cc" d="M-227.5-4735.4h2239.7v8919.6H-227.5z"></path></defs><use xlink:href="#cc" overflow="visible"></use><clipPath id="dd"><use xlink:href="#cc" overflow="visible"></use></clipPath><path clip-path="url(#dd)" d=


.login-content{padding:1em;text-align:right}.card.card-primary.login-panel .login-submit{text-align:left}.card.card-primary p.btn-link{margin:1rem}.panel{background-color:#fff;box-shadow:-8px 8px #eeeff7}.panel>.card-body+.table,.panel>.card-body+.table-responsive{border-top:1px solid #eeeff7}.box-widget .box-widget-card{background-color:#fff;border-radius:4px;box-shadow:0 2px 6px rgba(0,0,0,.2);color:#1e1e1e;font-size:14px;font-weight:400;height:180px;margin:0 10px 20px;padding:15px 20px;position:relative;vertical-align:middle;width:240px}.box-widget .box-widget-card .box-widget-card-body{display:flex;flex-direction:column;height:100%}.box-widget .box-widget-card .box-widget-card-header{cursor:pointer}.box-widget .box-widget-card .box-widget-card-header .box-widget-card-title{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;font-size:18px;font-weight:400;line-height:24px;margin:0;max-height:100%;overflow:hidden;text-overflow:ellipsis;white-space:normal}.box-widget .box-widget-card .box-widget-card-text{cursor:pointer;margin-top:6px}.box-widget .box-widget-card .box-widget-card-text [class*=" ri-"],.box-widget .box-widget-card .box-widget-card-text [class^=ri-]{vertical-align:0}.box-widget .box-widget-card .box-widget-card-text .box-widget-card-date{color:#6e748c;font-size:12px;line-height:16px}.box-widget .box-widget-card .box-widget-card-text .box-widget-card-status{color:#6e748c;font-size:12px;line-height:14px;margin-top:4px}.box-widget .box-widget-card .box-widget-card-text .box-widget-card-status i:before{align-content:end;display:inline-block;font-size:1.1em;height:16px;text-align:center;width:16px}.box-widget .box-widget-card .box-widget-card-footer{display:flex;flex-direction:column;flex-grow:1;justify-content:flex-end;outline:none}.box-widget .box-widget-card .box-widget-card-footer .box-widget-card-footer-items{align-items:baseline;display:flex;justify-content:space-between}.box-widget .box-widget-card .box-widget-card-footer .box-widget-card-footer-items .box-widget-card-footer-response{color:#6e748c;font-size:14px;line-height:20px}.box-widget .box-widget-card .box-widget-card-footer .icons{display:inline-flex;font-size:2em;font-weight:400}.box-widget .box-widget-card .box-widget-card-footer .icons a.active{color:#6f42c1;outline:none}.box-widget .box-widget-card .box-widget-card-footer .icons a.active i:before{display:inline-block;font-size:.9em;height:24px;width:24px}.box-widget .box-widget-card .box-widget-card-footer .icons .dropdown.ls-action_dropdown{margin:0 8px 0 0;padding:0;width:32px}.box-widget .box-widget-card .box-widget-card-footer .icons .dropdown.ls-action_dropdown button,.box-widget .box


import graphene
from django.core.exceptions import ValidationError

from ....channel.error_codes import ChannelErrorCode
from ....permission.enums import ChannelPermissions
from ....webhook.event_types import WebhookEventAsyncType
from ...core import ResolveInfo
from ...core.doc_category import DOC_CATEGORY_CHANNELS
from ...core.mutations import BaseMutation
from ...core.types import ChannelError
from ...core.utils import WebhookEventInfo
from ...plugins.dataloaders import get_plugin_manager_promise
from ..types import Channel

class ChannelActivate(BaseMutation):
    channel = graphene.Field(Channel, description="Activated channel.")

    class Arguments:
        id = graphene.ID(required=True, description="ID of the channel to activate.")

    class Meta:
        description = "Activate a channel."
        doc_category = DOC_CATEGORY_CHANNELS
        permissions = (ChannelPermissions.MANAGE_CHANNELS,)
        error_type_class = ChannelError
        error_type_field = "channel_errors"
        webhook_events_info = [
            WebhookEventInfo(
                type=WebhookEventAsyncType.CHANNEL_STATUS_CHANGED,
                description="A channel was activated.",
            ),
        ]

    @classmethod
    def clean_channel_availability(cls, channel):
        if channel.is_active:
            raise ValidationError(
                {
                    "id": ValidationError(
                        "This channel is already activated.",
                        code=ChannelErrorCode.INVALID.value,
                    )
                }
            )

    @classmethod
    def perform_mutation(cls, _root, info: ResolveInfo, /, **data):
        channel = cls.get_node_or_error(info, data["id"], only_type=Channel)
        cls.clean_channel_availability(channel)
        channel.is_active = True
        channel.save(update_fields=["is_active"])
        manager = get_plugin_manager_promise(info.context).get()
        cls.call_event(manager.channel_status_changed, channel)
        return ChannelActivate(channel=channel)