: 'imgSize'},
    {'1': 'top_right_icon', '3': 5, '4': 1, '5': 9, '10': 'topRightIcon'},
    {
      '1': 'play_gif_thumbnail',
      '3': 6,
      '4': 1,
      '5': 8,
      '10': 'playGifThumbnail'
    },
  ],
};

/// Descriptor for `Picture`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List pictureDescriptor = $convert.base64Decode(
    'CgdQaWN0dXJlEhcKB2ltZ19zcmMYASABKAlSBmltZ1NyYxIbCglpbWdfd2lkdGgYAiABKAFSCG'
    'ltZ1dpZHRoEh0KCmltZ19oZWlnaHQYAyABKAFSCWltZ0hlaWdodBIZCghpbWdfc2l6ZRgEIAEo'
    'AVIHaW1nU2l6ZRIkCg50b3BfcmlnaHRfaWNvbhgFIAEoCVIMdG9wUmlnaHRJY29uEiwKEnBsYX'
    'lfZ2lmX3RodW1ibmFpbBgGIAEoCFIQcGxheUdpZlRodW1ibmFpbA==');

@$core.Deprecated('Use pictureListReqDescriptor instead')
const PictureListReq$json = {
  '1': 'PictureListReq',
  '2': [
    {'1': 'oid', '3': 1, '4': 1, '5': 3, '10': 'oid'},
    {'1': 'type', '3': 2, '4': 1, '5': 3, '10': 'type'},
    {'1': 'extra', '3': 3, '4': 1, '5': 9, '10': 'extra'},
    {'1': 'after_rpid', '3': 4, '4': 1, '5': 3, '10': 'afterRpid'},
    {
      '1': 'mode',
      '3': 5,
      '4': 1,
      '5': 14,
      '6': '.bilibili.main.community.reply.v1.Mode',
      '10': 'mode'
    },
    {
      '1': 'pagination',
      '3': 6,
      '4': 1,
      '5': 11,
      '6': '.bilibili.pagination.FeedPagination',
      '10': 'pagination'
    },
    {'1': 'session_id', '3': 7, '4': 1, '5': 9, '10': 'sessionId'},
    {
      '1': 'main_list_session_id',
      '3': 8,
      '4': 1,
      '5': 9,
      '10': 'mainListSessionId'
    },
  ],
};

/// Descriptor for `PictureListReq`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List pictureListReqDescriptor = $convert.base64Decode(
    'Cg5QaWN0dXJlTGlzdFJlcRIQCgNvaWQYASABKANSA29pZBISCgR0eXBlGAIgASgDUgR0eXBlEh'
    'QKBWV4dHJhGAMgASgJUgVleHRyYRIdCgphZnRlcl9ycGlkGAQgASgDUglhZnRlclJwaWQSOgoE'
    'bW9kZRgFIAEoDjImLmJpbGliaWxpLm1haW4uY29tbXVuaXR5LnJlcGx5LnYxLk1vZGVSBG1vZG'
    'USQwoKcGFnaW5hdGlvbhgG


//	**************************************************************************************
//	File:			LeashDoc.h
//	By:				Arthur David Leather
//	Created:		12/02/98
//	Copyright		@1998 Massachusetts Institute of Technology - All rights reserved.
//	Description:    H file for LeashDoc.cpp. Contains variables and functions
//					for Leash
//
//	History:
//
//	MM/DD/YY	Inits	Description of Change
//	12/02/98	ADL		Original
//	**************************************************************************************

#if !defined(AFX_LeashDOC_H__6F45AD97_561B_11D0_8FCF_00C04FC2A0C2__INCLUDED_)
#define AFX_LeashDOC_H__6F45AD97_561B_11D0_8FCF_00C04FC2A0C2__INCLUDED_

#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000

class LeashDoc : public CDocument
{
protected: // create from serialization only
	LeashDoc();
	DECLARE_DYNCREATE(LeashDoc)

// Attributes
public:

// Operations
public:

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(LeashDoc)
	public:
	virtual BOOL OnNewDocument();
	virtual void Serialize(CArchive& ar);
	//}}AFX_VIRTUAL

// Implementation
public:
	virtual ~LeashDoc();
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

protected:

// Generated message map functions
protected:
	//{{AFX_MSG(LeashDoc)
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_LeashDOC_H__6F45AD97_561B_11D0_8FCF_00C04FC2A0C2__INCLUDED_)


/*
    GTK hotkeys configuration for Deadbeef player
    Copyright (C) 2009-2013 Oleksiy Yakovenko and other contributors

    This software is provided 'as-is', without any express or implied
    warranty.  In no event will the authors be held liable for any damages
    arising from the use of this software.

    Permission is granted to anyone to use this software for any purpose,
    including commercial applications, and to alter it and redistribute it
    freely, subject to the following restrictions:

    1. The origin of this software must not be misrepresented; you must not
     claim that you wrote the original software. If you use this software
     in a product, an acknowledgment in the product documentation would be
     appreciated but is not required.

    2. Altered source versions must be plainly marked as such, and must not be
     misrepresented as being the original software.

    3. This notice may not be removed or altered from any source distribution.
*/

#ifndef __GTKUI_HOTKEYS_H
#define __GTKUI_HOTKEYS_H

extern int gtkui_hotkeys_changed;

void
prefwin_init_hotkeys (GtkWidget *prefwin);

void
init_action_tree (GtkWidget *actions, const char *act, int ctx);

DB_plugin_action_t *
find_action_by_name (const char *command);

void
set_button_action_label (const char *act, int action_ctx, GtkWidget *button);

void
gtkui_set_default_hotkeys (void);

void
gtkui_import_0_5_global_hotkeys (void);

#endif // __GTKUI_HOTKEYS_H


0821F6AC:: @ 0821F6AC
	.incbin "baserom.gba", 0x21F6AC, 0x0000078

gUnk_0821F724:: @ 0821F724
	.incbin "baserom.gba", 0x21F724, 0x000001C

gUnk_0821F740:: @ 0821F740
	.incbin "baserom.gba", 0x21F740, 0x0000160

gUnk_0821F8A0:: @ 0821F8A0
	.incbin "baserom.gba", 0x21F8A0, 0x0000078

gUnk_0821F918:: @ 0821F918
	.incbin "baserom.gba", 0x21F918, 0x000001C

gUnk_0821F934:: @ 0821F934
	.incbin "baserom.gba", 0x21F934, 0x00001AC

gUnk_0821FAE0:: @ 0821FAE0
	.incbin "baserom.gba", 0x21FAE0, 0x0000078

gUnk_0821FB58:: @ 0821FB58
	.incbin "baserom.gba", 0x21FB58, 0x000001C

gUnk_0821FB74:: @ 0821FB74
	.incbin "baserom.gba", 0x21FB74, 0x00000F0

gUnk_0821FC64:: @ 0821FC64
	.incbin "baserom.gba", 0x21FC64, 0x0000078

gUnk_0821FCDC:: @ 0821FCDC
	.incbin "baserom.gba", 0x21FCDC, 0x000001C

gUnk_0821FCF8:: @ 0821FCF8
	.incbin "baserom.gba", 0x21FCF8, 0x00001AC

gUnk_0821FEA4:: @ 0821FEA4
	.incbin "baserom.gba", 0x21FEA4, 0x000005F

gUnk_0821FF03:: @ 0821FF03
	.incbin "baserom.gba", 0x21FF03, 0x0000013

gUnk_0821FF16:: @ 0821FF16
	.incbin "baserom.gba", 0x21FF16, 0x0000006

gUnk_0821FF1C:: @ 0821FF1C
	.incbin "baserom.gba", 0x21FF1C, 0x000001C

gUnk_0821FF38:: @ 0821FF38
	.incbin "baserom.gba", 0x21FF38, 0x00000EE

gUnk_08220026:: @ 08220026
	.incbin "baserom.gba", 0x220026, 0x00000B6

gUnk_082200DC:: @ 082200DC
	.incbin "baserom.gba", 0x2200DC, 0x0000034

gUnk_08220110:: @ 08220110
	.incbin "baserom.gba", 0x220110, 0x0000044

gUnk_08220154:: @ 08220154
	.incbin "baserom.gba", 0x220154, 0x000001C

gUnk_08220170:: @ 08220170
	.incbin "baserom.gba", 0x220170, 0x0000184

gUnk_082202F4:: @ 082202F4
	.incbin "baserom.gba", 0x2202F4, 0x000001C

gUnk_08220310:: @ 08220310
	.incbin "baserom.gba", 0x220310, 0x000005C

gUnk_0822036C:: @ 0822036C
	.incbin "baserom.gba", 0x22036C, 0x000001C

gUnk


1.v));
  g_v(&(f2));
  g_v(&(f3[0]));
  g_m(&(f1.m));
  g_m(&(f4));
}
)";

    DataMap data;
    auto got = Run<PackedVec3>(src, data);

    EXPECT_EQ(expect, str(got));
}

TEST_F(PackedVec3Test, WriteVec3Swizzle_FromRef) {
    auto* src = R"(
@group(0) @binding(0) var<storage, read_write> v : vec3<f32>;

fn f() {
  v = v.zyx;
}
)";

    auto* expect = R"(
enable chromium_internal_relaxed_uniform_layout;

@group(0) @binding(0) var<storage, read_write> v : __packed_vec3<f32>;

fn f() {
  v = __packed_vec3<f32>(vec3<f32>(v).zyx);
}
)";

    DataMap data;
    auto got = Run<PackedVec3>(src, data);

    EXPECT_EQ(expect, str(got));
}

TEST_F(PackedVec3Test, WriteVec3Swizzle_FromValue) {
    auto* src = R"(
@group(0) @binding(0) var<storage, read_write> v : vec3<f32>;

fn f() {
  v = vec3f(1, 2, 3).zyx;
}
)";

    auto* expect = R"(
enable chromium_internal_relaxed_uniform_layout;

@group(0) @binding(0) var<storage, read_write> v : __packed_vec3<f32>;

fn f() {
  v = __packed_vec3<f32>(vec3f(1, 2, 3).zyx);
}
)";

    DataMap data;
    auto got = Run<PackedVec3>(src, data);

    EXPECT_EQ(expect, str(got));
}

TEST_F(PackedVec3Test, WriteVec3Component_FromPackedValueIndexAccessor) {
    auto* src = R"(
struct S {
  v : vec3<f32>
}

@group(0) @binding(0) var<storage, read_write> s : S;

fn g() -> S {
  return S();
}

fn f() {
  s.v[0] = g().v[1];
}
)";

    auto* expect = R"(
enable chromium_internal_relaxed_uniform_layout;

struct S_tint_packed_vec3 {
  @align(16)
  v : __packed_vec3<f32>,
}

struct S {
  v : vec3<f32>,
}

@group(0) @binding(0) var<storage, read_write> s : S_tint_packed_vec3;

fn g() -> S {
  return S();
}

fn f() {
  s.v[0] = g().v[1];
}
)";

    DataMap data;
    auto got = Run<PackedVec3>(src, data);

    EXPECT_EQ(expect, str(got));
}

TEST_F(PackedVec3Test, ExtractVec3FromStructValueExpression) {
    auto* src = R"(
struct S {
  v : vec3<f32>
}

@group(0) @binding(0) var<storage, read_write> buffer : S;

fn f() {
  var v_var : vec3<f32> = S().v;
  let v_let : vec3<f32> = S().v;
  v_var = S().v;
  v_var = S().v * 2.0;
  buffer = S(S().v);
}
)";

    auto* expect = R"(
enable chromium_internal_relaxed_uniform_layout;

struct S_tint_packed_vec3 {
  @align(16)
  v : __packed_vec3<f


separation", 0);

	title = memnew(RichTextLabel);
	title->set_theme_type_variation("EditorHelpBitTitle");
	title->set_custom_minimum_size(Size2(640 * EDSCALE, 0)); // GH-93031. Set the minimum width even if `fit_content` is true.
	title->set_fit_content(true);
	title->set_selection_enabled(p_allow_selection);
	title->set_context_menu_enabled(p_allow_selection);
	title->set_selection_modifier(callable_mp_static(_replace_nbsp_with_space));
	title->connect("meta_clicked", callable_mp(this, &EditorHelpBit::_meta_clicked));
	title->hide();
	add_child(title);

	content_min_height = 48 * EDSCALE;
	content_max_height = 360 * EDSCALE;

	content = memnew(RichTextLabel);
	content->set_theme_type_variation("EditorHelpBitContent");
	content->set_custom_minimum_size(Size2(640 * EDSCALE, content_min_height));
	content->set_selection_enabled(p_allow_selection);
	content->set_context_menu_enabled(p_allow_selection);
	content->set_selection_modifier(callable_mp_static(_replace_nbsp_with_space));
	content->connect("meta_clicked", callable_mp(this, &EditorHelpBit::_meta_clicked));
	add_child(content);

	use_class_prefix = p_use_class_prefix;

	if (!p_symbol.is_empty()) {
		parse_symbol(p_symbol, p_prologue);
	} else if (!p_prologue.is_empty()) {
		set_custom_text(String(), String(), p_prologue);
	}
}

/// EditorHelpBitTooltip ///

bool EditorHelpBitTooltip::_is_tooltip_visible = false;

Control *EditorHelpBitTooltip::_make_invisible_control() {
	Control *control = memnew(Control);
	control->set_visible(false);
	return control;
}

void EditorHelpBitTooltip::_start_timer() {
	if (timer->is_inside_tree() && timer->is_stopped()) {
		timer->start();
	}
}

void EditorHelpBitTooltip::_target_gui_input(const Ref<InputEvent> &p_event) {
	// Only scrolling is not checked in `NOTIFICATION_INTERNAL_PROCESS`.
	const Ref<InputEventMouseButton> mb = p_event;
	if (mb.is_valid()) {
		switch (mb->get_button_index()) {
			case MouseButton::WHEEL_UP:
			case MouseButton::WHEEL_DOWN:
			case MouseButton::WHEEL_LEFT:
			case MouseButton::WHEEL_RIGHT:
				queue_free();
				break;
			default:
				break;
		}
	}
}

void EditorHelpBitTooltip::_notification(int p_what) {
	switch (p_what) {
		case NOTIFICATION_ENTER_TREE:
			_is_tooltip_visible = true;
			_enter_tree_time = OS::get_singleton()->get_ticks_msec();
			break;
		case NOTIFICATION_EXIT_TREE:
			_is_tooltip_visible = false;
			break;
		case NOTIFICATION_WM_MOUSE_ENTER:
			_is_mouse_inside_tooltip = true;
			timer->stop();
			break;
		case NOTIFICATION_WM_MOUSE_EXIT:
			_is_mouse_inside_tooltip = false;
			_start_timer();
			break;
		case NOTIFICATION_INTERNAL_PROCESS:
			// A workaround to hide the tooltip since the window does not receive keyboard events
			// with `FLAG_POPUP` and `FLAG_NO_FOCUS` flags, so we can't use `_input_from_window()`.


       | ${"every"}       | ${"every"}       | ${[]}           | ${""}
    ${"every weds, Fris"}             | ${"task"} | ${"every"} | ${[3, 5]}                | ${"every"}       | ${"every"}       | ${[]}           | ${""}
    ${"every mon, tue, thu, fri"}     | ${"task"} | ${"every"} | ${[1, 2, 4, 5]}          | ${"every"}       | ${"every"}       | ${[]}           | ${""}
    ${"every Other monday"}           | ${"task"} | ${"every"} | ${[1]}                   | ${"every other"} | ${"every"}       | ${[]}           | ${""}
    ${"every other mondays"}          | ${"task"} | ${"every"} | ${[1]}                   | ${"every other"} | ${"every"}       | ${[]}           | ${""}
    ${"every other mon,wed"}          | ${"task"} | ${"every"} | ${[1, 3]}                | ${"every other"} | ${"every"}       | ${[]}           | ${""}
    ${"every other mons,wed"}         | ${"task"} | ${"every"} | ${[1, 3]}                | ${"every other"} | ${"every"}       | ${[]}           | ${""}
    ${"every 1 mon"}                  | ${"task"} | ${"every"} | ${[1]}                   | ${[1]}           | ${"every"}       | ${[]}           | ${""}
    ${"every 1st mons"}               | ${"task"} | ${"every"} | ${[1]}                   | ${[1]}           | ${"every"}       | ${[]}           | ${""}
    ${"every other 2Th Mon"}          | ${"task"} | ${"every"} | ${[1]}                   | ${[2]}           | ${"every other"} | ${[]}           | ${""}
    ${"every 5"}                      | ${"task"} | ${[5]}     | ${[0, 1, 2, 3, 4, 5, 6]} | ${"every"}       | ${"every"}       | ${[]}           | ${""}
    ${"every 7, 14"}                  | ${"task"} | ${[7, 14]} | ${[0, 1, 2, 3, 4, 5, 6]} | ${"every"}       | ${"every"}       | ${[]}           | ${""}
    ${"every days ending 2018-07-07"} | ${"task"} | ${"every"} | ${[0, 1, 2, 3, 4, 5, 6]} | ${"every"}       | ${"every"}       | ${[]}           | ${"2018/7/7"}
`(
    "toRepetition returns when $dateString",
    ({ dateString, content, exDay, exDayOfWeek, exWeek, exMonth, exDatesExcepted, exLastDate }) => {
        const r: Repetition = toRepetition(dateString, content)
        test(`day is ${exDay}`, () => expect(r.day).toEqual(exDay))
        test(`dayOfWeek is ${exDayOfWeek}`, () => expect(r.dayOfWeek).toEqual(exDayOfWeek))
        test(`week is ${exWeek}`, () => expect(r.week).toEqual(exWeek))
        test(`month is ${exMonth}`, () => expect(r.month).toEqual(exMonth))
        test(`datesExpected is ${exDatesExcepted}`, () => expect(r.datesExcepted).toEqual(exDatesExcepted))
        test(`lastDate is ${exLastDate}`, () => expect(r.lastDate ? r.lastDate.format(FORMAT) : "").toEqual(exLastDate))
    }
)

describe.each`
    dateString        | content                    | exDay      | exDayOfWeek | exWeek     | exMonth    | exDatesExcepted
    ${"every monday"}


            VKEY_N = 0x4E,
            VKEY_O = 0x4F,
            VKEY_P = 0x50,
            VKEY_Q = 0x51,
            VKEY_R = 0x52,
            VKEY_S = 0x53,
            VKEY_T = 0x54,
            VKEY_U = 0x55,
            VKEY_V = 0x56,
            VKEY_W = 0x57,
            VKEY_X = 0x58,
            VKEY_Y = 0x59,
            VKEY_Z = 0x5A,
            VKEY_LWIN = 0x5B,
            VKEY_COMMAND = VKEY_LWIN, // Provide the Mac name for convenience.
            VKEY_RWIN = 0x5C,
            VKEY_APPS = 0x5D,
            VKEY_SLEEP = 0x5F,
            VKEY_NUMPAD0 = 0x60,
            VKEY_NUMPAD1 = 0x61,
            VKEY_NUMPAD2 = 0x62,
            VKEY_NUMPAD3 = 0x63,
            VKEY_NUMPAD4 = 0x64,
            VKEY_NUMPAD5 = 0x65,
            VKEY_NUMPAD6 = 0x66,
            VKEY_NUMPAD7 = 0x67,
            VKEY_NUMPAD8 = 0x68,
            VKEY_NUMPAD9 = 0x69,
            VKEY_MULTIPLY = 0x6A,
            VKEY_ADD = 0x6B,
            VKEY_SEPARATOR = 0x6C,
            VKEY_SUBTRACT = 0x6D,
            VKEY_DECIMAL = 0x6E,
            VKEY_DIVIDE = 0x6F,
            VKEY_F1 = 0x70,
            VKEY_F2 = 0x71,
            VKEY_F3 = 0x72,
            VKEY_F4 = 0x73,
            VKEY_F5 = 0x74,
            VKEY_F6 = 0x75,
            VKEY_F7 = 0x76,
            VKEY_F8 = 0x77,
            VKEY_F9 = 0x78,
            VKEY_F10 = 0x79,
            VKEY_F11 = 0x7A,
            VKEY_F12 = 0x7B,
            VKEY_F13 = 0x7C,
            VKEY_F14 = 0x7D,
            VKEY_F15 = 0x7E,
            VKEY_F16 = 0x7F,
            VKEY_F17 = 0x80,
            VKEY_F18 = 0x81,
            VKEY_F19 = 0x82,
            VKEY_F20 = 0x83,
            VKEY_F21 = 0x84,
            VKEY_F22 = 0x85,
            VKEY_F23 = 0x86,
            VKEY_F24 = 0x87,
            VKEY_NUMLOCK = 0x90,
            VKEY_SCROLL = 0x91,
            VKEY_LSHIFT = 0xA0,
            VKEY_RSHIFT = 0xA1,
            VKEY_LCONTROL = 0xA2,
            VKEY_RCONTROL = 0xA3,
            VKEY_LMENU = 0xA4,
            VKEY_RMENU = 0xA5,
            VKEY_BROWSER_BACK = 0xA6,
            VKEY_BROWSER_FORWARD = 0xA7,
            VKEY_BROWSER_REFRESH = 0xA8,
            VKEY_BROWSER_STOP = 0xA9,
            VKEY_BROWSER_SEARCH = 0xAA,
            VKEY_BROWSER_FAVORITES = 0xAB,
            VKEY_BROWSER_HOME = 0xAC,
            VKEY_VOLUME_MUTE = 0xAD,
            VKEY_VOLUME_DOWN = 0xAE,
            VKEY_VOLUME_UP = 0xAF,
            VKEY_MEDIA_NEXT_TRACK = 0xB0,
            VKEY_MEDIA_PREV_TRACK = 0xB1,
            VKEY_MEDIA_STOP = 0xB2,


/****************************************************************************
* Copyright (C) 2019 Eric Mor
*
* This file is part of Spore ModAPI.
*
* Spore ModAPI 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, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program.  If not, see <http://www.gnu.org/licenses/>.
****************************************************************************/

#pragma once

#include <Spore\Swarm\IEffectsWorld.h>
#include <Spore\Swarm\IEffectsManager.h>
#include <Spore\Object.h>

#include <EASTL\vector.h>
#include <EASTL\string.h>

namespace Swarm
{

	// TODO: Uncompleted
	class cEffectsWorld : public IEffectsWorld, public IVirtual
	{
	public:
		cEffectsWorld(IEffectsManager* pManager, cGlobalParams* pGlobalParams);

	protected:
		/* 08h */	int mnRefCount;
		/* 0Ch */	bool field_0C;
		/* 10h */	int field_10;
		/* 14h */	IEffectsManager* mpManager;
		/* 18h */	cGlobalParams* mpGlobalParams;  // it's a copy of the one in the constructor
		/* 1Ch */	int field_1C;
		/* 20h */	SwarmState mState;
		/* 24h */	bool field_24;
		/* 28h */	int field_28;  // 1
		/* 2Ch */	int field_2C;
		/* 30h */	eastl::vector<IVisualEffectPtr> field_30;
		/* 44h */	eastl::vector<int> field_44;  // indices to field_30
		/* 58h */	eastl::vector<int> field_58;
		/* 6Ch */	eastl::vector<int> field_6C;
		/* 80h */	int field_80;  // 1
		/* 84h */	int field_84;  // 1
		/* 88h */	float field_88;  // 1.0f
		/* 8Ch */	int field_8C;  // not initialized
		/* 90h */	int field_90;
		/* 94h */	eastl::string field_94;

		// 20h state
		// 90h effectCount

		/* 14h */	virtual void SetLOD(float value, int) override = 0;
	};
	ASSERT_SIZE(cEffectsWorld, 0xA4);
}


n returns True for users who have any permission ... ok\ntest_has_view_permission (modeladmin.tests.ModelAdminPermissionTests.test_has_view_permission)\nhas_view_permission() returns True for users who can view objects and ... ok\ntest_inline_has_add_permission_uses_obj (modeladmin.tests.ModelAdminPermissionTests.test_inline_has_add_permission_uses_obj) ... ok\n\n----------------------------------------------------------------------\nRan 36 tests in 0.049s\n\nOK\nDestroying test database for alias 'default' ('file:memorydb_default?mode=memory&cache=shared')..."}]}, {'role': 'assistant', 'content': [{'type': 'text', 'text': "I notice that the failing test from the problem description isn't yet included in the test suite. Let's add it first. The test should go in `/testbed/tests/modeladmin/tests.py`. Let me check the current content of this file:"}, {'type': 'text', 'text': "<tool_use>\n{'tool_name': editor, 'tool_input': {'command': 'view', 'path': '/testbed/tests/modeladmin/tests.py'}}\n</tool_use>"}]}, {'role': 'user', 'content': [{'type': 'text', 'text': 'Tool Result: Here\'s the result of running `cat -n` on /testbed/tests/modeladmin/tests.py:\n     1\tfrom datetime import date\n     2\t\n     3\tfrom django import forms\n     4\tfrom django.contrib.admin.models import ADDITION, CHANGE, DELETION, LogEntry\n     5\tfrom django.contrib.admin.options import (\n     6\t    HORIZONTAL,\n     7\t    VERTICAL,\n     8\t    ModelAdmin,\n     9\t    TabularInline,\n    10\t    get_content_type_for_model,\n    11\t)\n    12\tfrom django.contrib.admin.sites import AdminSite\n    13\tfrom django.contrib.admin.widgets import (\n    14\t    AdminDateWidget,\n    15\t    AdminRadioSelect,\n    16\t    AutocompleteSelect,\n    17\t    AutocompleteSelectMultiple,\n    18\t)\n    19\tfrom django.contrib.auth.models import User\n    20\tfrom django.db import models\n    21\tfrom django.forms.widgets import Select\n    22\tfrom django.test import SimpleTestCase, TestCase\n    23\tfrom django.test.utils import isolate_apps\n    24\t\n    25\tfrom .models import Band, Concert, Song\n    26\t\n    27\t\n    28\tclass MockRequest:\n    29\t    pass\n    30\t\n    31\t\n    32\tclass MockSuperUser:\n    33\t    def has_perm(self, perm, obj=None):\n    34\t        return True\n    35\t\n    36\t\n    37\trequest = MockRequest()\n    38\trequest.user = MockSuperUser()\n    39\t\n    40\t\n    41\tclass ModelAdminTests(TestCase):\n    42\t    @classmethod\n    43\t    def setUpTestData(cls):\n    44\t        cls.band = Band.objects.create(\n    45\t            name="The Doors",\n    46\t            bio="",\n    47\t            sign_date=date(1965, 1, 1),\n    48\t        )\n    49\t\n    50\t    def setUp(self):\n    51\t        self.site = AdminSite()\n    52\t\n    53\t    def test_modeladmin_str(self):\n    54\t        ma = ModelAdmin(Band, self.site)\n    55\t        self.assertEqual(str(ma), "modeladmin.ModelAdmin")\n    56\t\n    57\t    def test_default_attributes(self):\n    58\t        ma = ModelAdmin(Band, self.site)\n    59\t        self.assertEqual(ma.actions, ())\n    60\t        self.assertEqual(ma


height: var(--radix-accordion-content-height);
    }
    to {
      height: 0;
    }
  }

  @keyframes twinkle {
    100%,
    0% {
      opacity: 0.7;
    }
    50% {
      opacity: 0.3;
    }
  }

  @keyframes rotate {
    100%,
    0% {
      transform: rotate(-8deg);
    }
    50% {
      transform: rotate(0deg);
    }
  }

  @keyframes snore {
    100%,
    0% {
      transform: scale(1) rotate(30deg);
    }
    50% {
      transform: scale(0.5) rotate(30deg);
      border-bottom-left-radius: 50%;
    }
  }

  @keyframes falling {
    0% {
      -webkit-transform: translateY(-100vh);
      transform: translateY(-100vh);
    }
    100% {
      -webkit-transform: translateY(100vh);
      transform: translateY(100vh);
    }
  }

  @keyframes tail {
    0%,
    100% {
      height: 0;
    }
    30% {
      height: 100px;
    }
  }

  @keyframes palseTheLogo {
    0%,
    100% {
      opacity: 1;
    }
    50% {
      opacity: 0.3;
    }
  }

  @keyframes slideToCenter {
    0% {
      -webkit-transform: translateX(50px);
      transform: translateX(50px);
    }
    100% {
      -webkit-transform: translateX(0px);
      transform: translateX(0px);
    }
  }
}

:root {
  --radius: 0.5rem;
  --background: oklch(0.145 0 0);
  --foreground: oklch(0.985 0 0);
  --card: oklch(0.205 0 0);
  --card-foreground: oklch(0.985 0 0);
  --popover: oklch(0.205 0 0);
  --popover-foreground: oklch(0.985 0 0);
  --primary: oklch(0.922 0 0);
  --primary-foreground: oklch(0.205 0 0);
  --secondary: oklch(0.269 0 0);
  --secondary-foreground: oklch(0.985 0 0);
  --muted: oklch(0.269 0 0);
  --muted-foreground: oklch(0.708 0 0);
  --accent: oklch(0.269 0 0);
  --accent-foreground: oklch(0.985 0 0);
  --destructive: oklch(0.704 0.191 22.216);
  --border: oklch(1 0 0 / 10%);
  --input: oklch(1 0 0 / 15%);
  --ring: oklch(0.556 0 0);
  --chart-1: oklch(0.488 0.243 264.376);
  --chart-2: oklch(0.696 0.17 162.48);
  --chart-3: oklch(0.769 0.188 70.08);
  --chart-4: oklch(0.627 0.265 303.9);
  --chart-5: oklch(0.645 0.246 16.439);
  --sidebar: oklch(0.205 0 0);
  --sidebar-foreground: oklch(0.985 0 0);
  --sidebar-primary: oklch(0.488 0.243 264.376);
  --sidebar-primary-foreground: oklch(0.985 0 0);
  --sidebar-accent: oklch(0.269 0 0);
  --sidebar-accent-foreground: oklch(0.985 0 0);
  --sidebar-border: oklch(1 0 0 / 10%);
  --sidebar-ring: oklch(0.556 0 0);
}

@layer base {
  * {
    @apply border-border scroll-smooth;

    /* fuma vars */
    --fd-sideba


 new DefaultComboBoxModel(varKeys) {
      public Object getSelectedItem() {
        Object item = super.getSelectedItem();
        if (item instanceof String) {
          if (env.getVariableValue((String)item) != null) {
            String newS = "${" + (String)item + "}";
            item = newS;
          }
        }
        return item;
      }
    };
    m_combo.setModel(dm);
    m_combo.setSelectedItem("");
    m_combo.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        String selected = (String)m_combo.getSelectedItem();
        try {
          selected = processSelected(selected);

          selected = m_env.substitute(selected);
        } catch (Exception ex) {
          // quietly ignore unresolved variables
        }
        m_combo.setToolTipText(selected);
      }
    });

    m_combo.getEditor().getEditorComponent().addKeyListener(new KeyAdapter() {
      public void keyReleased(KeyEvent e) {
        java.awt.Component theEditor = m_combo.getEditor().getEditorComponent();
        if (theEditor instanceof JTextField) {
          String selected = ((JTextField)theEditor).getText();
          m_currentContents = selected;
          if (m_env != null) {
            try {
              selected = m_env.substitute(selected);
            } catch (Exception ex) {
              // quietly ignore unresolved variables
            }
          }
          m_combo.setToolTipText(selected);
        }
      }
    });
  }

  /**
   * Set the enabled status of the combo box.
   *
   * @param enabled true if the combo box is enabled
   */
  public void setEnabled(boolean enabled) {
    m_combo.setEnabled(enabled);
  }

  /**
   * Set the editable status of the combo box.
   *
   * @param editable true if the combo box is editable
   */
  public void setEditable(boolean editable) {
    m_combo.setEditable(editable);
  }

  /**
   * Main method for testing this class
   *
   * @param args command line args (ignored)
   */
  public static void main(String[] args) {
    try {
      final javax.swing.JFrame jf =
        new javax.swing.JFrame("EnvironmentField");
      jf.getContentPane().setLayout(new BorderLayout());
      final EnvironmentField f = new EnvironmentField("A label here");
      jf.getContentPane().add(f, BorderLayout.CENTER);
      Environment env = Environment.getSystemWide();
      f.setEnvironment(env);
      jf.addWindowListener(new java.awt.event.WindowAdapter() {
        public void windowClosing(java.awt.event.WindowEvent e) {
          jf.dispose();
          System.exit(0);
        }
      });
      jf.pack();
      jf.setVisible(true);
    } catch (Exception ex) {
      ex.printStackTrace();
    }
  }
}
/*
 *    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; either version 2 of the License, or
 *    (at your option) any later version.
 *
 *    This program is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with this program; if not, write to the Free Software
 *    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */


			} catch (IOException e) {
				LOGGER.warn("", e);
			}
		}
	}

	@Override
	public boolean close(boolean isForce) {
		for (PhysicalNode physicalNode : physicalNodes.values()) {
			physicalNode.clearConnections("manual reload", isForce);
		}
		return true;
	}

	@Override
	public PhysicalNode getPhysicalNode() {
		return null;
	}

	@Override
	public PhysicalNode getPhysicalNode(String cmd, String key) {
		return null;
	}

	@Override
	public PhysicalNode getPhysicalNode(String cmd, byte[] key) {
		return null;
	}

	@Override
	public boolean testConnection() {
		Collection<Node> nodes = discoverNodes();
		if (nodes == null || nodes.isEmpty()) {
			return false;
		}
		return true;
	}

	private Collection<Node> discoverNodes() {
		Set<String> theHostList = availableHostList;
		if (theHostList.isEmpty()) {
			theHostList = backupHostList;
		}
		for (String availableHost : theHostList) {
			String[] hostAndPort = availableHost.split(":");

			KafkaAdmin kafkaAdmin = null;
			try {
				kafkaAdmin = KafkaAdmin.create(hostAndPort[0] + ":" + hostAndPort[1]);
				Collection<Node> nodes = kafkaAdmin.getClusterNodes();
				if (nodes == null || nodes.isEmpty()) {
					continue;
				}
				return nodes;
			} finally {
				if (kafkaAdmin != null)
					kafkaAdmin.close();
			}
		}
		return null;
	}

	@Override
	public void availableCheck() {
		heartbeatTime = System.currentTimeMillis();

		// CAS， 避免网络不好的情况下，频繁并发的检测
		if (!availableCheckFlag.compareAndSet(false, true)) {
			return;
		}

		try {
			Collection<Node> nodes = discoverNodes();
			if (nodes == null || nodes.isEmpty()) {
				heartbeatStatus = -1;
				LOGGER.error("kafka pool err: heartbeatStatus={}", heartbeatStatus);
			} else {
				// 1 提取所有节点
				Map<Integer, PhysicalNode> newPhysicalNodes = new HashMap<Integer, PhysicalNode>(3);
				int poolType = poolCfg.getType();
				String poolName = poolCfg.getName();
				int minCon = poolCfg.getMinCon();
				int maxCon = poolCfg.getMaxCon();

				for (Node node : nodes) {
					PhysicalNode physicalNode = new PhysicalNode(backendConFactory,
							poolType, poolName, minCon, maxCon, node.host(), node.port());
					newPhysicalNodes.put(node.id(), physicalNode);
				}

				// 2 判断是否有新增，更改，删除节点
				StringBuffer logBuffer = new StringBuffer();		// 节点变更日志
				boolean isNodeAdd = false;
				boolean isNodeDel = false;
				boolean isNodeDiff = false;

				// 判断是否有新增和更改节点
				for (Map.Entry<Integer, PhysicalNode> newEntry : newPhysicalNodes.entrySet()) {
					int id = newEntry.getKey();
					PhysicalNode newNode = newEntry.getValue();
					PhysicalNode oldNode = physicalNodes.get(id);
					if (oldNode == null) {
						isNodeAdd = true;
						logBuffer.append( "add newNode:");
						logBuffer.append( newNode.toString() );
						logBuffer.append( "\r\n" );
					} else if (newNode.getPort() != oldNode.getPort() || !newNode.getHost().equals(oldNode.getHost())) {
						isNodeDiff = true;
						logBuffer.append( "dif newNode:");
						logBuffer.append( newNode.toString() );
						logBuffer.append( "\r\n" );
					}
				}

				// 判断是否有节点删除
				for (Map.Entry<Integer, PhysicalNod


ize Ys
        word = word.replace(Porter2.NORMALIZE_YS_RE, "y");

        return word;
    }
};
import { z, ZodTypeAny, ZodObject, ZodNumber, ZodAny, ZodString, ZodDefault, ZodArray } from "zod"

export class ZodFixtures {
    public static createFixture<T extends ZodTypeAny>(zodRef: T): z.infer<typeof zodRef> {
        const fixture: any = {}
        if (zodRef instanceof ZodObject) {
            for (const key in zodRef.shape) {
                const value = zodRef.shape[key];
                if (value instanceof ZodObject) {
                    fixture[key] = this.createFixture(value.shape)
                } else if (value instanceof ZodNumber) {
                    fixture[key] = 1;
                } else if (value instanceof ZodAny) {
                    fixture[key] = null;
                } else if (value instanceof ZodString) {
                    fixture[key] = "test";
                } else if (value instanceof ZodDefault) {
                    fixture[key] = "true";
                } else if (value instanceof ZodArray) {
                    fixture[key] = [12, 13];
                }
            }
        }
        return fixture;
    }
}import { containsProperties } from '../../lib/util'
import { safeQuery, Indexable } from '../../neo4j/connection'
import Base, { ModelPromise, ModelPromiseNull } from './base'

interface LabelRegistry {
  [key: string]: {
    modelClassname: string
    properties: Indexable
  }[]
}

interface Constructable<T extends typeof Base> {
  new(node: Indexable): InstanceType<T>
}

const classRegistry: Indexable = {}
const labelRegistry: LabelRegistry = {}

export function register<T extends typeof Base>(modelClass: Constructable<T>, neo4JLabel = modelClass.name, properties: Indexable = {}): void {
  classRegistry[modelClass.name] = modelClass
  if (!(neo4JLabel in labelRegistry)) {
    labelRegistry[neo4JLabel] = []
  }
  labelRegistry[neo4JLabel].push({
    modelClassname: modelClass.name,
    properties
  })
  // Every time an entry is added, which is going to be much less frequent than
  // when they are accessed, sort the list from the most specific set of properties
  // to the least specific.
  labelRegistry[neo4JLabel].sort(({ properties: a }, { properties: b }) => (
    Object.keys(b).length - Object.keys(a).length
  ))
}

export function deriveClass<T extends typeof Base>(label: string, properties: Indexable): Constructable<T> {
  const possibleClasses = labelRegistry[label]
  let foundClassname: string|null = null
  possibleClasses.forEach((modelClass) => {
    if (!foundClassname && containsProperties(properties, modelClass.properties)) {
      foundClassname = modelClass.modelClassname
    }
  })

  if (foundClassname) {
    return classRegistry[foundClassname]
  }

  throw Error(`Can't derive class for node with label: ${label}`)
}

export function derive<T extends typeof Base>(neo4JNode: Indexable): InstanceType<T> {
  const label = neo4JNode.labels[0]
  const { properties } = neo4JNode

  const ModelClass = deriveClass(label, properties)

  return new ModelClass(neo4JNode) as InstanceType<T>
}

export function getClass<T extends typeof Base>(datasetClassname: string): Constructable<T> {
  return classRegistry[datasetClassname]
}

export async function getByUniqueMatch<T extends


t, 0x41A0                ## $at = 41A00000
/* 03224 80A04E54 44812000 */  mtc1    $at, $f4                   ## $f4 = 20.00
/* 03228 80A04E58 8FA20038 */  lw      $v0, 0x0038($sp)
/* 0322C 80A04E5C 3C0140A0 */  lui     $at, 0x40A0                ## $at = 40A00000
/* 03230 80A04E60 46040182 */  mul.s   $f6, $f0, $f4
/* 03234 80A04E64 C448095C */  lwc1    $f8, 0x095C($v0)           ## 0000095C
/* 03238 80A04E68 44819000 */  mtc1    $at, $f18                  ## $f18 = 5.00
/* 0323C 80A04E6C 46083280 */  add.s   $f10, $f6, $f8
/* 03240 80A04E70 E7AA002C */  swc1    $f10, 0x002C($sp)
/* 03244 80A04E74 C4500960 */  lwc1    $f16, 0x0960($v0)          ## 00000960
/* 03248 80A04E78 46128100 */  add.s   $f4, $f16, $f18
/* 0324C 80A04E7C E7A40030 */  swc1    $f4, 0x0030($sp)
/* 03250 80A04E80 0C01DE0D */  jal     Math_Coss
              ## coss?
/* 03254 80A04E84 844400B6 */  lh      $a0, 0x00B6($v0)           ## 000000B6
/* 03258 80A04E88 3C0141A0 */  lui     $at, 0x41A0                ## $at = 41A00000
/* 0325C 80A04E8C 44813000 */  mtc1    $at, $f6                   ## $f6 = 20.00
/* 03260 80A04E90 8FA20038 */  lw      $v0, 0x0038($sp)
/* 03264 80A04E94 46060202 */  mul.s   $f8, $f0, $f6
/* 03268 80A04E98 C44A0964 */  lwc1    $f10, 0x0964($v0)          ## 00000964
/* 0326C 80A04E9C 460A4400 */  add.s   $f16, $f8, $f10
/* 03270 80A04EA0 E7B00034 */  swc1    $f16, 0x0034($sp)
/* 03274 80A04EA4 27A9002C */  addiu   $t1, $sp, 0x002C           ## $t1 = FFFFFFE4
.L80A04EA8:
/* 03278 80A04EA8 8D2B0000 */  lw      $t3, 0x0000($t1)           ## FFFFFFE4
/* 0327C 80A04EAC 960C02C4 */  lhu     $t4, 0x02C4($s0)           ## 000002C4
/* 03280 80A04EB0 AE0B0038 */  sw      $t3, 0x0038($s0)           ## 00000038
/* 03284 80A04EB4 8D2A0004 */  lw      $t2, 0x0004($t1)           ## FFFFFFE8
/* 03288 80A04EB8 318DFFEF */  andi    $t5, $t4, 0xFFEF           ## $t5 = 00000000
/* 0328C 80A04EBC AE0A003C */  sw      $t2, 0x003C($s0)           ## 0000003C
/* 03290 80A04EC0 8D2B0008 */  lw      $t3, 0


utStreamReader(FileInputStream(file), charsetName))
                }
                var line: String?
                while (reader.readLine().also { line = it } != null) {
                    sb.append(line).append("\r\n") // windows系统换行为\r\n，Linux为\n
                }
                // 要去除最后的换行符
                sb.delete(sb.length - 2, sb.length).toString()
            } catch (e: IOException) {
                e.printStackTrace()
                null
            } finally {
                closeIO(reader)
            }
        }

        /**
         * 指定编码按行读取文件到字符数组中
         *
         * @param filePath 文件路径
         * @return StringBuilder对象
         */
        @JvmStatic
        fun readFile2Bytes(filePath: String?): ByteArray? {
            return readFile2Bytes(getFileByPath(filePath))
        }

        /**
         * 指定编码按行读取文件到字符数组中
         *
         * @param file 文件
         * @return StringBuilder对象
         */
        @JvmStatic
        fun readFile2Bytes(file: File?): ByteArray? {
            return if (file == null) {
                null
            } else try {
                inputStream2Bytes(FileInputStream(file))
            } catch (e: FileNotFoundException) {
                e.printStackTrace()
                null
            }
        }

        /**
         * 简单获取文件编码格式
         *
         * @param filePath 文件路径
         * @return 文件编码
         */
        @JvmStatic
        fun getFileCharsetSimple(filePath: String?): String {
            return getFileCharsetSimple(getFileByPath(filePath))
        }

        /**
         * 简单获取文件编码格式
         *
         * @param file 文件
         * @return 文件编码
         */
        @JvmStatic
        fun getFileCharsetSimple(file: File?): String {
            var p = 0
            var `is`: InputStream? = null
            try {
                `is` = BufferedInputStream(FileInputStream(file))
                p = (`is`.read() shl 8) + `is`.read()
            } catch (e: IOException) {
                e.printStackTrace()
            } finally {
                closeIO(`is`)
            }
            return when (p) {
                0xefbb -> "UTF-8"
                0xfffe -> "Unicode"
                0xfeff -> "UTF-16BE"
                else -> "GBK"
            }
        }

        /**
         * 获取文件行数
         *
         * @param filePath 文件路径
         * @return 文件行数
         */
        @JvmStatic
        fun getFileLines(filePath: String?): Int {
            return getFileLines(getFileByPath(filePath))
        }

        /**
         * 获取文件行数
         *
         * @param file 文件
         * @return 文件行数
         */
        @JvmStatic
        fun getFileLines(file: File?): Int {
            var count = 1
            var `is`: InputStream? = null
            try {
                `is` = BufferedInputStream(FileInputStream(file))
                val buffer = ByteArray(KB)
                var readChars: Int
                while (`is`.read(buffer, 0, KB).also { readChars = it } != -1) {
                    for (i in 0 until readChars) {
                        if (buffer[i].equals('\n')) {
                            ++count
                        }
                    }
                }
            } catch (e: IOException) {
                e.printStackTrace()
            } finally {
                closeIO(`is`)
            }
            return count
        }

        /**
         * 获取文件大小
         *
         * @param filePath 文件路径


 undefined if marker file not found', async () => {
          jest.spyOn(fslib, 'fsReadDir').mockImplementation(async () => ['bar']);
          const result = await fslib.findBaseDirectory('C:\\some\\dir', 'foo');
          expect(result).toEqual(undefined);
        });

        it('should return path when marker file found in cwd', async () => {
          jest.spyOn(fslib, 'fsReadDir').mockImplementation(async () => ['foo']);
          const result = await fslib.findBaseDirectory('C:\\some\\dir', 'foo');
          expect(result).toEqual('C:\\some\\dir');
        });

        it('should return path when marker file found in one directory back', async () => {
          jest.spyOn(fslib, 'fsReadDir')
            .mockImplementationOnce(async () => ['garbage'])
            .mockImplementationOnce(async () => ['dir', 'foo']);
          const result = await fslib.findBaseDirectory('C:\\some\\dir', 'foo');
          expect(result).toEqual('C:\\some');
        });

        it('should return path when marker file found in really nested path', async () => {
          jest.spyOn(fslib, 'fsReadDir')
            .mockImplementationOnce(async () => [''])
            .mockImplementationOnce(async () => ['nested'])
            .mockImplementationOnce(async () => ['really'])
            .mockImplementationOnce(async () => ['is'])
            .mockImplementationOnce(async () => ['that'])
            .mockImplementationOnce(async () => ['dir', 'foo']);
          const result = await fslib.findBaseDirectory('C:\\some\\dir\\\\that\\is\\really\\nested', 'foo');
          expect(result).toEqual('C:\\some');
        });

      });

    });

  });

});
/**
 * @desc
 *
 * @使用场景
 *
 * @company qianmi.com
 * @Date    2019/5/6
 **/

/**

 直接调用
 action.commonChange([a,b,c],"1")
 action.commonChange("a.b.c","1")
 action.commonChange("a,b,c","1")

 action.commonChange([{paths:"a.b.c",value:13123}])

 dom高级使用方法:

    1. 更改值后回周触发;
   <Select placeholder="请选择服务分类" value={main.info.projectCateId} style={{ width: 160 }}
   //@ts-ignore
   onChange={_.curryRight(action.commonChange,2)((param)=>{
                         setTimeout(action.queryItems,0);
                         return param;
                       })}>
   {
     main.cates.map((item,index)=><Option key={item.projectCateId+(index+"")}  data-paths={"main.info.projectCateId"} value={item.projectCateId}>{item.projectCateName}</Option>)
   }
   </Select>

   2.值的修改.. 或批量添加.

 dom元素调用;

 <Checkbox.Group value={binary2Array(3)
              // main.card.distributionChannel
            } style={{ width: "100%" }} onChange={this._chooseChannel.bind(null,"info,channels")}>
   <Checkbox value="1">门店收银</Checkbox>
   <Checkbox value="2">网店销售</Checkbox>
 </Checkbox.Group>

 input 类型的
 <Input.TextArea rows={3} data-paths={'info,petFeatures'} onChange={action.commonChange} value={main.in


 store a cookie. So let's bust the authentication session (if one exists).
		if err := s.revokeAuthenticationSession(ctx, w, r); err != nil {
			return nil, err
		}
	}

	if !f.LoginRemember || f.LoginSkip && !f.LoginExtendSessionLifespan {
		// If the user doesn't want to remember the session, we do not store a cookie.
		// If login was skipped, it means an authentication cookie was present and
		// we don't want to touch it (in order to preserve its original expiry date)
		return f, nil
	}

	// Not a skipped login and the user asked to remember its session, store a cookie
	cookie, _ := store.Get(r, s.c.SessionCookieName(ctx))
	cookie.Values[CookieAuthenticationSIDName] = sessionID
	cookie.Options.MaxAge = int(s.c.GetAuthenticationSessionLifespan(ctx).Seconds())
	if f.LoginRememberFor > 0 {
		cookie.Options.MaxAge = f.LoginRememberFor
	}
	cookie.Options.HttpOnly = true
	cookie.Options.Path = s.c.SessionCookiePath(ctx)
	cookie.Options.SameSite = s.c.CookieSameSiteMode(ctx)
	cookie.Options.Secure = s.c.CookieSecure(ctx)
	if err := cookie.Save(r, w); err != nil {
		return nil, errors.WithStack(err)
	}

	s.r.Logger().WithRequest(r).
		WithFields(logrus.Fields{
			"cookie_name":      s.c.SessionCookieName(ctx),
			"cookie_http_only": true,
			"cookie_same_site": s.c.CookieSameSiteMode(ctx),
			"cookie_secure":    s.c.CookieSecure(ctx),
		}).Debug("Authentication session cookie was set.")

	return f, nil
}

func (s *DefaultStrategy) requestConsent(
	ctx context.Context,
	w http.ResponseWriter,
	r *http.Request,
	ar fosite.AuthorizeRequester,
	f *flow.Flow,
) (err error) {
	ctx, span := trace.SpanFromContext(ctx).TracerProvider().Tracer("").Start(ctx, "DefaultStrategy.requestConsent")
	defer otelx.End(span, &err)

	prompt := stringsx.Splitx(ar.GetRequestForm().Get("prompt"), " ")
	if slices.Contains(prompt, "consent") {
		return s.forwardConsentRequest(ctx, w, r, ar, f, false)
	}

	// https://tools.ietf.org/html/rfc6749
	//
	// As stated in Section 10.2 of OAuth 2.0 [RFC6749], the authorization
	// server SHOULD NOT process authorization requests automatically
	// without user consent or interaction, except when the identity of the
	// client can be assured.  This includes the case where the user has
	// previously approved an authorization request for a given client id --
	// unless the identity of the client can be proven, the request SHOULD
	// be processed as if no previous request had been approved.
	//
	// Measures such as claimed "https" scheme redirects MAY be accepted by
	// authorization servers as identity proof.  Some operating systems may
	// offer alternative platform-specific identity features that MAY be
	// accepted, as appropriate.
	if ar.GetClient().IsPublic() {
		// The OpenID Connect Test Tool fails if this returns `consent_required` when `prompt=none` is used.
		// According to the quote above, it should be ok to allow https to skip consent.
		//
		// Device initiated flows are never allowed to skip consent, the user must always explicitly authorize the device.
		//
		// This is tracked as issue: https://github.com/ory/hydra/issues/866
		// This is also tracked as upstream issue: https://github.com/openid-certification/oidctest/issues/97
		if f.DeviceChallengeID != "" {
			return s.forwardConsentRequest(ctx, w, r, ar, f, false)
		} else if !


mgg_test
    </title>

      sandia_sgmgg_test

      sandia_sgmgg_test,
      a FORTRAN90 code which
      calls sandia_sgmgg(), which
      contains some experimental code for the investigation of sparse
      grids constructed in a generalized fashion, in which the set of
      indices corresponding to a sparse grid is chosen in a generalized
      way, rather than being defined by a linear constraint.

      Licensing:

      The computer code and data files described and made available on this web page
      are distributed under
      the GNU LGPL license.

      Related Data and Programs:

      sandia_sgmgg,
      a FORTRAN90 code which
      contains some experimental code for the investigation of sparse
      grids constructed in a generalized fashion, in which the set of
      indices corresponding to a sparse grid is chosen in a generalized
      way, rather than being defined by a linear constraint.

      Source Code:

          sandia_sgmgg_test.f90,
          a sample calling program.

          sandia_sgmgg_test.sh,
          runs all the tests.

          sandia_sgmgg_test.txt,
          the output file.

      Last revised on 16 January 2023.

    <title>
      stroud_rule_test
    </title>

      stroud_rule_test

      stroud_rule_test,
      a Fortran90 code which
      calls stroud_rule(), which
      defines quadrature rules for a variety of M-dimensional regions,
      including the interior of the square, cube and hypercube, the pyramid,
      cone and ellipse, the hexagon, the M-dimensional octahedron,
      the circle, sphere and hypersphere, the triangle, tetrahedron and simplex,
      and the surface of the circle, sphere and hypersphere.

      Licensing:

      The information on this web page is distributed under the MIT license.

      Related Data and Programs:

      stroud_rule,
      a Fortran90 code which
      defines quadrature rules for a variety of M-dimensional regions,
      including the interior of the


 'title',
      begin: IDENT_RE,
      relevance: 0
    };
    const UNDERSCORE_TITLE_MODE = {
      scope: 'title',
      begin: UNDERSCORE_IDENT_RE,
      relevance: 0
    };
    const METHOD_GUARD = {
      // excludes method names from keyword processing
      begin: '\\.\\s*' + UNDERSCORE_IDENT_RE,
      relevance: 0
    };

    /**
     * Adds end same as begin mechanics to a mode
     *
     * Your mode must include at least a single () match group as that first match
     * group is what is used for comparison
     * @param {Partial<Mode>} mode
     */
    const END_SAME_AS_BEGIN = function(mode) {
      return Object.assign(mode,
        {
          /** @type {ModeCallback} */
          'on:begin': (m, resp) => { resp.data._beginMatch = m[1]; },
          /** @type {ModeCallback} */
          'on:end': (m, resp) => { if (resp.data._beginMatch !== m[1]) resp.ignoreMatch(); }
        });
    };

    var MODES = /*#__PURE__*/Object.freeze({
        __proto__: null,
        MATCH_NOTHING_RE: MATCH_NOTHING_RE,
        IDENT_RE: IDENT_RE,
        UNDERSCORE_IDENT_RE: UNDERSCORE_IDENT_RE,
        NUMBER_RE: NUMBER_RE,
        C_NUMBER_RE: C_NUMBER_RE,
        BINARY_NUMBER_RE: BINARY_NUMBER_RE,
        RE_STARTERS_RE: RE_STARTERS_RE,
        SHEBANG: SHEBANG,
        BACKSLASH_ESCAPE: BACKSLASH_ESCAPE,
        APOS_STRING_MODE: APOS_STRING_MODE,
        QUOTE_STRING_MODE: QUOTE_STRING_MODE,
        PHRASAL_WORDS_MODE: PHRASAL_WORDS_MODE,
        COMMENT: COMMENT,
        C_LINE_COMMENT_MODE: C_LINE_COMMENT_MODE,
        C_BLOCK_COMMENT_MODE: C_BLOCK_COMMENT_MODE,
        HASH_COMMENT_MODE: HASH_COMMENT_MODE,
        NUMBER_MODE: NUMBER_MODE,
        C_NUMBER_MODE: C_NUMBER_MODE,
        BINARY_NUMBER_MODE: BINARY_NUMBER_MODE,
        REGEXP_MODE: REGEXP_MODE,
        TITLE_MODE: TITLE_MODE,
        UNDERSCORE_TITLE_MODE: UNDERSCORE_TITLE_MODE,
        METHOD_GUARD: METHOD_GUARD,
        END_SAME_AS_BEGIN: END_SAME_AS_BEGIN
    });

    /**
    @typedef {import('highlight.js').CallbackResponse} CallbackResponse
    @typedef {import('highlight.js').CompilerExt} CompilerExt
    */

    // Grammar extensions / plugins
    // See: https://github.com/highlightjs/highlight.js/issues/2833

    // Grammar extensions allow "syntactic sugar" to be added to the grammar modes
    // without requiring any underlying changes to the compiler internals.

    // `compileMatch` being the perfect small example of now allowing a grammar
    // author to write `match` when they desire to match a single expression rather
    // than being forced to use `begin`.  The extension then just moves `match` into
    // `begin` when it runs.  Ie, no features have been added, but we've just made
    // the experience of writing (and reading grammars) a little bit nicer.

    // ------

    // TODO: We need negative look-behind support to do this properly
    /**
     * Skip a match if it has a preceding dot
     *
     * This is used for `beginKeywords` to prevent matching expressions such as
     * `bob.keyword.do()`. The mode compiler automatically wires this up as a
     * special _internal_ 'on:begin' callback for modes with `beginKeywords`
     * @param {RegExpMatchArray} match
     * @param {CallbackResponse} response
     */
    function skipIfHasPrecedingDot(match, response) {
      const before = match.input[match.index - 1];
      if (before === ".


qv.into(), epsilon = 1e-6);
    assert_ulps_eq!(gqv, mqv.into(), epsilon = 1e-6);
}

fn quat_mul_quat_compare() {
    let mut rng = Pcg64Mcg::new(rand::random());
    let mq1 = random_mint_quat(&mut rng);
    let mq2 = random_mint_quat(&mut rng);

    let gq1: glam::Quat = mq1.into();
    let gq2: glam::Quat = mq2.into();
    let gq3 = gq1 * gq2;

    let nq1 = nalgebra::UnitQuaternion::from_quaternion(mq1.into());
    let nq2 = nalgebra::UnitQuaternion::from_quaternion(mq2.into());
    let nq3 = nq1 * nq2;

    let cq1: cgmath::Quaternion<f32> = mq1.into();
    let cq2: cgmath::Quaternion<f32> = mq2.into();
    let cq3 = cq1 * cq2;

    // use nalgebra as assumed correct answer
    let mq3: mint::Quaternion<f32> = nq3.into();

    assert_ulps_eq!(cq3, mq3.into(), epsilon = 1e-6);
    assert_ulps_eq!(gq3, mq3.into(), epsilon = 1e-6);
}

#[test]
fn test_quat_from_axis_angle() {
    use cgmath::Rotation3;
    let rad = std::f32::consts::FRAC_PI_2;
    let gx = glam::Vec3::unit_x();
    let nx = nalgebra::Vector3::x_axis();
    let mx: mint::Vector3<f32> = nx.into_inner().into();
    assert_eq!(gx, mx.into());
    let cx = cgmath::Vector3::unit_x();
    let gq = glam::Quat::from_axis_angle(gx, rad);
    let nq = nalgebra::UnitQuaternion::from_axis_angle(&nx, rad);
    let cq = cgmath::Quaternion::from_axis_angle(cx, cgmath::Rad(rad));
    let mnq: mint::Quaternion<f32> = nq.into();
    let mcq: mint::Quaternion<f32> = cq.into();
    assert_ulps_eq!(gq, mnq.into());
    assert_ulps_eq!(gq, mcq.into());

    let gqv = gq * glam::Vec3::unit_y();
    let nqv = nq * nalgebra::Vector3::y_axis();
    let cqv = cq * cgmath::Vector3::unit_y();
    let mnqv: mint::Vector3<f32> = nqv.into_inner().into();
    let mcqv: mint::Vector3<f32> = cqv.into();
    assert_ulps_eq!(gqv, mnqv.into(), epsilon = 1e-5);
    assert_ulps_eq!(gqv, mcqv.into(), epsilon = 1e-5);
}

#[test]
fn test_quat_mul_vec3() {
    for _ in 0..NUM_ITERS {
        quat_mul_vec3_compare();
    }
}

#[test]
fn test_quat_mul_quat() {
    for _ in 0..NUM_ITERS {
        quat_mul_quat_compare();
    }
}
<reponame>thibautvdv/drone
//! CLI utility for Drone, an Embedded Operating System.
//!
//! # Documentation
//!
//! Refer to the [Drone Book](https://book.drone-os.com/) for documentation.
//!
//! # Usage
//!
//! The program requires Nightly channel of Rust. Make sure you have it
//! installed:
//!
//! ```shell
//! $ rustup toolchain install nightly
//! ```
//!
//! Install the latest version from crates.io:
//!
//! ```shell
//! $ cargo +nightly install drone
//! ```
//!
//! Check the built-in help:
//!
//! ```shell
//! $ drone help
//! ```

#![feature(bool_to_option)]


 effDate,
    'expDate': expDate,
    'keyType': src.keyType,
    'keyValue': src.keyValue,
    'refCode': src.refCode,
    'statCode': src.statCode
  };
  return dest;
}

export function termKeyNew() {
  const dest = {
    'id': null,
    'checkValue': null,
    'effDate': null,
    'expDate': null,
    'keyType': null,
    'keyValue': null,
    'refCode': null,
    'statCode': null
  };
  return dest;
}

/**
 * @see https://www.tutorialspoint.com/typescript/typescript_string_split.htm
 */
function dateToDateTime(oldDateTime: any, newDateTime: any) {
  console.log('oldDateTime:' + oldDateTime)
  console.log('newDateTime:' + newDateTime)

  const splitted: string = 'T';
  const formatDate: string = 'YYYY-MM-DDTHH:mm:ss.sssZZ';

  const dtCurr = moment()
                  .format(formatDate)
                  .split(splitted, 2);

  /**
   * №1 - новая дата, старое время (date+date)
   */
  if (!isEmpty(oldDateTime) && !isEmpty(newDateTime)) {
    const dtNew: any = moment(newDateTime.jsdate)
                        .format(formatDate)
                        .split(splitted, 2);
    const dtOld: any = oldDateTime.split(splitted, 2);
    return dtNew[0] + splitted + dtOld[1];
  }

  /**
   * №2 - новая дата, текущее время (null+date)
   */
  if (isEmpty(oldDateTime) && !isEmpty(newDateTime)) {
    const dtNew: any = moment(newDateTime.jsdate)
                        .format(formatDate)
                        .split(splitted, 2);
    return dtNew[0] + splitted + dtCurr[1];
  }

  /**
   * №3 - старая дата, старое время (date+null)
   */
  if (!isEmpty(oldDateTime) && isEmpty(newDateTime)) {
    const dtOld: any = oldDateTime.split(splitted, 2);
    return dtOld[0] + splitted + dtOld[1];
  }

  /**
   * №4 - ничего (null+null)
   */
  return null;
}

function dateTimeToJsDate(dateTime: any) {
  return !isEmpty(dateTime) ? { jsdate: new Date(dateTime) } : null;
}

/**
 * https://stackoverflow.com/questions/5515310/is-there-a-standard-function-to-check-for-null-undefined-or-blank-variables-in?rq=1
 */
function isEmpty(val) {
  return (val === null || val === undefined || val === '') ? true : false;
}
/*
* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org
*
* This software is provided 'as-is', without any express or implied
* warranty.  In no event will the authors be held liable for any damages
* arising from the use of this software.
* Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
* 1. The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software. If you use this software
* in a product, an acknowledgment in the product documentation would be
* appreciated but is not required.
* 2. Altered source versions must be plainly marked as such, and must not be
* misre


   }

        totalLength = Platform.getInt(base, offsetInPage) - 4;
        currentklen = Platform.getInt(base, offsetInPage + 4);
        currentvlen = totalLength - currentklen;

        key.pointTo(base, offsetInPage + 8, currentklen);
        value.pointTo(base, offsetInPage + 8 + currentklen, currentvlen);

        offsetInPage += 8 + totalLength + 8;
        recordsInPage -= 1;
        return true;
      }

      @Override
      public UnsafeRow getKey() {
        return key;
      }

      @Override
      public UnsafeRow getValue() {
        return value;
      }

      @Override
      public void close() {
        // do nothing
      }

      private void freeCurrentPage() {
        if (page != null) {
          freePage(page);
          page = null;
        }
      }
    };
  }

  protected VariableLengthRowBasedKeyValueBatch(StructType keySchema, StructType valueSchema,
                                              int maxRows, TaskMemoryManager manager) {
    super(keySchema, valueSchema, maxRows, manager);
    this.keyOffsets = new long[maxRows];
  }
}
/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You 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 org.apache.spark.sql.catalyst.expressions.codegen;

import org.apache.spark.sql.types.Decimal;
import org.apache.spark.unsafe.Platform;
import org.apache.spark.unsafe.array.ByteArrayMethods;
import org.apache.spark.unsafe.bitset.BitSetMethods;
import org.apache.spark.unsafe.types.CalendarInterval;
import org.apache.spark.unsafe.types.UTF8String;

import static org.apache.spark.sql.catalyst.expressions.UnsafeArrayData.calculateHeaderPortionInBytes;

/**
 * A helper class to write data into global row buffer using `UnsafeArrayData` format,
 * used by {@link org.apache.spark.sql.catalyst.expressions.codegen.GenerateUnsafeProjection}.
 */
public class UnsafeArrayWriter {

  private BufferHolder holder;

  // The offset of the global buffer where we start to write this array.
  private int startingOffset;

  // The number of elements in this array
  private int numElements;

  private int headerInBytes;

  private void assertIndexIsValid(int index) {
    assert index >= 0 : "index (" + index + ") should >= 0";
    assert index < numElements : "index (" + index + ") should < " + numElements;
  }

  public void initialize(BufferHolder holder, int numElements, int elementSize) {
    // We need 8 bytes to store numElements in header
    this.numElements = numElements;
    this.headerInBytes = calculateHeaderPortionInBytes(numElements);

    this.holder = holder;
    this.startingOffset = holder.cursor;

    // Grows the global buffer ahead for header and fixed size data.
    int fixedPartInBytes =
      ByteArrayMethods.roundNumberOfBytesToNearestWord(elementSize * numElements);
    holder.grow(headerInBytes + fixedPartInBytes);


long)(i * entrySize);
            TEntry entry = target.ProcessedData.GetOrAdd<TEntry>(entryAddress);
            entries.Add(entry);
        }
        return new SHash<TKey, TEntry>
        {
            Table = table,
            TableSize = tableSize,
            EntrySize = entrySize,
            Traits = traits,
            Entries = entries
        };
    }
    TEntry ISHash.LookupSHash<TKey, TEntry>(ISHash<TKey, TEntry> hashTable, TKey key)
    {
        SHash<TKey, TEntry> shashTable = (SHash<TKey, TEntry>)hashTable;
        if (shashTable.TableSize == 0)
            return shashTable.Traits!.Null();

        uint hash = shashTable.Traits!.Hash(key);
        uint index = hash % shashTable.TableSize;
        uint increment = 0;
        while (true)
        {
            TEntry current = shashTable.Entries![(int)index];
            if (shashTable.Traits.IsNull(current))
                return shashTable.Traits.Null();
            // we don't support the removal of entries
            if (!shashTable.Traits.IsDeleted(current) && shashTable.Traits.Equals(key, shashTable.Traits.GetKey(current)))
                return current;

            if (increment == 0)
                increment = (hash % (shashTable.TableSize - 1)) + 1;

            index += increment;
            if (index >= shashTable.TableSize)
                index -= shashTable.TableSize;
        }
    }
}


 Float.toString(ff).equals(answer));
		// TODO : There is a known problem with floating point printing. So
		// this is not included
	}

	/**
	 * @tests java.lang.Float#valueOf(java.lang.String)
	 */
	@SuppressWarnings("all") // "Comparing identical expressions" 0.0f == -0.0f
	public void test_valueOfLjava_lang_String() {
		// Test for method java.lang.Float
		// java.lang.Float.valueOf(java.lang.String)

		Float wanted = new Float(432.1235f);
		Float got = Float.valueOf("432.1235");
		assertTrue("Incorrect float returned--wanted: " + wanted + " but got: "
				+ got, got.equals(wanted));

		wanted = new Float(0f);
		got = Float.valueOf("0");
		assertTrue("Incorrect float returned--wanted: " + wanted + " but got: "
				+ got, got.equals(wanted));

		wanted = new Float(-1212.3232f);
		got = Float.valueOf("-1212.3232");
		assertTrue("Incorrect float returned--wanted: " + wanted + " but got: "
				+ got, got.equals(wanted));

		try {
			Float.valueOf(null);
			fail("Expected Float.valueOf(null) to throw NPE.");
		} catch (NullPointerException ex) {
			// expected
		} catch (Exception ex) {
			fail("Expected Float.valueOf(null) to throw NPE not "
					+ ex.getClass().getName());
		}

		try {
			Float.valueOf("");
			fail("Expected Float.valueOf(\"\") to throw NFE");
		} catch (NumberFormatException e) {
			// expected
		}

		Float posZero = Float.valueOf("+0.0");
		Float negZero = Float.valueOf("-0.0");
		assertFalse("Floattest0", posZero.equals(negZero));
		assertTrue("Floattest1", 0.0f == -0.0f);

		// Tests for float values by name.
		Float expectedNaN = new Float(Float.NaN);

		Float posNaN = Float.valueOf("NaN");
		assertTrue("Floattest2", posNaN.equals(expectedNaN));

		Float posNaNSigned = Float.valueOf("+NaN");
		assertTrue("Floattest3", posNaNSigned.equals(expectedNaN));

		Float negNaNSigned = Float.valueOf("-NaN");
		assertTrue("Floattest4", negNaNSigned.equals(expectedNaN));

		Float posInfinite = Float.valueOf("Infinity");
		assertTrue("Floattest5", posInfinite.equals(new Float(
				Float.POSITIVE_INFINITY)));

		Float posInfiniteSigned = Float.valueOf("+Infinity");
		assertTrue("Floattest6", posInfiniteSigned.equals(new Float(
				Float.POSITIVE_INFINITY)));

		Float negInfiniteSigned = Float.valueOf("-Infinity");
		assertTrue("Floattest7", negInfiniteSigned.equals(new Float(
				Float.NEGATIVE_INFINITY)));
	}

	/**
	 * Sets up the fixture, for example, open a network connection. This method
	 * is called before a test is executed.
	 */
	protected void setUp() {
	}

	/**
	 * Tears down the fixture, for example, close a network connection. This
	 * method is called after a test is executed.
	 */
	protected void tearDown() {
	}

	private void test_toString(float ff, String answer) {
		// Test for method java.lang.String java.lang.Double.toString(double)
		assertTrue("Incorrect


            {354608772, 151524494},
            {359629120, 146515788},
            {359638123, 105715491},
            {352907860, 98987790},
            {313120315, 98984639},
        },
        {
        },
    },
    {
        {
            {657746643, 86246732},
            {651722477, 92270881},
            {651720052, 131280884},
            {653947196, 131280884},
            {659746643, 125487816},
            {659746643, 119273826},
            {663742413, 112352691},
            {671726623, 112352691},
            {675733721, 119283349},
            {684745297, 119298573},
            {689758503, 114263168},
            {689752066, 91272158},
            {684746643, 86260871},
            {657746643, 86246732},
        },
        {
        },
    },
    {
        {
            {653940791, 39260871},
            {651720052, 39260871},
            {651726623, 78280611},
            {657746631, 84295035},
            {684746643, 84280891},
            {689752066, 79269604},
            {689746643, 56247942},
            {684745283, 51243184},
            {675733721, 51258413},
            {671726623, 58189071},
            {663742413, 58189071},
            {659746643, 51267936},
            {659746643, 45053950},
            {653940791, 39260871},
        },
        {
        },
    },
    {
        {
            {442365208, 3053303},
            {436408500, 5694021},
            {434342552, 11072741},
            {436986326, 17009033},
            {442365367, 19073360},
            {448299202, 16431441},
            {450365150, 11052721},
            {448299202, 5694021},
            {442365208, 3053303},
        },
        {
        },
    },
};
//
// gettsc.inl
//
// gives access to the Pentium's (secret) cycle counter
//
// This software was written by Leonard Janke (janke@unixg.ubc.ca)
// in 1996-7 and is entered, by him, into the public domain.

#if defined(__WATCOMC__)
void GetTSC(unsigned long&);
#pragma aux GetTSC = 0x0f 0x31 "mov [edi], eax" parm [edi] modify [edx eax];
#elif defined(__GNUC__)
inline
void GetTSC(unsigned long& tsc)
{
  asm volatile(".byte 15, 49\n\t"
	       : "=eax" (tsc)
	       :
	       : "%edx", "%eax");
}
#elif defined(_MSC_VER)
inline
void GetTSC(unsigned long& tsc)
{
  unsigned long a;
  __asm _emit 0fh
  __asm _emit 31h
  __asm mov a, eax;
  tsc=a;
}
#endif

#include <stdio.h>
#include <stdlib.h>
#include <openssl/des.h>

void main(int argc,char *argv[])
	{
	des_key_schedule key;
	unsigned long s1,s2,e1,e2;
	unsigned long


BranchID === 901 ? `Center` : `Oil`
                                setSendHeader(listHeader)
                              } else {
                                swal("แจ้งเตือน", "ไม่พบข้อมูล", "error")
                                  .then(() => {
                                    const listHeader = [...sendHeader]
                                    listHeader[0]['source'] = ""
                                    listHeader[0]['source_Department'] = ""
                                    listHeader[0]['source_BU'] = ""
                                    setSendHeader(listHeader)
                                  })
                              }
                            }}
                            renderInput={(params) => (
                              <TextField
                                {...params}
                                variant="standard"
                                InputProps={{
                                  ...params.InputProps,
                                  startAdornment: (
                                    <InputAdornment position="start">
                                      <Typography color="black" >
                                        ผู้ส่งมอบ :
                                      </Typography>
                                    </InputAdornment>
                                  ),
                                }}
                              />
                            )}
                          />
                        </Grid>
                        <Grid item xs={6}>
                          <TextField
                            variant="standard"
                            name='source_firstName'
                            value={sourceName}
                            onChange={(e) => {
                              const list = [...sendHeader]
                              list[0].nameSource = `${e.target.value} ${sourceLastName ? sourceLastName : ''}`
                              setSourceName(e.target.value);
                              setSendHeader(list)
                            }}
                            InputProps={{
                              startAdornment: (
                                <InputAdornment position="start">
                                  <Typography color="black" >
                                    ชื่อจริง :
                                  </Typography>
                                </InputAdornment>
                              ),
                            }}
                          />
                        </Grid>
                        <Grid item xs={6}>
                          <TextField
                            variant="standard"
                            name='source_lastName'
                            value={sourceLastName}
                            onChange={(e) => {
                              const list = [...sendHeader]
                              list[0].nameSource = `${sourceName ? sourceName : ''} ${e.target.value}`
                              setSourceLastName(e.target.value);
                              setSendHeader(list)
                            }}
                            InputProps={{
                              startAdornment: (
                                <InputAdornment position="start">
                                  <Typography color="black" >
                                    นามสกุล :
                                  </Typography>
                                </InputAdornment>
                              ),
                            }}
                          />
                        </Grid>
                        <Grid item xs={12}>
                          <LocalizationProvider dateAdapter={AdapterDayjs}>
                            <DateTimePicker
                              format="YYYY-MM-DD"
                              name="source_Date"
                              sx={{ width: '100%' }}
                              timezone="UTC"
                              value={sendHeader[0].sourceDate ? dayjs(sendHeader[0].sourceDate) : null}
                              onChange={(newValue) => {
                                const listHeader = [...sendHeader]
                                listHeader[0]['sourceDate'] = dayjs(newValue).format('YYYY-MM-DD HH:mm')
                                setSendHeader(listHeader)
                              }}
                              ampm={false}
                              label='วันที่ส่งมอบ'
                              slotProps={{
                                textField: { variant: 'standard' },
                              }}
                            />
                          </Localizatio


        expected,
            "The value in tuple should be flatten to string"
        );

        let line: Node<&'static str, &'static str, (), ()> = element(
            "line",
            vec![attr("transition", ("opacity", 1, "linear"))],
            vec![],
        );
        let expected = "<line transition=\"opacity 1 linear\"></line>";
        assert_eq!(
            format!("{}", line),
            expected,
            "The value in tuple should be flatten to string"
        );

        let line: Node<&'static str, &'static str, (), ()> = element(
            "line",
            vec![attr("transition", ("opacity", 1, "linear", true))],
            vec![],
        );
        let expected = "<line transition=\"opacity 1 linear true\"></line>";
        assert_eq!(
            format!("{}", line),
            expected,
            "The value in tuple should be flatten to string"
        );
    }

    #[test]
    fn array_value() {
        let line: Node<&'static str, &'static str, (), ()> =
            element("line", vec![attr("stroke-dasharray", [10, 20])], vec![]);
        let expected = "<line stroke-dasharray=\"10 20\"></line>";
        assert_eq!(
            format!("{}", line),
            expected,
            "The value in array should be flatten to string"
        );

        let line: Node<&'static str, &'static str, (), ()> = element(
            "line",
            vec![attr("stroke-dasharray", [10, 20, 30, 40])],
            vec![],
        );
        let expected = "<line stroke-dasharray=\"10 20 30 40\"></line>";
        assert_eq!(
            format!("{}", line),
            expected,
            "The value in array should be flatten to string"
        );
    }
}
<reponame>FlorianRohm/aoc2020-rs<filename>day17/src/simulation_3d.rs<gh_stars>1-10
use ndarray::{Array3, Zip};
use ndarray::prelude::s;

use crate::cell::Cell;

#[derive(PartialEq, Debug)]
pub struct Simulation3d {
    pub l_x: usize,
    pub l_y: usize,
    pub l_z: usize,
    pub lattice: Array3<Cell>,
    pub tmp_lattice: Array3<Cell>,
}

macro_rules! inner_slice {
    ( $x:expr ) => {
        s!(1..=$x.l_x, 1..=$x.l_y, 1..=$x.l_z)
    };
}
impl Simulation3d {
    pub fn propagate(mut self) -> Self {
        let source = self.lattice.windows((3, 3, 3));
        let mut target = self.tmp_lattice.slice_mut(inner_slice!(self));
        Zip::from(&mut target).and(source).apply(|tar, src| {
            let occupations = src.iter().filter(|c| c == &&Cell::Active).count();

            let new_cell = match (&src[[1, 1, 1]], occupations) {
                (Cell::Active, o) if o == 3 || o == 4 => Cell::Active,
                (Cell::Inactive, o) if o == 3 => Cell::Active,
                _ => Cell::Inactive
            };

            *tar = new_cell;
        });
        std::mem::swap(&mut self.tmp_lattice, &mut self.lattice);

        self
    }
    pub fn count_active(&self) -> usize {
        self.lattice.iter().filter(|c|


.vec.fvec, &vec_from_enemy);

	//	If shot is incoming...
	if (dot_from_enemy < 0.3f) {
		if (weapon_objp == unlocked_weapon_objp)
			aip->danger_weapon_objnum = -1;
		return;
	} else if (dot_from_enemy > 0.7f) {
		bool should_afterburn = dist < 200.0f;
		int aburn_time = F1_0 / 2;

		// within 200m bad, within 1.5 seconds good
		if (The_mission.ai_profile->flags[AI::Profile_Flags::Improved_missile_avoidance]) {
			should_afterburn = dist < weapon_objp->phys_info.speed * 1.5f;
			aburn_time = F1_0 + F1_0 / 2;
		}

		if (should_afterburn) {
			if (!( Pl_objp->phys_info.flags & PF_AFTERBURNER_ON )) {
				if (ai_maybe_fire_afterburner(Pl_objp, aip)) {
					afterburners_start(Pl_objp);
					aip->afterburner_stop_time = Missiontime + aburn_time;
				}
			}
		}

		// Fancy (read: effective) dodging
		// Try to go perpindicular to the incoming missile, and pick the quickest direction to get there
		if (The_mission.ai_profile->flags[AI::Profile_Flags::Improved_missile_avoidance]) {
			vec3d avoid_point;
			vm_project_point_onto_plane(&avoid_point, &vec_from_enemy, &Pl_objp->orient.vec.fvec, &vmd_zero_vector);
			vm_vec_normalize(&avoid_point);
			if (vm_vec_dot(&Pl_objp->orient.vec.fvec, &vec_from_enemy) > 0.f)
				vm_vec_negate(&avoid_point);
			vm_vec_scale_add(&avoid_point, &Pl_objp->pos, &avoid_point, 200.0f);

			turn_towards_point(Pl_objp, &avoid_point, nullptr, 0.0f);
		}
		//	If we're sort of pointing towards it...
		else if ((dot_to_enemy < -0.5f) || (dot_to_enemy > 0.5f)) {
			float rdot;
			float udot;

			//	Turn hard left or right, depending on which gets out of way quicker.
			//SUSHI: Also possibly turn up or down.
			rdot = vm_vec_dot(&Pl_objp->orient.vec.rvec, &vec_from_enemy);
			udot = vm_vec_dot(&Pl_objp->orient.vec.uvec, &vec_from_enemy);

			if (aip->ai_profile_flags[AI::Profile_Flags::Allow_vertical_dodge] && fl_abs(udot) > fl_abs(rdot))
			{
				if ((udot < -0.5f) || (udot > 0.5f))
					vm_vec_scale_add(&goal_point, &Pl_objp->pos, &Pl_objp->orient.vec.uvec, -200.0f);
				else
					vm_vec_scale_add(&goal_point, &Pl_objp->pos, &Pl_objp->orient.vec.uvec, 200.0f);
			}
			else
			{
				if ((rdot < -0.5f) || (rdot > 0.5f))
					vm_vec_scale_add(&goal_point, &Pl_objp->pos, &Pl_objp->orient.vec.rvec, -200.0f);
				else
					vm_vec_scale_add(&goal_point, &Pl_objp->pos, &Pl_objp->orient.vec.rve


ex].value;
        });
    }
}import { Translator } from '../../'

const MarginTranslator: Translator = {
  translateProperty: (breakPoint, property, element) => {
    switch (property) {
      case 'm':
        return `m${breakPoint}-${convertMarginValue(element.m)}`
      case 'mT':
        return `mt${breakPoint}-${convertMarginValue(element.mT)}`
      case 'mB':
        return `mb${breakPoint}-${convertMarginValue(element.mB)}`
      case 'mY':
        return `my${breakPoint}-${convertMarginValue(element.mY)}`
      case 'mL':
        return `ml${breakPoint}-${convertMarginValue(element.mL)}`
      case 'mR':
        return `mr${breakPoint}-${convertMarginValue(element.mR)}`
      case 'mX':
        return `mx${breakPoint}-${convertMarginValue(element.mX)}`
    }
    return ''
  },
}

const convertMarginValue = (value: string | number) =>
  typeof value === 'string' || value > 0 ? value : `n${value * -1}`

export default MarginTranslator
import { EventEmitter, EventDefinitions } from "zogra-renderer";

export class LazyEventEmitter<TEvents extends EventDefinitions>
{
    cachedEvents = new Map<string, any[]>();
    gapFrames = 3;
    private framesCount = 0;
    private eventEmitter: EventEmitter<TEvents>;
    constructor(eventEmitter:EventEmitter<TEvents>, gap: number = 3)
    {
        this.eventEmitter = eventEmitter;
        this.gapFrames = gap;
    }
    emit<T extends keyof TEvents>(event: T, ...args: Parameters<TEvents[T]>)
    {
        this.cachedEvents.set(event as string, args);
    }
    update()
    {
        this.framesCount++;
        if (this.framesCount >= this.gapFrames)
        {
            for (const [event, args] of this.cachedEvents)
            {
                this.eventEmitter.emit(event, ...args as any);
            }
            this.cachedEvents.clear();
            this.framesCount = 0;
        }
    }
}
export class BiMap<TKey, TValue>
{
    private k2v = new Map<TKey, TValue>();
    private v2k = new Map<TValue, TKey>();
    strict = true;
    get size() { return this.k2v.size }
    constructor(strict = true)
    {
        this.strict = strict;
    }
    clear()
    {
        this.k2v.clear();
        this.v2k.clear();
    }
    getValue(key: TKey)
    {
        return this.k2v.get(key);
    }
    getKey(value: TValue)
    {
        return this.v2k.get(value);
    }
    set(key: TKey, value: TValue)
    {
        if (this.strict && this.k2v.has(key) && this.k2v.get(key) !== value)
            throw new Error("Conflict with existed pair.");
        this.k2v.set(key, value);
        this.v2k.set(value, key);
    }
    hasKey(key: TKey)
    {
        return this.k2v.has(key);
    }
    hasValue(value: TValue)
    {
        return this.v2k.has(value);
    }
    deleteKey(key: TKey)
    {
        if (this.k2v.has(key))
        {
            this.v2k.delete(this.k2v.get(key) as TValue);
            this.k2v.delete(key);
        }
    }
    deleteValue(value: TValue)


, -0x10(r1)
/* 8017004C 0016CF8C  7C 08 02 A6 */	mflr r0
/* 80170050 0016CF90  90 01 00 14 */	stw r0, 0x14(r1)
/* 80170054 0016CF94  C0 04 00 00 */	lfs f0, 0(r4)
/* 80170058 0016CF98  D0 03 03 AC */	stfs f0, 0x3ac(r3)
/* 8017005C 0016CF9C  C0 04 00 04 */	lfs f0, 4(r4)
/* 80170060 0016CFA0  D0 03 03 B0 */	stfs f0, 0x3b0(r3)
/* 80170064 0016CFA4  C0 04 00 08 */	lfs f0, 8(r4)
/* 80170068 0016CFA8  D0 03 03 B4 */	stfs f0, 0x3b4(r3)
/* 8017006C 0016CFAC  81 83 00 00 */	lwz r12, 0(r3)
/* 80170070 0016CFB0  81 8C 01 B0 */	lwz r12, 0x1b0(r12)
/* 80170074 0016CFB4  7D 89 03 A6 */	mtctr r12
/* 80170078 0016CFB8  4E 80 04 21 */	bctrl
/* 8017007C 0016CFBC  80 01 00 14 */	lwz r0, 0x14(r1)
/* 80170080 0016CFC0  7C 08 03 A6 */	mtlr r0
/* 80170084 0016CFC4  38 21 00 10 */	addi r1, r1, 0x10
/* 80170088 0016CFC8  4E 80 00 20 */	blr
.endfn "onSetPosition__Q24Game6PelletFR10Vector3<f>"

.fn inWater__Q24Game6PelletFv, weak
/* 8017008C 0016CFCC  88 63 03 25 */	lbz r3, 0x325(r3)
/* 80170090 0016CFD0  4E 80 00 20 */	blr
.endfn inWater__Q24Game6PelletFv

.fn getBedamaColor__Q24Game6PelletFv, weak
/* 80170094 0016CFD4  38 60 FF FF */	li r3, -1
/* 80170098 0016CFD8  4E 80 00 20 */	blr
.endfn getBedamaColor__Q24Game6PelletFv

.fn getSound_PosPtr__Q24Game6PelletFv, weak
/* 8017009C 0016CFDC  38 63 03 AC */	addi r3, r3, 0x3ac
/* 801700A0 0016CFE0  4E 80 00 20 */	blr
.endfn getSound_PosPtr__Q24Game6PelletFv

.fn getFaceDir__Q24Game6PelletFv, weak
/* 801700A4 0016CFE4  C0 23 03 B8 */	lfs f1, 0x3b8(r3)
/* 801700A8 0016CFE8  4E 80 00 20 */	blr
.endfn getFaceDir__Q24Game6PelletFv

.fn deferPikiCollision__Q24Game6PelletFv, weak
/* 801700AC 0016CFEC  38 60 00 01 */	li r3, 1
/* 801700B0 0016CFF0  4E 80 00 20 */	blr
.endfn deferPikiCollision__Q24Game6PelletFv

.fn sound_otakaraEventFinish__Q24Game6PelletFv, weak
/* 801700B4 0016CFF4  4E 80 00 20 */	blr
.endfn sound_otakaraEventFinish__Q24Game6PelletFv

.fn __dt__Q


se an [Iterator].
 */
internal inline fun <R, T> List<R>.firstNotNullOfOrNullIndices(transform: (R) -> T?): T? {
    for (i in indices) {
        transform(get(i))?.let { return it }
    }
    return null
}

/**
 * Removes values from the list as determined by the [predicate].
 * Generate an index-based loop that doesn't use an [Iterator].
 */
internal inline fun <T> MutableList<T>.removeIfIndices(predicate: (T) -> Boolean) {
    var numDeleted = 0
    for (rawIndex in indices) {
        val index = rawIndex - numDeleted
        if (predicate(get(index))) {
            removeAt(index)
            numDeleted++
        }
    }
}
package com.seiko.imageloader.component

import com.seiko.imageloader.component.decoder.Decoder
import com.seiko.imageloader.component.fetcher.Fetcher
import com.seiko.imageloader.component.keyer.Keyer
import com.seiko.imageloader.component.mapper.Mapper

class ComponentRegistryBuilder internal constructor(
    private val mappers: MutableList<Mapper<out Any>> = mutableListOf(),
    private val keyers: MutableList<Keyer> = mutableListOf(),
    private val fetcherFactories: MutableList<Fetcher.Factory> = mutableListOf(),
    private val decoderFactories: MutableList<Decoder.Factory> = mutableListOf(),
) {
    internal constructor(componentRegistry: ComponentRegistry) : this(
        mappers = componentRegistry.mappers.toMutableList(),
        keyers = componentRegistry.keyers.toMutableList(),
        fetcherFactories = componentRegistry.fetcherFactories.toMutableList(),
        decoderFactories = componentRegistry.decoderFactories.toMutableList(),
    )

    fun takeFrom(
        componentRegistry: ComponentRegistry,
        clearComponents: Boolean = false,
    ) {
        if (clearComponents) {
            mappers.clear()
            keyers.clear()
            fetcherFactories.clear()
            decoderFactories.clear()
        }
        mappers.addAll(componentRegistry.mappers)
        keyers.addAll(componentRegistry.keyers)
        fetcherFactories.addAll(componentRegistry.fetcherFactories)
        decoderFactories.addAll(componentRegistry.decoderFactories)
    }

    fun add(mapper: Mapper<out Any>) {
        mappers.add(mapper)
    }

    fun add(keyer: Keyer) {
        keyers.add(keyer)
    }

    fun add(fetcherFactory: Fetcher.Factory) {
        fetcherFactories.add(fetcherFactory)
    }

    fun add(decoderFactory: Decoder.Factory) {
        decoderFactories.add(decoderFactory)
    }

    internal fun build(): ComponentRegistry = ComponentRegistry(
        mappers = mappers,
        keyers = keyers,
        fetcherFactories = fetcherFactories,
        decoderFactories = decoderFactories,
    )
}
package com.seiko.imageloader.intercept

import androidx.compose.ui.graphics.painter.Painter
import com.seiko.imageloader.


moduleDesc)
            )

        logger.info("encodedModuleDesc: $encodedModuleDesc".lines().joinToString(" "))

        moduleDescriptorJson.apply {
            parentFile.mkdirs()
            writeText(encodedModuleDesc)
        }

        return moduleDesc
    }
}
package imgui.internal.api

import imgui.ImGui.io
import imgui.WindowFlag
import imgui.api.g
import imgui.hasnt
import imgui.internal.classes.Window
import imgui.internal.hashStr
import imgui.internal.sections.SettingsHandler

/** Settings */
internal interface settings {

    fun markIniSettingsDirty() {
        if (g.settingsDirtyTimer <= 0f)
            g.settingsDirtyTimer = io.iniSavingRate
    }

    fun Window.markIniSettingsDirty() {
        if (flags hasnt WindowFlag.NoSavedSettings && g.settingsDirtyTimer <= 0f)
            g.settingsDirtyTimer = io.iniSavingRate
    }

    // MarkIniSettingsDirty(ImGuiWindow* window) -> Window class

    // Clear all settings (windows, tables, docking etc.)
    fun clearIniSettings() {
        g.settingsIniData = ""
        for (handler in g.settingsHandlers)
            handler.clearAllFn?.invoke(g, handler)
        g.settingsWindows.clear()
    }

    fun addSettingsHandler(handler: SettingsHandler) {
        assert(findSettingsHandler(handler.typeName) == null)
        g.settingsHandlers += handler
    }

    fun removeSettingsHandler(typeName: String) {
        findSettingsHandler(typeName)?.let { handler ->
            g.settingsHandlers -= handler
        }
    }

    fun findSettingsHandler(typeName: String): SettingsHandler? {
        val typeHash = hashStr(typeName)
        return g.settingsHandlers.find { it.typeHash == typeHash }
    }
}package imgui.internal.api

import glm_.func.common.max
import glm_.i
import glm_.vec2.Vec2
import glm_.vec4.Vec4
import imgui.*
import imgui.ImGui.buttonBehavior
import imgui.ImGui.calcItemSize
import imgui.ImGui.calcTextSize
import imgui.ImGui.calcWrapWidthForPos
import imgui.ImGui.currentWindow
import imgui.ImGui.frameHeight
import imgui.ImGui.getColorU32
import imgui.ImGui.isChildOf
import imgui.ImGui.isClippedEx
import imgui.ImGui.itemAdd
import imgui.ImGui.itemSize
import imgui.ImGui.logRenderedText
import imgui.ImGui.logSetNextTextDecoration
import imgui.ImGui.logText
import imgui.ImGui.popColumnsBackground
import imgui.ImGui.pushColumnsBackground
import imgui.ImGui.renderArrow
import imgui.ImGui.renderFrame
import imgui.ImGui.renderNavHighlight
import imgui.ImGui.renderText
import imgui.ImGui.renderTextClipped
import imgui.ImGui.renderTextEllipsis
import imgui.ImGui.renderTextWrapped
import imgui.ImGui.style
import imgui.api.g
import imgui.internal.classes.Rect
import imgui.internal.sections.*
import kotlin.math.floor
import kotlin.math.max
import kotlin.math.min

/** Widgets */
internal interface widgets {

    /** Raw text without formatting. Roughly equivalent to text("%s", text) but:
     *  A) doesn't require null terminated string if 'textEnd' is specified
     *  B) it's faster, no memory copy is done, no buffer size limits, recommended for long chunks of text. */
    fun textEx(text: String, textEnd: Int = -1, flags: TextFlags = none) {
        val bytes = text.toByteArray()
        textEx(bytes, if (textEnd != -1) textEnd else bytes.strlen(), flags)
    }

    /** Raw text without formatting. Roughly equivalent to text("%s", text) but:
     *  A) doesn't require null terminated string if 'textEnd' is specified
     *  B) it's faster, no memory copy is done, no buffer size limits, recommended for long chunks of text. */
    fun textEx(text: ByteArray,


 !important; /* Same cyan gradient */
  opacity: 0.9 !important; /* Same as liquid blue hover */
  box-shadow: 0 12px 32px rgba(0, 255, 255, 0.4) !important; /* Enhanced cyan shadow like .btn-primary:hover */
  transform: translateY(-2px) !important; /* Same lift as .btn-primary:hover */
}

/* ============================================= */
/* THREAD DROPDOWN BUTTON POSITIONING - MOVE LEFT */
/* ============================================= */

/* Reduce thread dropdown width for better proportion - moderate size */
[data-theme="liquid-glass"] .dropdown-content.menu.shadow-2xl.bg-black\/80.rounded-box.p-3.w-full.border,
[data-theme="liquid-blue"] .dropdown-content.menu.shadow-2xl.bg-black\/80.rounded-box.p-3.w-full.border {
  width: 341px !important; /* 341px width */
  max-width: 95vw !important; /* Prevent overflow on small screens */
}

/* Reduce space to the right of people and strangers icons */
[data-theme="liquid-glass"] .people-btn,
[data-theme="liquid-glass"] .strangers-btn,
[data-theme="liquid-blue"] .people-btn,
[data-theme="liquid-blue"] .strangers-btn {
  gap: 0.125rem !important; /* Much tighter gap between icon and text */
}

/* Move thread dropdown buttons slightly left for better alignment */
[data-theme="liquid-glass"] .dropdown-content.menu .thread-dropdown-btn,
[data-theme="liquid-glass"] .menu li > .thread-dropdown-btn {
  padding-left: 0.5rem !important; /* Reduce left padding */
  margin-left: -0.3rem !important; /* Add negative left margin */
}

[data-theme="liquid-blue"] .dropdown-content.menu .thread-dropdown-btn,
[data-theme="liquid-blue"] .menu li > .thread-dropdown-btn {
  padding-left: 0.5rem !important; /* Reduce left padding */
  margin-left: -0.3rem !important; /* Add negative left margin */
}

/* Ensure container accommodates the adjusted positioning */
[data-theme="liquid-glass"] .dropdown-content.menu li:has(.thread-dropdown-btn),
[data-theme="liquid-blue"] .dropdown-content.menu li:has(.thread-dropdown-btn) {
  padding-left: 0.3rem !important; /* Reduce container left padding */
}

/* Ensure emoji and image buttons use teal hover color in liquid-blue theme */
[data-theme="liquid-blue"] .HomeFeedTextarea-container button:hover svg,
[data-theme="liquid-blue"] .HomeFeedTextarea-container svg:hover,
[data-theme="liquid-blue"] button:hover svg[class*="text-secondary"],
[data-theme="liquid-blue"] svg[class*="text-secondary"]:hover {
  color: rgb(20, 184, 166) !important; /* teal-400 */
}

/* ============================================= */
/* THINKING INDICATOR ANIMATIONS */
/* ============================================= */

/* Sleek professional pulse animation for both themes */
/* ============================================= */
/* RELAY SETTINGS PAGE - LIQUID BLUE BACKDROP */
/* ============================================= */

/* Apply Liquid Blue gradient to Relay Settings page - MATCHING DASHBOARD STYLE */
[class*="relay-settings"],
[class*="RelaySettings"],
[data-*="relay-settings"],
[data-*="relaysettings"],
.h-screen.w-full.flex.relative:has(.bg-base-100.overflow-y-auto),
.h-screen.w-full.flex:has(.bg-base-100.overflow-y-auto) {
  /* Ma


可能取值为X = {x1, x2,…, xk}，其概率分布为P(X = xi) = pi（i = 1,2, ..., n），则随机变量X的熵定义为：

![](https://img.hacpai.com/e/26d8421fd2fc4de7a08156a869262ef1.webp)

把最前面的负号放到最后，便成了：

![](https://img.hacpai.com/e/08a5b921375348acb34a0df55dd01a98.webp)

上面两个熵的公式，无论用哪个都行，而且两者等价，一个意思（这两个公式在下文中都会用到）。

联合熵：两个随机变量X，Y的联合分布，可以形成联合熵Joint Entropy，用H(X,Y)表示。

条件熵：在随机变量X发生的前提下，随机变量Y发生所新带来的熵定义为Y的条件熵，用H(Y|X)表示，用来衡量在已知随机变量X的条件下随机变量Y的不确定性。

且有此式子成立：H(Y|X) = H(X,Y) – H(X)，整个式子表示(X,Y)发生所包含的熵减去X单独发生包含的熵。至于怎么得来的请看推导：![](https://img.hacpai.com/e/fe2587eec4354ee6a10ae1d1f8ed725b.webp)

   简单解释下上面的推导过程。整个式子共6行，其中

第二行推到第三行的依据是边缘分布p(x)等于联合分布p(x,y)的和；

第三行推到第四行的依据是把公因子logp(x)乘进去，然后把x,y写在一起；

第四行推到第五行的依据是：因为两个sigma都有p(x,y)，故提取公因子p(x,y)放到外边，然后把里边的-（log p(x,y) - log p(x)）写成- log (p(x,y)/p(x) ) ；

第五行推到第六行的依据是：p(x,y) = p(x) \* p(y|x)，故p(x,y) / p(x) =  p(y|x)。

相对熵：又称互熵，交叉熵，鉴别信息，Kullback熵，Kullback-Leible散度等。设p(x)、q(x)是X中取值的两个概率分布，则p对q的相对熵是：![](https://img.hacpai.com/e/a0b26fda137242f6abd241e0b49abcb4.webp)

在一定程度上，相对熵可以度量两个�


 => {
    const state: RaidenState = {
      address,
      blockNumber: 123,
      channels: {
        [tokenNetwork]: {
          [partner]: {
            state: ChannelState.open,
            own: { deposit: bigNumberify(200) as UInt<32> },
            partner: { deposit: bigNumberify(210) as UInt<32> },
            id: 17,
            settleTimeout: 500,
            openBlock: 121,
          },
        },
      },
      tokens: { [token]: tokenNetwork },
      transport: {},
      secrets: {},
      sent: {},
    };
    expect(JSON.parse(encodeRaidenState(state))).toEqual({
      address,
      blockNumber: 123,
      channels: {
        [tokenNetwork]: {
          [partner]: {
            state: 'open',
            own: { deposit: 200 },
            partner: { deposit: 210 },
            id: 17,
            settleTimeout: 500,
            openBlock: 121,
          },
        },
      },
      tokens: { [token]: tokenNetwork },
      transport: {},
      secrets: {},
      sent: {},
    });
  });

  test('decodeRaidenState', () => {
    // missing required properties
    expect(() => decodeRaidenState({ address })).toThrow('Invalid value undefined');

    // property of wrong type
    expect(() => decodeRaidenState({ address: 123 })).toThrow('Invalid value 123');

    // invalid deep enum value and BigNumber
    expect(() =>
      decodeRaidenState({
        address,
        blockNumber: 123,
        channels: {
          [tokenNetwork]: {
            [partner]: {
              state: 'unknownstate',
              own: { deposit: 'invalidBigNumber' },
              partner: { deposit: '210' },
            },
          },
        },
        tokens: {},
        transport: {},
        secrets: {},
        sent: {},
      }),
    ).toThrow('Invalid value "unknownstate"');

    // success on deep BigNumber and enum
    expect(
      decodeRaidenState({
        address,
        blockNumber: 123,
        channels: {
          [tokenNetwork]: {
            [partner]: {
              state: 'open',
              own: { deposit: '200' },
              partner: { deposit: '210' },
              id: 17,
              settleTimeout: 500,
              openBlock: 121,
            },
          },
        },
        tokens: { [token]: tokenNetwork },
        transport: {},
        secrets: {},
        sent: {},
      }),
    ).toEqual({
      address,
      blockNumber: 123,
      channels: {
        [tokenNetwork]: {
          [partner]: {
            state: ChannelState.open,
            own: { deposit: bigNumberify(200) as UInt<32> },
            partner: { deposit: bigNumberify(210) as UInt<32> },
            id: 17,
            settleTimeout: 500,
            openBlock: 121,
          },
        },
      },
      tokens: { [token]: tokenNetwork },
      transport: {},
      secrets: {},
      sent: {},
    });
  });
});
//
// 표준입력에서 데이터 읽기
import readline from "readline";
import fs from "fs";
import { argv } from "process";
const input = [] as string[];
if (argv.includes("readFromInputFile")) {
    input.push(...fs.readFileSync("./src/stdin").toString().split("\n"));
    solution();
} else {
    const rl = readline.createInterface({
        input: process.stdin,
        output: process.stdout,
    });
    rl.on("line", (line) => input.push(line.trim())).on("close", solution);
}

//
// 솔루션 함수
function solution() {
    const N = Number(input[0]);
    const lines = input
        .slice(1)
        .map((l) => l.split(" ").map(Number))
        .sort((a, b) => {
            if (a[0] !== b[0]) return a[0] - b[0];
            return a[1] - b[1];
        });

    const projects


// Determine the actual start position
		int cursorStartPos = cursorId * CURSOR_SIZE;

		// Synchronize cursor adjustments. Just in case.
		synchronized(this) {
			if (!mCursors.containsKey(cursorId)) {
				// Get a new cursor
				System.out.println("Getting cursor at " + cursorId);
				mCursors.put(cursorId, mBuilder.getOffsetCursor(cursorStartPos, CURSOR_SIZE));

				// Add this cursor id to the 'top' of the MRU list.
				mMruListPos = (mMruListPos + 1) % MRU_LIST_SIZE;
				mMruList[mMruListPos] = cursorId;

				// Remove any stale cursors
				purgeOldCursors(cursorId);
			} else {
				// Bring to top of MRU list, if present. It may not be in the MRU list if it was
				// preserved because it was in the window
				int oldPos = -1;
				for(int i = 0; i < MRU_LIST_SIZE; i++) {
					if (mMruList[i] == cursorId) {
						// TODO (4.1+): Remove Sanity check for com.eleybourn.bookcatalogue.debug; should just 'break' from loop after setting oldPos
						if (oldPos >= 0)
							throw new RuntimeException("Cursor appears twice in MRU list");
						oldPos = i;
					}
				}
				if (oldPos < 0) {
					// Not in MRU; just add it to the top
					mMruListPos = (mMruListPos + 1) % MRU_LIST_SIZE;
					mMruList[mMruListPos] = cursorId;
				} else {
					if (oldPos <= mMruListPos) {
						// Just shuffle intervening items down
						int n = oldPos;
						int i;
						while(n < mMruListPos) {
							i = n++;
							mMruList[i] = mMruList[n];
						}
					} else {
						// Need to shuffle intervening items 'down' with a wrap; this code
						// would actually work for the above case, but it's slower. Not sure
						// it really matters.
						int n = oldPos; // 'next' position
						int i; // current position
						// Count of rows to move
						int c = (MRU_LIST_SIZE - (oldPos - mMruListPos)) % MRU_LIST_SIZE; // Only really need '%' for case where oldPos<=listPos.
						while(c-- > 0) {
							i = n;
							n = (n + 1) % MRU_LIST_SIZE;
							mMruList[i] = mMruList[n];
						}
					}
					mMruList[mMruListPos] = cursorId;
				}

			}
			// DEBUG: Remove dump of MRU list!
			//System.out.print("MRU: ");
			//for(int i = 0; i < MRU_LIST_SIZE; i++)
			//	System.out.print(mMruList[(mMruListPos+1+i)%MRU_LIST_SIZE] + " ");
			//System.out.println();

			// Set the active cursor, and set its position correctly
			mActiveCursor = mCursors.get(cursorId);
			mActiveCursor.moveToPosition(newPosition - cursorStartPos);
		}
		return true;
	}

	/**
	 * Remove any old cursors that can be purged.
	 *
	 * @param currentId		Current cursor ID
	 */
	private void purgeOldCursors(final Integer currentId) {
		// List of cursors to purge
		ArrayList<Integer> toPurge = new ArrayList<Integer>();
		// Scan the hash
		for(Entry<Integer, BooklistCursor> cursorEntry: mCursors.entrySet()) {
			// If it is more than 3 'pages' from the current position, it's a candidate
			final Integer thisKey = cursorEntry.getKey();
			if ( Math.abs(thisKey) > 3 ) {
				// Must not be in the MRU list
				if (!checkMru(