 ) -> S

// TODO: Test negative quasiquotation (in a non end-to-end way):
//   '[Expr | (plus one (plus one (plus ,[lhs], ,[rhs], )))]'
// #[test]
// fn beta_with_negative_quasiquote() {
//
// }
// This file is part of linux-support. It is subject to the license terms in the COPYRIGHT file found in the top-level directory of this distribution and at https://raw.githubusercontent.com/lemonrock/linux-support/master/COPYRIGHT. No part of linux-support, including this file, may be copied, modified, propagated, or distributed except according to the terms contained in the COPYRIGHT file.
// Copyright © 2020 The developers of linux-support. See the COPYRIGHT file in the top-level directory of this distribution and at https://raw.githubusercontent.com/lemonrock/linux-support/master/COPYRIGHT.

/// Loads an `Atomic*` (eg `AtomicU8`) non-atomically without any synchronization.
pub trait LoadNonAtomically
{
	/// Non-atomic type.
	type NonAtomic: Sized + Copy;

	/// Loads from, say, an AtomicU32 non-atomically
	fn load_non_atomically(self) -> Self::NonAtomic;
}

macro_rules! load_non_atomically
{
	($atomic_type: ident, $non_atomic_type: ty) =>
	{
		impl<'a> LoadNonAtomically for &'a std::sync::atomic::$atomic_type
		{
			type NonAtomic = $non_atomic_type;

			#[inline(always)]
			fn load_non_atomically(self) -> Self::NonAtomic
			{
				let pointer: *const Self = unsafe { transmute(self) };
				unsafe { pointer.cast::<Self::NonAtomic>().read() }
			}
		}

		impl LoadNonAtomically for std::ptr::NonNull<std::sync::atomic::$atomic_type>
		{
			type NonAtomic = $non_atomic_type;

			#[inline(always)]
			fn load_non_atomically(self) -> Self::NonAtomic
			{
				(unsafe { self.as_ref() }).load_non_atomically()
			}
		}

		impl LoadNonAtomically for *const std::sync::atomic::$atomic_type
		{
			type NonAtomic = $non_atomic_type;

			#[inline(always)]
			fn load_non_atomically(self) -> Self::NonAtomic
			{
				(unsafe { & * self }).load_non_atomically()
			}
		}

		impl LoadNonAtomically for *mut std::sync::atomic::$atomic_type
		{
			type NonAtomic = $non_atomic_type;

			#[inline(always)]
			fn load_non_atomically(self) -> Self::NonAtomic
			{
				(unsafe { & * self }).load_non_atomically()
			}
		}
	}
}

load_non_atomically!(AtomicBool, bool);
load_non_atomically!(AtomicU8, u8);
load_non_atomically!(AtomicU16, u16);
load_non_atomically!(AtomicU32, u32);
load_non_atomically!(AtomicU64, u64);
load_non_atomically!(AtomicUsize, usize);
load_non_atomically!(AtomicI8, i8);
load_non_atomically!(AtomicI16, i16);
load_non_atomically!(AtomicI32, i32);
load_non_atomically!(AtomicI64, i64);
load_non_atomically!(AtomicIsize, isize);

impl<'a, T: 'a> LoadNonAtomically for &'a std::sync::atomic::AtomicPtr<T>
{
	type NonAtomic = *mut T;

	#[inline(always)]
	fn load_non_atomically(self) -> Self::NonAtomic
	{
		let pointer: *const Self = unsafe { transmute(self) };
		u


Epic.M2", -- [4]
					"DruidBearTauren_Legacy.m2", -- [5]
					"DruidBear_Legacy.m2", -- [6]
				},
				["N"] = "Druidbear",
			}, -- [239]
			{
				["T"] = {
					"DruidBearTroll.M2", -- [1]
					"DruidBearTrollEpic.M2", -- [2]
				},
				["N"] = "Druidbeartroll",
			}, -- [240]
			{
				["T"] = {
					"DruidBearWorgen.M2", -- [1]
					"DruidBearWorgenEpic.M2", -- [2]
				},
				["N"] = "Druidbearworgen",
			}, -- [241]
			{
				["T"] = {
					"DruidCat.M2", -- [1]
					"DruidCatEpic.M2", -- [2]
					"DruidCat_Legacy.M2", -- [3]
				},
				["N"] = "Druidcat",
			}, -- [242]
			{
				["T"] = {
					"DruidCatTauren.M2", -- [1]
					"DruidCatTaurenEpic.M2", -- [2]
					"DruidCatTauren_Legacy.M2", -- [3]
				},
				["N"] = "Druidcattauren",
			}, -- [243]
			{
				["T"] = {
					"DruidCatTroll.M2", -- [1]
					"DruidCatTrollEpic.M2", -- [2]
				},
				["N"] = "Druidcattroll",
			}, -- [244]
			{
				["T"] = {
					"DruidCatWorgen.M2", -- [1]
					"DruidCatWorgenEpic.M2", -- [2]
				},
				["N"] = "Druidcatworgen",
			}, -- [245]
			{
				["T"] = {
					"DruidOwlBear.M2", -- [1]
					"DruidOwlBearEpic.M2", -- [2]
					"DruidOwlBearTauren.M2", -- [3]
					"DruidOwlBearTaurenEpic.M2", -- [4]
				},
				["N"] = "Druidowlbear",
			}, -- [246]
			{
				["T"] = {
					"DruidTravelAlliance.M2", -- [1]
					"DruidTravelAlliance_low01.M2", -- [2]
				},
				["N"] = "Druidtravelalliance",
			}, -- [247]
			{
				["T"] = {
					"DruidTravelHorde.M2", -- [1]
				},
				["N"] = "Druidtravelhorde",
			}, -- [248]
			{
				["T"] = {
					"DruidTreeForm.M2", -- [1]
				},
				["N"] = "Druidtreeform",
			}, -- [249]
			{
				["T"] = {
					"Dryad.M2", -- [1]
				},
				["N"] = "Dryad",
			}, -- [250]
			{
				["T"] = {
					"Dryder.M2", -- [1]
				},
				["N"] = "Dryder",
			}, -- [251]
			{
				["T"] = {
					"Durotan.M2", -- [1]
				},
				["N"] = "Durotan",
			}, -- [252]
			{
				["T"] = {
					"DwarfMaleWarriorLight.M2", -- [1]
					"DwarfMaleWarriorLight_Ghost.M2", -- [2]
				},
				["N"] = "Dwarfmalewarr


�요": >vim
      	getcharpos('.')		returns [0, 5, 3, 0]
      	getpos('.')		returns [0, 5, 7, 0]
      <
    ]=],
    name = 'getcharpos',
    params = { { 'expr', 'string' } },
    returns = 'integer[]',
    signature = 'getcharpos({expr})',
  },
  getcharsearch = {
    desc = [=[
      Return the current character search information as a {dict}
      with the following entries:

          char	character previously used for a character
      		search (|t|, |f|, |T|, or |F|); empty string
      		if no character search has been performed
          forward	direction of character search; 1 for forward,
      		0 for backward
          until	type of character search; 1 for a |t| or |T|
      		character search, 0 for an |f| or |F|
      		character search

      This can be useful to always have |;| and |,| search
      forward/backward regardless of the direction of the previous
      character search: >vim
      	nnoremap <expr> ; getcharsearch().forward ? ';' : ','
      	nnoremap <expr> , getcharsearch().forward ? ',' : ';'
      <Also see |setcharsearch()|.
    ]=],
    name = 'getcharsearch',
    params = {},
    returns = 'table',
    signature = 'getcharsearch()',
  },
  getcharstr = {
    args = { 0, 2 },
    desc = [=[
      The same as |getchar()|, except that this always returns a
      String, and "number" isn't allowed in {opts}.
    ]=],
    name = 'getcharstr',
    params = { { 'expr', '-1|0|1' }, { 'opts', 'table' } },
    returns = 'string',
    signature = 'getcharstr([{expr} [, {opts}]])',
  },
  getcmdcomplpat = {
    desc = [=[
      Return completion pattern of the current command-line.
      Only works when the command line is being edited, thus
      requires use of |c_CTRL-\_e| or |c_CTRL-R_=|.
      Also see |getcmdtype()|, |setcmdpos()|, |getcmdline()|,
      |getcmdprompt()|, |getcmdcompltype()| and |setcmdline()|.
      Returns an empty string when completion is not defined.
    ]=],
    name = 'getcmdcomplpat',
    params = {},
    returns = 'string',
    signature = 'getcmdcomplpat()',
  },
  getcmdcompltype = {
    desc = [=[
      Return the type of the current command-line completion.
      Only works when the command line is being edited, thus
      requires use of |c_CTRL-\_e| or |c_CTRL-R_=|.
      See |:command-completion| for the return string.
      Also see |getcmdtype()|, |setcmdpos()|, |getcmdline()|,
      |getcmdprompt()|, |getcmdcomplpat()| and |setcmdline()|.
      Returns an empty string when completion is not defined.

      To get the type of the command-line completion for a specified
      string, use |getcompletiontype()|.
    ]=],
    name = 'getcmdcompltype',
    params = {},
    returns = 'string',
    signature = 'getcmdcompltype()',
  },
  getcmdline = {
    desc = [=[
      Return the current command-line input.  Only works when the
      command line is being edited, thus requires use of
      |c_CTRL-\_e| or |c_CTRL-R_=|.
      Example: >vim
      	cmap <F7> <C-\>eescape(getcmdline(), ' \')<CR>
      <Also see |getcmdtype()|, |getcmdpos()|, |setcmdpos()|,
      |getcmdprompt()| and |setcmdline()|.


{file}";
        pythonPath = function()
            return os_capture('which python')
        end;
    },
}

dap.adapters.bashdb = {
  type = 'executable';
  command = vim.fn.stdpath("data") .. '/mason/packages/bash-debug-adapter/bash-debug-adapter';
  name = 'bashdb';
}

dap.configurations.sh = {
  {
    type = 'bashdb';
    request = 'launch';
    name = "Launch file";
    showDebugOutput = true;
    pathBashdb = vim.fn.stdpath("data") .. '/mason/packages/bash-debug-adapter/extension/bashdb_dir/bashdb';
    pathBashdbLib = vim.fn.stdpath("data") .. '/mason/packages/bash-debug-adapter/extension/bashdb_dir';
    trace = true;
    file = "${file}";
    program = "${file}";
    cwd = '${workspaceFolder}';
    pathCat = "cat";
    pathBash = "/bin/bash";
    pathMkfifo = "mkfifo";
    pathPkill = "pkill";
    args = {};
    env = {};
    terminalKind = "integrated";
  }
}

dap.adapters.node2 = {
  type = 'executable',
  command = 'node',
  args = {vim.fn.stdpath("data") .. '/mason/packages/node-debug2-adapter/out/src/nodeDebug.js'},
}

dap.configurations.javascript = {
    {
        name = 'Launch file',
        type = 'node2',
        request = 'launch',
        program = '${file}',
        cwd = vim.fn.getcwd(),
        sourceMaps = true,
        protocol = 'inspector',
        console = 'integratedTerminal',
    },
    {
        -- For this to work you need to make sure the node process is started with the `--inspect` flag.
        name = 'Attach to process',
        type = 'node2',
        request = 'attach',
        processId = require'dap.utils'.pick_process,
    },
}
dap.configurations.typescript = dap.configurations.javascript
dap.configurations.javascriptreact = dap.configurations.javascript
dap.configurations.typescriptreact = dap.configurations.typescript

local dapui = require('dapui')

dapui.setup()

dap.listeners.after.event_initialized["dapui_config"] = function()
  dapui.open()
end
dap.listeners.before.event_terminated["dapui_config"] = function()
  dapui.close()
end
dap.listeners.before.event_exited["dapui_config"] = function()
  dapui.close()
end

-- vim.cmd [[vnoremap gsK <Cmd>lua require("dapui").eval()<CR>]]
-- vim.cmd [[nnoremap gsK <Cmd>lua require("dapui").eval()<CR>]]

vim.fn.sign_define('DapBreakpoint', {text='🔴', texthl='', linehl='', numhl=''})
vim.fn.sign_define('DapBreakpointCondition', {text='⭕', texthl='', linehl='', numhl=''})
vim.fn.sign_define('DapBreakpointRejected', {text='🚫', texthl='', linehl='', numhl=''})
vim.fn.sign_define('DapLogPoint', {text='📔', texthl='', linehl='', numhl=''})
vim.fn.sign_define('DapStopped', {text='👉', texthl='', linehl='', numhl=''})

require("nvim-dap-virtual-text").setup()


', {}]
      for (const i of invalids) {
        //@ts-expect-error
        const c = new LRU({ ttl: 5, ttlResolution: i, max: 5 })
        t.not(c.ttlResolution, i)
        t.equal(c.ttlResolution, Math.floor(c.ttlResolution))
        t.ok(c.ttlResolution >= 0)
      }
      t.end()
    }
  )

  t.test('ttlAutopurge', t => {
    statuses.length = 0
    const c = new LRU({
      ttl: 10,
      ttlAutopurge: true,
      ttlResolution: 0,
    })
    c.set(1, 1, { status: s() })
    c.set(2, 2, { status: s() })
    t.equal(c.size, 2)
    c.set(2, 3, { ttl: 11, status: s() })
    clock.advance(11)
    t.equal(c.size, 1)
    clock.advance(1)
    t.equal(c.size, 0)
    t.matchSnapshot(statuses, 'status updates')
    t.end()
  })

  t.test('ttl on set, not on cache', t => {
    statuses.length = 0
    const c = new LRU({ max: 5, ttlResolution: 0 })
    c.set(1, 1, { ttl: 10, status: s() })
    t.equal(c.get(1, { status: s() }), 1)
    clock.advance(5)
    t.equal(c.get(1, { status: s() }), 1)
    clock.advance(5)
    t.equal(c.get(1, { status: s() }), 1)
    clock.advance(1)
    t.equal(c.has(1, { status: s() }), false)
    t.equal(c.get(1, { status: s() }), undefined)
    t.equal(c.size, 0)

    c.set(2, 2, { ttl: 100, status: s() })
    clock.advance(50)
    t.equal(c.has(2, { status: s() }), true)
    t.equal(c.get(2, { status: s() }), 2)
    clock.advance(51)
    t.equal(c.has(2, { status: s() }), false)
    t.equal(c.get(2, { status: s() }), undefined)

    c.clear()
    for (let i = 0; i < 9; i++) {
      c.set(i, i, { ttl: 10, status: s() })
    }
    // now we have 9 items
    // get an expired item from old set
    clock.advance(11)
    t.equal(c.has(4, { status: s() }), false)
    t.equal(c.get(4, { status: s() }), undefined)

    t.matchSnapshot(statuses, 'status updates')
    t.end()
  })

  t.test('ttl with allowStale', t => {
    const c = new LRU({
      max: 5,
      ttl: 10,
      allowStale: true,
      ttlResolution: 0,
    })
    c.set(1, 1)
    t.equal(c.get(1), 1)
    clock.advance(5)
    t.equal(c.get(1), 1)
    clock.advance(5)
    t.equal(c.get(1), 1)
    clock.advance(1)
    t.equal(c.has(1), false)

    t.equal(c.get(1, { status: s(), noDeleteOnStaleGet: true }), 1)
    t.equal(c.get(1), 1)
    t.equal(c.get(1), undefined)
    t.equal(c.size, 0)

    c.set(2, 2, { ttl: 100 })
    clock.advance(50)


_name);

            linenoiseHistoryLoad(repl->history_path);

            exit_value = load_keymap(home);
            if (exit_value != EXIT_SUCCESS) {
                return exit_value;
            }
        }

        linenoiseSetMultiLine(1);
        linenoiseSetCompletionCallback(completion);
        linenoiseSetHighlightCallback(highlight);
        linenoiseSetHighlightCancelCallback(highlight_cancel);
    }

    socket_accept_info_t socket_accept_data = {config.socket_repl_host,
                                               config.socket_repl_port,
                                               socket_repl_listen_successful_cb,
                                               accepted_socket_repl_connection,
                                               socket_repl_data_arrived,
                                               0,
                                               NULL};

    if (config.socket_repl_port) {
        block_until_engine_ready();

        if (config.dumb_terminal) {
            set_print_sender(NULL);
        } else {
            set_print_sender(&linenoisePrintNow);
        }

        int err = bind_and_listen(&socket_accept_data);
        if (err == -1) {
            engine_perror("Failed to set up socket REPL");
        } else {
            pthread_t thread;
            pthread_create(&thread, NULL, accept_connections, &socket_accept_data);
        }
    }

    run_cmdline_loop(repl);

    return exit_value;
}


Endian);
        assert!(UnitIndex::parse(buf).is_err());
    }

    #[test]
    fn test_version_2_sections() {
        #[rustfmt::skip]
        let section = Section::with_endian(Endian::Big)
            // Header.
            .D32(2).D32(8).D32(1).D32(2)
            // Slots.
            .D64(0).D64(0).D32(0).D32(0)
            // Sections.
            .D32(constants::DW_SECT_V2_INFO.0)
            .D32(constants::DW_SECT_V2_TYPES.0)
            .D32(constants::DW_SECT_V2_ABBREV.0)
            .D32(constants::DW_SECT_V2_LINE.0)
            .D32(constants::DW_SECT_V2_LOC.0)
            .D32(constants::DW_SECT_V2_STR_OFFSETS.0)
            .D32(constants::DW_SECT_V2_MACINFO.0)
            .D32(constants::DW_SECT_V2_MACRO.0)
            // Offsets.
            .D32(11).D32(12).D32(13).D32(14).D32(15).D32(16).D32(17).D32(18)
            // Sizes.
            .D32(21).D32(22).D32(23).D32(24).D32(25).D32(26).D32(27).D32(28);
        let buf = section.get_contents().unwrap();
        let buf = EndianSlice::new(&buf, BigEndian);
        let index = UnitIndex::parse(buf).unwrap();
        assert_eq!(index.section_count, 8);
        assert_eq!(
            index.sections,
            [
                SectionId::DebugInfo,
                SectionId::DebugTypes,
                SectionId::DebugAbbrev,
                SectionId::DebugLine,
                SectionId::DebugLoc,
                SectionId::DebugStrOffsets,
                SectionId::DebugMacinfo,
                SectionId::DebugMacro,
            ]
        );
        #[rustfmt::skip]
        let expect = [
            UnitIndexSection { section: SectionId::DebugInfo, offset: 11, size: 21 },
            UnitIndexSection { section: SectionId::DebugTypes, offset: 12, size: 22 },
            UnitIndexSection { section: SectionId::DebugAbbrev, offset: 13, size: 23 },
            UnitIndexSection { section: SectionId::DebugLine, offset: 14, size: 24 },
            UnitIndexSection { section: SectionId::DebugLoc, offset: 15, size: 25 },
            UnitIndexSection { section: SectionId::DebugStrOffsets, offset: 16, size: 26 },
            UnitIndexSection { section: SectionId::DebugMacinfo, offset: 17, size: 27 },
            UnitIndexSection { section: SectionId::DebugMacro, offset: 18, size: 28 },
        ];
        let mut sections = index.sections(1).unwrap();
        for section in &expect {
            assert_eq!(*section, sections.next().unwrap());
        }
        assert!(sections.next().is_none());
    }

    #[test]
    fn test_version_5_sections() {
        #[rustfmt::skip]
        let section = Section::with_endian(Endian::Big)
            // Header.
            .D16(5).D16(0).D32(7).D32(1).D32(2)
            // Slots.
            .D64(0).D64(0).D32(0).D32(0)
            // Sections.
            .D32(constants::DW_SECT_INFO.0)
            .D32(constants::DW_SECT_ABBREV.0)
            .D32(constants::DW_SECT_LINE.0)
            .D32(constants::DW_SECT_LOCLISTS.0)
            .D32(constants::DW_


_ACTION_USER_PRESENT = _class.staticFieldId(
    r'ACTION_USER_PRESENT',
    r'Ljava/lang/String;',
  );

  /// from: `static public final java.lang.String ACTION_USER_PRESENT`
  /// The returned object must be released after use, by calling the [release] method.
  static jni$_.JString? get ACTION_USER_PRESENT =>
      _id_ACTION_USER_PRESENT.get(_class, const jni$_.JStringNullableType());

  static final _id_ACTION_USER_UNLOCKED = _class.staticFieldId(
    r'ACTION_USER_UNLOCKED',
    r'Ljava/lang/String;',
  );

  /// from: `static public final java.lang.String ACTION_USER_UNLOCKED`
  /// The returned object must be released after use, by calling the [release] method.
  static jni$_.JString? get ACTION_USER_UNLOCKED =>
      _id_ACTION_USER_UNLOCKED.get(_class, const jni$_.JStringNullableType());

  static final _id_ACTION_VIEW = _class.staticFieldId(
    r'ACTION_VIEW',
    r'Ljava/lang/String;',
  );

  /// from: `static public final java.lang.String ACTION_VIEW`
  /// The returned object must be released after use, by calling the [release] method.
  static jni$_.JString? get ACTION_VIEW =>
      _id_ACTION_VIEW.get(_class, const jni$_.JStringNullableType());

  static final _id_ACTION_VIEW_LOCUS = _class.staticFieldId(
    r'ACTION_VIEW_LOCUS',
    r'Ljava/lang/String;',
  );

  /// from: `static public final java.lang.String ACTION_VIEW_LOCUS`
  /// The returned object must be released after use, by calling the [release] method.
  static jni$_.JString? get ACTION_VIEW_LOCUS =>
      _id_ACTION_VIEW_LOCUS.get(_class, const jni$_.JStringNullableType());

  static final _id_ACTION_VIEW_PERMISSION_USAGE = _class.staticFieldId(
    r'ACTION_VIEW_PERMISSION_USAGE',
    r'Ljava/lang/String;',
  );

  /// from: `static public final java.lang.String ACTION_VIEW_PERMISSION_USAGE`
  /// The returned object must be released after use, by calling the [release] method.
  static jni$_.JString? get ACTION_VIEW_PERMISSION_USAGE =>
      _id_ACTION_VIEW_PERMISSION_USAGE.get(
        _class,
        const jni$_.JStringNullableType(),
      );

  static final _id_ACTION_VIEW_PERMISSION_USAGE_FOR_PERIOD = _class
      .staticFieldId(
        r'ACTION_VIEW_PERMISSION_USAGE_FOR_PERIOD',
        r'Ljava/lang/String;',
      );

  /// from: `static public final java.lang.String ACTION_VIEW_PERMISSION_USAGE_FOR_PERIOD`
  /// The returned object must be released after use, by calling the [release] method.
  static jni$_.JString? get ACTION_VIEW_PERMISSION_USAGE_FOR_PERIOD =>
      _id_ACTION_VIEW_PERMISSION_USAGE_FOR_PERIOD.get(
        _class,
        const jni$_.JStringNullableType(),
      );

  static final _id_ACTION_VOICE_COMMAND = _class.staticFieldId(
    r'ACTION_VOICE_COMMAND',
    r'Ljava/lang/String;',
  );

  /// from: `static public final java.lang.String ACTION_VOICE_COMMAND`
  /// The returned object must be released after use, by calling the [release] method.
  static jni$_.JString?


 */
SVGViewElement.SVG_ZOOMANDPAN_MAGNIFY;

/**
 * @const
 * @type {number}
 */
SVGViewElement.prototype.SVG_ZOOMANDPAN_MAGNIFY;

/**
 * @type {number}
 */
SVGViewElement.prototype.zoomAndPan;

/**
 * @type {!SVGAnimatedRect}
 */
SVGViewElement.prototype.viewBox;

/**
 * @type {!SVGAnimatedPreserveAspectRatio}
 */
SVGViewElement.prototype.preserveAspectRatio;

/**
 * @constructor
 * @extends {SVGElement}
 * @implements {SVGURIReference}
 * @implements {SVGExternalResourcesRequired}
 */
function SVGMPathElement(){}

/**
 * @type {!SVGAnimatedBoolean}
 */
SVGMPathElement.prototype.externalResourcesRequired;

/**
 * @type {!SVGAnimatedString}
 */
SVGMPathElement.prototype.href;

/**
 * @constructor
 * @extends {SVGElement}
 */
function SVGFontFaceSrcElement(){}

/**
 * @constructor
 * @extends {SVGElement}
 * @implements {SVGURIReference}
 * @implements {SVGLangSpace}
 * @implements {SVGExternalResourcesRequired}
 * @implements {SVGFilterPrimitiveStandardAttributes}
 */
function SVGFEImageElement(){}

/**
 * @type {!SVGAnimatedPreserveAspectRatio}
 */
SVGFEImageElement.prototype.preserveAspectRatio;

/**
 * @type {!SVGAnimatedLength}
 */
SVGFEImageElement.prototype.x;

/**
 * @type {!SVGAnimatedLength}
 */
SVGFEImageElement.prototype.y;

/**
 * @type {!SVGAnimatedLength}
 */
SVGFEImageElement.prototype.width;

/**
 * @type {!SVGAnimatedLength}
 */
SVGFEImageElement.prototype.height;

/**
 * @type {!SVGAnimatedString}
 */
SVGFEImageElement.prototype.result;

/**
 * @type {!SVGAnimatedBoolean}
 */
SVGFEImageElement.prototype.externalResourcesRequired;

/**
 * @type {!SVGAnimatedString}
 */
SVGFEImageElement.prototype.href;

/**
 * @type {!SVGAnimatedString}
 */
SVGFEImageElement.prototype.className;

/**
 * @param {string=} opt_name
 * @return {!CSSValue}
 * @override
 */
SVGFEImageElement.prototype.getPresentationAttribute = function(opt_name){};

/**
 * @type {string}
 */
SVGFEImageElement.prototype.xmllang;

/**
 * @type {string}
 */
SVGFEImageElement.prototype.xmlspace;

/**
 * @constructor
 * @extends {SVGElement}
 */
function SVGFEDistantLightElement(){}

/**
 * @type {!SVGAnimatedNumber}
 */
SVGFEDistantLightElement.prototype.azimuth;

/**
 * @type {!SVGAnimatedNumber}
 */
SVGFEDistantLightElement.prototype.elevation;

/**
 * @constructor
 * @extends {SVGElement}
 */
function SVGFontFaceUriElement(){}

/**
 * @constructor
 * @extends {SVGElement}
 * @implements {SVGFilterPrimitiveStandardAttributes}
 */
function SVGFEDiffuseLightingElement(){}

/**
 * @type {!SVGAnimatedString}
 */
SVGFEDiffuseLightingElement.prototype.in1;

/**
 * @type {!SVGAnimatedNumber}
 */
SVGFEDiffuseLightingElement.prototype.surfaceScale;

/**
 * @type {!SVGAnimatedNumber}
 */
SVGFEDiffuseLightingElement.prototype.diffuseConstant;

/*


----*-*----*-
        -----*----*-*----*-
        -------------------
        -------***---***---
        -------------------
    """, 10)
}

// UTILITIES

fun runGameOfLife(fieldText: String, steps: Int) {
    var field = makeField(fieldText)
    for (step in 1..steps) {
        println("Step: $step")
        for (i in 0..field.height - 1) {
            for (j in 0..field.width - 1) {
                print(if (field[i, j]) "*" else " ")
            }
            println("")
        }
        field = next(field)
    }
}

fun makeField(s: String): Field {
    val lines = s.replace(" ", "").split('\n').filter({ it.isNotEmpty() })
    val longestLine = lines.toList().maxBy { it.length } ?: ""

    return Field(longestLine.length, lines.size) { i, j -> lines[i][j] == '*' }
}
package org.frknkrc44.hma_oss.ui.adapter

import android.view.ViewGroup
import android.widget.Filter
import icu.nullptr.hidemyapplist.service.ServiceClient
import icu.nullptr.hidemyapplist.ui.adapter.AppSelectAdapter
import icu.nullptr.hidemyapplist.ui.view.AppItemView
import icu.nullptr.hidemyapplist.util.PackageHelper
import kotlinx.coroutines.runBlocking

class AppPresetAdapter(
    private val presetName: String
) : AppSelectAdapter() {
    var packages = mutableListOf<String>()

    fun updateList() {
        packages.clear()
        packages += ServiceClient.getPackagesForPreset(presetName)?.toList() ?: listOf()
    }

    inner class ViewHolder(view: AppItemView) : AppSelectAdapter.ViewHolder(view) {
        override fun bind(packageName: String) {
            (itemView as AppItemView).let {
                it.load(packageName)
                it.alpha = if (!PackageHelper.exists(packageName)) 0.5f else 1.0f
            }
        }
    }

    override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
        val view = AppItemView(parent.context, false)
        view.layoutParams = ViewGroup.LayoutParams(
            ViewGroup.LayoutParams.MATCH_PARENT,
            ViewGroup.LayoutParams.WRAP_CONTENT
        )
        return ViewHolder(view)
    }

    private inner class PresetFilter : Filter() {

        override fun performFiltering(constraint: CharSequence): FilterResults {
            return runBlocking {
                val constraintLowered = constraint.toString().trim().lowercase()
                val filteredList = packages.filter {
                    if (constraintLowered.isEmpty()) return@filter true

                    if (it.lowercase().contains(constraintLowered)) return@filter true

                    try {
                        val label = PackageHelper.loadAppLabel(it)
                        return@filter label.lowercase().contains(constraintLowered)
                    } catch (e: Throwable) {
                        return@filter false
                    }
                }

                FilterResults().also { it.values = filteredList }
            }
        }

        @Suppress("UNCHECKED_CAST", "NotifyDataSetChanged")
        override fun publishResults(constraint: CharSequence, results: FilterResults) {
            val values = results.values
            if (values != null) {
                filteredList = values as List<String>
                notifyDataSetChanged()
            }
        }
    }

    private val mFilter = PresetFilter()

    override fun getFilter(): Filter = mFilter
}
package icu.nullptr.hidemyapplist.ui.adapter

import android.annotation.SuppressLint
import android.content.Context
import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
import icu.nullptr.hidemyapplist.service.PrefManager


1A90 00000000 */  nop
/* 000F4 80AA1A94 1000000E */  beq     $zero, $zero, .L80AA1AD0
/* 000F8 80AA1A98 00001825 */  or      $v1, $zero, $zero          ## $v1 = 00000000
.L80AA1A9C:
/* 000FC 80AA1A9C 3C028016 */  lui     $v0, 0x8016                ## $v0 = 80160000
/* 00100 80AA1AA0 2442E660 */  addiu   $v0, $v0, 0xE660           ## $v0 = 8015E660
/* 00104 80AA1AA4 94580F08 */  lhu     $t8, 0x0F08($v0)           ## 8015F568
/* 00108 80AA1AA8 24030002 */  addiu   $v1, $zero, 0x0002         ## $v1 = 00000002
/* 0010C 80AA1AAC 37191000 */  ori     $t9, $t8, 0x1000           ## $t9 = 00001000
/* 00110 80AA1AB0 10000007 */  beq     $zero, $zero, .L80AA1AD0
/* 00114 80AA1AB4 A4590F08 */  sh      $t9, 0x0F08($v0)           ## 8015F568
.L80AA1AB8:
/* 00118 80AA1AB8 3C028016 */  lui     $v0, 0x8016                ## $v0 = 80160000
/* 0011C 80AA1ABC 2442E660 */  addiu   $v0, $v0, 0xE660           ## $v0 = 8015E660
/* 00120 80AA1AC0 94480F08 */  lhu     $t0, 0x0F08($v0)           ## 8015F568
/* 00124 80AA1AC4 00001825 */  or      $v1, $zero, $zero          ## $v1 = 00000000
/* 00128 80AA1AC8 35092000 */  ori     $t1, $t0, 0x2000           ## $t1 = 00002000
/* 0012C 80AA1ACC A4490F08 */  sh      $t1, 0x0F08($v0)           ## 8015F568
glabel L80AA1AD0
.L80AA1AD0:
/* 00130 80AA1AD0 8FBF0014 */  lw      $ra, 0x0014($sp)
/* 00134 80AA1AD4 27BD0020 */  addiu   $sp, $sp, 0x0020           ## $sp = 00000000
/* 00138 80AA1AD8 00601025 */  or      $v0, $v1, $zero            ## $v0 = 00000000
/* 0013C 80AA1ADC 03E00008 */  jr      $ra
/* 00140 80AA1AE0 00000000 */  nop


ice.updateStatus(_localization.translate('quickbms.logs.preparing'));
      print(_localization.translate('quickbms.logs.start_process'));

      final command = '"$quickBmsExe" -C -o "$bmsScript" "$pakFilePath" "$finalOutputPath"';
      print(_localization.translate('quickbms.logs.executing_command', {'command': command}));

      final process = await Process.start(quickBmsExe, [
        '-C', '-o', bmsScript, pakFilePath, finalOutputPath
      ]);

      // Добавляем небольшую задержку перед началом распаковки
      await Future.delayed(const Duration(seconds: 1));

      // Обрабатываем вывод процесса
      process.stdout.transform(systemEncoding.decoder).transform(const LineSplitter()).listen((output) {
        final line = output.trim();
        if (line.isEmpty) return;

        // Проверяем начало распаковки по различным признакам
        if (line.toLowerCase().contains('starting the extraction') ||
            line.toLowerCase().contains('- starting the extraction') ||
            line.toLowerCase().contains('scanning') ||
            line.contains('.uasset') ||
            line.contains('.uexp') ||
            line.contains('.ubulk') ||
            line.contains('->')) {

          if (!unpacking) {
            print('Обнаружено начало распаковки: $line');
            unpacking = true;
            unpackingService.updateStatus(_localization.translate('quickbms.logs.extracting'));
          }

          // Извлекаем имя файла из строки вывода
          String? fileName;
          if (line.contains('->')) {
            final parts = line.split('->');
            if (parts.length > 1) {
              fileName = parts[1].trim();
            }
          } else if (line.contains('.u')) {
            // Ищем последнюю часть пути после последнего пробела
            final parts = line.split(' ');
            fileName = parts.last.trim();
          }

          // Если нашли имя файла, обновляем статус
          if (fileName != null && fileName.isNotEmpty) {
            final status = _localization.translate('quickbms.logs.unpacking_file', {'file': fileName});
            print('Текущий файл: $fileName');
            unpackingService.updateStatus(status);
          }
        }
      });

      // Обрабатываем ошибки
      process.stderr.transform(systemEncoding.decoder).transform(const LineSplitter()).listen((error) {
        final line = error.trim();
        if (line.isEmpty) return;
        print('Ошибка QuickBMS: $line'); // Отладочный вывод
      });

      // Ждем завершения процесса
      final exitCode = await process.exitCode;

      if (exitCode != 0) {
        throw Exception(_localization.translate('quickbms.errors.unpack_failed', {'code': exitCode.toString()}));
      }

      print(_localization.translate('quickbms.logs.unpack_complete'));
      unpackingService.updateStatus(_localization.translate('quickbms.logs.unpack_complete'));

      // Если нужно переместить в бэкап
      if (moveToBackup && isGameFile) {
        try {
          final backupPath = path.join(backupPakPath, pakFileName);

          // Проверяем существование оригинального файла
          if (!await File(pakFilePath).exists()) {
            print('О�


',
      'window-restore',
      'wrench'
    ]
  },
  {
    title: '辅助功能',
    icon: [
      'american-sign-language-interpreting',
      'asl-interpreting',
      'assistive-listening-systems',
      'audio-description',
      'blind',
      'braille',
      'cc',
      'deaf',
      'deafness',
      'hard-of-hearing',
      'low-vision',
      'question-circle-o',
      'sign-language',
      'signing',
      'tty',
      'universal-access',
      'volume-control-phone',
      'wheelchair',
      'wheelchair-alt'
    ]
  },
  {
    title: '手势',
    icon: [
      'hand-grab-o',
      'hand-lizard-o',
      'hand-o-down',
      'hand-o-left',
      'hand-o-right',
      'hand-o-up',
      'hand-paper-o',
      'hand-peace-o',
      'hand-pointer-o',
      'hand-rock-o',
      'hand-scissors-o',
      'hand-spock-o',
      'hand-stop-o',
      'thumbs-down',
      'thumbs-o-down',
      'thumbs-o-up',
      'thumbs-up'
    ]
  },
  {
    title: '运输',
    icon: [
      'ambulance',
      'automobile',
      'bicycle',
      'bus',
      'cab',
      'car',
      'fighter-jet',
      'motorcycle',
      'plane',
      'rocket',
      'ship',
      'space-shuttle',
      'subway',
      'taxi',
      'train',
      'truck',
      'wheelchair',
      'wheelchair-alt'
    ]
  },
  {
    title: '性别',
    icon: [
      'genderless',
      'intersex',
      'mars',
      'mars-double',
      'mars-stroke',
      'mars-stroke-h',
      'mars-stroke-v',
      'mercury',
      'neuter',
      'transgender',
      'transgender-alt',
      'venus',
      'venus-double',
      'venus-mars'
    ]
  },
  {
    title: '文件类型',
    icon: [
      'file',
      'file-archive-o',
      'file-audio-o',
      'file-code-o',
      'file-excel-o',
      'file-image-o',
      'file-movie-o',
      'file-o',
      'file-pdf-o',
      'file-photo-o',
      'file-picture-o',
      'file-powerpoint-o',
      'file-sound-o',
      'file-text',
      'file-text-o',
      'file-video-o',
      'file-word-o',
      'file-zip-o'
    ]
  },
  {
    title: '可旋转',
    icon: [
      'circle-o-notch',
      'cog',
      'gear',
      'refresh',
      'spinner'
    ]
  },
  {
    title: '表单',
    icon: [
      'check-square',
      'check-square-o',
      'circle',
      'circle-o',
      'dot-circle-o',
      'minus-square',
      'minus-square-o',
      'plus-square',
      'plus-square-o',
      'square',
      'square-o'
    ]
  },
  {
    title: '支付',
    icon: [
      'cc-amex',
      'cc-diners-club',
      'cc-discover',
      'cc-jcb',
      'cc-mastercard',
      'cc-paypal',
      'cc-stripe',
      'cc-visa',


, PartialEq, Eq, Hash, Serialize_repr, Deserialize_repr, FromStr)]
#[repr(u8)]
pub enum Look {
    #[display("creep")]
    Creeps = 0,
    #[display("energy")]
    Energy = 1,
    #[display("resource")]
    Resources = 2,
    #[display("source")]
    Sources = 3,
    #[display("mineral")]
    Minerals = 4,
    // LOOK_DEPOSITS is defined here in constants.js but is implemented below to prevent renumbering
    #[display("structure")]
    Structures = 5,
    #[display("flag")]
    Flags = 6,
    #[display("constructionSite")]
    ConstructionSites = 7,
    #[display("nuke")]
    Nukes = 8,
    #[display("terrain")]
    Terrain = 9,
    #[display("tombstone")]
    Tombstones = 10,
    #[display("powerCreep")]
    PowerCreeps = 11,
    #[display("deposit")]
    Deposits = 12,
    #[display("ruin")]
    Ruins = 13,
}

js_deserializable!(Look);

impl Look {
    /// Helper function for deserializing from a string rather than a fake
    /// integer value.
    pub fn deserialize_from_str<'de, D: Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
        let s: Cow<'de, str> = Cow::deserialize(d)?;
        Self::from_str(&s).map_err(|_| {
            D::Error::invalid_value(Unexpected::Str(&s), &"a known LOOK_* constant string")
        })
    }
}

pub unsafe trait LookConstant {
    type Item;

    fn convert_and_check_items(reference: Value) -> Vec<Self::Item>;

    fn look_code(&self) -> Look;
}

typesafe_look_constants! {
    pub struct CREEPS = (Look::Creeps, Creep, IntoExpectedType::into_expected_type);
    pub struct ENERGY = (Look::Energy, Resource, IntoExpectedType::into_expected_type);
    pub struct RESOURCES = (Look::Resources, Resource, IntoExpectedType::into_expected_type);
    pub struct SOURCES = (Look::Sources, Source, IntoExpectedType::into_expected_type);
    pub struct MINERALS = (Look::Minerals, Mineral, IntoExpectedType::into_expected_type);
    pub struct DEPOSITS = (Look::Deposits, Deposit, IntoExpectedType::into_expected_type);
    pub struct STRUCTURES = (Look::Structures, Structure, IntoExpectedType::into_expected_type);
    pub struct FLAGS = (Look::Flags, Flag, IntoExpectedType::into_expected_type);
    pub struct CONSTRUCTION_SITES = (Look::ConstructionSites, ConstructionSite,
        IntoExpectedType::into_expected_type);
    pub struct NUKES = (Look::Nukes, Nuke, IntoExpectedType::into_expected_type);
    pub struct TERRAIN = (Look::Terrain, Terrain, TryInto::try_into);
    pub struct TOMBSTONES = (Look::Tombstones, Tombstone, IntoExpectedType::into_expected_type);
    pub struct POWER_CREEPS = (Look::PowerCreeps, PowerCreep, IntoExpectedType::into_expected_type);
    pub struct RUINS = (Look::Ruins, Ruin, IntoExpectedType::into_expected_type);
}
<filename>src/impls/core/cell.rs
use crate::{Field, TypeGraph, TypeLayout, TypeLayoutGraph, TypeLayoutInfo, TypeStructure};

unsafe impl<T> TypeLayout for core::cell::UnsafeCell<T> {
    const TYPE_LAYOUT: TypeLayoutInfo<'static> = TypeLayoutInfo {
        name: ::core::any::type_name::<Self>(),
        size: ::core::mem::size_of::<Self>(),
        alignment: ::core::mem


() != null
                && this.getName().equals(castOther.getName()))
            && (this.getDept() == castOther.getDept() || this.getDept() != null && castOther.getDept() != null
                && this.getDept().equals(castOther.getDept()))
            && (this.getJob() == castOther.getJob() || this.getJob() != null && castOther.getJob() != null
                && this.getJob().equals(castOther.getJob()))
            && (this.getYears() == castOther.getYears() || this.getYears() != null && castOther.getYears() != null
                && this.getYears().equals(castOther.getYears()))
            && (this.getSalary() == castOther.getSalary() || this.getSalary() != null && castOther.getSalary() != null
                && this.getSalary().equals(castOther.getSalary()))
            && (this.getComm() == castOther.getComm() || this.getComm() != null && castOther.getComm() != null
                && this.getComm().equals(castOther.getComm()));
    }

    @Override
    public int hashCode() {
        int result = 17;

        result = 37 * result + this.getId();
        result = 37 * result + (getName() == null ? 0 : this.getName().hashCode());
        result = 37 * result + (getDept() == null ? 0 : this.getDept().hashCode());
        result = 37 * result + (getJob() == null ? 0 : this.getJob().hashCode());
        result = 37 * result + (getYears() == null ? 0 : this.getYears().hashCode());
        result = 37 * result + (getSalary() == null ? 0 : this.getSalary().hashCode());
        result = 37 * result + (getComm() == null ? 0 : this.getComm().hashCode());
        return result;
    }

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

package com.wavemaker.runtime.data.sample.db2sampledb;

// Generated Feb 7, 2008 1:47:51 PM by Hibernate Tools 3.2.0.CR1

/**
 * Productsupplier generated by hbm2java
 */
@SuppressWarnings({ "serial" })
public class Productsupplier implements java.io.Serializable {

    private ProductsupplierId id;

    public Productsupplier() {
    }

    public Productsupplier(ProductsupplierId id) {
        this.id = id;
    }

    public ProductsupplierId getId() {
        return this.id;
    }

    public void setId(ProductsupplierId id) {
        this.id = id;
    }

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

package com.wavemaker.runtime.data


8*6(CTX1), g
	mov	8*7(CTX1), h

	# save %rdi (CTX) before it gets clobbered
	mov	%rdi, frame_CTX(%rsp)

	vmovdqa	PSHUFFLE_BYTE_FLIP_MASK(%rip), BYTE_FLIP_MASK

loop0:
	lea	K512(%rip), TBL

	## byte swap first 16 dwords
	COPY_YMM_AND_BSWAP	Y_0, (INP), BYTE_FLIP_MASK
	COPY_YMM_AND_BSWAP	Y_1, 1*32(INP), BYTE_FLIP_MASK
	COPY_YMM_AND_BSWAP	Y_2, 2*32(INP), BYTE_FLIP_MASK
	COPY_YMM_AND_BSWAP	Y_3, 3*32(INP), BYTE_FLIP_MASK

	mov	INP, frame_INP(%rsp)

	## schedule 64 input dwords, by doing 12 rounds of 4 each
	movq	$4, frame_SRND(%rsp)

.align 16
loop1:
	vpaddq	(TBL), Y_0, XFER
	vmovdqa XFER, frame_XFER(%rsp)
	FOUR_ROUNDS_AND_SCHED

	vpaddq	1*32(TBL), Y_0, XFER
	vmovdqa XFER, frame_XFER(%rsp)
	FOUR_ROUNDS_AND_SCHED

	vpaddq	2*32(TBL), Y_0, XFER
	vmovdqa XFER, frame_XFER(%rsp)
	FOUR_ROUNDS_AND_SCHED

	vpaddq	3*32(TBL), Y_0, XFER
	vmovdqa XFER, frame_XFER(%rsp)
	add	$(4*32), TBL
	FOUR_ROUNDS_AND_SCHED

	subq	$1, frame_SRND(%rsp)
	jne	loop1

	movq	$2, frame_SRND(%rsp)
loop2:
	vpaddq	(TBL), Y_0, XFER
	vmovdqa XFER, frame_XFER(%rsp)
	DO_4ROUNDS
	vpaddq	1*32(TBL), Y_1, XFER
	vmovdqa XFER, frame_XFER(%rsp)
	add	$(2*32), TBL
	DO_4ROUNDS

	vmovdqa	Y_2, Y_0
	vmovdqa	Y_3, Y_1

	subq	$1, frame_SRND(%rsp)
	jne	loop2

	mov	frame_CTX(%rsp), CTX2
	addm	8*0(CTX2), a
	addm	8*1(CTX2), b
	addm	8*2(CTX2), c
	addm	8*3(CTX2), d
	addm	8*4(CTX2), e
	addm	8*5(CTX2), f
	addm	8*6(CTX2), g
	addm	8*7(CTX2), h

	mov	frame_INP(%rsp), INP
	add	$128, INP
	cmp	frame_INPEND(%rsp), INP
	jne	loop0

done_hash:

	# Restore Stack Pointer
	mov	%rbp, %rsp
	pop	%rbp

	# Restore GPRs
	pop	%r15
	pop	%r14
	pop	%r13
	pop	%r12
	pop	%rbx

	RET
SYM_FUNC_END(sha512_transform_rorx)

########################################################################
### Binary Data

# Mergeable 640-byt


8VciOodyVqltlnJeku4oKr3QRlQ/7zMxnpo2v2LvZu5/t3o1udKMb3ehGN7rRjW50oxvd6EY3utGNbnSj25sK3ehGN7rRjW50o9ufqgTd455RkjwPVVXl/jXEVPnKjKuENpHOjcl/kNJ1acoqopq9MgVXZq6VdFf2pXi6SrorrdlM2EwC3kzQjW50oxvd6EY3utGNbnSjG93oRje60Y1udHtToRvd6EY3utGNbnT7U5V+0po27kOtDCethXLSml1p65JyV8pdVXXSWizdXmty0ponz+1x0lrdqqk3E//PTLOqyTeTwis/TlqTnLTG3s3eHdTejW50oxvd6EY3utGNbnSjG93oRje60Y1udKPbmwrd6EY3utGNbnSj259q/rr/AHzwo7v7eXxiAAAAAElFTkSuQmCC alt=模式选择 style=cursor:zoom-in>

一般情况下，可以考虑采用 COLUMN 模式，开发、运维简单，以最少的服务器为最多的租户提供服务。

租户规模比较大，或者一些租户对安全性要求较高，可以考虑采用 DATASOURCE 模式，当然它也相对复杂的多。

不推荐采用 SCHEMA 模式，因为它的优点并不明显，而且它的缺点也很明显，同时对复杂 SQL 支持一般。

提问：项目支持哪些模式？

目前支持最主流的 DATASOURCE 和 COLUMN 两种模式。而 SCHEMA 模式不推荐使用，所以暂时不考虑实现。

考虑到让大家更好的理解 DATASOURCE 和 COLUMN 模式，拆成了两篇文章：

《SaaS 多租户【字段隔离】》：讲解 COLUMN 模式

《SaaS 多租户【数据库隔离】》：讲解 DATASOURCE 模式

# 3. 多租户的开关

系统有两个配置项，设置为 true 时开启多租户，设置为 false 时关闭多租户。

注意，两者需要保持一致，否则会报错！

配置项	 说明	 配置文件

vehicleunion.server.


	//		Populates results[] with expected values after each keypress.
					//		Also sets up listener to every keyboard event (arrow key etc) on a spinner and
					//		records to record the actual spinner values into results[].
					var spinner = dijit.byId(inSpinnerId);
					results = populateExpected(spinner);
					strokeIndex = 0;
					noteConnect = spinner.connect(spinner.focusNode, "onkeydown", function(){
						setTimeout(function(){
							results[strokeIndex].actual = spinner.get('value');
							strokeIndex++;
						}, 5);
					});
				}

				// Use spinner api to calculate values for a set of keystrokes.
				// Returns array of expected values.
				var populateExpected = function(/*Spinner Widget*/inSpinner){
					var initVal = inSpinner.get('value');
					var eVals = [];
					var newVal;
					var i;

					// The values expected by pressing HOME, right arrow five times,
					// PgUp twice, PgDn, up arrow twice, down arrow once,
					// left arrow once, and END.
					if(inSpinner.constraints.min){
						inSpinner.set('value', inSpinner.constraints.min);
					}
					newVal = inSpinner.get('value');
					eVals.push({stroke: "HOME", expected: newVal});
					// UP 5 times
					for(i = 0; i < 5; i++){
						newVal = inSpinner.adjust(newVal, inSpinner.smallDelta);
						inSpinner.set('value', newVal);
						newVal = inSpinner.get('value');
						eVals.push({stroke: "UP", expected: newVal});
					}
					// PgUp twice
					for(i = 0; i < 2; i++){
						newVal = inSpinner.adjust(newVal, inSpinner.largeDelta);
						inSpinner.set('value', newVal);
						newVal = inSpinner.get('value');
						eVals.push({stroke: "PgUp", expected: newVal});
					}
					// PgDn once.
					newVal = inSpinner.adjust(newVal, -inSpinner.largeDelta);
					inSpinner.set('value', newVal);
					newVal = inSpinner.get('value');
					eVals.push({stroke: "PgDn", expected: newVal});
					// DOWN
					newVal = inSpinner.adjust(newVal, -inSpinner.smallDelta);
					inSpinner.set('value', newVal);
					newVal = inSpinner.get('value');
					eVals.push({stroke: "DOWN", expected: newVal});
					// END
					if(inSpinner.constraints.max){
						inSpinner.set('value', inSpinner.constraints.max);
					}
					newVal = inSpinner.get('value');
					eVals.push({stroke: "END", expected: newVal});

					// reset <inSpinner> back to its initial value, and return
					inSpinner.set('value', initVal);
					return eVals;
				};

				// execute some test as soon as the widget gets focus
				var focusThenRun = function(widget, fcn){
					if(!widget.focused){
						var handler = widget.connect(widget, '_onFocus', function(){
							widget.disconnect(handler);
							setTimeout(fcn, 1);
						});
						widget.focus();
					}else{
						fcn();
					}
				};

				// common robot TAB-focus test function.
				var a11yTabFocus = function(inSpinnerId){
					var d = new doh.Deferred();
					var spinner = dijit.byId(inSpinnerId);
					focusThenRun(spinner, function(){
						var handler = spinner.connect(spinner, '_onBlur', function(){


7191393626793647,true],"xlSjDQL"],"a":[{"c":null,"b":-3.31044629414266e-203},[5.08501079708449e+64,true,"To7_sk",-7813867695183313,undefined,-2.6288856620187387e-300,true,"opc$","},.h%"],"_aa%]B"],"c":""}
// • {"c":[null,true,-5103135698626634,true,8.640826035376584e+129,"BQxVJft(?",-1.5564132973251761e-224,-8751473183072760]}
// • {"a":null,"c":":M2(J"}
// • {"b":[],"c":true,"a":{"c":undefined,"a":1.4812341361081706e-90,"b":3.0694085912031733e-265}}
// • …

fc.object({
  maxDepth: 0,
});
// Examples of generated values:
// • {}
// • {"":-2661215485674034,"xc\" _":5.122556662839035e+30}
// • {"EjK.b?^O":"D1$L","zDJWs":"","s ":true}
// • {"":"","r ":"f96g[G4Ta","Lo":-9007199254740982,"y?D0":-4.029795204858185e-145,"{k\"":"4Eg!e$X&!","!#\"{;[r|":true,"ElpSy!":undefined,"N_/?":"3|OB->","Ur!\"":8.561972111917054e-150,"whbHaYv(9":undefined}
// • {"i<\":q":-2.6171334135337624e-291}
// • …

fc.object({
  maxDepth: 1,
});
// Examples of generated values:
// • {}
// • {"":{"7xc\" ":"pU","`2ce{'@$":"rT0u2Fz","=\\MDU^x?F":-1634219774646683,"=C_`":":p","5r&":"UHG\"<N"},"9DK]":true}
// • {"EjK.b?^O":{},"D1$L":{"JWsn":" 9%Gp.m0N|"},"?8,E(":{"p7*8>":"O","d!R":"vUwQTwv","Jk<?]Q4kiz":"t9sE;","/a70Mu$":1.553810706514351e-293,"u?*":"};Q4%","":-1.6909038094436722e+50,"jlh42":-1.5681604359387257e+267,";\"OH=dAQ":true,"U<SYe":-6.243528612631655e+287,"_":"q\\b%5"}}
// • {"":{},"r ":{"f96g[G4Ta":3507520577650897,">":null,"-d%v":"YBz[cn","<0u\">P":"?D","1! oW":true,"\\7q5":false,"zx":-3977761363413685,"_":true,"@gK7^Ue YJ":false,"<T.o":-7480996801782140},"y$ );[":-1.7976931348623143e+308,"v&ElpSy!8":{"_/?==2^3|O":null,")[uv*IokV}":" rn(#c","A6[":undefined,"":-7486588236535470},"$1$#S?&Q":5675817337610269,"Z":{},",\"S":[],"F":{"10":-6578471272860074,"djr%&u9k":9007199254740988,"Q9$%":-9007199254740972,"_Ziwm4T":"$__prot","WgRxy<]":true,"?k@":null,"!^!":-3e-323,":NCTp":-8325747361775351}," &HDDGxQP":["Mfwc!n",true," g\"",true,5924336580000517,-7.4e-323],":,"


path);
    if (!file.existsSync()) {
      usageException('File $path does not exist!');
    }
    return file;
  }

  void printComparison(File oldJson, File newJson,
      {int maxWidth = 0,
      bool collapseAnonymousClosures = false,
      HistogramType granularity = HistogramType.bySymbol}) async {
    final oldJsonRaw = await loadJsonFromFile(oldJson);
    final newJsonRaw = await loadJsonFromFile(newJson);
    final oldSizes = loadProgramInfoFromJson(oldJsonRaw,
        collapseAnonymousClosures: collapseAnonymousClosures);
    final newSizes = loadProgramInfoFromJson(newJsonRaw,
        collapseAnonymousClosures: collapseAnonymousClosures);

    if ((oldSizes.snapshotInfo == null) != (newSizes.snapshotInfo == null)) {
      usageException('Input files must be produced by the same flag.');
    }

    final diff = computeDiff(oldSizes, newSizes);

    // Compute total sizes.
    final totalOld = oldSizes.totalSize;
    final totalNew = newSizes.totalSize;
    final totalDiff = diff.totalSize;

    // Compute histogram.
    final histogram = computeHistogram(diff, granularity);

    // Now produce the report table.
    const numLargerSymbolsToReport = 30;
    const numSmallerSymbolsToReport = 10;
    printHistogram(diff, histogram,
        sizeHeader: 'Diff (Bytes)',
        prefix: histogram.bySize
            .where((k) => histogram.buckets[k]! > 0)
            .take(numLargerSymbolsToReport),
        suffix: histogram.bySize.reversed
            .where((k) => histogram.buckets[k]! < 0)
            .take(numSmallerSymbolsToReport)
            .toList()
            .reversed,
        maxWidth: maxWidth);

    print('Comparing ${oldJson.path} (old) to ${newJson.path} (new)');
    print('Old   : $totalOld bytes.');
    print('New   : $totalNew bytes.');
    print('Change: ${totalDiff > 0 ? '+' : ''}$totalDiff'
        ' (${formatPercent(totalDiff, totalOld, withSign: true)}) bytes.');

    if (oldSizes.snapshotInfo != null) {
      print(bucketLegend);
      print('\nBreakdown by object type:');
      final oldTypeHistogram =
          computeHistogram(oldSizes, HistogramType.byNodeType);
      final newTypeHistogram =
          computeHistogram(newSizes, HistogramType.byNodeType);

      final diffTypeHistogram = Histogram.fromIterable<String>(
          <String>{}
            ..addAll(oldTypeHistogram.buckets.keys)
            ..addAll(newTypeHistogram.buckets.keys),
          sizeOf: (bucket) =>
              (newTypeHistogram.buckets[bucket] ?? 0) -
              (oldTypeHistogram.buckets[bucket] ?? 0),
          bucketFor: (bucket) => bucket,
          bucketInfo: oldTypeHistogram.bucketInfo);

      printHistogram(oldSizes, diffTypeHistogram,
          prefix: diffTypeHistogram.bySize
              .where((bucket) => diffTypeHistogram.buckets[bucket] != 0),
          maxWidth: maxWidth);

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

// IMPORTANT: This file should only ever be modified by modifying the
// corresponding .proto file and then running
// `dart runtime/vm/protos/tools/compile_perfetto_protos.dart` from the SDK root
// directory.
//
//  Generated code. Do not modify.
//  source: protos/perfetto/trace/clock_snapshot.proto
//
// @dart = 3.3

// ignore_for_file: annotate_overrides, camel_case_types, comment_references
// ignore_for_file: constant_identifier_names, library_prefixes
// ignore_for_file: non_constant_identifier_


try:
    from sg_py_vendor.pymarshal import pm_assert, type_assert, type_assert_iter
except ImportError:
    from pymarshal import pm_assert, type_assert, type_assert_iter

class PlaylistPoolEntry:
    def __init__(
        self,
        name,
        seq_uid,
    ):
        self.name = type_assert(
            name,
            str,
            desc="The friendly name of this sequence",
        )
        self.seq_uid = type_assert(
            seq_uid,
            int,
            desc="The UID of the sequence this corresponds to",
        )

class PlaylistEntry:
    def __init__(
        self,
        seq_uid,
    ):
        self.seq_uid = type_assert(
            seq_uid,
            int,
            desc="The UID of the sequence this corresponds to",
        )

class Playlist:
    def __init__(
        self,
        pool,
        playlist,
    ):
        self.pool = type_assert_iter(
            pool,
            PlaylistPoolEntry,
            desc="A mapping of sequence uid and name",
        )
        self.playlist = type_assert_iter(
            playlist,
            PlaylistEntry,
            desc="The playlist",
        )

    def add_to_pool(
        self,
        entry: PlaylistPoolEntry,
    ):
        type_assert(entry, PlaylistPoolEntry)
        by_name = self.pool_by_name()
        pm_assert(
            entry.name not in by_name,
            FileExistsError,
            msg=f"{entry.name} already exists",
        )
        self.pool.append(entry)
        self.pool.sort(key=lambda x: x.name)

    def pool_by_uid(self):
        return {
            x.seq_uid: x
            for x in self.pool
        }

    def pool_by_name(self):
        return {
            x.name: x
            for x in self.pool
        }

    @staticmethod
    def new():
        return Playlist(
            pool=[
                PlaylistPoolEntry(
                    'default',
                    0,
                )
            ],
            playlist=[
                PlaylistEntry(
                    0,
                )
            ],
        )


s.AAxis.YDataAccessor#translatePxToValue(int)
     */
    @Override
    public double translatePxToValue(int pixel) {
      double result = 0;
      // invert, as awt px are higher the lower the chart value is:
      final double px = this.m_chart.getYChartStart() - pixel;

      final int rangeY = this.m_chart.getYChartStart() - this.m_chart.getYChartEnd();
      if (rangeY != 0) {
        final double scaledY = px / rangeY;
        final Range valueRangeY = new Range(AAxisTransformation.this.getMinTransformed(),
            AAxisTransformation.this.getMaxTransformed());
        result = scaledY * valueRangeY.getExtent() + valueRangeY.getMin();
      }
      return result;
    }

    /**
     * @see info.monitorenter.gui.chart.axis.AAxis.AChart2DDataAccessor#translateValueToPx(double)
     */
    @Override
    public final int translateValueToPx(final double value) {
      /*
       * Note: This code (the math) is the combination of the scaleTrace code
       * above for normalization plus the deflate-into-pixelspace code in
       * Chart2D.paint.
       */
      int result = 0;
      Range range = AAxisTransformation.this.getRange();
      double scaler = range.getExtent();
      double normalizedValue;
      double absolute = value;
      try {
        // range.getMin() is based upon the transformed minimum (see getMin() of
        // outer class)!
        normalizedValue = (AAxisTransformation.this.transform(absolute) - range.getMin());
        normalizedValue = normalizedValue / scaler;
        if (!MathUtil.isDouble(normalizedValue)) {
          normalizedValue = 0;
        }
      } catch (IllegalArgumentException e) {
        long tstamp = System.currentTimeMillis();
        if (tstamp - AAxisTransformation.this.m_outputErrorTstamp > AAxisTransformation.OUTPUT_ERROR_THRESHHOLD) {
          System.out.println(e.getLocalizedMessage());
          AAxisTransformation.this.m_outputErrorTstamp = tstamp;
        }
        normalizedValue = 0;
      }
      // Now the value is normalized:
      Chart2D chart = this.getChart();
      int pixelRange = this.getPixelRange();
      result = (int) Math.round(chart.getYChartStart() - normalizedValue * pixelRange);
      return result;
    }

  }

  /**
   * Internal flag that defines that only every n milliseconds a transformation
   * error (untransformable value was used in chart: this axis implementation of
   * axis is not recommended for the data used) should be reported on system
   * output.
   */
  private static final int OUTPUT_ERROR_THRESHHOLD = 30000;

  /** Generated serialVersionUID. **/
  private static final long serialVersionUID = -4665444421196939779L;

  /**
   * Internal timestamp of the last transformation error reporting.
   */
  protected long m_outputErrorTstamp = 0;

  /**
   * Creates a default instance that will use a
   * {@link info.monitorenter.gui.chart.labelformatters.LabelFormatterAutoUnits}
   * for formatting labels.
   *

   */
  public AAxisTransformation() {
    super();
  }

  /**
   * Creates an instance that will the given label formatter for formatting
   * labels.
   *

   *
   * @param formatter
   *          needed for formatting labels of this axis.
   *
   * @param scalePolicy
   *          controls the ticks/labels and their distance.
   */
  public AAxisTransformation(final IAxisLabelFormatter formatter, final T scalePolicy) {
    super(formatter, scalePolicy);
  }

  /**
   *


oxes__item:hover .govuk-checkboxes__input:focus+.govuk-checkboxes__label:before {
        outline-color: Highlight
    }
}

@media (hover:none),
(pointer:coarse) {
    .govuk-checkboxes--small .govuk-checkboxes__item:hover .govuk-checkboxes__input:not(:disabled)+.govuk-checkboxes__label:before {
        box-shadow: none
    }
    .govuk-checkboxes--small .govuk-checkboxes__item:hover .govuk-checkboxes__input:focus+.govuk-checkboxes__label:before {
        box-shadow: 0 0 0 3px #fd0
    }
}

.govuk-cookie-banner {
    padding-top: 20px;
    border-bottom: 10px solid transparent;
    background-color: #f3f2f1
}

.govuk-template--rebranded .govuk-cookie-banner {
    background-color: #f4f8fb
}

.govuk-cookie-banner[hidden] {
    display: none
}

.govuk-cookie-banner__message {
    margin-bottom: -10px
}

.govuk-cookie-banner__message[hidden] {
    display: none
}

.govuk-cookie-banner__message:focus {
    outline: none
}

.govuk-input {
    font-family: GDS Transport, arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-weight: 400;
    font-size: 1rem;
    line-height: 1.25;
    box-sizing: border-box;
    width: 100%;
    height: 2.5rem;
    margin-top: 0;
    padding: 5px;
    border: 2px solid #0b0c0c;
    border-radius: 0;
    -webkit-appearance: none;
    appearance: none
}

@media print {
    .govuk-input {
        font-family: sans-serif
    }
}

@media (min-width:40.0625em) {
    .govuk-input {
        font-size: 1.1875rem;
        line-height: 1.3157894737
    }
}

@media print {
    .govuk-input {
        font-size: 14pt;
        line-height: 1.15
    }
}

.govuk-input:focus {
    outline: 3px solid #fd0;
    outline-offset: 0;
    box-shadow: inset 0 0 0 2px
}

.govuk-input:disabled {
    opacity: .5;
    color: inherit;
    background-color: transparent;
    cursor: not-allowed
}

.govuk-input::-webkit-inner-spin-button,
.govuk-input::-webkit-outer-spin-button {
    margin: 0;
    -webkit-appearance: none
}

.govuk-input[type=number] {
    -moz-appearance: textfield
}

.govuk-input--error {
    border-color: #d4351c
}

.govuk-input--error:focus {
    border-color: #0b0c0c
}

.govuk-input--extra-letter-spacing {
    font-variant-numeric: tabular-nums;
    letter-spacing: .05em
}

.govuk-input--width-30 {
    max-width: 29.5em
}

.govuk-input--width-20 {
    max-width: 20.5em
}

.govuk-input--width-10 {
    max-width: 11.5em
}

.govuk-input--width-5 {
    max-width: 5.5em
}

.govuk-input--width-4 {
    max-width: 4.5em
}

.govuk-input--width-3 {
    max-width: 3.75em
}

.gov


.debugStack[0].environment.ls())
    TestCase.assertTrue("var1" in rInterop.debugStack[1].environment.ls())
    TestCase.assertTrue("var2" in rInterop.debugStack[2].environment.ls())
    TestCase.assertTrue("var3" in rInterop.debugStack[3].environment.ls())

    helper.invokeAndWait(false) { rInterop.debugCommandContinue() }
  }

  fun testStepOver() {
    val file = loadFileWithBreakpointsFromText("""
      x <- 10
      x <- 20 # BREAKPOINT
      x <- 30
      x <- 40
    """.trimIndent())

    helper.invokeAndWait(true) { rInterop.replSourceFile(file, true) }
    TestCase.assertEquals(1, rInterop.debugStack.lastOrNull()?.position?.line)
    TestCase.assertEquals("10", rInterop.executeCode("cat(x)").stdout)

    helper.invokeAndWait(true) { rInterop.debugCommandStepOver() }
    TestCase.assertEquals(2, rInterop.debugStack.lastOrNull()?.position?.line)
    TestCase.assertEquals("20", rInterop.executeCode("cat(x)").stdout)

    rInterop.debugMuteBreakpoints(true)
    helper.invokeAndWait(true) { rInterop.debugCommandStepOver() }
    TestCase.assertEquals(3, rInterop.debugStack.lastOrNull()?.position?.line)
    TestCase.assertEquals("30", rInterop.executeCode("cat(x)").stdout)

    helper.invokeAndWait(false) { rInterop.debugCommandStepOver() }
    TestCase.assertEquals("40", rInterop.executeCode("cat(x)").stdout)
  }

  fun testFunctionSteps() {
    val file = loadFileWithBreakpointsFromText("""
      ff <- function() {
        1
        2
        3
      }
      hh <- function() {
        6
        ff() # 7
        8
      } # 9
      { # 10
        hh() # 11 # BREAKPOINT
        hh() # 12
        13
      }
    """.trimIndent())

    helper.invokeAndWait(true) { rInterop.replSourceFile(file, true) }
    TestCase.assertEquals(listOf(11), rInterop.debugStack.map { it.position!!.line })

    helper.invokeAndWait(true) { rInterop.debugCommandStepInto() }
    TestCase.assertEquals(listOf(11, 6), rInterop.debugStack.map { it.position!!.line })

    helper.invokeAndWait(true) { rInterop.debugCommandStepOver() }
    TestCase.assertEquals(listOf(11, 7), rInterop.debugStack.map { it.position!!.line })

    helper.invokeAndWait(true) { rInterop.debugCommandStepInto() }
    TestCase.assertEquals(listOf(11, 7, 1), rInterop.debugStack.map { it.position!!.line })

    helper.invokeAndWait(true) { rInterop.debugCommandStepOut() }
    TestCase.assertEquals(listOf(11, 8), rInterop.debugStack.map { it.position!!.line })

    helper.invokeAndWait(true) { rInterop.debugCommandStepOver() }
    TestCase.assertEquals(listOf(12), rInterop.debugStack.map { it.position!!.line })

    helper.invokeAndWait(true) { rInterop.debugCommandStepInto() }
    TestCase.assertEquals(listOf(12, 6), rInterop.debugStack.map { it.position!!.line })

    helper.invokeAndWait(true) { rInterop.debugCommandStepOut() }
    TestCase.assertEquals(listOf(13), rInterop.debugStack.map { it.position!!.line })

    helper.invokeAndWait(false) { rInterop.debugCommandStepIntoMyCode() }
  }

  fun testStepIntoCat() {
    val file = loadFileWithBreakpointsFromText("""
      f <- function(x) {
        return(x + 10)
      }
      cat(f(2)) #


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

using Google.Apis.Bigquery.v2.Data;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Linq;
using Xunit;

namespace Google.Cloud.BigQuery.V2.Tests
{
    public class BigQueryRowTest
    {
        [Fact]
        public void Scalars()
        {
            var schema = new TableSchemaBuilder
            {
                { "integer", BigQueryDbType.Int64 },
                { "bool", BigQueryDbType.Bool },
                { "bytes", BigQueryDbType.Bytes },
                { "float", BigQueryDbType.Float64 },
                { "string", BigQueryDbType.String },
                { "timestamp", BigQueryDbType.Timestamp },
                { "date", BigQueryDbType.Date },
                { "dateTime", BigQueryDbType.DateTime },
                { "time", BigQueryDbType.Time },
                { "numeric", BigQueryDbType.Numeric },
                { "bigNumeric", BigQueryDbType.BigNumeric },
                { "geography", BigQueryDbType.Geography },
                { "json", BigQueryDbType.Json },
                { "struct", new TableSchemaBuilder { { "x", BigQueryDbType.Int64 }, { "y", BigQueryDbType.String } } }
            }.Build();
            var rawRow = new TableRow
            {
                F = new[]
                {
                    new TableCell { V = "10" },
                    new TableCell { V = "true" },
                    new TableCell { V = "AQI=" }, // 1, 2
                    new TableCell { V = "2.5" },
                    new TableCell { V = "text" },
                    new TableCell { V = "1477566580.5" }, // 2016-10-27T11:09:40.500Z
                    new TableCell { V = "2017-08-09" },
                    new TableCell { V = "2017-08-09T12:34:56.123" },
                    new TableCell { V = "12:34:56.123" },
                    new TableCell { V = "1234567890123456789012345678.123456789" },
                    new TableCell { V = "123456789012345678901234567890123456789.12345678901234567890123456789012345678" },
                    new TableCell { V = "POINT(1 2)" },
                    new TableCell { V = "{\"x\": 10, \"y\": \"text\"}" },
                    new TableCell { V = new JObject { ["f"] = new JArray {new JObject { ["v"] = "100" }, new JObject { ["v"] = "xyz" } } } }
                }
            };
            var row = new BigQueryRow(rawRow, schema);
            Assert.Equal(10, (long)row["integer"]);
            Assert.Equal(true, (bool)row["bool"]);
            Assert.Equal(new byte[] { 1, 2 }, (byte[])row["bytes"]);
            Assert.Equal(2.5d, (double)row["float"]);
            Assert.Equal("text", (string)row["string"]);
            Assert.Equal(new DateTime(2016, 10, 27, 11, 9, 40, 500, DateTimeKind.Utc), (DateTime)row["timestamp"]);
            Assert.Equal(new DateTime(2017, 8, 9, 0, 0, 0, DateTimeKind.Utc), (DateTime)row["date"]);
            Assert.Equal(new DateTime(2017, 8, 9, 12


= addDuplicate(c, cx, cy, true) }
  }

  return { vertices, triangles, uv }
}
import Character from '../../Character/Character';
import DisplayText from '../../display/DisplayText';
import CombatEffect from '../CombatEffect';

export class KissOfDeath extends CombatEffect {
    public update(character: Character) {
        character.stats.lust += 5;
        character.combat.stats.loseHP(15, null);
        DisplayText("Your lips burn with an unexpected flash of heat.  They sting and burn with unholy energies as a puff of ectoplasmic gas escapes your lips.  That puff must be a part of your soul!  It darts through the air to the succubus, who slurps it down like a delicious snack.  You feel feverishly hot and exhausted...");
        DisplayText("\n\n");
    }
}
import ICreateSponsorshipDTO from '@modules/sponsorships/dtos/ICreateSponsorshipDTO';
import IFindSponsorshipDTO from '@modules/sponsorships/dtos/IFindSponsorshipDTO';
import IUpdateSponsorshipDTO from '@modules/sponsorships/dtos/IUpdateSponsorshipDTO';
import ISponsorshipRepository from '@modules/sponsorships/repositories/ISponsorshipRepository';
import { getRepository, Repository } from 'typeorm';
import Sponsorship from '../entities/Sponsorship';

export default class PostgresSponsorshipRepository
  implements ISponsorshipRepository
{
  private ormRepository: Repository<Sponsorship>;

  constructor() {
    this.ormRepository = getRepository(Sponsorship);
  }

  async findByUnreadSponsorshipCode(
    sponsorship_code?: string,
  ): Promise<Sponsorship | undefined> {
    const sponsorship = await this.ormRepository.findOne({
      where: {
        sponsorship_code,
      },
    });

    return sponsorship;
  }

  async updateSponsorship(
    sponsor_user_id: string,
    sponsorshipsUpdateData: IUpdateSponsorshipDTO,
  ): Promise<Sponsorship | undefined> {
    const { affected } = await this.ormRepository.update(
      sponsor_user_id,
      sponsorshipsUpdateData,
    );

    if (affected === 1) {
      const updated = await this.ormRepository.findOne(sponsor_user_id);

      return updated;
    }
    return undefined;
  }

  async findBySponsorshipCode(
    sponsorship_code?: string,
  ): Promise<Sponsorship | undefined> {
    const sponsorship = await this.ormRepository.findOne({
      where: {
        sponsorship_code,
      },
    });

    return sponsorship;
  }

  async findAllSponsorshipsFromUser(
    sponsored_user_id: string,
  ): Promise<Sponsorship[]> {
    const sponsorships = await this.ormRepository.find({
      where: {
        sponsored_user_id,
      },
      relations: ['sponsor'],
    });
    return sponsorships;
  }

  async save(sponsorship: Sponsorship): Promise<Sponsorship> {
    return this.ormRepository.save(sponsorship);
  }

  async findSponsorship({
    sponsor_user_id,
    sponsored_user_id,
  }: IFindSponsorshipDTO): Promise<Sponsorship


piryInfo,
  }) {
    final result = create();
    if (expiryInfo != null) result.expiryInfo = expiryInfo;
    return result;
  }

  PugvSeasonPrimaryCustomInfo._();

  factory PugvSeasonPrimaryCustomInfo.fromBuffer($core.List<$core.int> data,
          [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
      create()..mergeFromBuffer(data, registry);
  factory PugvSeasonPrimaryCustomInfo.fromJson($core.String json,
          [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
      create()..mergeFromJson(json, registry);

  static final $pb.BuilderInfo _i = $pb.BuilderInfo(
      _omitMessageNames ? '' : 'PugvSeasonPrimaryCustomInfo',
      package: const $pb.PackageName(
          _omitMessageNames ? '' : 'bilibili.app.viewunite.common'),
      createEmptyInstance: create)
    ..aOS(1, _omitFieldNames ? '' : 'expiryInfo')
    ..hasRequiredFields = false;

  @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
  PugvSeasonPrimaryCustomInfo clone() => deepCopy();
  @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
  PugvSeasonPrimaryCustomInfo copyWith(
          void Function(PugvSeasonPrimaryCustomInfo) updates) =>
      super.copyWith(
              (message) => updates(message as PugvSeasonPrimaryCustomInfo))
          as PugvSeasonPrimaryCustomInfo;

  @$core.override
  $pb.BuilderInfo get info_ => _i;

  @$core.pragma('dart2js:noInline')
  static PugvSeasonPrimaryCustomInfo create() =>
      PugvSeasonPrimaryCustomInfo._();
  @$core.override
  PugvSeasonPrimaryCustomInfo createEmptyInstance() => create();
  static $pb.PbList<PugvSeasonPrimaryCustomInfo> createRepeated() =>
      $pb.PbList<PugvSeasonPrimaryCustomInfo>();
  @$core.pragma('dart2js:noInline')
  static PugvSeasonPrimaryCustomInfo getDefault() => _defaultInstance ??=
      $pb.GeneratedMessage.$_defaultFor<PugvSeasonPrimaryCustomInfo>(create);
  static PugvSeasonPrimaryCustomInfo? _defaultInstance;

  @$pb.TagNumber(1)
  $core.String get expiryInfo => $_getSZ(0);
  @$pb.TagNumber(1)
  set expiryInfo($core.String value) => $_setString(0, value);
  @$pb.TagNumber(1)
  $core.bool hasExpiryInfo() => $_has(0);
  @$pb.TagNumber(1)
  void clearExpiryInfo() => $_clearField(1);
}

class PugvSeasonPrimaryHotRank extends $pb.GeneratedMessage {
  factory PugvSeasonPrimaryHotRank({
    $core.String? text,
    $core.String? link,
  }) {
    final result = create();
    if (text != null) result.text = text;
    if (link != null) result.link = link;
    return result;
  }

  PugvSeasonPrimaryHotRank._();

  factory PugvSeasonPrimaryHotRank.fromBuffer($core.List<$core.int> data,
          [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
      create()..mergeFromBuffer(data, registry);
  factory PugvSeasonPrimaryHotRank.fromJson($core.String json,
          [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
      create()..mergeFromJson(json, registry);

  static final $pb.BuilderInfo _i = $pb.BuilderInfo(
      _omitMessageNames ? ''


BE4 00095B24  7F 83 E3 78 */	mr r3, r28
/* 80098BE8 00095B28  B0 01 00 2A */	sth r0, 0x2a(r1)
/* 80098BEC 00095B2C  80 93 00 08 */	lwz r4, 8(r19)
/* 80098BF0 00095B30  48 00 02 9D */	bl "JSUConvertOffsetToPtr<Q211JASWSParser9TCtrlWave>__FPCvUl"
/* 80098BF4 00095B34  80 03 00 00 */	lwz r0, 0(r3)
/* 80098BF8 00095B38  7E 43 93 78 */	mr r3, r18
/* 80098BFC 00095B3C  7E 24 8B 78 */	mr r4, r17
/* 80098C00 00095B40  38 C1 00 08 */	addi r6, r1, 8
/* 80098C04 00095B44  54 05 04 3E */	clrlwi r5, r0, 0x10
/* 80098C08 00095B48  7C B0 2B 78 */	mr r16, r5
/* 80098C0C 00095B4C  48 00 19 55 */	bl setWaveInfo__Q216JASBasicWaveBank10TWaveGroupFiUlRC11JASWaveInfo
/* 80098C10 00095B50  7C 1B 80 40 */	cmplw r27, r16
/* 80098C14 00095B54  40 80 00 08 */	bge .L_80098C1C
/* 80098C18 00095B58  7E 1B 83 78 */	mr r27, r16
.L_80098C1C:
/* 80098C1C 00095B5C  3A 94 00 04 */	addi r20, r20, 4
/* 80098C20 00095B60  3A 73 00 04 */	addi r19, r19, 4
/* 80098C24 00095B64  3A 31 00 01 */	addi r17, r17, 1
.L_80098C28:
/* 80098C28 00095B68  80 16 00 04 */	lwz r0, 4(r22)
/* 80098C2C 00095B6C  7C 11 00 40 */	cmplw r17, r0
/* 80098C30 00095B70  41 80 FF 54 */	blt .L_80098B84
/* 80098C34 00095B74  7E 43 93 78 */	mr r3, r18
/* 80098C38 00095B78  7E A4 AB 78 */	mr r4, r21
/* 80098C3C 00095B7C  48 00 33 0D */	bl setFileName__10JASWaveArcFPCc
/* 80098C40 00095B80  3B FF 00 04 */	addi r31, r31, 4
/* 80098C44 00095B84  3B DE 00 04 */	addi r30, r30, 4
/* 80098C48 00095B88  3B 5A 00 01 */	addi r26, r26, 1
.L_80098C4C:
/* 80098C4C 00095B8C  80 17 00 08 */	lwz r0, 8(r23)
/* 80098C50 00095B90  7C 1A 00 40 */	cmplw r26, r0
/* 80098C54 00095B94  41 80 FE C4 */	blt .L_80098B18
/* 80098C58 00095B98  7F 03 C3 78 */	mr r3, r24
/* 80098C5C 00095B9C  38 9B 00 01 */	addi r4, r27, 1
/* 80098C60 00095BA0  48 00 14 71 */	bl setWaveTableSize__16JASBasicWaveBankFUl
/* 80098C64 00095BA4  7F A3 EB 78 */	mr r3, r29
/* 80098C68 00095BA8  4B F8 AB 4D */	bl getFreeSize


--D・クリーナン
function c48868994.initial_effect(c)
	--atk
	local e1=Effect.CreateEffect(c)
	e1:SetDescription(aux.Stringid(48868994,0))
	e1:SetCategory(CATEGORY_DAMAGE)
	e1:SetType(EFFECT_TYPE_IGNITION)
	e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
	e1:SetCountLimit(1)
	e1:SetRange(LOCATION_MZONE)
	e1:SetCondition(c48868994.cona)
	e1:SetCost(c48868994.costa)
	e1:SetTarget(c48868994.tga)
	e1:SetOperation(c48868994.opa)
	c:RegisterEffect(e1)
	--equip
	local e2=Effect.CreateEffect(c)
	e2:SetDescription(aux.Stringid(48868994,1))
	e2:SetCategory(CATEGORY_EQUIP)
	e2:SetType(EFFECT_TYPE_IGNITION)
	e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
	e2:SetRange(LOCATION_MZONE)
	e2:SetCountLimit(1)
	e2:SetCondition(c48868994.cond)
	e2:SetTarget(c48868994.tgd)
	e2:SetOperation(c48868994.opd)
	c:RegisterEffect(e2)
end
function c48868994.cona(e,tp,eg,ep,ev,re,r,rp)
	return not e:GetHandler():IsDisabled() and e:GetHandler():IsAttackPos()
end
function c48868994.costa(e,tp,eg,ep,ev,re,r,rp,chk)
	if chk==0 then return e:GetHandler():GetEquipGroup():IsExists(Card.IsAbleToGraveAsCost,1,nil) end
	Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
	local g=e:GetHandler():GetEquipGroup():FilterSelect(tp,Card.IsAbleToGraveAsCost,1,1,nil)
	Duel.SendtoGrave(g,REASON_COST)
end
function c48868994.tga(e,tp,eg,ep,ev,re,r,rp,chk)
	if chk==0 then return true end
	Duel.SetTargetPlayer(1-tp)
	Duel.SetTargetParam(500)
	Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,500)
end
function c48868994.opa(e,tp,eg,ep,ev,re,r,rp)
	local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_P


3)

					--Find next point along bolt
					local NextPoint = i ~= PartsN
							and (CFrame.new(bezier0, bezier1) * CFrame.Angles(0, 0, noise0) * CFrame.Angles(
							math.acos(math.clamp(NoiseBetween(input2, input, 2.7, offsetAngle, 1), -1, 1)),
							0,
							0
						) * CFrame.new(0, 0, -noise1)).Position
						or bezier1

					ThisBranch:_UpdateGeometry(BPart, PercentAlongBolt, TimePassed, thicknessNoise, PrevPoint, NextPoint)

					ThisBranch:_UpdateColor(BPart, PercentAlongBolt, TimePassed)

					PrevPoint, bezier0 = NextPoint, bezier1
				end
			else
				ThisBranch:Destroy()
			end
		else --Enabled = false
			if ThisBranch._PartsHidden == false then
				ThisBranch._PartsHidden = true
				ThisBranch:_Disable()
			end
		end
	end

	debug.profileend()
end)

return LightningBolt


",
  "PM": "Saint Pierre și Miquelon",
  "VC": "Sfântul Vincent",
  "WS": "Samoa",
  "SM": "San Marino",
  "ST": "São Tomé și Príncipe",
  "SA": "Arabia Saudită",
  "SN": "Senegal",
  "RS": "Serbia",
  "SC": "Seychelles",
  "SL": "Sierra Leone",
  "SG": "Singapore",
  "SX": "Sint Maarten",
  "SK": "Slovacia",
  "SI": "Slovenia",
  "SB": "Insulele Solomon",
  "SO": "Somalia",
  "ZA": "Africa de Sud",
  "GS": "Georgia de Sud și Insulele Sandwich de Sud",
  "KR": "Coreea de Sud",
  "SS": "Sudanul de Sud",
  "ES": "Spania",
  "LK": "Sri Lanka",
  "SD": "Sudan",
  "SR": "Surinam",
  "SJ": "Svalbard și Jan Mayen",
  "SZ": "Eswatini",
  "SE": "Suedia",
  "CH": "Elveția",
  "SY": "Siria",
  "TW": "Taiwan",
  "TJ": "Tadjikistan",
  "TZ": "Tanzania",
  "TH": "Thailanda",
  "TG": "Togo",
  "TK": "Tokelau",
  "TO": "Tonga",
  "TT": "Trinidad și Tobago",
  "TN": "Tunisia",
  "TR": "Turcia",
  "TM": "Turkmenistan",
  "TC": "Insulele Turks și Caicos",
  "TV": "Tuvalu",
  "VI": "Insulele Virgine Americane",
  "UG": "Uganda",
  "UA": "Ucraina",
  "AE": "Emiratele Arabe Unite",
  "GB": "Regatul Unit",
  "US": "Statele Unite ale Americii",
  "UY": "Uruguay",
  "UZ": "Uzbekistan",
  "VU": "Vanuatu",
  "VA": "Statul Vatican",
  "VE": "Venezuela",
  "VN": "Vietnam",
  "WF": "Wallis și Futuna",
  "WW": "La nivel mondial",
  "EH": "Sahara de Vest",
  "YE": "Yemen",
  "ZM": "Zambia",
  "ZW": "Zimbabwe",
  "search": "Căutare",
};
Map<String, String> fr = {
  "AF": "Afghanistan",
  "AX": "Åland",
  "AL": "Albanie",
  "DZ": "Algérie",
  "AS": "Samoa américaines",
  "AD": "Andorre",
  "AO": "Angola",
  "AI": "Anguilla",
  "AG": "Antigua-et-Barbuda",
  "AR": "Argentine",
  "AM": "Arménie",
  "AW": "Aruba",
  "AC": "Île de l'Ascension",
  "AU": "Australie",
  "AT": "Autriche",
  "AZ": "Azerbaïdjan",
  "BS": "Bahamas",
  "BH": "Bahreïn",
  "BD": "Bangladesh",
  "BB": "Barbade",
  "BY": "Biélorussie",
  "BE": "Belgique",
  "BZ": "Belize",
  "BJ": "Bénin",
  "BM": "Bermudes",
  "BT": "Bhoutan",
  "BO": "Bolivie",
  "BA": "B


)
		if err != nil && err != ErrNotFound {
			return err
		}

		// Determine model type based on the args
		modelType := types.ModelTypeChat // Default to chat
		for _, arg := range model.Args {
			if arg == "embed" {
				modelType = types.ModelTypeEmbed
				break
			}
		}

		// Determine sort order - embedding models get higher numbers (lower priority)
		sortOrder := i + 100 // Start VLLM models at 100+ to come after Ollama models
		if modelType == types.ModelTypeEmbed {
			sortOrder = i + 1000 // Embedding models get even higher numbers
		}

		if existingModel != nil {
			// Always update system-managed fields if user hasn't modified the model
			shouldUpdate := false
			updateData := *existingModel

			// Update sort order if not set
			if existingModel.SortOrder == 0 {
				updateData.SortOrder = sortOrder
				shouldUpdate = true
			}
			// Update model type if incorrect
			if existingModel.Type != modelType {
				log.Info().
					Str("model_id", model.ID).
					Str("old_type", string(existingModel.Type)).
					Str("new_type", string(modelType)).
					Msg("Updating VLLM model type")
				updateData.Type = modelType
				shouldUpdate = true
			}

			// If user hasn't modified the model, keep it in sync with code definitions
			log.Debug().
				Str("model_id", model.ID).
				Bool("user_modified", existingModel.UserModified).
				Bool("existing_prewarm", existingModel.Prewarm).
				Bool("code_prewarm", model.Prewarm).
				Msg("checking if VLLM model needs seeding updates")
			if !existingModel.UserModified {
				// Update all system-managed fields from code definitions
				if existingModel.Memory != model.Memory {
					updateData.Memory = model.Memory
					shouldUpdate = true
				}
				if existingModel.Name != model.Name {
					updateData.Name = model.Name
					shouldUpdate = true
				}
				if existingModel.Description != model.Description {
					updateData.Description = model.Description
					shouldUpdate = true
				}
				if existingModel.Hide != model.Hide {
					updateData.Hide = model.Hide
					shouldUpdate = true
				}
				if existingModel.Prewarm != model.Prewarm {
					log.Warn().
						Str("model_id", model.ID).
						Bool("existing_prewarm", existingModel.Prewarm).
						Bool("new_prewarm", model.Prewarm).
						Bool("user_modified", existingModel.UserModified).
						Msg("OVERRIDING VLLM prewarm setting during model seeding - this may override user dashboard changes!")
					updateData.Prewarm = model.Prewarm
					shouldUpdate = true
				}
				if existingModel.ContextLength != model.ContextLength {
					updateData.ContextLength = model.ContextLength
					shouldUpdate = true
				}
			}

			if shouldUpdate {
				_, err = s.UpdateModel(ctx, &updateData)
				if err != nil {
					log.Err(err).Str("model_id", model.ID).Msg("failed to update existing vllm model")
				} else {
					log.Warn().
						Str("model_id", model.ID).
						Bool("user_modified", existingModel.UserModified).
						Bool("prewarm_updated", updateData.Prewarm != existingModel.Prewarm).
						Bool("final_prewarm", updateData.Prewarm).
						Msg("SEEDING OVERRODE VLLM model settings - check if this conflicts with user dashboard changes")
				}
			}
			continue
		}

		// Create R


/*
 * Copyright (C) 2021 CutefishOS Team.
 *
 * Author:     revenmartin <revenmartin@gmail.com>
 *
 * 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 3 of the License, or
 * 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/>.
 */

#ifndef WINDOWSHADOW_H
#define WINDOWSHADOW_H

#include "tileset.h"

#include <QGuiApplication>
#include <QMap>
#include <QObject>
#include <QPainter>
#include <QPixmap>
#include <QQmlEngine>
#include <QQmlParserStatus>
#include <QRect>
#include <QWindow>
#include <QVector>

struct ShadowParams
{
    ShadowParams() = default;

    ShadowParams(const QPoint &offset, int radius, qreal opacity):
        offset(offset),
        radius(radius),
        opacity(opacity)
    {}

    QPoint offset;
    int radius = 0;
    qreal opacity = 0;
};

struct CompositeShadowParams
{
    CompositeShadowParams() = default;

    CompositeShadowParams(
            const QPoint &offset,
            const ShadowParams &shadow1,
            const ShadowParams &shadow2)
        : offset(offset)
        , shadow1(shadow1)
        , shadow2(shadow2) {}

    bool isNone() const
    { return qMax(shadow1.radius, shadow2.radius) == 0; }

    QPoint offset;
    ShadowParams shadow1;
    ShadowParams shadow2;
};

class WindowShadow : public QObject, public QQmlParserStatus
{
    Q_OBJECT
    Q_INTERFACES(QQmlParserStatus)
    Q_PROPERTY(QWindow *view READ view WRITE setView NOTIFY viewChanged)
    Q_PROPERTY(QRect geometry READ geometry WRITE setGeometry NOTIFY geometryChanged)
    Q_PROPERTY(qreal radius READ radius WRITE setRadius NOTIFY radiusChanged)
    Q_PROPERTY(qreal strength READ strength WRITE setStrength NOTIFY strengthChanged)

public:
    WindowShadow(QObject *parent = nullptr) noexcept;
    ~WindowShadow() override;

    static CompositeShadowParams lookupShadowParams(int shadowSizeEnum);

    void classBegin() override;
    void componentComplete() override;

    void setView(QWindow *view);
    QWindow *view() const;

    void setGeometry(const QRect &rect);
    QRect geometry() const;

    void setRadius(qreal value);
    qreal radius() { return m_radius; }

    qreal strength() const;
    void setStrength(qreal strength);

private slots:
    void onViewVisibleChanged(bool);

private:
    void configureTiles();
    TileSet shadowTiles();

    QMargins shadowMargins(TileSet) const;

signals:
    void geometryChanged();
    void enabledChanged();
    void viewChanged();
    void edgesChanged();
    void radiusChanged();
    void strengthChanged();

private:
    QWindow *m_view;
    QRect m_rect;
    TileSet m_shadowTiles;
    qreal m_radius = 10;
    qreal m_strength = 1.2;
};

#endif


-非商业性使用-相同方式共享 3.0 协议**](https://creativecommons.org/licenses/by-sa/3.0/deed.zh-hans) 下提供，附加条款亦可能应用。

引用类型与其他类型作品版权归原作者所有，如有作者授权则遵照授权协议使用。

详细请查阅 [THBWiki：免责声明](https://thbwiki.cc/THBWiki:%E5%85%8D%E8%B4%A3%E5%A3%B0%E6%98%8E)。

# SAVE_THE_QUEEN

SAVE THE QUEEN ，于 2009 年成立，主要制作 同人音乐 的日本同人社团，主催是 あっさー，当前状态为 休止

本页是关于 **[同人社团](./同人社团.md#同人社团)** 的词条

## 目录

- [1 社团信息](#社团信息)
- [2 成员名单](#成员名单)
- [3 作品列表](#作品列表)
- [4 其他信息](#其他信息)

## 社团信息
[](./文件-SAVE_THE_QUEENbanner.jpg.md)  [](./文件-SAVE_THE_QUEENbanner.jpg.md)banner

社团名称	 SAVE THE QUEEN

主要作品类型	同人音乐

成立时间	2009

当前状态	休止

主催	 あっさー

地区	日本

官网页面	http://savethequeen.ninja-web.net （已经失效）

SAVE THE QUEEN（同人社团，同人音乐社团） - SAVE THE QUEEN ，于 2009 年成立，主要制作 同人音乐 的日本同人社团，主催是 あっさー，当前状态为 休止

## 成员名单
- あっさー (未找到链接)
- 式部 (未找到链接)
- navio* (未找到链接)
- 枷奈 (未找到链接)
- ちぃ。 (未找到链接)
- 三日月 (未找到链接)

## 作品列表
[](./幻想のエリシオン.md)[幻想のエリシオン](./幻想のエリシオン.md)首发日期：2010-08-14 （Comic Market 78 (未找到链接)）ANSTQ-0001EP （一般向）该作品是与 anos+plus (未找到链接) 合作创作的[](.


em 0;
}

.collection h2 {
    font-size: 2.5rem;
    font-weight: 600;
    margin: 0;
}

#featured p {
    max-width: 54ch;
}

#github img {
    aspect-ratio: 1;
    filter: var(--image-filters);
    width: 2rem;
}

a#github {
    display: block;
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
}

.show_scrollbar::-webkit-scrollbar {
    width: 10px;
    opacity: 0.1;
}
.show_scrollbar::-webkit-scrollbar-track {
}
.show_scrollbar::-webkit-scrollbar-thumb {
    /* height: 11px; */
    background-color: var(--black);
    opacity: 0.6;
    border-radius: 1000px;
}
.show_scrollbar::-webkit-scrollbar-thumb:hover {
    opacity: 1;
}
.siac-inner-card {
    position: relative;
    font-size: 12px !important;
    overflow-x: hidden;
    overflow-y: hidden;
    max-height: 950px;
    min-width: 95px;
    word-break: break-word;
    box-sizing: border-box;;
    background: var(--c-card-bg);
  }
body.nightMode .siac-inner-card, #siac-reading-modal .siac-inner-card {
    color: white;
    background: var(--c-card-bg-night) !important;
  }

  .siac-note-outer.meta .siac-inner-card {
    max-height: none;
}
.siac-note-outer:hover .siac-note-btns {
    /* visibility: visible; */
    opacity: 1;
}
.pdf .siac-inner-card{
    min-width: 200px;
}
.siac-inner-card:empty {
    display: none !important;
}
.siac-inner-card > *:first-child {
    margin-top: 0;
}
.siac-inner-card > *:last-child {
    margin-bottom: 0;
}
.siac-inner-card img {
    max-height: var(--img-max-height) !important;
    max-width: 100%;
}
.siac-inner-card dt {
    font-weight: bold;
}
.siac-inner-card dd {
    font-style: italic;
}
.siac-inner-card dl {
    border-left: 10px solid var(--c-note-foreground);
    padding-left: 10px;
    margin: 1.5em 10px;

}
.siac-inner-card blockquote, .siac-inner-card pre {
  background: #f9f9f9;
  border-left: 10px solid #2496dc;
  margin: 1.5em 10px;
  padding: 0.5em 10px;
}
body.nightMode .siac-inner-card blockquote,
body.nightMode .siac-inner-card pre,
#siac-reading-modal .siac-inner-card blockquote,
#siac-reading-modal .siac-inner-card pre {
  background: #474749;
  border-left: 10px solid #2496dc;
}
.siac-outer-note.grid .siac-inner-card {
    word-wrap: break-word;
}
.editedStamp {
    display: inline;
}
.retMark {
    display: inline-block;
    user-select: none;
    padding: 1px;
    margin-left: 13px;
    font-size: 10px;
    white-space: nowrap;
    border


';
  static const String AUDIO_WAV = 'http-get:*:audio/wav:*';
  static const String AUDIO_L16 = 'http-get:*:audio/l16:AUDIO*';
  static const String AUDIO_MP3 = 'http-get:*:audio/mp3:*';
  static const String AUDIO_MPEG = 'http-get:*:audio/mpeg:*';
  static const String AUDIO_X_MS_WMA = 'http-get:*:audio/x-ms-wma:*';
  static const String AUDIO_WMA = 'http-get:*:audio/wma:*';
  static const String AUDIO_VND_DLNA_ADTS = 'http-get:*:audio/vnd.dlna.adts:*';
  static const String AUDIO_MP4 = 'http-get:*:audio/mp4:*';
  static const String AUDIO_X_AIFF = 'http-get:*:audio/x-aiff:*';
  static const String AUDIO_X_FLAC = 'http-get:*:audio/x-flac:*';
  static const String AUDIO_X_APE = 'http-get:*:audio/x-ape:*';
  static const String AUDIO_X_MATROSKA = 'http-get:*:audio/x-matroska:*';

  AudioObject(String title, String url, String protocol) {
    this.title = title;
    this.url = url;
    this.protocol = protocol;
  }

  @override
  String toString() {
    return 'AudioObject ${super.toString()}';
  }
}

class ImageObject extends DIDLObject {
  static const String IMAGE_JPEG = 'http-get:*:image/jpeg:*';
  static const String IMAGE_PNG = 'http-get:*:image/png:*';
  static const String IMAGE_TIFF = 'http-get:*:image/tiff:*';
  static const String IMAGE_GIF = 'http-get:*:image/gif:*';

  ImageObject(String title, String url, String protocol) {
    this.title = title;
    this.url = url;
    this.protocol = protocol;
  }

  @override
  String toString() {
    return 'ImageObject ${super.toString()}';
  }
}
import 'dart:async';

import '../dlna_device.dart';
import '../dlna_manager.dart';
import 'description_parser.dart';
import 'local_device_parser.dart';

class DiscoveryDeviceManger {
  static const int FROM_ADD = 1;
  static const int FROM_UPDATE = 2;
  static const int FROM_CACHE_ADD = 3;

  // 150s = 2.5min
  static const int DEVICE_DESCRIPTION_INTERVAL_TIME = 150000;

  // 5min
  static const DEVICE_ALIVE_CHECK_INTERVAL_TIME = Duration(minutes: 5);
  static const DEVICE_ALIVE_CHECK_RETRY_INTERVAL_TIME = Duration(seconds: 30);

  final int _startSearchTime = DateTime.now().millisecondsSinceEpoch;
  final List<String> _descTasks = [];
  final Map<String, int> _unnecessaryDevices = {};
  final Map<String, DLNADevice> _currentDevices = {};

  final DescriptionParser _descriptionParser = DescriptionParser();
  final LocalDeviceParser _localDeviceParser = LocalDeviceParser();

  Timer _timer;
  bool _enableCache = false;
  bool _disable = true;
  DeviceRefresher _refresher;

  void enableCache() {
    _enableCache = true;
  }

  Future<List<DLNADevice>> getLocalDevices() async {
    return _localDeviceParser.findAndConvert();
  }

  void setRefresh(DeviceRefresher refresher) {
    _refresher = refresher;
    if (_refresher != null) {
      _currentDevices.forEach((key, value) {
        _refresher.onDeviceAdd(value);
      });
    }
  }

  void enable() {
    _disable = false;
    _timer = Timer.periodic(DEVICE_ALIVE_CHECK_INTERVAL_TIME, (Timer t) {
      if (_disable) {
        return;
      }


  [3]    [4]    [5]    [6]    [7]    [8]    [9]    [10]   [11]   [12]
# CHECK-NEXT:  -      -      -     0.25   0.25   0.25   0.25    -      -      -      -      -      -

# CHECK:      Resource pressure by instruction:
# CHECK-NEXT: [0]    [1]    [2]    [3]    [4]    [5]    [6]    [7]    [8]    [9]    [10]   [11]   [12]   Instructions:
# CHECK-NEXT:  -      -      -     0.25   0.25   0.25   0.25    -      -      -      -      -      -     lzcntw	%ax, %bx

# CHECK:      Timeline view:
# CHECK-NEXT:                     0
# CHECK-NEXT: Index     0123456789

# CHECK:      [0,0]     DeER .    .   lzcntw	%ax, %bx
# CHECK-NEXT: [1,0]     D=eER.    .   lzcntw	%ax, %bx
# CHECK-NEXT: [2,0]     D==eER    .   lzcntw	%ax, %bx
# CHECK-NEXT: [3,0]     D===eER   .   lzcntw	%ax, %bx
# CHECK-NEXT: [4,0]     .D===eER  .   lzcntw	%ax, %bx
# CHECK-NEXT: [5,0]     .D====eER .   lzcntw	%ax, %bx
# CHECK-NEXT: [6,0]     .D=====eER.   lzcntw	%ax, %bx
# CHECK-NEXT: [7,0]     .D======eER   lzcntw	%ax, %bx

# CHECK:      Average Wait times (based on the timeline view):
# CHECK-NEXT: [0]: Executions
# CHECK-NEXT: [1]: Average time spent waiting in a scheduler's queue
# CHECK-NEXT: [2]: Average time spent waiting in a scheduler's queue while ready
# CHECK-NEXT: [3]: Average time elapsed from WB until retire stage

# CHECK:            [0]    [1]    [2]    [3]
# CHECK-NEXT: 0.     8     4.0    0.1    0.0       lzcntw	%ax, %bx


inCredentials)
WINADVAPI BOOL  WINAPI CredRenameA(LPCSTR,LPCSTR,DWORD,DWORD);
WINADVAPI BOOL  WINAPI CredRenameW(LPCWSTR,LPCWSTR,DWORD,DWORD);
#define                CredRename WINELIB_NAME_AW(CredRename)
WINADVAPI BOOL  WINAPI CredUnmarshalCredentialA(LPCSTR,PCRED_MARSHAL_TYPE,PVOID *);
WINADVAPI BOOL  WINAPI CredUnmarshalCredentialW(LPCWSTR,PCRED_MARSHAL_TYPE,PVOID *);
#define                CredUnmarshalCredential WINELIB_NAME_AW(CredUnmarshalCredential)
WINADVAPI BOOL  WINAPI CredWriteA(PCREDENTIALA,DWORD);
WINADVAPI BOOL  WINAPI CredWriteW(PCREDENTIALW,DWORD);
#define                CredWrite WINELIB_NAME_AW(CredWrite)

BOOL  WINAPI CredPackAuthenticationBufferW(DWORD,LPWSTR,LPWSTR,PBYTE,DWORD *);
BOOL  WINAPI CredUnPackAuthenticationBufferW(DWORD,PVOID,DWORD,LPWSTR,DWORD *,LPWSTR,DWORD *,LPWSTR,DWORD *);
DWORD WINAPI CredUICmdLinePromptForCredentialsW(PCWSTR,PCtxtHandle,DWORD,PWSTR,ULONG,PWSTR,ULONG,PBOOL,DWORD);
DWORD WINAPI CredUICmdLinePromptForCredentialsA(PCSTR,PCtxtHandle,DWORD,PSTR,ULONG,PSTR,ULONG,PBOOL,DWORD);
#define      CredUICmdLinePromptForCredentials WINELIB_NAME_AW(CredUICmdLinePromptForCredentials)
DWORD WINAPI CredUIConfirmCredentialsW(PCWSTR,BOOL);
DWORD WINAPI CredUIConfirmCredentialsA(PCSTR,BOOL);
#define      CredUIConfirmCredentials WINELIB_NAME_AW(CredUIConfirmCredentials)
DWORD WINAPI CredUIParseUserNameW(PCWSTR,PWSTR,ULONG,PWSTR,ULONG);
DWORD WINAPI CredUIParseUserNameA(PCSTR,PSTR,ULONG,PSTR,ULONG);
#define      CredUIParseUserName WINELIB_NAME_AW(CredUIParseUserName)
DWORD WINAPI CredUIPromptForCredentialsW(PCREDUI_INFOW,PCWSTR,PCtxtHandle,DWORD,PWSTR,ULONG,PWSTR,ULONG,PBOOL,DWORD);
DWORD WINAPI CredUIPromptForCredentialsA(PCREDUI_INFOA,PCSTR,PCtxtHandle,DWORD,PSTR,ULONG,PSTR,ULONG,PBOOL,DWORD);
#define      CredUIPromptForCredentials WINELIB_NAME_AW(CredUIPromptForCredentials)
DWORD WINAPI CredUIPromptForWindowsCredentialsW(PCREDUI_INFOW,DWORD,ULONG *,LPCVOID,ULONG,LPVOID *, ULONG *, BOOL *,
                                                DWORD);
DWORD WINAPI CredUIStoreSSOCredW(PCWSTR,PCWSTR,PCWSTR,BOOL);
/* Note: no CredUIStoreSSOCredA in PSDK header */
DWORD WINAPI CredUIReadSSOCredW(PCWSTR,PWSTR*);
/* Note: no CredUIReadSSOCredA in PSDK header */

#ifdef __cplusplus
}
#endif

#include "wine/winheader_exit.h"

#endif /* _WINCRED_H_ */


body {
                font-family: "Arial", sans-serif;
            }
            h1 {
                font-size: {{ title_size }}pt;
                color: {{ title_color }};
            }
            .report-people {
                font-size: {{ report_people_size }}pt;
                color: {{ report_people_color }};
            }
            .report-datetime {
                font-size: {{ report_datatime_size }}pt;
                color: {{ report_datatime_color }};
            }
            .report-place {
                font-size: {{ report_place_size }}pt;
                color: {{ report_place_color }};
            }
            table {
                border-collapse: collapse;
                width: 100%;
            }
            th, td {
                border: 1px solid black;
                padding: 8px;
                text-align: center;
            }
        </style>

        {% if title %}

{{ title }}

        {% endif %}

        {% if report_people %}

汇报人: {{ report_people }}

        {% endif %}

        {% if report_datatime %}

实验日期: {{ report_datatime }}

        {% endif %}

        {% if report_place %}

实验地点: {{ report_place }}

        {% endif %}

        {% if data_chart %}

实验数据

        {% for table in data_chart %}

                        {% for column in table[0] %}
                            {{ column }}
                        {% endfor %}

                    {% for row in table[1:] %}

                            {% for cell in row %}
                                {{ cell }}
                            {% endfor %}

                    {% endfor %}

        {% endfor %}
        {% endif %}

        {% if data_picture %}

报告图片

        {% endif %}

    """

    return template

# 使用示例
file_path = "E://python//获取报告生成适配该报告的jinja2模板//rest_1.docx"
report_features = extract_docx_features(file_path)

# 生成 Jinja2 模板
template = generate_jinja2_template(report_features)

# 使用 Jinja2 渲染模板
jinja_template = Template(template)
rendered_html = jinja_template.render(report_features)

# 打印渲染后的 HTML
print(rendered_html)

报告内容为：
空气动力学实验报告
汇报人：丁真
实验日期：2024-12-17
实验地点：西南科技大学
数据表格：
ID	Name	Age	Department	Salary
1	Alice	30	Engineering	70000
2	Bob	24	Marketing	50000
3	Charlie	28	Human Resources	55000
4	David	35	Finance	80000
5	Eve	32	Engineering