"""
Problem 68 from Top Interview 150: Text Justification

Given an array of strings words and a width maxWidth, format the text such that each
line has exactly maxWidth characters and is fully (left and right) justified.

You should pack your words in a greedy approach; that is, pack as many words as you can in
each line. Pad extra spaces ' ' when necessary so that each line has exactly maxWidth characters.

Extra spaces between words should be distributed as evenly as possible. If the number of spaces
on a line does not divide evenly between words, the empty slots on the left will be assigned more
spaces than the slots on the right.

For the last line of text, it should be left-justified, and no extra space is inserted between words.

Note:

    A word is defined as a character sequence consisting of non-space characters only.
    Each word's length is guaranteed to be greater than 0 and not exceed maxWidth.
    The input array words contains at least one word.
"""

class Solution(object):
    def fullJustify(self, words, maxWidth):
        """
        :type words: List[str]
        :type maxWidth: int
        :rtype: List[str]
        """
        characters_so_far = 0
        curr_line = []
        min_white_spaces_needed = 0
        output = []
        while len(words) > 0:
            if characters_so_far + len(words[0]) + min_white_spaces_needed <= maxWidth:
                characters_so_far += len(words[0])
                curr_line.append(words.pop(0))
                if len(curr_line) > 1:
                    min_white_spaces_needed += 1
            if len(words) == 0 or characters_so_far + len(words[0]) + min_white_spaces_needed >= maxWidth:
                dictionary = {}
                for i in range(0, len(curr_line)):
                    dictionary[i] = curr_line[i]
                space_number = 0
                num_to_assign = min_white_spaces_needed
                while min_white_spaces_needed > 0:
                    dictionary[space_number % num_to_assign] += " "
                    space_number += 1
                    min_white_spaces_needed -= 1
                whitespaces_left = maxWidth - (characters_so_far + num_to_assign)
                space_number = 0
                num_to_assign = len(dictionary) - 1
                if len(words) == 0:
                    dictionary[len(curr_line) - 1] += " " * whitespaces_left
                    whitespaces_left = 0
                while whitespaces_left > 0:
                    if num_to_assign <= 0:
                        dictionary[0] += " "
                        whitespaces_left -= 1
                    else:
                        dictionary[space_number % num_to_assign] += " "
                        space_number += 1
                        whitespaces_left -= 1
                str_to_build = ''.join(dictionary.values())
                output.append(str_to_build)
                curr_line = []
                min_white_spaces_needed = 0
                characters_so_far = 0
        return output


], x1
        st1             {v23.8h}, [x6], x1
        b.gt            8b
        ret
160:
320:
640:
        add             x12, x2,  w3, uxtw #1
        sub             x1,  x1,  w3, uxtw #1
        ld1r            {v5.8h}, [x12]            // right
        sub             x2,  x2,  #4
        mov             x7,  #-4
        mov             w9,  w3
        add             v31.4h,  v4.4h,   v5.4h   // bottom+right

1:
        ld2r            {v0.8h, v1.8h},   [x2],  x7 // left
        ld2r            {v16.8b, v17.8b}, [x11], #2 // weights_ver
        sub             v0.8h,   v0.8h,   v5.8h   // left-right
        sub             v1.8h,   v1.8h,   v5.8h
        uxtl            v16.8h,  v16.8b           // weights_ver
        uxtl            v17.8h,  v17.8b
2:
        ld1             {v7.16b}, [x10],  #16     // weights_hor
        ld1             {v2.8h, v3.8h}, [x8], #32 // top
        ushll           v20.4s,  v31.4h,  #8      // (bottom+right)*256
        ushll           v21.4s,  v31.4h,  #8
        ushll           v22.4s,  v31.4h,  #8
        ushll           v23.4s,  v31.4h,  #8
        ushll           v24.4s,  v31.4h,  #8
        ushll           v25.4s,  v31.4h,  #8
        ushll           v26.4s,  v31.4h,  #8
        ushll           v27.4s,  v31.4h,  #8
        uxtl            v6.8h,   v7.8b            // weights_hor
        uxtl2           v7.8h,   v7.16b
        sub             v2.8h,   v2.8h,   v4.8h   // top-bottom
        sub             v3.8h,   v3.8h,   v4.8h
        smlal           v20.4s,  v1.4h,   v6.4h   // += (left-right)*weights_hor
        smlal2          v21.4s,  v1.8h,   v6.8h   // (left flipped)
        smlal           v22.4s,  v1.4h,   v7.4h
        smlal2          v23.4s,  v1.8h,   v7.8h
        smlal           v24.4s,  v0.4h,   v6.4h
        smlal2          v25.4s,  v0.8h,   v6.8h
        smlal           v26.4s,  v0.4h,   v7.4h
        smlal2          v27.4s,  v0.8h,   v7.8h
        smlal           v20.4s,  v2.4h,   v16.4h  // += (top-bottom)*weights_ver
        smlal2          v21.4s,  v2.8h,   v16.8h
        smlal           v22.4s,  v3.4h,   v16.4h
        smlal2          v23.4s,  v3.8h,


Only call schedule on return to userspace. If we're returning
	 * to kernel space, we may schedule if CONFIG_PREEMPTION, otherwise
	 * we jump back to intr_restore.
	 */
	LDREG	PT_IASQ0(%r16), %r20
	cmpib,COND(=)	0, %r20, intr_do_preempt
	nop
	LDREG	PT_IASQ1(%r16), %r20
	cmpib,COND(=)	0, %r20, intr_do_preempt
	nop

	/* NOTE: We need to enable interrupts if we schedule.  We used
	 * to do this earlier but it caused kernel stack overflows. */
	ssm     PSW_SM_I, %r0

#ifdef CONFIG_64BIT
	ldo	-16(%r30),%r29		/* Reference param save area */
#endif

	ldil	L%intr_check_sig, %r2
#ifndef CONFIG_64BIT
	b	schedule
#else
	load32	schedule, %r20
	bv	%r0(%r20)
#endif
	ldo	R%intr_check_sig(%r2), %r2

	/* preempt the current task on returning to kernel
	 * mode from an interrupt, iff need_resched is set,
	 * and preempt_count is 0. otherwise, we continue on
	 * our merry way back to the current running task.
	 */
#ifdef CONFIG_PREEMPTION
	.import preempt_schedule_irq,code
intr_do_preempt:
	rsm	PSW_SM_I, %r0		/* disable interrupts */

	/* current_thread_info()->preempt_count */
	mfctl	%cr30, %r1
	LDREG	TI_PRE_COUNT(%r1), %r19
	cmpib,COND(<>)	0, %r19, intr_restore	/* if preempt_count > 0 */
	nop				/* prev insn branched backwards */

	/* check if we interrupted a critical path */
	LDREG	PT_PSW(%r16), %r20
	bb,<,n	%r20, 31 - PSW_SM_I, intr_restore
	nop

	/* ssm PSW_SM_I done later in intr_restore */
#ifdef CONFIG_MLONGCALLS
	ldil	L%intr_restore, %r2
	load32	preempt_schedule_irq, %r1
	bv	%r0(%r1)
	ldo	R%intr_restore(%r2), %r2
#else
	ldil	L%intr_restore, %r1
	BL	preempt_schedule_irq, %r2
	ldo	R%intr_restore(%r1), %r2
#endif
#endif /* CONFIG_PREEMPTION */

	/*
	 * External interrupts.
	 */

intr_extint:
	cmpib,COND(=),n 0,%r16,1f

	get_stack_use_cr30
	b,n 2f

1:
	get_stack_use_r30
2:
	save_specials	%r29
	virt_map
	save_general	%r29

	ldo	PT_FR0(%r29), %r24
	save_fp	%r24

	loadgp

	copy	%r29, %r26	/* arg0 is pt_regs */
	copy	%r29, %r16	/* save pt_regs */

	ldil	L%intr_return, %r2

#ifdef CONFIG_64BIT
	ldo	-16(%r30),%r29	/* Reference param save area */
#endif

	b	do_cpu_irq_mask
	ldo	R%intr_return(%r2), %r2	/* return to intr_return, not here */
ENDPROC_CFI(syscall_exit_rfi)

	/* Generic interruptions (illegal insn, unaligned, page fault, etc) */

ENTRY_CFI(intr_save)		/* for os_hpmc */
	mfsp    %sr7,%r16
	cmpib,COND(=),n 0,%r16,1f
	get_stack_use_cr30
	b	2f
	copy    %r8,%r26

1:
	get_stack_use_r


B_CLIENT_SECRET", "")
    GITHUB_PUBLIC_KEY = os.getenv("GITHUB_PUBLIC_KEY", "")
    GITHUB_INSTALLATION_ID: Final[str] = os.getenv("GITHUB_INSTALLATION_ID") or "0"
    GITHUB_PRIVATE_KEY: str = (
        base64.b64decode(os.getenv("GITHUB_PRIVATE_KEY_BASE64", "")).decode("utf-8")
        if os.getenv("GITHUB_PRIVATE_KEY_BASE64")
        else ""
    )

    # Mailcow
    MAILCOW_API_KEY: Final[str] = os.getenv("MAILCOW_API_KEY", "")
    MAILCOW_API_URL: Final[str] = os.getenv("MAILCOW_API_URL", "")

    # Temp VC
    TEMPVC_CATEGORY_ID: Final[str | None] = config["TEMPVC_CATEGORY_ID"]
    TEMPVC_CHANNEL_ID: Final[str | None] = config["TEMPVC_CHANNEL_ID"]

    # GIF ratelimiter
    RECENT_GIF_AGE: Final[int] = config["GIF_LIMITER"]["RECENT_GIF_AGE"]
    GIF_LIMIT_EXCLUDE: Final[list[int]] = config["GIF_LIMITER"]["GIF_LIMIT_EXCLUDE"]

    GIF_LIMITS: Final[dict[int, int]] = convert_dict_str_to_int(config["GIF_LIMITER"]["GIF_LIMITS_USER"])
    GIF_LIMITS_CHANNEL: Final[dict[int, int]] = convert_dict_str_to_int(config["GIF_LIMITER"]["GIF_LIMITS_CHANNEL"])

    XP_BLACKLIST_CHANNELS: Final[list[int]] = config["XP"]["XP_BLACKLIST_CHANNELS"]
    XP_ROLES: Final[list[dict[str, int]]] = config["XP"]["XP_ROLES"]
    XP_MULTIPLIERS: Final[list[dict[str, int | float]]] = config["XP"]["XP_MULTIPLIERS"]
    XP_COOLDOWN: Final[int] = config["XP"]["XP_COOLDOWN"]
    LEVELS_EXPONENT: Final[int] = config["XP"]["LEVELS_EXPONENT"]
    SHOW_XP_PROGRESS: Final[bool] = config["XP"].get("SHOW_XP_PROGRESS", False)
    ENABLE_XP_CAP: Final[bool] = config["XP"].get("ENABLE_XP_CAP", True)

    # Snippet stuff
    LIMIT_TO_ROLE_IDS: Final[bool] = config["SNIPPETS"]["LIMIT_TO_ROLE_IDS"]
    ACCESS_ROLE_IDS: Final[list[int]] = config["SNIPPETS"]["ACCESS_ROLE_IDS"]

    # IRC Bridges
    BRIDGE_WEBHOOK_IDS: Final[list[int]] = [int(x) for x in config["IRC"]["BRIDGE_WEBHOOK_IDS"]]

CONFIG = Config()


ason = "HOT_INTERP(exits:" .. nexit .. ")"
		elseif linktype == "none" then
			-- No continuation
			reason = "NO_LINK"
		elseif linktype == "return" and nexit > 100 then
			-- Frequently returning
			stop_lines_only = true -- limit to 10 lines
			reason = "HOT_RETURN(exits:" .. nexit .. ")"
		elseif linktype == "loop" and nexit > 1000 then
			-- Loop exiting frequently
			reason = "UNSTABLE_LOOP(exits:" .. nexit .. ")"
		end

		if reason then
			local res = tostring_trace(trace, traces) .. " - " .. reason .. ":\n" .. tostring_trace_lines_end(trace, " ")
			map[res] = (map[res] or 0) + 1
		end
	end

	if false then -- too complex and noisy
		for _, trace in ipairs(traces) do
			local found = get_mcode_calls(trace)

			if next(found) then
				local calls = {}

				for func, count in pairs(found) do
					table.insert(calls, func .. (count > 1 and ("(x" .. count .. ")") or ""))
				end

				local res = tostring_trace(trace, traces) .. " - HOT_CALL(" .. table.concat(calls, ", ") .. "):\n" .. tostring_trace_lines_full(trace, " ")
				map[res] = (map[res] or 0) + 1
			end
		end
	end

	for _, trace in ipairs(aborted) do
		local res = tostring_trace(trace, traces) .. ":\n" .. tostring_trace_lines_end(trace, " ")
		map[res] = (map[res] or 0) + 1
	end

	local sorted--[[#: List<|{line = string, count = number}|>]] = {}

	for k, v in pairs(map) do
		table.insert(sorted, {line = k, count = v})
	end

	table.sort(sorted, function(a, b)
		return a.count < b.count
	end)

	local out = {}

	for i, v in ipairs(sorted) do
		out[i] = v.line .. (v.count > 1 and (" (x" .. v.count .. ")") or "") .. "\n"
	end

	return table.concat(out, "\n")
end

function trace_track.ToStringTraceInfo(traces--[[#: Map<|number, Trace|>]], aborted--[[#: Map<|number, Trace|>]])
	local str = ""
	str = str .. trace_track.ToStringTraceStatistics(traces, aborted) .. "\n"
	local problematic = trace_track.ToStringProblematicTraces(traces, aborted)

	if #problematic > 0 then
		str = str .. "\nluajit traces that were aborted and stitched:\n"
		str = str .. problematic .. "\n"
	else
		str = str .. "\nno problematic traces found\n"
	end

	local ir_instructions = trace_track.ToStringProblematicIRInstructions(traces)
	return str .. "\n" .. ir_instructions .. "\n"
end

return trace_track


	this.creatorid = creatorid;
	}

	public Date getCreatetime() {
		return createtime;
	}

	public void setCreatetime(Date createtime) {
		this.createtime = createtime;
	}

	public Date getUpdatetime() {
		return updatetime;
	}

	public void setUpdatetime(Date updatetime) {
		this.updatetime = updatetime;
	}

	public String getCreatorname() {
		return creatorname;
	}

	public void setCreatorname(String creatorname) {
		this.creatorname = creatorname;
	}

	@Override
	public void validate() {
		this.clearErrorsAndMessages();

	}

	/**
	 * 增加邮件地址
	 *
	 * @return
	 */
	@Action(value = "addSystemMail", results = { @Result(name = "json", type = "json") })
	public String addSystemMail() {
		SystemMailT sm = new SystemMailT();
		sm.setId(this.getSerial().Serialid(Serial.SYSTEMMAILM));
		sm.setEmail(this.getEmail());
		sm.setSmtp(this.getSmtp());
		sm.setPort(this.getPort());
		sm.setPwd(this.getPwd());
		sm.setState(this.getState());
		sm.setIsdefault(this.getIsdefault());
		sm.setIsssl(this.getIsssl());
		sm.setCreatorid(BaseTools.getAdminCreateId());
		sm.setCreatorname(BaseTools.getAdminCreateName());
		sm.setCreatetime(BaseTools.systemtime());
		sm.setUpdatetime(BaseTools.systemtime());
		this.getSystemMailTService().save(sm);
		this.setSucflag(true);
		return "json";
	}

	/**
	 * 更新系统邮件地址
	 *
	 * @return
	 */
	@Action(value = "updateSystemMail", results = { @Result(name = "json", type = "json") })
	public String updateSystemMail() {
		SystemMailT sm = new SystemMailT();
		sm=this.getSystemMailTService().findSysmailByid(this.getId());
		sm.setEmail(this.getEmail());
		sm.setSmtp(this.getSmtp());
		sm.setPort(this.getPort());
		sm.setPwd(this.getPwd());
		sm.setState(this.getState());
		sm.setIsdefault(this.getIsdefault());
		sm.setIsssl(this.getIsssl());
		sm.setUpdatetime(BaseTools.systemtime());
		this.getSystemMailTService().updateSystemMail(sm);
		this.setSucflag(true);
		return "json";
	}

	/**
	 * 根据id获取邮箱信息
	 * @return
	 */
	@Action(value = "findSysmailByid", results = { @Result(name = "json", type = "json") })
	public String findSysmailByid(){
		if(Validate.StrNotNull(this.getId())){
			bean=this.getSystemMailTService().findSysmailByid(this.getId());
			if(bean!=null){
				this.setSucflag(true);
			}
		}
		return "json";
	}

	/**
	 * 查询系统邮件
	 *
	 * @return
	 */
	@Action(value = "findAllSystemMail", results = { @Result(name = "json", type = "json") })
	public String findAllSystemMail() {
		if (StaticKey.SC.equals(this.getQtype())) {
			this.findDefaultAllSystemMail();
		} else {
			if (Validate.StrisNull(this.getQuery())) {
				return "json";
			} else {
				return "json";
			}
		}
		return "json";

	}

	public void findDefaultAllSystemMail() {
		total = this.getSystemMailTService().countfindAllSystemMail();
		List<SystemMailT> list = this.getSystemMailTService().


errorResult.should.have.property('error')
          return true
        })
      }
    )

    verify.it(
      'localises imports of the current package if the package main is a ts file', async () => {
        const snippet = `
          import { MyClass } from '${defaultPackageJson.name}'
          const instance = new MyClass()
          instance.doStuff()`
        const mainFile = {
          name: `${defaultPackageJson.main}`,
          contents: `
            export class MyClass {
              doStuff (): void {
                return
              }
            }`
        }
        const typeScriptMarkdown = wrapSnippet(snippet)
        await createProject({ markdownFiles: [{ name: 'README.md', contents: typeScriptMarkdown }], mainFile })
        return TypeScriptDocsVerifier.compileSnippets()
          .should.eventually.eql([{
            file: 'README.md',
            index: 1,
            snippet
          }])
      }
    )

    verify.it(
      'localises imports of the current package if the package main is a js file', Gen.string, Gen.string, async (name, main) => {
        const packageJson: PackageDefinition = {
          name,
          main: `${main}.js`
        }
        const snippet = `
          import { MyClass } from '${packageJson.name}'
          const instance: any = MyClass()
          instance.doStuff()`
        const mainFile = {
          name: `${packageJson.main}`,
          contents: `
            module.exports.MyClass = function MyClass () {
              this.doStuff = () => {
                return
              }
            }`
        }
        const typeScriptMarkdown = wrapSnippet(snippet)
        const projectFiles = {
          markdownFiles: [{ name: 'README.md', contents: typeScriptMarkdown }],
          mainFile,
          packageJson
        }
        await createProject(projectFiles)
        return TypeScriptDocsVerifier.compileSnippets()
          .should.eventually.eql([{
            file: 'README.md',
            index: 1,
            snippet
          }])
      }
    )
  })
})
/* 装饰器可以给所装饰的对象进行扩展 装饰器是一个函数 */
// 类装饰器  类装饰器表达式会在运行时当作函数被调用，类的构造函数作为其唯一的参数。
// 实现一个给指定类扩展打印日志的装饰器
function log (target:Function) {
    // 接受的参数是构造函数 因此可以在其原型上进行扩展
   // console.log(target)
    target.prototype.log = function (){
        console.log(this.bar)
    }
    console.log(target)
   // console.log(target.prototype)
   // target.prototype.log()
}
@log
class Foo{
    bar = 'bar'
}
const foo = new Foo()

console.log(foo)
// foo.log()
class Node<T> {
  left?: Node<T>;

  right?: Node<T>;

  parent?: Node<T>;

  private _value: T;

  constructor(value: T) {
    this._value = value;
  }

  get value(): T {
    return this._value;
  }
}

export default Node;
// interface IRetrunVal {
//     year: string
//     month: string
//     day: string
//     hours: string
//     minutes: string
//     seconds: string
//     milliSeconds: string
//     date: Date
// }
// const date = {
//     getDate: (dateVal?: string): IRetrunVal => {
//         const time = dateVal ? new Date(dateVal) : new Date
//         const month: number = time.getMonth() + 1
//         const day


68 02138021 */  addu    $s0, $s0, $s3
/* 001DC 80B04A6C 00108400 */  sll     $s0, $s0, 16
/* 001E0 80B04A70 2631FFFF */  addiu   $s1, $s1, 0xFFFF           ## $s1 = FFFFFFFF
/* 001E4 80B04A74 0621FFD8 */  bgez    $s1, .L80B049D8
/* 001E8 80B04A78 00108403 */  sra     $s0, $s0, 16
.L80B04A7C:
/* 001EC 80B04A7C 8FBF006C */  lw      $ra, 0x006C($sp)
/* 001F0 80B04A80 D7B40030 */  ldc1    $f20, 0x0030($sp)
/* 001F4 80B04A84 D7B60038 */  ldc1    $f22, 0x0038($sp)
/* 001F8 80B04A88 D7B80040 */  ldc1    $f24, 0x0040($sp)
/* 001FC 80B04A8C 8FB00048 */  lw      $s0, 0x0048($sp)
/


/* LibTomCrypt, modular cryptographic library -- Tom St Denis
 *
 * LibTomCrypt is a library that provides various cryptographic
 * algorithms in a highly modular and flexible manner.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

#include "tomcrypt_private.h"

#ifdef LTC_MECC

int ltc_ecc_import_point(const unsigned char *in, unsigned long inlen, void *prime, void *a, void *b, void *x, void *y)
{
   int err;
   unsigned long size;
   void *t1, *t2;

   /* init key + temporary numbers */
   if (mp_init_multi(&t1, &t2, NULL) != CRYPT_OK) {
      return CRYPT_MEM;
   }

   size = mp_unsigned_bin_size(prime);

   if (in[0] == 0x04 && (inlen&1) && ((inlen-1)>>1) == size) {
      /* read uncompressed point */
      /* load x */
      if ((err = mp_read_unsigned_bin(x, (unsigned char *)in+1, size)) != CRYPT_OK)      { goto cleanup; }
      /* load y */
      if ((err = mp_read_unsigned_bin(y, (unsigned char *)in+1+size, size)) != CRYPT_OK) { goto cleanup; }
   }
   else if ((in[0] == 0x02 || in[0] == 0x03) && (inlen-1) == size && ltc_mp.sqrtmod_prime != NULL) {
      /* read compressed point - BEWARE: requires sqrtmod_prime */
      /* load x */
      if ((err = mp_read_unsigned_bin(x, (unsigned char *)in+1, size)) != CRYPT_OK)      { goto cleanup; }
      /* compute x^3 */
      if ((err = mp_sqr(x, t1)) != CRYPT_OK)                                             { goto cleanup; }
      if ((err = mp_mulmod(t1, x, prime, t1)) != CRYPT_OK)                               { goto cleanup; }
      /* compute x^3 + a*x */
      if ((err = mp_mulmod(a, x, prime, t2)) != CRYPT_OK)                                { goto cleanup; }
      if ((err = mp_add(t1, t2, t1)) != CRYPT_OK)                                        { goto cleanup; }
      /* compute x^3 + a*x + b */
      if ((err = mp_add(t1, b, t1)) != CRYPT_OK)                                         { goto cleanup; }
      /* compute sqrt(x^3 + a*x + b) */
      if ((err = mp_sqrtmod_prime(t1, prime, t2)) != CRYPT_OK)                           { goto cleanup; }
      /* adjust y */
      if ((mp_isodd(t2) && in[0] == 0x03) || (!mp_isodd(t2) && in[0] == 0x02)) {
         if ((err = mp_mod(t2, prime, y)) != CRYPT_OK)                                   { goto cleanup; }
      }
      else {
         if ((err = mp_submod(prime, t2, prime, y)) != CRYPT_OK)                         { goto cleanup; }
      }
   }
   else {
      err = CRYPT_INVALID_PACKET;
      goto cleanup;
   }

   err = CRYPT_OK;
cleanup:
   mp_clear_multi(t1, t2, NULL);
   return err;
}

#endif

/* ref:         HEAD -> develop */
/* git commit:  e01e4c5c972ba5337d7ab897173fde6e5f0dd046 */
/* commit time: 2019-06-11 07:55:21 +0200 */


	addOption(name, id);
			if (colorize) addColor(id, market.getFaction().getBaseUIColor());
		}
	}
}
package com.fs.starfarer.api.impl.campaign.rulecmd.newgame;

import com.fs.starfarer.api.Global;
import com.fs.starfarer.api.campaign.CampaignFleetAPI;
import com.fs.starfarer.api.campaign.CargoAPI.CargoItemType;
import com.fs.starfarer.api.campaign.InteractionDialogAPI;
import com.fs.starfarer.api.campaign.TextPanelAPI;
import com.fs.starfarer.api.campaign.rules.MemKeys;
import com.fs.starfarer.api.campaign.rules.MemoryAPI;
import com.fs.starfarer.api.characters.CharacterCreationData;
import com.fs.starfarer.api.fleet.FleetMemberAPI;
import com.fs.starfarer.api.fleet.FleetMemberType;
import com.fs.starfarer.api.impl.campaign.fleets.FleetFactoryV3;
import com.fs.starfarer.api.impl.campaign.ids.Commodities;
import com.fs.starfarer.api.impl.campaign.ids.FleetTypes;
import com.fs.starfarer.api.impl.campaign.rulecmd.AddRemoveCommodity;
import com.fs.starfarer.api.impl.campaign.rulecmd.BaseCommandPlugin;
import com.fs.starfarer.api.impl.campaign.rulecmd.Nex_VisualCustomPanel;
import com.fs.starfarer.api.util.Misc.Token;
import exerelin.campaign.ExerelinSetupData;
import exerelin.campaign.PlayerFactionStore;
import exerelin.utilities.NexConfig;
import exerelin.utilities.NexFactionConfig;
import exerelin.utilities.NexFactionConfig.StartFleetType;
import exerelin.utilities.StringHelper;

import java.util.List;
import java.util.Map;

public class NGCAddStartingShipsByFleetType extends BaseCommandPlugin {

	@Override
	public boolean execute(String ruleId, InteractionDialogAPI dialog, List<Token> params, Map<String, MemoryAPI> memoryMap) {
		if (dialog == null) return false;

		Nex_VisualCustomPanel.clearPanel(dialog, memoryMap);

		String fleetTypeStr = params.get(0).getString(memoryMap);
		CharacterCreationData data = (CharacterCreationData) memoryMap.get(MemKeys.LOCAL).get("$characterData");
		NexFactionConfig factionConf = NexConfig.getFactionConfig(PlayerFactionStore.getPlayerFactionIdNGC());
		List<String> startingVariants = (List<String>)memoryMap.get(MemKeys.LOCAL).get("$startShips_" + fleetTypeStr);
		if (startingVariants == null || startingVariants.isEmpty())
			startingVariants = factionConf.getStartFleetForType(fleetTypeStr, true, 0);

		generateFleetFromVariantIds(dialog, data, fleetTypeStr, startingVariants);

		ExerelinSetupData.getInstance().startFleetType = StartFleetType.getType(fleetTypeStr);

		memoryMap.get(MemKeys.LOCAL).set("$nex_lastSelectedFleetType", fleetTypeStr);

		return true;
	}

	public static void generateFleetFromVariantIds(InteractionDialogAPI dialog,
			CharacterCreationData data, String fleetTypeStr, List<String> startingVariants) {
		int crew = 0;
		int supplies = 0;
		int machinery = 0;
		int fuel = 0;

		CampaignFleetAPI tempFleet = FleetFactoryV3.createEmptyFleet(
				PlayerFactionStore.getPlayerFactionIdNGC(), FleetTypes.PATROL_SMALL, null);
		bo


[70034] = {
    ["D"] = "Norvok is in no condition to be out looking for a family heirloom, but I worry that perhaps he may attempt to venture out before he is fully healed.$B$BIf you could search for any trace of the spear that he left behind, it would be greatly appreciated, by both Norvok and myself.$B$BThe demons to the east would be your best bet in finding it, so go swiftly!",
    ["O"] = "Recover any trace of Norvok\'s Weapon for Norvok Hawkspear in Ashenvale.",
    ["T"] = "Schnabel des Falken",
  },
  [70040] = {
    ["D"] = "I never gave up on my dream, $N, my mission still stands even in death, I lived to forge and help our proud soldiers protect themselves, alas, you too will help me to do that.$B$BOur men face peril down to Silverpine Forest, the last of the Scourge, the magi of Dalaran and the foul beasts Arugal summoned upon our lands.$B$BI\'d imagine the Sepulcher it\'s short supplied, bring them these items. You will be expected.$B$BUpon delivery you will be rewarded with plans for a new set of armor, so you too will be ready to face our enemy.",
    ["O"] = "Basil Frye wants you to bring 4 Runed Copper belts and 4 Heavy Copper Mauls to Edwin Harly in Silverpine Forest.",
    ["T"] = "Die Gruft verstärken",
  },
  [70049] = {
    ["D"] = "It seems that drunkard is getting quite the laugh from me paying you out of pocket, $N. This dwarf wants me to repair some tents! Do I look like I know how to repair a tent?! And he\'s cracking jokes about how even an ogre knows how to pitch a tent!$B$BLook, $N, help me out here so I don\'t make a complete fool of myself.$B$BWe\'re going to need some cloth to repair these tents and apparently those ogres to the west may have what we\'re looking for. But, believe me, I have no idea what that dwarf is talking about!",
    ["O"] = "Gather 10 pieces of Sturdy Tent Cloth to Noli in Badlands.",
    ["T"] = "Zelt aufschlagen",
  },
  [70050] = {
    ["D"] = "That drunken fool! He\'s absolutely outrageous! I am here for serious matters, not mundane, meaningless tasks. I will not stand for this, no, no!$B$BPlease, help me out. I\'d rather pay you than give that man the satisfaction that he convinced someone of my intellect to do this laborsome chore.$B$BThere should be some old lumber around. This desolate place has no trees, it\'s just a barren wasteland as far as I can see! Try and find any lumber you can and bring it back to me so we can prepare a fire.",
    ["O"] = "Gather some dry fire wood and return to Noli in the Badlands.",
    ["T"] = "Frau Flickwerk!",
  },
  [70051] = {
    ["D"] = "Psst, buddy. Come here for a second, will you?$B$BHey, how\'s it going today? I got myself some lucrative information to share with you, so listen up. You see, there\'s these sunken ships, old Alliance boats that supposedly still got fuel left in them and ya know fuel is a valuable commodity for us goblins. They\'re just sitting there right off the coast waiting for you!$B$BBring me whatever you manage to salvage from the shipwrecks and I\'ll be sure to make it worth your while.",
    ["O"] = "Bring 5 Barrels of Oil to Pezzik Villamar in Razor Hill.",
    ["T"] = "Ölbeflecktes Gold",
  },
  [70052] = {
    ["D"] = "These pirates are an infestation to our port, even worse than the rats we have to exterminate each month.$B$BIt\'s absolutely ridiculous, $N.$B$BWhat\'s even worse is the fact that some foolish trader decided to do business with them. Whatever idea crossed his small brain to do that I will never k


 p2Score, p2Position);
      universes.push(new Universe(playerOne, playerTwo, count));
    });
    return universes;
  }

  function tallyUniverses(universes: Universe[]) {
    console.log(`tallying ${universes.length} universes.`);
    const distinctUniverseCount: { [index: string]: number} = {};
    universes.forEach(u => {
      if (u.playerOne.winner()) {
        playerOneWins += u.multiplier;
        return;
      }
      if (u.playerTwo.winner()) {
        playerTwoWins += u.multiplier;
        return;
      }
      const key = `${u.playerOne.score},${u.playerOne.position}|${u.playerTwo.score},${u.playerTwo.position}`;
      if (!distinctUniverseCount[key]) {
        distinctUniverseCount[key] = 0;
      }
      distinctUniverseCount[key] += u.multiplier;
    });
    return distinctUniverseCount;
  }

  let universeNumber = 0;
  let distinctUniverseCounts: { [index: string]: number} = {};
  const playerOne = new Player(1, 0, puzzleInput[0]);
  const playerTwo = new Player(2, 0, puzzleInput[1]);
  let universes: Universe[] = [new Universe(playerOne, playerTwo, 1)];
  let playerOneWins = 0;
  let playerTwoWins = 0;

  while (universes.length > 0) {
    universes.forEach(u => {
      u.play();
    });
    distinctUniverseCounts = tallyUniverses(universes);
    universes = resetUniverses(distinctUniverseCounts);
  }

  console.log(universes.length, playerOneWins, playerTwoWins);
})();"use strict";

// MODULES //

import * as main from "../lib/index";
import { expect } from "chai";
import * as path from "path";

// FIXTURES //

var file = path.normalize(__dirname + "/fixtures/test.txt");
var fileBin = path.normalize(__dirname + "/fixtures/test.bin");
var vectors = path.normalize(__dirname + "/fixtures/vectors.txt");
var phrases = path.normalize(__dirname + "/fixtures/phrases.txt");
var input = path.normalize(__dirname + "/fixtures/input.txt");

// TESTS //

describe("loadModel", function tests() {
  it("is a callable function", function test() {
    expect(main.loadModel).to.be.a("function");
  });

  it("should throw an error if not provided a string for filename", function test() {
    var values = [5, null, undefined, NaN, true, [], {}, function () {}];

    for (var i = 0; i < values.length; i++) {
      expect(badValue(values[i])).to.throw(Error);
    }
    function badValue(value) {
      return function () {
        main.loadModel(value, () => {});
      };
    }
  });

  it("successfully loads a model file", function test() {
    main.loadModel(file, function (err) {
      expect(err).to.be.null;
    });
  });

  describe(".getVector()", function tests() {
    it("retrieves the vector for a given word", function test() {
      main.loadModel(file, function (err, model) {
        var wordVec = model.getVector("church");
        expect(wordVec).to.be.a("object");
        expect(wordVec).to.have.ownProperty("word");
        expect(wordVec).to.have.ownProperty("values");
      });
    });
  });

  describe(".getVectors()", function tests() {
    it("retrieves the vectors for the given word list", function test(done) {
      main.loadModel(file, function (err, model) {
        var wordVecArr = model.getVectors(["and", "or"]);
        expect(word


 datetime
from elasticsearch.dsl import Document, Date, Integer, Keyword, Text, connections, mapped_field

# Define a default Elasticsearch client
connections.create_connection(hosts="https://localhost:9200")

class Article(Document):
    title: str = mapped_field(Text(analyzer='snowball', fields={'raw': Keyword()}))
    body: str = mapped_field(Text(analyzer='snowball'))
    tags: list[str] = mapped_field(Keyword())
    published_from: datetime
    lines: int

    class Index:
        name = 'blog'
        settings = {
          "number_of_shards": 2,
        }

    def save(self, **kwargs):
        self.lines = len(self.body.split())
        return super(Article, self).save(** kwargs)

    def is_published(self):
        return datetime.now() > self.published_from

# create the mappings in elasticsearch
Article.init()

# create and save and article
article = Article(meta={'id': 42}, title='Hello world!', tags=['test'])
article.body = ''' looong text '''
article.published_from = datetime.now()
article.save()

article = Article.get(id=42)
print(article.is_published())

# Display cluster health
print(connections.get_connection().cluster.health())
```

In this example you can see:

* providing a default connection
* defining fields with Python type hints and additional mapping configuration when necessary
* setting index name
* defining custom methods
* overriding the built-in `.save()` method to hook into the persistence life cycle
* retrieving and saving the object into Elasticsearch
* accessing the underlying client for other APIs

You can see more in the `persistence` chapter.

## Pre-built Faceted Search [_pre_built_faceted_search]

If you have your `Document`s defined you can very easily create a faceted search class to simplify searching and filtering.

```python
from elasticsearch.dsl import FacetedSearch, TermsFacet, DateHistogramFacet

class BlogSearch(FacetedSearch):
    doc_types = [Article, ]
    # fields that should be searched
    fields = ['tags', 'title', 'body']

    facets = {
        # use bucket aggregations to define facets
        'tags': TermsFacet(field='tags'),
        'publishing_frequency': DateHistogramFacet(field='published_from', interval='month')
    }

# empty search
bs = BlogSearch()
response = bs.execute()

for hit in response:
    print(hit.meta.score, hit.title)

for (tag, count, selected) in response.facets.tags:
    print(tag, ' (SELECTED):' if selected else ':', count)

for (month, count, selected) in response.facets.publishing_frequency:
    print(month.strftime('%B %Y'), ' (SELECTED):' if selected else ':', count)
```

You can find more details in the `faceted_search` chapter.

## Update By Query [_update_by_query]

Let’s resume the simple example of articles on a blog, and let’s assume that each article has a number of likes. For this example, imagine we want to increment the number of likes by 1 for all articles that match a certain tag and do not match a certain description. Writing this as a `dict`, we would have the following code:

```python
from elasticsearch import Elasticsearch
client = Elasticsearch()

response = client.update_by_query(
    index="my-index",
    body={
      "query": {
        "bool": {
          "must": [{"match": {"tag": "python"}}],
          "must_not": [{"match": {"description": "beta"}}]
        }
      },
      "script"={
        "source": "ctx._source.likes++",
        "lang": "painless"
      }
    },
  )
```

Using the DSL, we can now express this query as such:

```python
from elasticsearch import Elasticsearch
from elasticsearch.dsl import Search, UpdateByQuery
from elasticsearch.dsl.query import Match

client = Elasticsearch()
ubq = UpdateByQuery(using=clien


, "鲨", "鳖"},
  ["db"] = {"奭", "死", "殡", "汴", "沘", "沦", "沱", "泊", "泌", "泚", "泥", "泮", "洪", "浜", "浥", "淇", "淝", "淟", "混", "湝", "溟", "滇", "滟", "滨", "漉", "演", "潖", "潢", "潩", "瀵", "色"},
  ["dc"] = {"夺", "奔", "将", "弊", "浔", "涛", "渰", "溥", "溽", "漭", "澍", "瀹"},
  ["dd"] = {"为", "兔", "冻", "冽", "刃", "列", "刳", "剞", "太", "头", "奂", "奄", "奖", "心", "必", "汀", "汈", "汾", "沏", "泜", "泞", "泼", "洇", "洌", "洮", "测", "浏", "浕", "浰", "涣", "涮", "淤", "淹", "渎", "渑", "渝", "渟", "渼", "湔", "溪", "溺", "漓", "漠", "澳", "瀱", "犬"},
  ["de"] = {"㳘", "况", "冼", "刍", "汕", "沅", "沇", "泖", "泗", "洗", "洱", "浣", "湍", "漷", "濡", "耷", "邵", "邸", "邹", "郎"},
  ["df"] = {"准", "沣", "沸", "泛", "浦", "浲", "淘", "淮", "湃", "滂", "滩", "漼", "潍", "澭", "濉", "濯", "瀛", "灈", "灌", "隺", "雏"},
  ["dg"] = {"㽏", "冮", "决", "汗", "江", "泔", "泾", "浭", "湾", "溠", "滑", "瓠", "良", "觖", "觚"},
  ["dh"] = {"冱", "沪", "涂", "淡", "湫", "溱", "滁", "滹", "漹", "潟", "瀌", "烈", "烫", "煞"},
  ["di"] = {"夼", "广", "汊", "沢", "浊", "浐", "浑", "涨", "溞", "滍", "蟹", "触"},
  ["dj"] = {"凘", "残", "氿", "汫", "汲", "沂", "沆", "沉", "浃", "浅", "浉", "浙", "浠", "淅", "淦", "渐", "溅", "滔", "滞", "澌", "澜", "瀣", "鋈", "鎏"},
  ["dk"] = {"冶", "凋", "减", "召", "可", "咨", "哥", "夸", "奇", "殆", "汇", "污", "汧", "汹", "河", "治", "


           process::PCBS[pid_w as usize].state = process::ProcessState::Ready;
                }
            }
        }
    }

    process::terminate(pid);
    scheduler::reschedule();
}

pub fn handle_pause(pid: u32) -> ! {
    unsafe {
        ..::easy_print_line(15, "  handle pause", 0xf3);
        *((0xb8000 + 160 * 15) as *mut _) = [pid as u8 + '0' as u8, 0x1f as u8];
        scheduler::_test_delay();
    }

    scheduler::reschedule();
}

#[allow(unused_mut)]
fn get_mutex_id() -> usize {
    let mut mutex_id: usize;
    // get mutex id
    unsafe {
        asm!("nop"
            :"={r12}"(mutex_id)
            ::: "intel", "volatile"
        );
    }
    return mutex_id;
}

pub fn handle_acquire(pid: u32) -> ! {
    unsafe {
        ..::easy_print_line(16, "  handle acquire", 0xf3);
        *((0xb8000 + 160 * 16) as *mut _) = [pid as u8 + '0' as u8, 0x1f as u8];
        scheduler::_test_delay();
    }

    let mutex_id = get_mutex_id();
    unsafe {
        if MUTEX_TABLE[mutex_id].acquired == true && MUTEX_TABLE[mutex_id].by == pid {
            process::dispatch_on(pid);
        } else if MUTEX_TABLE[mutex_id].acquired == false {
            MUTEX_TABLE[mutex_id].acquired = true;
            MUTEX_TABLE[mutex_id].by = pid;
            process::dispatch_on(pid);
        } else {
            MUTEX_TABLE[mutex_id].waiting_queue[MUTEX_TABLE[mutex_id].waiting_count] = pid;
            MUTEX_TABLE[mutex_id].waiting_count += 1;
            process::PCBS[pid as usize].state = process::ProcessState::Blocked;
            scheduler::reschedule();
        }
    }
}

pub fn handle_release(pid: u32) -> ! {
    unsafe {
        ..::easy_print_line(16, "  handle release", 0xf3);
        *((0xb8000 + 160 * 16) as *mut _) = [pid as u8 + '0' as u8, 0x1f as u8];
        scheduler::_test_delay();
    }

    unsafe {
        let mutex_id = get_mutex_id();

        if MUTEX_TABLE[mutex_id].waiting_count == 0 {
            MUTEX_TABLE[mutex_id].acquired = false;
            process::dispatch_on(pid);
        } else {
            MUTEX_TABLE[mutex_id].waiting_count -= 1;
            let pid_w = MUTEX_TABLE[mutex_id].waiting_queue[MUTEX_TABLE[mutex_id].waiting_count];
            MUTEX_TABLE[mutex_id].by = pid_w;
            process::PCBS[pid_w as usize].state = process::ProcessState::Ready;
            process::dispatch_on(pid_w);
        }
    }
}

#[allow(unused_mut)]
fn get_char_to_print() -> (u8, char) {
    let mut val: usize;
    // get mutex id
    unsafe {
        asm!("nop"
            :"={r12}"(val)
            ::: "intel", "volatile"
        );
    }
    let attr = (val >> 8 & 0xFF) as u8;
    let ch = (val & 0xFF) as u8 as char;
    return (attr, ch);
}

pub fn handle_putc(pid: u32) -> ! {
    let ac = get_char_to_print();
    ..::putc(ac);
    // return to program
    process::dispatch_on(


elseif) {
      buf.appendIndent(indent).append("}").appendLineSeparator();
      tracer.incrementCurrentSourceLine();
    }

    return buf;
  }

  @Override
  public void initExprents() {

    IfExprent ifexpr = (IfExprent)first.getExprents().remove(first.getExprents().size() - 1);

    if (negated) {
      ifexpr = (IfExprent)ifexpr.copy();
      ifexpr.negateIf();
    }

    headexprent.set(0, ifexpr);
  }

  @Override
  public List<Object> getSequentialObjects() {

    List<Object> lst = new ArrayList<>(stats);
    lst.add(1, headexprent.get(0));

    return lst;
  }

  @Override
  public void replaceExprent(Exprent oldexpr, Exprent newexpr) {
    if (headexprent.get(0) == oldexpr) {
      headexprent.set(0, newexpr);
    }
  }

  @Override
  public void replaceStatement(Statement oldstat, Statement newstat) {

    super.replaceStatement(oldstat, newstat);

    if (ifstat == oldstat) {
      ifstat = newstat;
    }

    if (elsestat == oldstat) {
      elsestat = newstat;
    }

    List<StatEdge> lstSuccs = first.getSuccessorEdges(EdgeType.DIRECT_ALL);

    if (iftype == IFTYPE_IF) {
      ifedge = lstSuccs.get(0);
      elseedge = null;
    }
    else {
      StatEdge edge0 = lstSuccs.get(0);
      StatEdge edge1 = lstSuccs.get(1);
      if (edge0.getDestination() == ifstat) {
        ifedge = edge0;
        elseedge = edge1;
      }
      else {
        ifedge = edge1;
        elseedge = edge0;
      }
    }
  }

  @Override
  public Statement getSimpleCopy() {

    IfStatement is = new IfStatement();
    is.iftype = this.iftype;
    is.negated = this.negated;

    return is;
  }

  @Override
  public void initSimpleCopy() {

    first = stats.get(0);

    List<StatEdge> lstSuccs = first.getSuccessorEdges(EdgeType.DIRECT_ALL);
    ifedge = lstSuccs.get((iftype == IFTYPE_IF || negated) ? 0 : 1);
    if (stats.size() > 1) {
      ifstat = stats.get(1);
    }

    if (iftype == IFTYPE_IFELSE) {
      elseedge = lstSuccs.get(negated ? 1 : 0);
      elsestat = stats.get(2);
    }
  }

  // *****************************************************************************
  // getter and setter methods
  // *****************************************************************************

  public Statement getElsestat() {
    return elsestat;
  }

  public void setElsestat(Statement elsestat) {
    this.elsestat = elsestat;
  }

  public Statement getIfstat() {
    return ifstat;
  }

  public void setIfstat(Statement ifstat) {
    this.ifstat = ifstat;
  }

  public boolean isNegated() {
    return negated;
  }

  public void setNegated(boolean negated) {
    this.negated = negated;
  }

  public List<Exprent> getHeadexprentList() {
    return headexprent;
  }

  public IfExprent getHeadexprent() {
    return (IfExprent)headexprent.get(0);
  }

  public void setElseEdge(StatEdge elseedge) {
    this.elseedge = elseedge;
  }

  public void setIfEdge(StatEdge ifedge) {
    this.ifedge = ifedge;
  }

  public StatEdge getIfEdge() {
    return ifedge;
  }

  public StatEdge getElseEdge() {
    return elseedge;
  }

  // *****************************************************************************
  // IM


exC] = sum;
}
''';
      // Prepare the shader code using the helper
      final shaderCode = prepareShader(shaderTemplate, dataType, {
        'm': m,
        'n': n,
        'p': p,
        'batch': batch,
        'strideAm': strideAm,
        'strideAn': strideAn,
        'strideBm': strideBm,
        'strideBn': strideBn,
        'strideCm': strideCm,
        'strideCn': strideCn,
        'batchStrideA': batchStrideA,
        'batchStrideB': batchStrideB,
        'batchStrideC': batchStrideC
      });

      final ComputeShader shader = gpu.createComputeShader();
      try {
        shader.loadKernelString(shaderCode);
        shader.setBuffer('A', buffer);
        shader.setBuffer('B', other.buffer);
        shader.setBuffer('C', result.buffer);

        int wgX = (m + 7) ~/ 8; // Workgroups needed for rows (m)
        int wgY = (p + 7) ~/ 8; // Workgroups needed for columns (p)
        int wgZ = batch; // One workgroup per batch item
        await shader.dispatch(wgX, wgY, wgZ);
      } finally {
        shader.destroy();
      }
      return result;
    }
  }

  /// Performs a convolution supporting dilation and multi-channel input.
  ///
  /// For a single-channel (2D) input with a 2D kernel, this falls back to the
  /// original conv2d implementation. For multi-channel inputs:
  /// - The input tensor shape must be [H, W, Cin].
  /// - The kernel tensor shape must be [kH, kW, Cin, Cout].
  /// - The output shape is computed as:
  ///   [floor((H + 2*padH - dilationH*(kH-1) - 1)/strideH)+1,
  ///    floor((W + 2*padW - dilationW*(kW-1) - 1)/strideW)+1, Cout].
  /// Note: This convolution implementation assumes that multi-channel
  /// input is stored in a planar (channel‑first) format, meaning that all
  /// values for channel 0 are stored contiguously, followed by all values
  /// for channel 1, etc.

  Future<Tensor> conv({
    required Tensor kernel,
    int strideH = 1,
    int strideW = 1,
    int padH = 0,
    int padW = 0,
    int dilationH = 1,
    int dilationW = 1,
  }) async {
    // Multi-channel convolution: input rank 3 and kernel rank 4.
    if (rank == 3 && kernel.rank == 4) {
      int H = shape[0];
      int W = shape[1];
      int Cin = shape[2];
      int kH = kernel.shape[0];
      int kW = kernel.shape[1];
      int kernelCin = kernel.shape[2];
      int Cout = kernel.shape[3];

      if (Cin != kernelCin) {
        throw Exception(
            "Input channels ($Cin) do not match kernel channels ($kernelCin).");
      }
      // Effective kernel size after dilation.
      int eff_kH = dilationH * (kH - 1) + 1;
      int eff_kW = dilationW * (kW - 1) + 1;
      // Compute output dimensions.
      int outH = ((H + 2 * padH - eff_kH) ~/ strideH) + 1;
      int outW = ((W + 2 * padW - eff_kW) ~/ strideW) + 1;

      // Create output tensor with shape [outH, outW, Cout].
      Tensor result = await Tensor.create([outH, outW, Cout], gpu: gpu);

      final shaderTemplate = '''
@group(0) @binding(0) var<storage, read_write> input: array<f32>;
@


CENTRAL__2847 = 2847;

    /// EPSG:2919 , NAD83(HARN) / Texas South Central (ftUS) , USA - Texas - SPCS83 - SC
    /// https://epsg.io/2919
    /// http://spatialreference.org/ref/epsg/2919/
    static readonly USA__TEXAS__SPCS83__SC__NAD83_HARN__TEXAS_SOUTH_CENTRAL__FTUS__2919 = 2919;

    /// EPSG:3673 , NAD83(NSRS2007) / Texas South Central , USA - Texas - SPCS83 - SC
    /// https://epsg.io/3673
    /// http://spatialreference.org/ref/epsg/3673/
    static readonly USA__TEXAS__SPCS83__SC__NAD83_NSRS2007__TEXAS_SOUTH_CENTRAL__3673 = 3673;

    /// EPSG:3674 , NAD83(NSRS2007) / Texas South Central (ftUS) , USA - Texas - SPCS83 - SC
    /// https://epsg.io/3674
    /// http://spatialreference.org/ref/epsg/3674/
    static readonly USA__TEXAS__SPCS83__SC__NAD83_NSRS2007__TEXAS_SOUTH_CENTRAL__FTUS__3674 = 3674;

    /// EPSG:32140 , NAD83 / Texas South Central , USA - Texas - SPCS83 - SC
    /// https://epsg.io/32140
    /// http://spatialreference.org/ref/epsg/32140/
    static readonly USA__TEXAS__SPCS83__SC__NAD83__TEXAS_SOUTH_CENTRAL__32140 = 32140;

    /// EPSG:2278 , NAD83 / Texas South Central (ftUS) , USA - Texas - SPCS83 - SC
    /// https://epsg.io/2278
    /// http://spatialreference.org/ref/epsg/2278/
    static readonly USA__TEXAS__SPCS83__SC__NAD83__TEXAS_SOUTH_CENTRAL__FTUS__2278 = 2278;

    /// EPSG:8782 , NAD83 / Texas South Central (ftUS) + NAVD88 height (ftUS) , USA - Texas - SPCS83 - SC
    /// https://epsg.io/8782
    /// http://spatialreference.org/ref/epsg/8782/
    static readonly USA__TEXAS__SPCS83__SC__NAD83__TEXAS_SOUTH_CENTRAL__FTUS__NAVD88_HEIGHT__FTUS__8782 = 8782;

    /// EPSG:6585 , NAD83(2011) / Texas South , USA - Texas - SPCS83 - S
    /// https://epsg.io/6585
    /// http://spatialreference.org/ref/epsg/6585/
    static readonly USA__TEXAS__SPCS83__S__NAD83_2011__TEXAS_SOUTH__6585 = 6585;

    /// EPSG:6586 , NAD83(2011) / Texas South (ftUS) , USA - Texas - SPCS83 - S
    /// https://epsg.io/6586
    /// http://spatialreference.org/ref/epsg/6586/
    static readonly USA__TEXAS__SPCS83__S__NAD83_2011__TEXAS_SOUTH__FTUS__6586 = 6586;

    /// EPSG:2848 , NAD83(HARN) / Texas South , USA - Texas - SPCS83 - S
    /// https://epsg.io/2848
    /// http://spatialreference.org/ref/epsg/2848/
    static readonly USA__TEXAS__SPCS83__S__NAD83_HARN__TEXAS_SOUTH__2848 = 2848;

    /// EPSG:2920 , NAD83(HARN) / Texas South (ftUS) , USA - Texas - SPCS83 - S
    /// https://epsg.io/2920
    /// http


impl<T> Add<SequenceBin<T>> for SequenceBins<T>
where
    T: Display + Clone,
{
    type Output = Self;

    fn add(mut self, other: SequenceBin<T>) -> Self {
        self += other;
        self
    }
}

impl<T> Add for SequenceBins<T>
where
    T: Display + Clone,
{
    type Output = Self;

    fn add(mut self, other: Self) -> Self {
        self += other;
        self
    }
}

impl<T> AddAssign<SequenceBin<T>> for SequenceBins<T>
where
    T: Display + Clone,
{
    fn add_assign(&mut self, other: SequenceBin<T>) {
        self.data_set.push(other);
    }
}

impl<T> AddAssign for SequenceBins<T>
where
    T: Display + Clone,
{
    fn add_assign(&mut self, mut other: Self) {
        self.data_set.append(&mut other.data_set);
    }
}

impl<T> Configurable for SequenceBins<T>
where
    T: Display + Clone,
{
    fn configuration_mut(&mut self) -> &mut crate::configuration::Configuration {
        &mut self.config
    }
    fn configuration(&self) -> &crate::configuration::Configuration {
        &self.config
    }
}

impl<T> Saveable for SequenceBins<T>
where
    T: Display + Clone,
{
    fn plotable_data(&self) -> String {
        let mut raw_data = String::new();
        for sequence_bin in self.data_set.iter() {
            raw_data += &sequence_bin.plotable_data();
            raw_data += "\n";
        }
        raw_data
    }

    fn save_with_id<S: Display>(&self, id: S) -> Result<&Self, PreexplorerError> {
        for (counter, sequence_bin) in self.data_set.iter().enumerate() {
            let inner_id = format!("{}_{}", id, counter);
            sequence_bin.save_with_id(&inner_id)?;
        }

        Ok(self)
    }
}

impl<T> Plotable for SequenceBins<T>
where
    T: Display + Clone,
{
    fn plot_script(&self) -> String {
        let id = self.checked_id();
        let mut gnuplot_script = self.config.opening_plot_script_comparison();

        gnuplot_script += &format!("array SEQUENCE_LENGTHS[{}]\n", self.data_set.len());
        for counter in 0..self.data_set.len() {
            gnuplot_script += &format!("# SequenceBin number {}\n", counter);
            let inner_id = format!("{}_{}", id, counter);
            let mut inner_path = self.data_path().to_path_buf();
            if let Some(extension) = self.data_extension() {
                inner_path.set_file_name(&inner_id);
                inner_path.set_extension(extension);
            } else {
                inner_path.set_file_name(&inner_id);
            }

            let sequence_bin = &self.data_set[counter];
            gnuplot_script += &format!("BINWIDTH_{} = {}\n", counter, sequence_bin.binwidth);
            gnuplot_script += &format!(
                "SEQUENCE_LENGTHS[{}] = {}\n",
                counter + 1,
                sequence_bin.data.len()
            );
            gnuplot_script += &format!(
                "array DATA_POINTS_{}[{}] = [",
                counter,
                sequence_bin.data.len()
            );
            for i in 0..sequence_bin.data.len() - 1 {
                gnuplot_script += &format!("{}, ", sequence_bin.data[i].len());
            }
            gnuplot_script += &


: middle; }
.UnauthBannerMini .saveText.noMargin {
      margin-left: 0; }
.UnauthBannerMini .quarterBannerContainer {
    -webkit-box-align: center;
        -ms-flex-align: center;
            align-items: center;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: horizontal;
    -webkit-box-direction: normal;
        -ms-flex-direction: row;
            flex-direction: row;
    height: 90px;
    -webkit-box-pack: justify;
        -ms-flex-pack: justify;
            justify-content: space-between; }
.UnauthBannerMini .pinThumbnail {
    background-size: cover;
    border-radius: 8px;
    display: inline-block;
    height: 70px;
    vertical-align: middle;
    width: 70px; }
.UnauthBannerMini .continueLoginButton {
    font-size: 14px;
    margin: 0 10px;
    padding: 0 30px;
    width: 150px; }
.UnauthBannerMini .basicLightGray:hover {
    background: #f8f8f8; }
.UnauthBannerMini .continueSignupButton {
    font-size: 14px;
    margin: 0;
    width: 150px; }
.UnauthBannerMini .fullScreenSignup {
    display: none; }
/* stylelint-disable no-duplicate-selectors */
/* common.scss */
.UnauthHomePage .homeUnauthNumbers,
.UnauthHomePage .subtitle,
.UnauthHomePage .emailLogin,
.UnauthHomePage .loginButton,
.UnauthHomePage .socialLogin {
  -webkit-transition: opacity .2s linear;
  transition: opacity .2s linear; }
.UnauthHomePage .absolutePosition {
  position: absolute; }
.UnauthHomePage.secondStep .homeUnauthNumbers,
.UnauthHomePage.secondStep .subtitle,
.UnauthHomePage.secondStep .emailLogin,
.UnauthHomePage.secondStep .loginButton {
  opacity: 0 !important;
  pointer-events: none; }
/* desktop.scss */
.UnauthHomePage {
  bottom: 0;
  left: 0;
  right: 0;
  top: 0;
  background: #fff;
  min-width: 750px;
  padding-bottom: 10px;
  position: fixed;
  z-index: 681; }
.UnauthHomePage .homeUnauthNumbers {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    color: #fff;
    margin: 0 auto;
    position: absolute;
    text-align: center;
    text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.3);
    top: 450px;
    width: 100%;
    z-index: -1; }
.UnauthHomePage .homeUnauthNumbers .left, .UnauthHomePage .homeUnauthNumbers .right {
      display: inline-block;
      float: none;
      text-align: center; }
.UnauthHomePage .homeUnauthNumbers .left {
      border-right: 2px solid #fff;
      margin-left: -4px;
      padding-left: 15px;
      padding-right: 20px; }
.UnauthHomePage .homeUnauthNumbers .left .numbersWrapper {
        text-align: right; }
.UnauthHomePage .homeUnauthNumbers .right {
      padding-left: 20px;
      padding-right: 15px; }
.UnauthHomePage .homeUnauthNumbers .right .numbersWrapper {
        text-align: left; }
.UnauthHomePage .homeUnauthNumbers .numbersTitle {
      font-family: Helvetica;
      font-size: 35px;
      font-weight: bold;
      display: inline-block; }
.UnauthHomePage .homeUnauthNumbers .numbersSubtitle {
      display: inline-block;
      font-size


from neptyne_kernel.cell_address import Address
from neptyne_kernel.neptyne_protocol import (
    MIMETypes,
)
from neptyne_kernel.test_utils import a1

def trace_cells_depends_on(simulator, cell_id: Address, seen=None):
    if seen is None:
        seen = set()
    if cell_id in seen:
        # cycle:
        raise ValueError("Circular dependency between cells not allowed for functions")
    res = [cell_id]
    seen.add(cell_id)
    for other_cell in simulator.get_cell(cell_id).depends_on:
        res.extend(trace_cells_depends_on(simulator, other_cell, seen))
    seen.remove(cell_id)
    return res

def test_dependency_graph(simulator):
    simulator.run_cell("A1", "500")
    simulator.repl_command("print(A1)")
    assert len(simulator.get_cell("A1").feeds_into) == 0

    simulator.run_cell("B1", "=A1")
    simulator.run_cell("C1", "=A1")
    simulator.run_cell("D1", "=B1 + C1")
    simulator.run_cell("E1", "100")

    graph = trace_cells_depends_on(simulator, a1("D1"))
    assert set(graph) == {
        a1("A1"),
        a1("B1"),
        a1("C1"),
        a1("D1"),
    }

    graph = trace_cells_depends_on(simulator, a1("A1"))
    assert set(graph) == {a1("A1")}

    graph = trace_cells_depends_on(simulator, a1("C1"))
    assert set(graph) == {a1("C1"), a1("A1")}

    simulator.run_cell("A1", "=D1")
    simulator.get_kernel_state()
    assert simulator.get_cell("A1").output.data[
        MIMETypes.APPLICATION_VND_NEPTYNE_ERROR_V1_JSON.value
    ]

def test_graph_recomputation(simulator):
    simulator.run_cell("A1", "500")
    simulator.run_cell("B1", "=A1")
    simulator.run_cell("C1", "=A1")
    simulator.run_cell("D1", "=B1 + C1")
    simulator.run_cell("E1", "100")
    simulator.run_cell("A1", "1000")
    simulator.get_kernel_state()

    assert simulator.get("A1") == 1000
    assert simulator.get("B1") == 1000
    assert simulator.get("C1") == 1000
    assert simulator.get("D1") == 2000
    assert simulator.get("E1") == 100


ark distributions on EMR use Scala version 2.12.
Former Members of Rajya Sabha since 1952 as on 17th July 2013 in English
==========================================================================

Details
---------

Creator: Rajyasabha rajyasabaha.nic.in

Publisher: data.gov.in http://data.gov.in/access-point-download-count?url=http://data.gov.in/sites/default/files/Former_Rajya_Sabha_Members_since_1952_as_on_17th_July_2013.xls&nid=19255

Date of Publication: 18/07/2013

Source: http://data.gov.in/access-point-download-count?url=http://data.gov.in/sites/default/files/Former_Rajya_Sabha_Members_since_1952_as_on_17th_July_2013.xls&nid=19255

Duration: 1952-2013

Variables
------------

Member Name

Gender

Email ID

Delhi Address

Permanent Address

Whether Minister

Term Start Date

Term End Date

State Name

Party Name

Father Name

Mother Name

Date of Birth

Place of Birth

Marital Status

Date of Marriage

Spouse Name

No. of Sons

No. of Daughters

Educational Qualification(s)

Other Profession(s)

Previous Membership

Position(s) Held

Freedom Fighter

Book(s) Published

Activity(s)

Hobbies

Country(s) Visited

Essential Information
# Contributing to Indian Village Boundaries
We are open to contributions. Please read [DataMeet Community Code of Conduct](http://datameet.org/wiki/guidelines:datameet-community-code-of-conduct) before you start and also read our [license to familiarize yourself with ODBl](http://opendatacommons.org/licenses/odbl/) under which all our and your contributions will be distributed.

## Referencing the Source
For any change you make please link to a source. We prefer goverment websites or websites/apps like [OpenStreeMap](https://www.openstreetmap.org/
) who share the data under ODBl. You can add them to the state specific .md file, so they due credit. If they are generic then you can add it to the reference.md file.

## Format
All the village boundaries are available in geojson (WGS84, EPSG4326) format.

## Attributes
Each boundary will have the following attributes

- NAME : Name of the Village/Town as per census
- TYPE: Village or Town
- SUB_DISTRICT: Sub District name as per census
- DISTRICT : District name as per census
- STATE: State or UT name as per census
- CENSUS_CODE_2001: Code as per 2001 census, its a concatination of State Code, District Code, Sub-District Code, Village Code 2001.
- CENSUS_CODE_2011: Code as per 2011 census, its a concatination of State Code, District Code, Sub-District Code, Village Code 2001.

## How to contribute
- Fork the project
- Make changes
- Send a pull request

## Acceptance procedure
- One of the core volunteer will cross-check/validate with the references you add to pull request
- If everything is okay then will accept the pull request

## Adding new attribute or changing the value
Before adding any new attribute, discuss on the list. If you have any corrections to the value of attribute source it from an official goverment site or Census of India. Without reference we wont add.

## Adding new state
Refer the availabe state map files online. Generally state revenue department. If they are not availabe online, request through RTI. Digitize it. Add attributes and send a pull request. Before starting a new state put an [issue on the issue tracker](https://github.com/datameet/indian_village_boundaries/issues), so other know you are working on it. Also check the status on the README file.

## Reporting error
If you have


// <summary>
        /// 换脸任务超时
        /// </summary>
        public int FaceSwapTimeoutMinutes { get; set; } = 10;

        /// <summary>
        /// 启用视频换脸
        /// </summary>
        public bool EnableVideoFaceSwap { get; set; }

        /// <summary>
        /// 视频换脸模型版本
        /// https://replicate.com/xrunda/hello
        /// </summary>
        public string VideoFaceSwapVersion { get; set; } = "104b4a39315349db50880757bc8c1c996c5309e3aa11286b0a3c84dab81fd440";

        /// <summary>
        /// 视频换脸并发数
        /// </summary>
        public int VideoFaceSwapCoreSize { get; set; } = 3;

        /// <summary>
        /// 视频换脸等待队列长度。
        /// </summary>
        public int VideoFaceSwapQueueSize { get; set; } = 10;

        /// <summary>
        /// 视频换脸任务超时
        /// </summary>
        public int VideoFaceSwapTimeoutMinutes { get; set; } = 30;

        /// <summary>
        /// 最大文件大小限制
        /// </summary>
        public long MaxFileSize { get; set; } = 10 * 1024 * 1024;

        /// <summary>
        /// 回调通知
        /// </summary>
        public string Webhook { get; set; }

        /// <summary>
        /// 回调通知事件过滤
        /// start：预测开始时立即
        /// output：每次预测都会产生一个输出（请注意，预测可以产生多个输出）
        /// logs：每次日志输出都是由预测生成的
        /// completed：当预测达到终止状态（成功/取消/失败）时
        /// </summary>
        public string[] WebhookEventsFilter { get; set; } = [];
    }
}


�론을 낼 수 있다 으로 인하여 있다 어떤것 관계가 있다 관련이 있다 연관되다 어떤것들 에 대해 이리하여 그리하여 여부 하기보다는 하느니 하면 할수록 운운 이러이러하다 하구나 하도다 다시말하면 다음으로 에 있다 에 달려 있다 우리 우리들 오히려 하기는한데 어떻게 어떻해 어찌됏어 어때 어째서 본대로 자 이 이쪽 여기 이것 이번 이렇게말하자면 이런 이러한 이와 같은 요만큼 요만한 것 얼마 안 되는 것 이만큼 이 정도의 이렇게 많은 것 이와 같다 이때 이렇구나 것과 같이 끼익 삐걱 따위 와 같은 사람들 부류의 사람들 왜냐하면 중의하나 오직 오로지 에 한하다 하기만 하면 도착하다 까지 미치다 도달하다 정도에 이르다 할 지경이다 결과에 이르다 관해서는 여러분 하고 있다 한 후 혼자 자기 자기집 자신 우에 종합한것과같이 총적으로 보면 총적으로 말하면 총적으로 대로 하다 으로서 참 그만이다 할 따름이다 쿵 탕탕 쾅쾅 둥둥 봐 봐라 아이야 아니 와아 응 아이 참나 년 월 일 령 영 일 이 삼 사 오 육 륙 칠 팔 구 이천육 이천칠 이천팔 이천구 하나 둘 셋 넷 다섯 여섯 일곱 여덟 아홉 령 영".split(" ")),e.Pipeline.registerFunction(e.ko.stopWordFilter,"stopWordFilter-ko"),e.ko.stemmer=function(){return function(e){return"function"==typeof e.update?e.update(function(e){return e}):e}}(),e.Pipeline.registerFunction(e.ko.stemmer,"stemmer-ko")}});!function(e,t){"function"==typeof define&&define.amd?define(t):"object"==typeof exports?module.exports=t():t()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.te=function(){this.pipeline.reset(),this.pipeline.add(e.te.trimmer,e.te.stopWordFilter,e.te.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(e.te.stemmer))


; Sector 2 - Cathedral
; make door to reo room functional
; remove hatch to ripper roost
; move zoro out of the way of ripper roost
; move cocoon and kihunter spritesets to intact room state
; limit zoro pathing to prevent climbing the room early with ice beam
; move a stop-enemy block one tile lower to avoid glitchy sprite behavior
.org readptr(Sector2Levels + 0Dh * LevelMeta_Size + LevelMeta_Bg1)
.area 4E1h
.incbin "data/rooms/S2-0D-BG1.rlebg"
.endarea

.autoregion DataFreeSpace, DataFreeSpaceEnd
@S2_CentralShaft_Clipdata:
.incbin "data/rooms/S2-0D-Clip.rlebg"
.endautoregion

.autoregion
@S2_CentralShaft_KihunterSpriteset:
    .db     3Eh, 00h
    .db     5Eh, 01h
    .db     36h, 08h
    .db     8Ah, 02h
    .db     5Bh, 03h
    .db     5Ch, 03h
    .db     89h, 06h
    .db     0, 0
.endautoregion

.org SpritesetList + 1Eh * 04h
.area 04h
    .dw     @S2_CentralShaft_KihunterSpriteset
.endarea

.org readptr(Sector2Levels + 0Dh * LevelMeta_Size + LevelMeta_Spriteset0) + (1 * Spriteset_SpriteSize)
.area 03h
    .db     17h, 05h, 24h
.endarea

.org readptr(Sector2Levels + 0Dh * LevelMeta_Size + LevelMeta_Spriteset0) + (3 * Spriteset_SpriteSize)
.area 03h
    .db     2Bh, 03h, 24h
.endarea

.org readptr(Sector2Levels + 2Eh * LevelMeta_Size + LevelMeta_Spriteset0) + (1 * Spriteset_SpriteSize)
.area 03h
    .db     17h, 05h, 24h
.endarea

.org readptr(Sector2Levels + 2Eh * LevelMeta_Size + LevelMeta_Spriteset1) + (2 * Spriteset_SpriteSize)
.area 03h
    .db     17h, 05h, 24h
.endarea

.org readptr(Sector2Levels + 2Eh * LevelMeta_Size + LevelMeta_Spriteset1) + (6 * Spriteset_SpriteSize)
.area 03h


:Class 场景元素类
		 * @return
		 *
		 */
		public getElement(cls:any):SceneElement{
			var array:Array<any> = this.getElementCacheArray(this.getElementType(cls));

			var element:SceneElement = null;

			if(array.length > 0){
				element = array.pop();

				this._elementFlagMap.remove(element.hashCode);
			}else{
				element = new cls();
			}

			return element;
		}
		//
		/**
		 * 回收场景元素
		 * @param element:SceneElement
		 *
		 */
		public recoverElement(element:SceneElement):void{
			if(!element){
				LogManager.error(this,"回收场景元素element为空");
				return;
			}
			if(this._elementFlagMap.containsKey(element.hashCode)){
				LogManager.error(this,"重复回收场景元素:element = " + element + ",id = " + element.id);
				return;
			}
			//if(element == Role.getInstance()){
			//	//主角，宠物等不用回收
			//	return;
			//}
			if(RoleManager.getInstance().isRoleInstance(element)){
				//主角，宠物等不用回收
				return;
			}

			var type:string = this.getElementType(element);
			var array:Array<any> = this.getElementCacheArray(type);
			if(!this.COUNT_ELEMENT_CACHE[type]){
				LogManager.error(this,"未配置场景元素缓存数量 type = " + type);

				//测试
				throw new Error("未配置场景元素缓存数量 type = " + type);
			}

			if(array.length < this.COUNT_ELEMENT_CACHE[type]){
				array.push(element);

				this._elementFlagMap.put(element.hashCode,true);
			}else{
				var index:number = array.indexOf(element);
				if(index != -1)
					array.splice(index,1);
				this._elementFlagMap.remove(element.hashCode);
				element.destroy();
			}
		}
		//
		/**
		 * 获取场景元素缓存
		 * @param element:*
		 * @return
		 *
		 */
		private getElementCacheArray(type:string):Array<any>{
			var array:Array<any> = this._elementCache.get(type);

			if(!array){
				array = [];
				this._elementCache.put(type,array);
			}

			return array;
		}
		//
		/**
		 * 根据场景元素实例获取类型
		 * @param target:* 场景元素实例
		 * @return
		 *
		 */
		private getElementType(target:any):string{
			var type:string = null;

			if(target == PlayerAnimal || target instanceof PlayerAnimal){
				type = SceneElementManager.ELEMENT_PLAYER_ANIMAL;
			}
			else if(target == PlayerWarrior || target instanceof PlayerWarrior){
				type = SceneElementManager.ELEMENT_PLAYER_WARRIOR;
			}
			else if(target == PlayerMage || target instanceof PlayerMage){
				type = SceneElementManager.ELEMENT_PLAYER_MAGE;
			}
			else if(target == PlayerBowman || target instanceof PlayerBowman){
				type = SceneElementManager.ELEMENT_PLAYER_BOWMAN;
			}
			else if(target == ElementMonster || target instanceof ElementMonster){
				type = SceneElementManager.ELEMENT_MONSTER;
			}else if(target == ElementSkill || target instanceof ElementSkill){
				type = SceneElementManager.ELEMENT_SKILL;
			}else if(target == ElementMageNormalSkill || target instanceof ElementMageNormalSkill){
				type = SceneElementManager.ELEMENT_MAGE_NORMAL_SKILL;
			}else if(target == ElementEffect || target instanceof ElementEffect){
				type = SceneElementManager.ELEMENT_EFFECT;
			}else if(


Mode = BlendMode.SrcOver
// _0_0
alphaStack.add(0, alpha)
alpha *= 0.3186813f
blendModeStack.add(0, BlendMode.SrcOver)
blendMode = BlendMode.SrcOver
withTransform({
transform(
Matrix(values=floatArrayOf(
1.0f, 0.0f, 0.0f, 0.0f,
0.0f, 1.0f, 0.0f, 0.0f,
0.0f, 0.0f, 1.0f, 0.0f,
1.0f, 4.0f, 0.0f, 1.0f)
))}){
// _0_0_0
if (generalPath == null) {
   generalPath = Path()
} else {
   generalPath!!.reset()
}
generalPath?.run {
    moveTo(37.625f, 37.75f)
    cubicTo(37.648037f, 39.810402f, 34.913227f, 41.71825f, 30.456121f, 42.751118f)
    cubicTo(25.999018f, 43.78399f, 20.500982f, 43.78399f, 16.043879f, 42.751118f)
    cubicTo(11.586774f, 41.71825f, 8.851964f, 39.810402f, 8.875f, 37.75f)
    cubicTo(8.851964f, 35.689598f, 11.586774f, 33.78175f, 16.043879f, 32.748882f)
    cubicTo(20.500982f, 31.71601f, 25.999018f, 31.71601f, 30.456121f, 32.748882f)
    cubicTo(34.913227f, 33.78175f, 37.648037f, 35.689598f, 37.625f, 37.75f)
    close()
}
shape = Outline.Generic(generalPath!!)
brush = Brush.radialGradient(0.0f to Color(0, 0, 0, 255), 1.0f to Color(0, 0, 0, 0), center = Offset(23.25f, 37.750004f), radius = 14.875f, tileMode = TileMode.Clamp)
drawOutline(outline = shape!!, style=Fill, brush=brush!!, alpha=alpha, blendMode = blendMode)
}
alpha = alphaStack.removeAt(0)
blendMode = blendModeStack.removeAt(0)
alphaStack.add(0, alpha)
alpha *= 0.6978022f
blendModeStack.add(0, BlendMode.SrcOver)
blendMode = BlendMode.SrcOver
withTransform({
transform(
Matrix(values=floatArrayOf(
1.0f, 0.0f, 0.0f, 0.0f,
0.0f, 1.0f, 0.0f, 0.0f,
0.0f, 0.0f, 1.0f, 0.0f,
-0.125f, 4.75f, 0.0f, 1.0f)
))}){
// _0_0_1
if (generalPath == null) {
   generalPath = Path()
} else {
   generalPath!!.reset()
}
generalPath?.run {
    moveTo(33.5f, 36.8125f)
    cubicTo(33.51372f, 37.865097f, 31.884726f, 38.839756f, 29.229843f, 39.36742f)
    cubicTo(26.574959f, 39.89508f, 23.300041f, 39.89508f, 20.645157f, 39.36742f)
    cubicTo(17.990274f, 38.839756f, 16.361279f, 37.865097f, 16.375f, 36.8125f)
    cubicTo(16.361279f, 35.759903f, 17.990274f, 34.785244f, 20.


      dc.b %11,6,9,1,%11,6,19,1,%10,1,13,0,0,0,26,0,0,0,27,0,%1000,3,31,0
      dc.b 0,-1,34,1,%10,1,12,0,0,1,28,1,1,0,32,0,0,0,29,0,0,0,30,0,0,0,33,1
      dc.b 0,5,15,0,0,0,14,1,%110,2,0,0,%111,2,16,0,0,-1,24,0,0,1,35,1
      dc.b 0,-1,17,1,1,0,38,0

 data
 even

; puissances de 10 de 10^-1  10^-256

negdata:  dc.l $3fb99999,$9999999a
          dc.l $3f847ae1,$47ae147a
          dc.l $3f1a36e2,$eb1c432c
          dc.l $3e45798e,$e2308c38
          dc.l $3c9cd2b2,$97d889b7
          dc.l $3949f623,$d5a8a729
          dc.l $32a50ffd,$44f4a72d
          dc.l $255bba08,$cf8c9771
          dc.l $0ac80628,$64ac6ef7

; puissances de 10 de 10^1  10^256

posdata: dc.l $40240000,0
         dc.l $40590000,0
         dc.l $40c38800,0
         dc.l $4197d784,0
         dc.l $4341c379,$37e08000
         dc.l $4693b8b5,$b5056e16
         dc.l $4d384f03,$e93ff9f3
         dc.l $5a827748,$f9301d2e
         dc.l $75154fdd,$7f73bf33

; nombres rels de 1  9

chdata:  dc.w $3ff0,$4000,$4008,$4010,$4014,$4018,$401c,$4020,$4022

; donnes pour le CORDIC

cordk:  dc.l $3fe36e9d,$b5086bcb
        dc.l $3ff351e8,$7200eec2
pi:     dc.w $4009,$21fb,$5444,$2d18
pisur2: dc.w $3ff9,$21fb,$5444,$2d18

 even
ordres:
 dc.b 6,"[empl]",8,"variable",8,"constant",5,"array",6,"string"
 dc.b 6,"array$",5,"table",2,">r",2,"r>",2,"r@",4,"?dup"
 dc.b 5,"depth",4,"drop",3,"dup",4,"over",4,"pick",2,"r0"
 dc.b 4,"roll",3,"rot",3,"rp!",5,"w/mod",3,"rp@",2,"s0",3,"sp!"
 dc.b 4,"wmod",3,"sp@",4,"swap",1,"*",2,"w*",2,"w/",1,"+",2,"+-"
 dc.b 1,"-",1,"/",4,"/mod",2,"0<",2,"0=",2,"0>",1,">",1,"<",1,"="
 dc.b 2,"1+",2,"1-",2,"2+",2,"2-",2,"2*",2,"2/",3,"abs",3,"and"
 dc.b 3,"max",3,"min",3,"mod",6,"negate",3,"not",2,"or",3,"xor"
 dc.b 4,"loop",5,"+loop",2,"do",5,"again",5,"begin",5,"until"
 dc.b 5,"while",6,"repeat",4,"exit",4,"case",2,"of",5,"


using System;
using System.Drawing;
using System.Drawing.Drawing2D;

namespace Microsoft.Reporting.Chart.WebForms.ChartTypes
{
	internal class PolarChart : RadarChart
	{
		public override string Name => "Polar";

		public override bool RequireClosedFigure()
		{
			return false;
		}

		public override bool XAxisCrossingSupported()
		{
			return true;
		}

		public override bool XAxisLabelsSupported()
		{
			return true;
		}

		public override bool RadialGridLinesSupported()
		{
			return true;
		}

		public override int GetNumerOfSectors(ChartArea area, SeriesCollection seriesCollection)
		{
			int result = 12;
			double interval = area.AxisX.Interval;
			if (area.AxisX.LabelStyle.Interval > 0.0)
			{
				interval = area.AxisX.LabelStyle.Interval;
			}
			if (interval != 0.0)
			{
				double num = area.AxisX.autoMaximum ? 360.0 : area.AxisX.Maximum;
				double num2 = area.AxisX.autoMinimum ? 0.0 : area.AxisX.Minimum;
				result = (int)(Math.Abs(num - num2) / interval);
			}
			return result;
		}

		public override float[] GetYAxisLocations(ChartArea area)
		{
			float[] array = new float[1]
			{
				0f
			};
			if (!double.IsNaN(area.AxisX.Crossing))
			{
				array[0] = (float)area.AxisX.Crossing;
				while (array[0] < 0f)
				{
					array[0] = 360f + array[0];
				}
			}
			return array;
		}

		protected override RadarDrawingStyle GetDrawingStyle(Series ser, DataPoint point)
		{
			RadarDrawingStyle result = RadarDrawingStyle.Line;
			if (point.IsAttributeSet("


culated between both axes
     * @see dist
     */
    fun dist(xAxis: InputSignal, yAxis: InputSignal, deadZone: Float = axisDeadZone): Float =
        max(abs(axis(xAxis, deadZone)), abs(axis(yAxis, deadZone)))

    /**
     * Calculates the angle of a vector [InputSignal]. Requires a vector to have been added with the
     * specified [vector].
     *
     * @param vector the input signal
     * @param deadZone the threshold a [GameAxis] needs to surpass in order to return a value other
     *   than `0`.
     * @return the angle between both axes in the vector
     * @see addVector
     */
    fun angle(vector: InputSignal, deadZone: Float = axisDeadZone): Float =
        vectors[vector]?.let {
            val vec = vector(vector, deadZone)
            atan2(vec.y, vec.x)
        } ?: 0f

    /**
     * Calculates the angle between both [InputSignal] axes. Requires the axes to have been added
     * with the specified [axis] and [yAxis].
     *
     * @param xAxis the **X** axis input signal
     * @param yAxis the **Y** axis input signal
     * @param deadZone the threshold a [GameAxis] needs to surpass in order to return a value other
     *   than `0`.
     * @return the angle between both axes in the vector
     * @see addVector
     */
    fun angle(xAxis: InputSignal, yAxis: InputSignal, deadZone: Float = axisDeadZone) =
        atan2(axis(yAxis, deadZone), axis(xAxis, deadZone))

    enum class KeyModifier(val keys: List<Key>) {
        SHIFT(listOf(Key.SHIFT_LEFT, Key.SHIFT_RIGHT)),
        CTRL(listOf(Key.CTRL_LEFT, Key.CTRL_RIGHT)),
        ALT(listOf(Key.ALT_LEFT, Key.ALT_RIGHT))
    }
}

private data class InputAxis<T>(val positive: T, val negative: T)

private data class InputVector<T>(
    val positiveX: T,
    val positiveY: T,
    val negativeX: T,
    val negativeY: T
)

private data class KeyBindingWithModifiers<T>(
    val input: T,
    val keys: List<Key>,
    val modifiers: List<InputMapController.KeyModifier>,
)
package com.littlekt.util.packer

/**
 * @author Colton Daily
 * @date 1/27/2022
 */
open class BinRect(
    x: Int = 0,
    y: Int = 0,
    width: Int = 0,
    height: Int = 0,
    isRotated: Boolean = false,
    allowRotation: Boolean? = null,
    data: Map<String, Any> = mapOf(),
    tag: String? = null
) {
    protected var _dirty = 0

    protected var _x = x
    protected var _y = y
    protected var _width = width
    protected var _height = height
    protected var _isRotated: Boolean = isRotated
    protected var _allowRotation: Boolean? = allowRotation
    protected var _tag = tag

    var x: Int
        get() = _x
        set(value) {
            if (value == _x) return
            _x = value
            _dirty++
        }

    var y: Int
        get() = _y
        set(value) {
            if (value == _y) return
            _y = value
            _dirty++
        }

    var width: Int
        get() = _width
        set(value) {
            if (value == _width) return
            _width = value
            _dirty++
        }

    var height: Int
        get() = _height
        set(value) {
            if (value == _height) return
            _height = value
            _dirty++
        }

    var isRotated: Boolean
        get() = _isRotated
        set(value) {
            if (_allowRotation == false) return
            if (value == _isRotated) return
            val tmp = width
            width = height
            height = tmp
            _isRot


b>, in pixels.

### -field lpszCaption

Pointer to an OLESTR that contains the caption of the dialog.

### -field cObjects

Number of object pointers passed in lplpUnk.

### -field lplpUnk

Array of IUnknown pointers on the objects for which this property sheet is being invoked. The number of elements in the array is specified by cObjects. These pointers are passed to each property page through IPropertyPage::SetObjects.

### -field cPages

Number of property pages specified in lpPages.

### -field lpPages

Pointer to an array of size cPages containing the CLSIDs of each property page to display in the property sheet.

### -field lcid

Locale identifier for the property sheet. This value will be returned through IPropertyPageSite::GetLocaleID.

### -field dispidInitialProperty

Property that is highlighted when the dialog box is made visible.

## -see-also

IPropertyPage::SetObjects

IPropertyPageSite::GetLocaleID

OLESTR

OleCreatePropertyFrameIndirect---
UID: NS:mapi.MapiFileDescW
title: MapiFileDescW (mapi.h)
description: A MapiFileDescW structure contains information about a file containing a message attachment stored as a temporary file. That file can contain a static OLE object, an embedded OLE object, an embedded message, and other types of files.
helpviewer_keywords: ["*lpMapiFileDescW","MAPI_OLE","MAPI_OLE_STATIC","MapiFileDescW","MapiFileDescW structure","lpMapiFileDescW","lpMapiFileDescW structure pointer","mapi.mapifiledescw","mapi/MapiFileDescW","mapi/lpMapiFileDescW"]
old-location: mapi\mapifiledescw.htm
tech.root: mapi
ms.assetid: CF7C41DF-D361-457F-B038-5C1144E70AA6
ms.date: 12/05/2018
ms.keywords: '*lpMapiFileDescW, MAPI_OLE, MAPI_OLE_STATIC, MapiFileDescW, MapiFileDescW structure, lpMapiFileDescW, lpMapiFileDescW structure pointer, mapi.mapifiledescw, mapi/MapiFileDescW, mapi/lpMapiFileDescW'
req.header: mapi.h
req.include-header:
req.target-type: Windows
req.target-min-winverclnt: Windows 8 [desktop apps only]
req.target-min-winversvr: Windows Server 2012 [desktop apps only]
req.kmdf-ver:
req.umdf-ver:
req.ddi-compliance:
req.unicode-


                                cost = float(cost_matrix[small_idx, large_idx])
                                    if cost < min_force_cost:
                                        min_force_cost = cost
                                        best_force_merge = large_root
                                        best_connection_pair = (small_idx, large_idx)

                    if best_force_merge is not None:
                        # 检查强制合并后的簇内连通性
                        merged_members = large_clusters[best_force_merge] + small_members
                        if self._verify_cluster_connectivity(merged_members, insight_matrix):
                            large_clusters[best_force_merge].extend(small_members)
                        else:
                            # 如果会产生孤星，保留为独立小簇
                            large_clusters[small_root] = small_members
                    else:
                        # 真的没有任何可见性连接，保留为独立小簇
                        large_clusters[small_root] = small_members

        # 使用合并后的簇
        cluster_dict = large_clusters

        # 首先收集所有目标及其可见卫星
        target_to_satellites = defaultdict(set)
        print(f"🔍 收集目标-卫星可见性关系，共 {len(sat_target_vis)} 条记录")

        # 调试信息：检查格式一致性
        sample_sat_ids = sat_ids[:5] if len(sat_ids) >= 5 else sat_ids
        sample_vis_keys = list(sat_target_vis.keys())[:5]
        print(f"🔍 调试：sat_ids 前{len(sample_sat_ids)}个: {sample_sat_ids}")
        print(f"🔍 调试：sat_target_vis 前{len(sample_vis_keys)}个键: {sample_vis_keys}")

        matched_count = 0
        unmatched_sats = set()

        for (s_id, t_id), quality in sat_target_vis.items():
            # 确保使用完全相同的字符串格式进行匹配
            sat_idx = -1
            if s_id in sat_ids:
                sat_idx = sat_ids.index(s_id)
                matched_count += 1
            else:
                unmatched_sats.add(s_id)

            if sat_idx >= 0:
                # 找到卫星所属的簇（在合并后的簇中）
                cluster_root = None
                for root, members in cluster_dict.items():
                    if sat_idx in members:
                        cluster_root = root
                        break
                if cluster_root is not None:
                    target_to_satellites[t_id].add(cluster_root)

        print(f"🔍 调试：匹配到的卫星记录数: {matched_count}")
        if unmatched_sats:
            print(f"🔍 调试：未匹配的卫星ID: {list(unmatched_sats)[:10]}")  # 只显示前10个

        print(f"🎯 发现 {len(target_to_satellites)} 个目标可被观测")

        # 为每个目标分配最佳簇，考虑负载均衡
        target_assignments = {}  # 目标 -> 簇根节点
        cluster_target_counts = defaultdict(int)  # 簇 -> 已分配目标数量

        # 按目标被观测的簇数量排序，优先处理竞争激烈的目标
        sorted_targets = sorted(target_to_satellites.items(),
                               key=lambda x: len(x[1]))

        for t_id, cluster_roots in sorted_targets:
            if len(cluster_roots) == 0:
                continue
            elif len(cluster_roots) == 1:
                # 如果目标只被一个簇观测到，直接分配
                root = next(iter(cluster_roots))
                target_assignments[t_id] = root
                cluster_target_counts[root] += 1
            else:
                # 如果目标被多个簇观测到，考虑多个因素选择最佳簇
                best_root = None
                best_score = -float('inf')

                for root in cluster_roots:
                    # 计算该簇中能观测到此目标的卫星数量
                    observers = sum(1 for idx in cluster_dict[root]
                                   if (sat_ids[idx], t_id) in sat_target_vis)

                    # 计算当前簇的负载（目标数/卫星数）
                    cluster_size = len(cluster_dict[root])
                    current_load = cluster_target_counts[root] / cluster_size

                    # 计算观测质量得分
                    total_quality = sum(sat_target_vis.get((sat_ids[idx], t_id), 0)
                                      for idx in cluster_dict[root]
                                      if (sat_ids[idx], t_id) in sat_target_vis)
                    quality_score = total_quality / cluster_size if cluster_size > 0 else 0

                    # 大幅强化负载均衡：使用更严格的指数惩罚函数
                    # 目标是让每个簇的负载趋近于1.0（即每个卫星承担1个目标）
                    if current_load <= 0.8:
                        load_penalty = current_load * 0.1  # 几乎无惩罚，鼓励使用低负载簇
                    elif current_load <= 1.2:
                        load_penalty = 0.08 + (current_load - 0.8) * 0.2  # 轻微惩罚
                    elif current_load <= 1.8:


 := iprot.ReadString(); err != nil {
		return err
	} else {
		_field = &v
	}
	p.TosURI = _field
	return nil
}
func (p *DocumentInfo) ReadField5(iprot thrift.TProtocol) error {

	var _field int32
	if v, err := iprot.ReadI32(); err != nil {
		return err
	} else {
		_field = v
	}
	p.CreateTime = _field
	return nil
}
func (p *DocumentInfo) ReadField6(iprot thrift.TProtocol) error {

	var _field int32
	if v, err := iprot.ReadI32(); err != nil {
		return err
	} else {
		_field = v
	}
	p.UpdateTime = _field
	return nil
}
func (p *DocumentInfo) ReadField7(iprot thrift.TProtocol) error {

	var _field *int64
	if v, err := iprot.ReadI64(); err != nil {
		return err
	} else {
		_field = &v
	}
	p.CreatorID = _field
	return nil
}
func (p *DocumentInfo) ReadField8(iprot thrift.TProtocol) error {

	var _field int32
	if v, err := iprot.ReadI32(); err != nil {
		return err
	} else {
		_field = v
	}
	p.SliceCount = _field
	return nil
}
func (p *DocumentInfo) ReadField9(iprot thrift.TProtocol) error {

	var _field string
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		_field = v
	}
	p.Type = _field
	return nil
}
func (p *DocumentInfo) ReadField10(iprot thrift.TProtocol) error {

	var _field int32
	if v, err := iprot.ReadI32(); err != nil {
		return err
	} else {
		_field = v
	}
	p.Size = _field
	return nil
}
func (p *DocumentInfo) ReadField11(iprot thrift.TProtocol) error {

	var _field int32
	if v, err := iprot.ReadI32(); err != nil {
		return err
	} else {
		_field = v
	}
	p.CharCount = _field
	return nil
}
func (p *DocumentInfo) ReadField12(iprot thrift.TProtocol) error {

	var _field DocumentStatus
	if v, err := iprot.ReadI32(); err != nil {
		return err
	} else {
		_field = DocumentStatus(v)
	}
	p.Status = _field
	return nil
}
func (p *DocumentInfo) ReadField13(iprot thrift.TProtocol) error {

	var _field int32
	if v, err := iprot.ReadI32(); err != nil {
		return err
	} else {
		_field = v
	}
	p.HitCount = _field
	return nil
}
func (p *DocumentInfo) ReadField14(iprot thrift.TProtocol) error {

	var _field DocumentSource
	if v, err := iprot.ReadI32(); err != nil {
		return err
	} else {
		_field = DocumentSource(v)
	}
	p.SourceType = _field
	return nil
}
func (p *DocumentInfo) ReadField18(iprot thrift.TProtocol) error {

	var _field FormatType
	if v, err := iprot.ReadI32(); err != nil {
		return err
	} else {
		_field = FormatType(v)
	}
	p.FormatType = _field
	return nil
}
func (p *DocumentInfo) ReadField19(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return err
	}
	_field := make([]*TableColumn, 0, size)
	values := make([]Tabl


	4(%esp), %ebp           # 4-byte Folded Reload
	adcl	%ebx, %esi
	adcl	$0, %ecx
	adcl	$0, %eax
	adcl	$0, %edx
	adcl	$0, %edi
	addl	%edx, 24(%esp)          # 4-byte Folded Spill
	adcl	%edi, 28(%esp)          # 4-byte Folded Spill
	adcl	%ebp, %edx
	movl	%edx, 20(%esp)          # 4-byte Spill
	adcl	%esi, %edi
	adcl	$0, %ecx
	adcl	$0, %eax
	sbbl	%ebx, %ebx
	andl	$1, %ebx
	movl	24(%esp), %esi          # 4-byte Reload
	addl	$1, %esi
	movl	28(%esp), %ebp          # 4-byte Reload
	adcl	$0, %ebp
	adcl	$1, %edx
	movl	%edx, 8(%esp)           # 4-byte Spill
	movl	%edi, %edx
	adcl	$0, %edx
	movl	%edx, 12(%esp)          # 4-byte Spill
	movl	%ecx, %edx
	adcl	$0, %edx
	movl	%edx, 16(%esp)          # 4-byte Spill
	movl	%eax, %edx
	adcl	$0, %edx
	adcl	$-1, %ebx
	andl	$1, %ebx
	jne	.LBB1_2
# BB#1:
	movl	%edx, %eax
.LBB1_2:
	testb	%bl, %bl
	movl	24(%esp), %edx          # 4-byte Reload
	jne	.LBB1_4
# BB#3:
	movl	%esi, %edx
.LBB1_4:
	movl	52(%esp), %esi
	movl	%edx, (%esi)
	movl	20(%esp), %edx          # 4-byte Reload
	movl	28(%esp), %ebx          # 4-byte Reload
	jne	.LBB1_6
# BB#5:
	movl	%ebp, %ebx
.LBB1_6:
	movl	%ebx, 4(%esi)
	jne	.LBB1_8
# BB#7:
	movl	8(%esp), %edx           # 4-byte Reload
.LBB1_8:
	movl	%edx, 8(%esi)
	jne	.LBB1_10
# BB#9:
	movl	12(%esp), %edi          # 4-byte Reload
.LBB1_10:
	movl	%edi, 12(%esi)
	jne	.LBB1_12
# BB#11:
	movl	16(%esp), %ecx          # 4-byte Reload
.LBB1_12:
	movl	%ecx, 16(%esi)
	movl	%eax, 20(%esi)
	addl	$32, %esp
	popl	%esi
	popl	%edi
	popl	%ebx
	popl	%ebp
	retl
.Lfunc_end1:
	.size	mcl_fpDbl_mod_NIST_P192Lbmi2, .Lfunc_end1-mcl_fpDbl_mod_NIST_P192Lbmi2

	.globl	mcl_fp_sqr_NIST_P192Lbmi2
	.align	16, 0x90
	.type	mcl_fp_sqr_NIST_P192Lbmi2,@function
mcl_fp_sqr_NIST_P192Lbmi2:              # @mcl_fp_sqr_NIST_P192Lbmi2
# BB#0:
	pushl	%ebp
	pushl	%ebx
	pushl	%edi
	pushl	%esi
	subl	$92


atomsPerCol)
			setNextWindowContentSize(numCols*50f, 0f)
			child("atoms", 500f, 200f, true, flags = IntFlags.of(Commands.BeginFlags.HorizontalScrollBar)) {

				columns(numCols, border = true) {
					for (c in 0 until numCols) {
						column {
							for (i in 0 until atomsPerCol) {

								val atom = mol.atoms.getOrNull(c*atomsPerCol + i) ?: break

								withId("$c-$i") {

									// show a label for the atom that we can hover over
									selectable(atom.name, slideHovers.atom === atom || guiHovers.atom === atom)
									if (isItemHovered()) {
										guiHovers.atom = atom
										guiHovers.molecule = mol
									}

									// show a context menu to center the camera on the molecule
									popupContextItem("centerCamera") {
										if (button("Center Camera")) {
											slidewin.camera.lookAt(atom, slide)
											slidewin.camera.changed()
											closeCurrentPopup()
										}
									}
								}
							}
						}
					}
				}
			}
		}
	}

	override fun contextMenu(contextMenu: ContextMenu, slide: Slide.Locked, slidewin: SlideCommands, target: ViewIndexed) {

		if (!winState.isOpen) {
			return
		}

		// get the atom, if any
		val view = target.view as? MoleculeRenderView ?: return
		val mol = view.currentMol
		val atom = target.target as? Atom ?: return

		contextMenu.add {

			// show details about the atom
			text("Atom: ${atom.name} (${atom.element})")
			indent(10f)

			// show the molecule
			val types = mol.findTypes()
			text("${types.joinToString(",")}: $mol")

			// get the chain and residue, if any
			if (mol is Polymer) {
				mol.findChainAndResidue(atom)?.let { (chain, res) ->
					text("Residue ${chain.id} ${res.id} ${res.type}")
				}
			}

			// show a button to center the camera on the atom
			if (button("Center Camera")) {
				closeCurrentPopup()
				slidewin.camera.lookAt(atom, slide)
				slidewin.camera.changed()
			}

			unindent(10f)
		}
	}

	private fun updateFocusAtoms(views: List<MoleculeRenderView>) {

		for (view in views) {

			val residues = focusedResidues[view.currentMol]
			if (residues == null) {

				// no residue definitions? revert back to default
				view.selector = viewSelectors[view] ?: MoleculeSelectors.all

			} else {

				// otherwise, translate the focus into a selector
				val atoms = residues.flatMap { it.atoms }
				view.selector = { atoms }
			}
		}
	}

	private fun Polymer.Residue.findWithin(mol: Polymer, dist: Double): List<Polymer.Residue> {

		fun dist(a: Polymer.Residue, b: Polymer.Residue) =
			a.atoms.allPairs(b.atoms)
				.map { (a, b) -> a.pos.distance(b.pos) }
				.minOrNull()
				?: Double.POSITIVE_INFINITY

		return mol.chains
			.flatMap { it.residues }
			.filter { res -> dist(this, res) <= dist }
	}
}

private val hoverEffect = RenderEffect(
	ByteFlags.of(RenderEffect.Flags.Highlight, RenderEffect.Flags.Outset),
	200u, 200u, 200u
)
package co.doneservices.callkeep

import android.os.Bundle

class Call {
}

@Suppress("UNCHECKED_CAST")
data class Data(val args: Map<String, Any?>) {

    var id: String = (args["id"] as? String) ?: ""
    var uuid: String = (


6)
        } catch (nfe: NumberFormatException) {
            null
        }
    }

    // SimpleDateFormat isn't thread safe, cache one instance per thread as needed.
    private val ndkDateFormatHolder = object : ThreadLocal<DateFormat>() {
        override fun initialValue(): DateFormat {
            return SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'", Locale.US).apply {
                timeZone = TimeZone.getTimeZone("UTC")
            }
        }
    }
}
package com.bugsnag.android.test

import android.app.ApplicationExitInfo
import org.mockito.Mockito.mock
import java.io.InputStream
import org.mockito.Mockito.`when` as whenever

fun mockAppExitInfo(pid: Int, timestamp: Long, reason: Int): ApplicationExitInfo {
    return mock<ApplicationExitInfo>().also { info ->
        whenever(info.pid).thenReturn(pid)
        whenever(info.timestamp).thenReturn(timestamp)
        whenever(info.reason).thenReturn(reason)
    }
}

fun mockAppExitInfo(
    pid: Int,
    timestamp: Long,
    reason: Int,
    processStateSummery: ByteArray?,
    traceFile: (() -> InputStream)? = null,
): ApplicationExitInfo {
    return mock<ApplicationExitInfo>().also { info ->
        whenever(info.pid).thenReturn(pid)
        whenever(info.timestamp).thenReturn(timestamp)
        whenever(info.reason).thenReturn(reason)
        whenever(info.processStateSummary).thenReturn(processStateSummery)

        if (traceFile != null) {
            whenever(info.traceInputStream).then { traceFile() }
        }
    }
}
package com.bugsnag.android

import org.junit.After
import org.junit.Assert.assertEquals
import org.junit.Assert.assertNotNull
import org.junit.Before
import org.junit.Test
import org.mockito.Mockito.mock
import java.io.File

class ExitInfoPluginStoreTest {
    private lateinit var storeFile: File

    @Before
    fun setUp() {
        storeFile = File.createTempFile("bugsnag-exit-reasons", null)
    }

    @After
    fun tearDown() {
        storeFile.delete()
    }

    @Test
    fun testStoreInitialization() {
        val store = ExitInfoPluginStore(storeFile, mock())

        // Verify that the store initializes correctly
        assert(store.previousState == null)
        assert(store.currentState.processedExitInfoKeys.isEmpty())
        assert(store.currentState.pid == android.os.Process.myPid())
        assert(store.currentState.timestamp > 0)
    }

    @Test
    fun testParsesLegacyFile() {
        storeFile.writeText("1234567890")
        val store = ExitInfoPluginStore(storeFile, mock())

        assertEquals(1234567890, store.previousState?.pid)
        assertEquals(true, store.previousState?.processedExitInfoKeys?.isEmpty())
    }

    @Test
    fun testPersistsExitInfoKeys() {
        val store = ExitInfoPluginStore(storeFile, mock())
        store.addExitInfoKey(ExitInfoKey(1234, 1234567890L))
        store.addExitInfoKey(ExitInfoKey(5678, 1234567891L))

        val restoredStore = ExitInfoPluginStore(storeFile, mock())
        assertEquals(2, restoredStore.previousState?.processedExitInfoKeys?.size)
        val previousState = restoredStore.previousState
        assertNotNull(previousState)
        assertEquals(
            true,
            previousState?.processedExitInfoKeys?.contains(ExitInfoKey(1234, 1234567890L))
        )
        assertEquals(
            true,
            previousState?.processedExitInfoKeys?.contains(ExitInfoKey(5678, 1234567891L))
        )
    }
}
package com.bugsnag.android

import android.os.Build
import androidx.annotation.RequiresApi
import com.bugsnag.android.Thread.State
import com.bugsnag.android.repackaged.server.os.TombstoneProtos


-to-edit mode (where Trogedit manages whether the field
 * is editable), this works for both editable and uneditable fields.
 *
 * TODO(user): Is this really necessary? See TODO below.
 * @param {boolean=} opt_placeCursor Whether to place the cursor in the field
 *     after clearing lorem.
 * @private
 */
goog.editor.plugins.LoremIpsum.prototype.clearLorem_ = function(
    opt_placeCursor) {
  // Don't mess with lorem state when a dialog is open as that screws
  // with the dialog's ability to properly restore the selection
  // on dialog close (since the DOM nodes would get clobbered)
  var fieldObj = this.getFieldObject();
  if (this.usingLorem_ && !fieldObj.inModalMode()) {
    var field = fieldObj.getElement();
    if (!field) {
      // Fallback on the original element. This is needed by
      // fields managed by click-to-edit.
      field = fieldObj.getOriginalElement();
    }

    goog.asserts.assert(field);
    this.usingLorem_ = false;
    field.style.fontStyle = this.oldFontStyle_;
    fieldObj.setHtml(true, null, true);

    // TODO(nicksantos): I'm pretty sure that this is a hack, but talk to
    // Julie about why this is necessary and what to do with it. Really,
    // we need to figure out where it's necessary and remove it where it's
    // not. Safari never places the cursor on its own willpower.
    if (opt_placeCursor && fieldObj.isLoaded()) {
      if (goog.userAgent.WEBKIT) {
        goog.dom.getOwnerDocument(fieldObj.getElement()).body.focus();
        fieldObj.focusAndPlaceCursorAtStart();
      } else if (goog.userAgent.OPERA) {
        fieldObj.placeCursorAtStart();
      }
    }
  }
};
// Copyright 2011 The Closure Library Authors. 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.

/**
 * @fileoverview Adds a keyboard shortcut for the link command.
 *
 */

goog.provide('goog.editor.plugins.LinkShortcutPlugin');

goog.require('goog.editor.Command');
goog.require('goog.editor.Link');
goog.require('goog.editor.Plugin');
goog.require('goog.string');

/**
 * Plugin to add a keyboard shortcut for the link command
 * @constructor
 * @extends {goog.editor.Plugin}
 * @final
 */
goog.editor.plugins.LinkShortcutPlugin = function() {
  goog.editor.plugins.LinkShortcutPlugin.base(this, 'constructor');
};
goog.inherits(goog.editor.plugins.LinkShortcutPlugin, goog.editor.Plugin);

/** @override */
goog.editor.plugins.LinkShortcutPlugin.prototype.getTrogClassId = function() {
  return 'LinkShortcutPlugin';
};

/**
 * @override
 */
goog.editor.plugins.LinkShortcutPlugin.prototype.handleKeyboardShortcut =
    function(e, key, isModifierPressed) {
  var command;
  if (isModifierPressed && key == 'k' && !e.shiftKey) {
    var link = /** @type {goog.editor.Link?} */ (
        this.getFieldObject().execCommand(goog.editor.Command.LINK));
    if (link) {
      link.finishLinkCreation(this.getFieldObject());
    }
    return true;
  }

  return false;
};

// Copyright 2008 The Closure Library Authors. All Rights Reserved.
//
// Licensed under the Apache Licens


CH3_ENVS+FAMISTUDIO_ENV_VOLUME_OFF
    sta famistudio_env_value+FAMISTUDIO_N163_CH4_ENVS+FAMISTUDIO_ENV_VOLUME_OFF
    sta famistudio_env_value+FAMISTUDIO_N163_CH5_ENVS+FAMISTUDIO_ENV_VOLUME_OFF
    sta famistudio_env_value+FAMISTUDIO_N163_CH6_ENVS+FAMISTUDIO_ENV_VOLUME_OFF
    sta famistudio_env_value+FAMISTUDIO_N163_CH7_ENVS+FAMISTUDIO_ENV_VOLUME_OFF
.endif
.if FAMISTUDIO_EXP_S5B
    sta famistudio_env_value+FAMISTUDIO_S5B_CH0_ENVS+FAMISTUDIO_ENV_VOLUME_OFF
    sta famistudio_env_value+FAMISTUDIO_S5B_CH1_ENVS+FAMISTUDIO_ENV_VOLUME_OFF
    sta famistudio_env_value+FAMISTUDIO_S5B_CH2_ENVS+FAMISTUDIO_ENV_VOLUME_OFF
.endif
.if FAMISTUDIO_EXP_EPSM
.if FAMISTUDIO_EXP_EPSM_ENV_CNT > 0
    sta famistudio_env_value+FAMISTUDIO_EPSM_CH0_ENVS+FAMISTUDIO_ENV_VOLUME_OFF
.endif
.if FAMISTUDIO_EXP_EPSM_ENV_CNT > 1
    sta famistudio_env_value+FAMISTUDIO_EPSM_CH1_ENVS+FAMISTUDIO_ENV_VOLUME_OFF
.endif
.if FAMISTUDIO_EXP_EPSM_ENV_CNT > 2
    sta famistudio_env_value+FAMISTUDIO_EPSM_CH2_ENVS+FAMISTUDIO_ENV_VOLUME_OFF
.endif
.if FAMISTUDIO_EXP_EPSM_ENV_CNT > 3
    sta famistudio_env_value+FAMISTUDIO_EPSM_CH3_ENVS+FAMISTUDIO_ENV_VOLUME_OFF
.endif
.if FAMISTUDIO_EXP_EPSM_ENV_CNT > 4
    sta famistudio_env_value+FAMISTUDIO_EPSM_CH4_ENVS+FAMISTUDIO_ENV_VOLUME_OFF
.endif
.if FAMISTUDIO_EXP_EPSM_ENV_CNT > 5
    sta famistudio_env_value+FAMISTUDIO_EPSM_CH5_ENVS+FAMISTUDIO_ENV_VOLUME_OFF
.endif
.if FAMISTUDIO_EXP_EPSM_ENV_CNT > 6
    sta famistudio_env_value+FAMISTUDIO_EPSM_CH6_ENVS+FAMISTUDIO_ENV_VOLUME_OFF
.endif
.if FAMISTUDIO_EXP_EPSM_ENV_CNT > 7
    sta famistudio_env_value+FAMISTUDIO_EPSM_CH7_ENVS+FAMISTUDIO_ENV_VOLUME_OFF
.endif
.if FAMISTUDIO_EXP_EPSM_ENV_CNT > 8
    sta famistudio_env_value+FAMISTUDIO_EPSM_CH8_ENVS+FAMISTUDIO_ENV_VOLUME_OFF
.endif
.endif
    lda famistudio_song_speed ; <= 0 pauses the music
    ora #$80
    bne @done
@unpause:
    lda famistudio_song_speed ; > 0 unpause music
    and #$7f
@done:
    sta famistudio_song_speed

    rts

;======================================================================================================================
; FAMISTUDIO_GET_NOTE_PITCH_MACRO (internal)
;
; Uber-macro used to compute the final pitch of a note, taking into account the current note, arpeggios, instrument
; pitch envelopes, slide notes and fine pitch tracks.
;
; [in] x : note index.
; [in] y : slide/pitch envelope index.
; [out] famistudio_ptr1 : Final note pitch.
;==============================================