      _add32(_k[i], m[t1])),
                            _r[i]));
      a = temp;
    }

    _h[0] = _add32(a, _h[0]);
    _h[1] = _add32(b, _h[1]);
    _h[2] = _add32(c, _h[2]);
    _h[3] = _add32(d, _h[3]);
  }
}

// The SHA1 hasher is used to compute an SHA1 message digest.
class _SHA1 extends _HashBase {
  // Construct a SHA1 hasher object.
  _SHA1() : _w = new List(80), super(16, 5, true) {
    _h[0] = 0x67452301;
    _h[1] = 0xEFCDAB89;
    _h[2] = 0x98BADCFE;
    _h[3] = 0x10325476;
    _h[4] = 0xC3D2E1F0;
  }

  // Returns a new instance of this Hash.
  _SHA1 newInstance() {
    return new _SHA1();
  }

  // Compute one iteration of the SHA1 algorithm with a chunk of
  // 16 32-bit pieces.
  void _updateHash(List<int> m) {
    assert(m.length == 16);

    var a = _h[0];
    var b = _h[1];
    var c = _h[2];
    var d = _h[3];
    var e = _h[4];

    for (var i = 0; i < 80; i++) {
      if (i < 16) {
        _w[i] = m[i];
      } else {
        var n = _w[i - 3] ^ _w[i - 8] ^ _w[i - 14] ^ _w[i - 16];
        _w[i] = _rotl32(n, 1);
      }
      var t = _add32(_add32(_rotl32(a, 5), e), _w[i]);
      if (i < 20) {
        t = _add32(_add32(t, (b & c) | (~b & d)), 0x5A827999);
      } else if (i < 40) {
        t = _add32(_add32(t, (b ^ c ^ d)), 0x6ED9EBA1);
      } else if (i < 60) {
        t = _add32(_add32(t, (b & c) | (b & d) | (c & d)), 0x8F1BBCDC);
      } else {
        t = _add32(_add32(t, b ^ c ^ d), 0xCA62C1D6);
      }

      e = d;
      d = c;
      c = _rotl32(b, 30);
      b = a;
      a = t & _MASK_32;
    }

    _h[0] = _add32(a, _h[0]);
    _h[1] = _add32(b, _h[1]);
    _h[2] = _add32(c, _h[2]);
    _h[3] = _add32(d, _h[3]);
    _h[4] = _add32(e, _h[4]);
  }

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

/**
 * Support for asynchronous programming,
 * with classes such as Future and Stream.
 *
 * For an introduction to asynchronous programming in Dart, see


 "")
	c.LoadBalancer.toINI(lb)

	bs := out.Section("BlockStorage", "")
	c.BlockStorage.toINI(bs)

	for _, name := range slices.Sorted(maps.Keys(c.LoadBalancerClass)) {
		if name == "" {
			continue
		}

		lbClass := out.Section("LoadBalancerClass", name)
		opts, ok := c.LoadBalancerClass[name]
		if !ok {
			continue
		}

		opts.toINI(lbClass)
	}

	buf := &bytes.Buffer{}
	if err := out.Render(buf); err != nil {
		return "", err
	}

	return buf.String(), nil
}

type LoadBalancerOpts struct {
	UseOctavia           *bool
	SubnetID             string
	FloatingNetworkID    string
	LBMethod             string
	LBProvider           string
	CreateMonitor        bool
	MonitorDelay         time.Duration
	MonitorTimeout       time.Duration
	MonitorMaxRetries    uint
	ManageSecurityGroups bool

	EnableIngressHostname *bool
	IngressHostnameSuffix *string
}

func (o *LoadBalancerOpts) toINI(section ini.Section) {
	section.AddBoolKey("manage-security-groups", o.ManageSecurityGroups)
	section.AddStringKey("lb-version", "v2")
	section.AddStringKey("lb-provider", o.LBProvider)
	section.AddStringKey("subnet-id", o.SubnetID)
	section.AddStringKey("floating-network-id", o.FloatingNetworkID)

	method := o.LBMethod
	if method == "" {
		method = defaultLBMethod
	}
	section.AddStringKey("lb-method", method)

	if val := o.UseOctavia; val != nil {
		section.AddBoolKey("use-octavia", *val)
	}

	if enable := o.EnableIngressHostname; enable != nil {
		section.AddBoolKey("enable-ingress-hostname", *enable)

		if suffix := o.IngressHostnameSuffix; suffix != nil {
			section.AddStringKey("ingress-hostname-suffix", *suffix)
		}
	}

	if o.CreateMonitor {
		section.AddBoolKey("create-monitor", true)
		section.AddStringKey("monitor-delay", o.MonitorDelay.String())
		section.AddStringKey("monitor-timeout", o.MonitorTimeout.String())
		section.AddStringKey("monitor-max-retries", strconv.FormatUint(uint64(o.MonitorMaxRetries), 10))
	}
}

type BlockStorageOpts struct {
	BSVersion             string
	TrustDevicePath       bool
	IgnoreVolumeAZ        bool
	NodeVolumeAttachLimit uint
}

func (o *BlockStorageOpts) toINI(section ini.Section) {
	section.AddBoolKey("ignore-volume-az", o.IgnoreVolumeAZ)
	section.AddBoolKey("trust-device-path", o.TrustDevicePath)

	version := o.BSVersion
	if version == "" {
		version = defaultBSVersion
	}
	section.AddStringKey("bs-version", version)

	if limit := o.NodeVolumeAttachLimit; limit != 0 {
		section.AddStringKey("node-volume-attach-limit", strconv.FormatUint(uint64(limit), 10))
	}
}

type GlobalOpts struct {
	AuthURL                     string
	Username                    string
	Password                    string
	ApplicationCredentialID     string
	ApplicationCredentialSecret string
	TenantName                  string
	TenantID                    string
	DomainName                  string
	Region                      string
}

func (o *GlobalOpts) toINI(section ini.Section) {
	section.AddStringKey("auth-url", o.AuthURL)
	section.AddStringKey("region", o.Region)

	if o.ApplicationCredentialID != "" {
		section.AddStringKey("application-credential-id", o.ApplicationCredentialID)
		section.AddStringKey("application-credenti


23:
!$EV trig_pc_d(2,expr(@VA(.MAIN.T2_hwint_723), 16, 16)) -> intp(2, 0, 2d)
T2_hwint_724:
!$EV trig_pc_d(2,expr(@VA(.MAIN.T2_hwint_724), 16, 16)) -> intp(2, 0, 2a)
	.word 0xbfa5c860  ! 5265: FADDq	dis not found

T2_hwint_725:
!$EV trig_pc_d(2,expr(@VA(.MAIN.T2_hwint_725), 16, 16)) -> intp(2, 0, 34)
	.word 0xb5a98820  ! 5269: FMOVNEG	fmovs	%fcc1, %f0, %f26
	.word 0xb83d0000  ! 5270: XNOR_R	xnor 	%r20, %r0, %r28
	.word 0xbd2ce001  ! 5271: SLL_I	sll 	%r19, 0x0001, %r30
	.word 0xbdec4000  ! 5275: RESTORE_R	restore	%r17, %r0, %r30
	.word 0xb3ece050  ! 5279: RESTORE_I	restore	%r19, 0x0001, %r25
T2_hwint_726:
!$EV trig_pc_d(2,expr(@VA(.MAIN.T2_hwint_726), 16, 16)) -> intp(2, 0, 26)
T2_hwint_727:
!$EV trig_pc_d(2,expr(@VA(.MAIN.T2_hwint_727), 16, 16)) -> intp(2, 0, 16)
	.word 0xb5e54000  ! 5283: SAVE_R	save	%r21, %r0, %r26
	.word 0xb1356001  ! 5287: SRL_I	srl 	%r21, 0x0001, %r24
	.word 0xbebdc000  ! 5288: XNORcc_R	xnorcc 	%r23, %r0, %r31
	.word 0xbbe5a12a  ! 5289: SAVE_I	save	%r22, 0x0001, %r29
T2_hwint_728:
!$EV trig_pc_d(2,expr(@VA(.MAIN.T2_hwint_728), 16, 16)) -> intp(2, 0, 39)
T2_hwint_729:
!$EV trig_pc_d(2,expr(@VA(.MAIN.T2_hwint_729), 16, 16)) -> intp(2, 0, 1b)
T2_irf_ce_439:
!$EV error(2,expr(@VA(.MAIN.T2_irf_ce_439), 16, 16),1,IRF,ce,13,39, x,x,x, x,x,x)
	.word 0xb6ada111  ! 5296: ANDNcc_I	andncc 	%r22, 0x0111, %r27
T2_hwint_730:
!$EV trig_pc_d(2,expr(@VA(.MAIN.T2_hwint_730), 16, 16)) -> intp(2, 0, 1e)
	.word 0xbfab0820  ! 5300: FMOVGU	fmovs	%fcc1, %f0, %f31
	.word 0xb5ec0000  ! 5301: RESTORE_R	restore	%r16, %r0, %r26
T2_hwint_731:
!$EV trig_pc_d(2,expr(@VA(.MAIN.T2_hwint_731), 16, 16)) -> intp(2, 0, 10)
	.word 0xb8bde0c6  ! 5303: XNORcc_I	xnorcc 	%r23, 0x00c6, %r28
	.word 0xb1e4a1af  ! 5304: SAVE_I	save


.AreEqual(6.0 , decimal.Parse(testsuiteList[0].Attribute("time").Value, CultureInfo.InvariantCulture));
            Assert.AreEqual(3.0 , decimal.Parse(testsuiteList[1].Attribute("time").Value, CultureInfo.InvariantCulture));
            Assert.AreEqual(20.0, decimal.Parse(testsuiteList[2].Attribute("time").Value, CultureInfo.InvariantCulture));
            Assert.AreEqual(2.0 , decimal.Parse(testsuiteList[3].Attribute("time").Value, CultureInfo.InvariantCulture));
        });
    }
}


,.e-heatmap.e-js.e-grid .e-headercell.e-default.e-headertemplate,.e-heatmap.e-js.e-grid .e-cellselectionbackground .e-activecell,.e-heatmap.e-grid td.e-cellselectionbackground{background-color:#000}.e-content-area{background-color:#111;color:#fff;border-color:#808080;font-family:Segoe UI,Helvetica Neue,Ubuntu,Arial}.e-excelfilter.e-dlgcontainer{font-family:Segoe UI,Helvetica Neue,Ubuntu,Arial;font-weight:normal;font-size:13px;color:#dbdb00;z-index:10001}.e-excelfilter .e-searchcontainer,.e-excelfilter.e-dlgcontainer{background:none #000}.e-excelfilter .e-menu,.e-excelfilter .e-menu.e-vertical,.e-excelfilter .e-menu.e-vertical .e-list>ul{background:#000}.e-excelfilter .e-checkboxlist{background:#121212;border:#121212}.e-excelfilter.e-dlgcontainer,.e-excelfilter.e-dlgcustom .e-fieldset,.e-excelfilter .e-menu.e-vertical .e-list>ul{border-width:1px;border-style:solid;border-color:#000}.e-excelfilter .e-checkboxlist label.e-ftrchk,.e-excelfilter.e-dlgcustom label.e-caption,.e-excelfilter .e-searchbox .e-searchitem{font-weight:normal}.e-sortasc,.e-sortdesc{font-size:18px}.e-excelfilter.e-dlgcustom .e-fieldset legend{font-size:14px;color:#dbdb00;border:none}.e-excelfilter .e-select:hover .e-icon{color:#fff}.e-excelfilter.e-dlgcustom .e-input{line-height:1.7em}.e-excelfilter{-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.e-excelfilter .e-menu .e-list.e-fghdrcolor,.e-excelfilter .e-menu .e-list.e-bghdrcolor,e-excelfilter .e-menu .e-list.e-fghdrcolor.e-mhover.e-mfocused,.e-excelfilter .e-menu .e-list.e-bghdrcolor.e-mhover.e-mfocused,.e-excelfilter .e-menu.e-vertical .e-list.e-fghdrcolor:hover,.e-excelfilter .e-menu.e-vertical .e-list.e-bghdrcolor:hover{background:#000}.e-bghdrcolor>a,.e-fghdrcolor>a{color:#fff}.e-excelfilter .e-menu .e-list.e-valcolor{border-color:#000}.e-excelfilter .e-menu .e-list.e-valcolor.e-mhover.e-mfocused{border-color:#008000;background:transparent}.e-excelfilter .e-menu .e-list.e-fghdrcolor.e-mhover>a,.e-excelfilter .e-menu .e-list.e-fghdrcolor.e-mfocused>a,.e-excelfilter .e-menu .e-list.e-bghdrcolor.e-mhover>a,.e-excelfilter .e-menu .e-list.e-bghdrcolor.e-mfocused>a{background:transparent;color:#fff}.e-content-area{background-color:#111;color:#fff;border-color:#808080;font-family:Segoe UI,


null)
						&&((I.container()==null)
							||((flagLib.isOpenAccessibleContainer(I.container())
								&&(I.container().container()==null)
								&&(flagLib.canBeSeenBy(I.container(), mob)))))
						&&(CMLib.english().containsString(I.name(mob), ID)
							||CMLib.english().containsString(I.displayText(mob), ID))
						&&(flagLib.canBeSeenBy(I, mob)))
						{
							String name = R.getContextName(I);
							if(I.container() != null)
								name += " in " + R.getContextName(I.container());
							things.add("^I"+name+"^?");
						}
					}
					for(final Enumeration<MOB> i=R.inhabitants();i.hasMoreElements();)
					{
						final MOB M = i.nextElement();
						if((M!=null)
						&&(M!=mob)
						&&(CMLib.english().containsString(M.name(mob), ID)
							||CMLib.english().containsString(M.displayText(mob), ID))
						&&(flagLib.canBeSeenBy(M, mob)))
						{
							final String name = R.getContextName(M);
							things.add("^M"+name+"^?");
						}
					}
					for(int d=0;d<Directions.NUM_DIRECTIONS();d++)
					{
						if(R.getRoomInDir(d)!=null)
						{
							final Exit E = R.getExitInDir(d);
							if((E!=null)
							&&(CMLib.english().containsString(E.name(mob), ID)
								||CMLib.english().containsString(E.displayText(mob), ID))
							&&(flagLib.canBeSeenBy(E, mob)))
							{
								final String name = R.getContextName(E);
								things.add("^D"+name+"^?");
							}
						}
					}
				}
				else
				{
					String name = R.getContextName(thisThang);
					if((thisThang != null) && (((Item)thisThang).container() != null))
						name += " in " + R.getContextName(((Item)thisThang).container());
					things.add(name);
				}
				if(things.size()==0)
					mob.tell(L("Nothing like that catches your eye."));
				else
				{
					final String list = CMLib.english().toEnglishStringList(things);
					final CMMsg msg=CMClass.getMsg(mob,null,lookingTool,CMMsg.MSG_GLANCE,L("You spot '@x1'.",list));
					if(R.okMessage(mob, msg))
						R.send(mob, msg);
				}
			}
			else
			if(thisThang!=null)
			{
				String name="at <T-NAMESELF>";
 				if((thisThang instanceof Room)||(thisThang instanceof Exit))
				{
					if(thisThang==R)
						name="around";
					else
					if(dirCode>=0)
						name=CMLib.directions().getDirectionName(dirCode, CMLib.flags().getDirType(R));
				}
				final CMMsg msg=CMClass.getMsg(mob,thisThang,lookingTool,CMMsg.MSG_LOOK,textMsg+name+".");
				if((thisThang instanceof Room)
				&&(mob.isAttributeSet(MOB.Attrib.AUTOEXITS))
				&&(CMProps.getIntVar(CMProps.Int.EXVIEW)!=CMProps.Int.EXVIEW_PARAGRAPH))
				{
					final CMMsg exitMsg=CMClass.getMsg(mob,thisThang,lookingTool,CMMsg.MSG_LOOK_EXITS,null);
					if((CMProps.getIntVar(CMProps.Int.EXVIEW)>=CMProps


from box_embeddings.parameterizations.tf_box_tensor import TFBoxTensor
from .tf_pooling import TFBoxPooler
import tensorflow as tf

def tf_hard_intersection_pooler(
    boxes: TFBoxTensor,
    mask: tf.Tensor = None,
    dim: int = 0,
    keepdim: bool = False,
) -> TFBoxTensor:
    box_z = boxes.z
    box_Z = boxes.Z

    if mask is not None:
        box_z[mask] -= float("inf")
        box_Z[mask] += float("inf")
    z = tf.math.reduce_max(box_z, axis=dim, keepdims=keepdim)[0]
    Z = tf.math.reduce_min(box_Z, axis=dim, keepdims=keepdim)[0]

    return boxes.like_this_from_zZ(z, Z)

@TFBoxPooler.register("hard-intersection")
class TFHardIntersectionBoxPooler(TFBoxPooler):

    """Pools a box tensor using hard intersection operation"""

    def __init__(self, dim: int = 0, keepdim: bool = False):
        super().__init__()  # type:ignore
        self.dim = dim
        self.keepdim = keepdim

    def __call__(  # type:ignore
        self, box_tensor: TFBoxTensor, mask: tf.Tensor = None
    ) -> TFBoxTensor:
        return tf_hard_intersection_pooler(
            box_tensor, mask=mask, dim=self.dim, keepdim=self.keepdim
        )


4,
    0,   /* quantifier_offset */
    offsetof(DbgVmEntry, end),
    NULL,
    NULL,
    0,             /* flags */
    0,NULL,NULL    /* reserved1,reserved2, etc */
  },
  {
    "offset",
    4,
    PROTOBUF_C_LABEL_NONE,
    PROTOBUF_C_TYPE_UINT64,
    0,   /* quantifier_offset */
    offsetof(DbgVmEntry, offset),
    NULL,
    NULL,
    0,             /* flags */
    0,NULL,NULL    /* reserved1,reserved2, etc */
  },
  {
    "protection",
    5,
    PROTOBUF_C_LABEL_NONE,
    PROTOBUF_C_TYPE_INT32,
    0,   /* quantifier_offset */
    offsetof(DbgVmEntry, protection),
    NULL,
    NULL,
    0,             /* flags */
    0,NULL,NULL    /* reserved1,reserved2, etc */
  },
};
static const unsigned dbg_vm_entry__field_indices_by_name[] = {
  2,   /* field[2] = end */
  0,   /* field[0] = name */
  3,   /* field[3] = offset */
  4,   /* field[4] = protection */
  1,   /* field[1] = start */
};
static const ProtobufCIntRange dbg_vm_entry__number_ranges[1 + 1] =
{
  { 1, 0 },
  { 0, 5 }
};
const ProtobufCMessageDescriptor dbg_vm_entry__descriptor =
{
  PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
  "DbgVmEntry",
  "DbgVmEntry",
  "DbgVmEntry",
  "",
  sizeof(DbgVmEntry),
  5,
  dbg_vm_entry__field_descriptors,
  dbg_vm_entry__field_indices_by_name,
  1,  dbg_vm_entry__number_ranges,
  (ProtobufCMessageInit) dbg_vm_entry__init,
  NULL,NULL,NULL    /* reserved[123] */
};
static const ProtobufCFieldDescriptor dbg_process_limited__field_descriptors[3] =
{
  {
    "processId",
    1,
    PROTOBUF_C_LABEL_NONE,
    PROTOBUF_C_TYPE_INT32,
    0,   /* quantifier_offset */
    offsetof(DbgProcessLimited, processid),
    NULL,
    NULL,
    0,             /* flags */
    0,NULL,NULL    /* reserved1,reserved2, etc */
  },
  {
    "name",
    2,
    PROTOBUF_C_LABEL_NONE,
    PROTOBUF_C_TYPE_STRING,
    0,   /* quantifier_offset */
    offsetof(DbgProcessLimited, name),
    NULL,
    &protobuf_c_empty_string,
    0,             /* flags */
    0,NULL,NULL    /* reserved1,reserved2, etc */
  },
  {
    "entries",
    3,
    PROTOBUF_C_LABEL_REPEATED,
    PROTOBUF_C_TYPE_MESSAGE,
    offsetof(DbgProcessLimited, n_entries),
    offsetof(DbgProcessLimited, entries),
    &dbg_vm_entry__descriptor,
    NULL,
    0,             /* flags */
    0,NULL,NULL    /* reserved1,reserved2, etc */
  },
};
static const unsigned dbg_process_limited__field_indices_by_name[] = {
  2,   /* field[2] = entries */
  1,   /* field[1] = name */
  0,   /* field[0] = processId */
};
static const ProtobufCIntRange dbg_process_limited__number_ranges[1 + 1] =
{
  { 1, 0 },
  { 0, 3 }
};
const ProtobufCMessageDescriptor dbg_process_limited__descriptor =
{
  PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
  "DbgProcessLimited",
  "DbgProcessLimited",
  "DbgProcessLimited",
  "",
  sizeof(DbgProcessLimited),
  3,
  dbg_process_limited__field_descriptors,
  dbg_process_limited__field_indices_by_name,
  1,  dbg_process_limited__number_ranges,
  (ProtobufCMessageInit) dbg_process_limited__init,
  NULL,NULL,NULL    /* reserved[123] */
};


{
		*(.rodata*)
		*(.flash_rodata*)
		KEEP(*(.eh_frame*))
		*(.note.gnu.build-id)
	} > FLASH

#ifdef TRACE_STR_SECTION
	.trc_str (.) :
	{
		*(.trc_str*)
	} > FLASH
#endif

	.custom.cmd.table (.) :
	{
		. = ALIGN(4);
		__custom_handler_table_start = .;
		KEEP(*(.custom_handler_table))
		__custom_handler_table_end = .;
	} > FLASH

	.thirdparty.event.table (.) :
	{
		. = ALIGN(4);
		__thirdparty_handler_table_start = .;
		KEEP(*(.thirdparty_handler_table))
		__thirdparty_handler_table_end = .;
	} > FLASH

#if defined(FIRMWARE_REV)
	.firmware_rev (.) :
	{
		. = ALIGN(64);
		*(.fw_rev)
	} > FLASH
#endif

	/* To copy multiple FLASH to RAM sections,
	 * uncomment .copy.table section and,
	 * define __STARTUP_COPY_MULTIPLE in startup_ARMCMx.S */
	/*
	.copy.table (.) :
	{
		. = ALIGN(4);
		__copy_table_start__ = .;
		LONG (__etext)
		LONG (__data_start__)
		LONG (__data_end__ - __data_start__)
		LONG (__etext2)
		LONG (__data2_start__)
		LONG (__data2_end__ - __data2_start__)
		__copy_table_end__ = .;
	} > FLASH
	*/

	/* To clear multiple BSS sections,
	 * uncomment .zero.table section and,
	 * define __STARTUP_CLEAR_BSS_MULTIPLE in startup_ARMCMx.S */
	/*
	.zero.table (.) :
	{
		. = ALIGN(4);
		__zero_table_start__ = .;
		LONG (__bss_start__)
		LONG (__bss_end__ - __bss_start__)
		LONG (__bss2_start__)
		LONG (__bss2_end__ - __bss2_start__)
		__zero_table_end__ = .;
	} > FLASH
	*/

	__etext = .;

	.data : AT (__etext)
	{
		__data_start__ = .;
		*(vtable)
		*(.data*)

		. = ALIGN(4);
		/* preinit data */
		PROVIDE_HIDDEN (__preinit_array_start = .);
		KEEP(*(.preinit_array))
		PROVIDE_HIDDEN (__preinit_array_end = .);

		. = ALIGN(4);
		/* init data */
		PROVIDE_HIDDEN (__init_array_start = .);
		KEEP(*(SORT(.init_array.*)))
		KEEP(*(.init_array))
		PROVIDE_HIDDEN (__init_array_end = .);

		. = ALIGN(4);
		/* finit data */
		PROVIDE_HIDDEN (__fini_array_start = .);
		KEEP(*(SORT(.fini_array.*)))
		KEEP(*(.fini_array))
		PROVIDE_HIDDEN (__fini_array_end = .);

		KEEP(*(.jcr*))
		. = ALIGN(4);
		/* All data end */
		__data_end__ = .;

	} > RAM

	.bss (.) (NOLOAD) :
	{
		. = ALIGN(4);
		__bss_start__ = .;
		*(.bss*)
		*(COMMON)
		. = ALIGN(4);
		__bss_end__ = .;
	} > RAM

	.heap (.) (NOLOAD) :
	{
		. = ALIGN(8);
		__HeapBase = .;
		__end__ = .;
		end = __end__;
		. +


        return dir;
        }
        delete dir;
        return NULL;
    }

    FlipperFile* OpenRead(const char* path) {
        FlipperFile* file = new FlipperFile(storage, path, false);
        if(file->IsOpened()) {
            return file;
        }
        delete file;
        return NULL;
    }

    FlipperFile* OpenRead(const char* dir, const char* file) {
        String concatedPath = String("%s/%s", dir, file);
        return OpenRead(concatedPath.cstr());
    }

    FlipperFile* OpenWrite(const char* path) {
        FlipperFile* file = new FlipperFile(storage, path, true);
        if(file->IsOpened()) {
            return file;
        }
        delete file;
        return NULL;
    }

    FlipperFile* OpenWrite(const char* dir, const char* file) {
        String concatedPath = String("%s/%s", dir, file);
        return OpenWrite(concatedPath.cstr());
    }

    void DeleteFile(const char* dir, const char* file) {
        String concatedPath = String("%s/%s", dir, file);
        DeleteFile(concatedPath.cstr());
    }

    void DeleteFile(const char* filePath) {
        storage_common_remove(storage, filePath);
    }

    ~FileManager() {
        furi_record_close(RECORD_STORAGE);
    }
};
#pragma once

#include <toolbox/path.h>
#include <storage/storage.h>

class Directory {
private:
    bool isOpened;
    Storage* storage;
    File* dir;

public:
    Directory(Storage* storage, const char* dirPath) {
        this->storage = storage;
        dir = storage_file_alloc(storage);
        isOpened = storage_dir_open(dir, dirPath);
    }

    bool IsOpened() {
        return isOpened;
    }

    void Rewind() {
        if(isOpened) {
            storage_dir_rewind(dir);
        }
    }

    bool GetNextFile(char* name, uint16_t nameLength) {
        if(!isOpened) {
            return false;
        }

        FileInfo fileInfo = FileInfo();
        do {
            if(!storage_dir_read(dir, &fileInfo, name, nameLength)) {
                return false;
            }
        } while((fileInfo.flags & FSF_DIRECTORY) > 0); // dir

        return true;
    }

    bool GetNextDir(char* name, uint16_t nameLength) {
        if(!isOpened) {
            return false;
        }

        FileInfo fileInfo = FileInfo();
        do {
            if(!storage_dir_read(dir, &fileInfo, name, nameLength)) {
                return false;
            }
        } while((fileInfo.flags & FSF_DIRECTORY) == 0); // not dir

        return true;
    }

    ~Directory() {
        storage_dir_close(dir);
        storage_file_free(dir);
    }
};
#pragma once

#include <furi.h>
#include <gui/gui.h>
#include <gui/elements.h>

#include "UiView.hpp"
#include "lib/String.hpp"

#undef LOG_TAG
#define LOG_TAG "UI_ADV_SUBMENU"

using namespace std;

// Inspired by https://github.com/flipperdevices/flipperzero-firmware/blob/dev/applications/main/subghz/views/receiver.c

#define FRAME_HEIGHT    12
#define ITEMS_ON_SCREEN 4

class ColumnOrientedListUiView : public UiView {
private:
    View* view = NULL;
    const char* noElementsCapton = NULL;

    const char* leftButtonCaption = NULL;
    const char* ceneterButtonCaption = NULL;
    const


p_uvec2',['../a00282.html#ga752ee45136011301b64afd8c310c47a4',1,'glm']]],
  ['lowp_5fuvec3',['lowp_uvec3',['../a00282.html#ga7b2efbdd6bdc2f8250c57f3e5dc9a292',1,'glm']]],
  ['lowp_5fuvec4',['lowp_uvec4',['../a00282.html#ga5e6a632ec1165cf9f54ceeaa5e9b2b1e',1,'glm']]],
  ['lowp_5fvec1',['lowp_vec1',['../a00271.html#ga0a57630f03031706b1d26a7d70d9184c',1,'glm']]],
  ['lowp_5fvec2',['lowp_vec2',['../a00282.html#ga30e8baef5d56d5c166872a2bc00f36e9',1,'glm']]],
  ['lowp_5fvec3',['lowp_vec3',['../a00282.html#ga868e8e4470a3ef97c7ee3032bf90dc79',1,'glm']]],
  ['lowp_5fvec4',['lowp_vec4',['../a00282.html#gace3acb313c800552a9411953eb8b2ed7',1,'glm']]]
];
function toggleVisibility(linkObj)
{
 var base = $(linkObj).attr('id');
 var summary = $('#'+base+'-summary');
 var content = $('#'+base+'-content');
 var trigger = $('#'+base+'-trigger');
 var src=$(trigger).attr('src');
 if (content.is(':visible')===true) {
   content.hide();
   summary.show();
   $(linkObj).addClass('closed').removeClass('opened');
   $(trigger).attr('src',src.substring(0,src.length-8)+'closed.png');
 } else {
   content.show();
   summary.hide();
   $(linkObj).removeClass('closed').addClass('opened');
   $(trigger).attr('src',src.substring(0,src.length-10)+'open.png');
 }
 return false;
}

function updateStripes()
{
  $('table.directory tr').
       removeClass('even').filter(':visible:even').addClass('even');
}

function toggleLevel(level)
{
  $('table.directory tr').each(function() {
    var l = this.id.split('_').length-1;
    var i = $('#img'+this.id.substring(3));
    var a = $('#arr'+this.id.substring(3));
    if (l<level+1) {
      i.removeClass('iconfopen iconfclosed').addClass('iconfopen');
      a.html('▼');
      $(this).show();
    } else if (l==level+1) {
      i.removeClass('iconfclosed iconfopen').addClass('iconfclosed');
      a.html('►');
      $(this).show();
    } else {
      $(this).hide();
    }
  });
  updateStripes();
}

function toggleFolder(id)
{
  // the clicked row
  var currentRow = $('#row_'+id);

  // all rows after the clicked row
  var rows = currentRow.nextAll("tr");

  var re = new RegExp('^row_'+id+'\\d+_$', "i"); //only one sub

  // only match elements AFTER this one (can't hide elements before)
  var childRows = rows.filter(function() { return this.id.match(re); });

  // first row is visible we are HIDING
  if (childRows.filter(':first').is(':visible')===true) {
    // replace down arrow by right arrow for current row
    var currentRowSpans = currentRow.find("span");
    currentRowSpans.filter(


 = "";
			this.inputTextFinal = "";
		}

		// change recovery questions
		yFromTopDistance += 15;
		if (this.mouseX > var6 && this.mouseX < var5 + var6 && this.mouseY > yFromTopDistance - 12 && this.mouseY < yFromTopDistance + 4
			&& mouseButtonClick == 1) {
			this.packetHandler.getClientStream().newPacket(197);
			this.packetHandler.getClientStream().finishPacket();
		}

		// change contact details
		yFromTopDistance += 15;
		if (this.mouseX > var6 && this.mouseX < var5 + var6 && this.mouseY > yFromTopDistance - 12 && this.mouseY < yFromTopDistance + 4
			&& mouseButtonClick == 1) {
			this.packetHandler.getClientStream().newPacket(247);
			this.packetHandler.getClientStream().finishPacket();
		}

		// divider
		yFromTopDistance += 3 * 15 + 5;
		boolean var11 = false;

		// block chat toggle
		if (this.mouseX > var6 && this.mouseX < var5 + var6 && this.mouseY > yFromTopDistance - 12
			&& 4 + yFromTopDistance > this.mouseY && this.mouseButtonClick == 1) {
			this.settingsBlockChat = ++this.settingsBlockChat %3;
			var11 = true;
		}

		// plock private toggle
		yFromTopDistance += 15;
		if (this.mouseX > var6 && var5 + var6 > this.mouseX && this.mouseY > yFromTopDistance - 12
			&& yFromTopDistance + 4 > this.mouseY && this.mouseButtonClick == 1) {
			this.settingsBlockPrivate = ++this.settingsBlockPrivate %3;
			var11 = true;
		}

		// block trade toggle
		yFromTopDistance += 15;
		if (this.mouseX > var6 && this.mouseX < var6 + var5 && yFromTopDistance - 12 < this.mouseY
			&& this.mouseY < 4 + yFromTopDistance && this.mouseButtonClick == 1) {
			this.settingsBlockTrade = ++this.settingsBlockTrade %3;
			var11 = true;
		}

		// block duel toggle
		yFromTopDistance += 15;
		if (wantMembers() && this.mouseX > var6 && this.mouseX < var6 + var5
			&& yFromTopDistance - 12 < this.mouseY && this.mouseY < yFromTopDistance + 4 && this.mouseButtonClick == 1) {
			var11 = true;
			this.settingsBlockDuel = ++this.settingsBlockDuel %3;
		}

		// adjusts the menu slightly to accommodate the skip link below
		yFromTopDistance += 20;
		if (var11) {
			this.createPacket64(this.settingsBlockChat, this.settingsBlockPrivate,
				this.settingsBlockTrade, this.settingsBlockDuel);
		}

		// skip tutorial button or exit blackhole button
		if (this.insideTutorial) { // tutorial menu option
			if (this.mouseX > var6 && var5 + var6 > this.mouseX && yFromTopDistance - 12 < this.mouseY
				&& this.mouseY < yFromTopDistance + 4 && this.mouseButtonClick == 1) {
				this.showItemModX(InputXPrompt.promptSkipTutorial, InputXAction.SKIP_TUTORIAL, false);
				if (!C_CUSTOM_UI)
					this.showUiTab = 0;
			}
			yFromTopDistance += 20;
		} else if (this.insideBlackHole) { // blackhole menu option
			if (this.mouseX > var6 && var5 + var6 > this.mouseX && yFromTopDistance - 12 < this.mouseY
				&& this.mouseY < yFromTopD


former implements ViewPager.PageTransformer {

        @Override
        public void transformPage(View page, float position) {
            if (position < -1) {
                page.setAlpha(1);
            } else if (position <= 0) {
                //ViewPager正在滑动时，页面左边的View       -1～0
                page.setAlpha(1);
                page.setTranslationX(0);
                page.setScaleX(1);
                page.setScaleY(1);
            } else if (position <= 1) {
                //ViewPager正在滑动时，页面右边的View       0～1
                page.setAlpha(1 - position);
                page.setTranslationX(0);
                page.setScaleX((float) (1 - position * 0.8));
                page.setScaleY((float) (1 - position * 0.8));
            } else {
                page.setAlpha(1);
            }
        }
    }

    private LinearLayout.LayoutParams params;

    //初始化数据
    public void addContent(View view) {
        if (params == null) {
            params = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
            params.setMargins(DEFAULT_DOT_SPAN, DEFAULT_DOT_SPAN, DEFAULT_DOT_SPAN, DEFAULT_DOT_SPAN);
        }
        Dot dot = new Dot(getContext());
        dots.add(dot);
        ll_dots.addView(dot, params);
        views.add(view);
        adapter.notifyDataSetChanged();
        mViewPager.setCurrentItem(views.size() * 1024);
        refreshDots(0);
    }

    public void addContentList(List<View> viewList) {
        if (viewList == null || viewList.size() == 0) {
            return;
        }
        if (params == null) {
            params = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
            params.setMargins(5, 5, 5, 5);
        }
        for (View view : viewList) {
            Dot dot = new Dot(getContext());
            dots.add(dot);
            ll_dots.addView(dot, params);
            views.add(view);
            adapter.notifyDataSetChanged();
            mViewPager.setCurrentItem(views.size() * 1024);
            refreshDots(0);
        }
    }

    private void refreshDots(int position_in_data) {
        for (Dot dot : dots) {
            dot.setDotColor(UNSELECTED_DOT_COLOR);
        }
        dots.get(position_in_data).setDotColor(SELECTED_DOT_COLOR);
    }

    @Override
    public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {

    }

    @Override
    public void onPageSelected(int position) {
        int position_in_data = position % views.size();
        refreshDots(position_in_data);
    }

    @Override
    public void onPageScrollStateChanged(int state) {

    }

    //定义Dot类，可以表示当前viewpager处于第几个页面
    private class Dot extends View {

        private Paint dotPaint;
        private int dotColor = UNSELECTED_DOT_COLOR;

        public Dot(Context context) {
            super(context);

            dotPaint = new Paint();
            dotPaint.setAntiAlias(true);
            dotPaint.setDither(true);
            dotPaint.setStyle(Paint.Style.FILL);
        }

        @Override
        protected void onDraw(Canvas canvas) {
            dotPaint.setColor(dotColor);
            canvas.drawCircle(getWidth() / 2, getHeight() / 2, getWidth() / 2, dotPaint);
        }

        //这一步的作用是把dot的宽度和高度定�


        toggleOffOnRegex("([ \\t]+//#if[\\s\\S]*?[ \\t]+//#endif)")
        customKtlint()
    }
    java {
        target("**/src/*/java/**/*.java")
        // disable formatting between `//#if` and `//#endif` including any space in front of them
        toggleOffOnRegex("([ \\t]*//#if[\\s\\S]*?[ \\t]*//#endif)")
        // TODO: importOrder()
        removeUnusedImports()
        eclipse("4.31").configFile("eclipse-prefs.xml")
        formatAnnotations()
    }
}

tasks.register("buildAndGather") {
    subprojects {
        dependsOn(project.tasks.named("build").get())
    }
    doFirst {
        println("Gathering builds")

        fun buildLibs(p: Project) = p.layout.buildDirectory.get().asFile.toPath().resolve("libs")
        delete(
            fileTree(buildLibs(rootProject)) {
                include("*")
            },
        )
        subprojects {
            if (!project.name.endsWith("-common")) {
                copy {
                    from(buildLibs(project)) {
                        include("*.jar")
                        exclude("*-dev.jar", "*-sources.jar")
                    }
                    into(buildLibs(rootProject))
                    duplicatesStrategy = DuplicatesStrategy.INCLUDE
                }
            }
        }
    }
}
package de.rubixdev.inventorio.slot

import de.rubixdev.inventorio.api.ToolBeltSlotTemplate
import de.rubixdev.inventorio.player.PlayerInventoryAddon
import de.rubixdev.inventorio.util.*
import kotlin.math.min
import net.minecraft.item.ItemStack
import net.minecraft.screen.slot.Slot

open class ToolBeltSlot(private val template: ToolBeltSlotTemplate, private val inventoryAddon: PlayerInventoryAddon, index: Int, x: Int, y: Int) : Slot(inventoryAddon, index, x, y) {
    override fun canInsert(stack: ItemStack): Boolean {
        return template.test(stack, inventoryAddon)
    }

    companion object {
        fun getGuiPosition(deepPocketsRows: Int, index: Int, totalCount: Int): Rectangle {
            val columnCapacity = getColumnCapacity(deepPocketsRows)
            val heightOffset = 177 - min(totalCount, columnCapacity) * SLOT_UI_SIZE + DEEP_POCKETS_EXTRA_HEIGHT(deepPocketsRows)
            val relativeIndex = index % columnCapacity
            return Rectangle(
                173 + (index / columnCapacity) * SLOT_UI_SIZE,
                heightOffset + (relativeIndex - 1) * SLOT_UI_SIZE,
                18,
                90,
            )
        }

        fun getSlotPosition(deepPocketsRows: Int, index: Int, totalCount: Int): Rectangle {
            val guiPos = getGuiPosition(deepPocketsRows, index, totalCount)
            return Rectangle(guiPos.x + 1, guiPos.y + 1, guiPos.width, guiPos.height)
        }

        fun getColumnCapacity(deepPocketsRows: Int): Int {
            return 6 + deepPocketsRows
        }
    }
}
package de.rubixdev.inventorio.player.inventory

import de.rubixdev.inventorio.config.GlobalSettings
import de.rubixdev.inventorio.config.PlayerSettings
import de.rubixdev.inventorio.packet.InventorioNetworking
import de.rubixdev.inventorio.player.PlayerInventoryAddon.Companion.inventoryAddon
import de.rubixdev.inventorio.util.isNotEmpty
import net.minecraft.entity.player.PlayerEntity
import net.minecraft.entity.player.PlayerInventory
import net.minecraft.item.ItemStack
import net.minecraft.util.Util

abstract class PlayerInventoryHandFeatures protected constructor(player: PlayerEntity) : PlayerInventoryInjects(player) {
    var displayToolTimeStamp = 0L
        protected set


/* -*- c++ -*- ----------------------------------------------------------
   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
   https://www.lammps.org/, Sandia National Laboratories
   LAMMPS development team: developers@lammps.org

   Copyright (2003) Sandia Corporation.  Under the terms of Contract
   DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
   certain rights in this software.  This software is distributed under
   the GNU General Public License.

   See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */

#ifdef NPAIR_CLASS
// clang-format off
NPairStyle(skip/half/respa,
           NPairSkipRespa,
           NP_SKIP | NP_RESPA | NP_HALF | NP_FULL |
           NP_NSQ | NP_BIN | NP_MULTI | NP_MULTI_OLD |
           NP_NEWTON | NP_NEWTOFF | NP_ORTHO | NP_TRI);
// clang-format on
#else

#ifndef LMP_NPAIR_SKIP_RESPA_H
#define LMP_NPAIR_SKIP_RESPA_H

#include "npair.h"

namespace LAMMPS_NS {

class NPairSkipRespa : public NPair {
 public:
  NPairSkipRespa(class LAMMPS *);
  void build(class NeighList *) override;
};

}    // namespace LAMMPS_NS

#endif
#endif


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

import 'dart:typed_data';
import 'dart:io' as io;

import 'package:path/path.dart' as path;

import 'package:flat_buffers/flat_buffers.dart';
import 'package:test/test.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';

import './monster_test_my_game.example_generated.dart' as example;

main() {
  defineReflectiveSuite(() {
    defineReflectiveTests(BuilderTest);
    defineReflectiveTests(CheckOtherLangaugesData);
    defineReflectiveTests(GeneratorTest);
  });
}

int indexToField(int index) {
  return (1 + 1 + index) * 2;
}

@reflectiveTest
class CheckOtherLangaugesData {
  test_cppData() async {
    List<int> data = await new io.File(path.join(
      path.dirname(io.Platform.script.path),
      'monsterdata_test.mon',
    )).readAsBytes();
    example.Monster mon = new example.Monster(data);
    expect(mon.hp, 80);
    expect(mon.mana, 150);
    expect(mon.name, 'MyMonster');
    expect(mon.pos.x, 1.0);
    expect(mon.pos.y, 2.0);
    expect(mon.pos.z, 3.0);
    expect(mon.pos.test1, 3.0);
    expect(mon.pos.test2.value, 2.0);
    expect(mon.pos.test3.a, 5);
    expect(mon.pos.test3.b, 6);
    expect(mon.testType.value, example.AnyTypeId.Monster.value);
    expect(mon.test is example.Monster, true);
    final monster2 = mon.test as example.Monster;
    expect(monster2.name, "Fred");

    expect(mon.inventory.length, 5);
    expect(mon.inventory.reduce((cur, next) => cur + next), 10);
    expect(mon.test4.length, 2);
    expect(
        mon.test4[0].a + mon.test4[0].b + mon.test4[1].a + mon.test4[1].b, 100);
    expect(mon.testarrayofstring.length, 2);
    expect(mon.testarrayofstring[0], "test1");
    expect(mon.testarrayofstring[1], "test2");

    // this will fail if accessing any field fails.
    expect(
      mon.toString(),
      'Monster{'
      'pos: Vec3{x: 1.0, y: 2.0, z: 3.0, test1: 3.0, test2: Color{value: 2}, test3: Test{a: 5, b: 6}}, '
      'mana: 150, hp: 80, name: MyMonster, inventory: [0, 1, 2, 3, 4], '
      'color: Color{value: 8}, testType: AnyTypeId{value: 1}, '
      'test: Monster{pos: null, mana: 150, hp: 100, name: Fred, '
      'inventory: null, color: Color{value: 8}, testType: AnyTypeId{value: 0}, '
      'test: null, test4: null, testarrayofstring: null, '
      'testarrayoftables: null, enemy: null, testnestedflatbuffer: null, '
      'testempty: null, testbool: false, testhashs32Fnv1: 0, '
      'testhashu32Fnv1: 0, testhashs64Fnv1: 0, testhashu64Fnv1: 0, '
      'testhashs32Fnv1a: 0, testhashu32Fnv1a: 0, testhashs64Fnv1a: 0, '
      'testhashu64Fnv1a: 0, testarrayofbools: null, testf: 3.14159, '
      'testf2: 3.0, testf3: 0.0, testarrayofstring2: null, '
      'testarrayofsortedstruct: null, flex: null, test5: null, '
      'vectorOfLongs: null, vectorOfDoubles: null, parentNamespaceTest: null, '
      'vectorOfReferrables: null, singleWeakReference: 0, '
      'vectorOfWeakReferences: null, vectorOfStrongReferrables: null, '
      'coOwningReference: 0, vectorOfCoOwningReferences: null, '
      'nonOwningReference: 0, vectorOfNonOwningReferences: null, '
      'anyUniqueType: AnyUniqueAliasesTypeId{value: 0}, anyUnique


"""
Guardrail Manager cho Chat Workflow
Tích hợp và quản lý tất cả guardrail rules với LLM-powered analysis
"""

from typing import Dict, Any, List, Optional
from datetime import datetime
from .core import GuardrailEngine, GuardrailResult
from .llm_guardrail import LLMGuardrailEngine
from .input_guardrails import (
	ProfanityGuardrail,
	SpamGuardrail,
	LengthGuardrail,
	PersonalInfoGuardrail,
	InjectionGuardrail,
	EnterViuContextGuardrail,
)
from .output_guardrails import (
	HallucinationGuardrail,
	FactualityGuardrail,
	ToxicityGuardrail,
	BrandSafetyGuardrail,
	ResponseQualityGuardrail,
	EnterViuConsistencyGuardrail,
)
from ..utils.color_logger import get_color_logger, Colors

# TODO: Consider using external color_logger module
# from ..utils.color_logger import get_color_logger, Colors

# Initialize colorful logger
color_logger = get_color_logger(__name__)

class ChatWorkflowGuardrailManager:
	"""Manager chính cho tất cả guardrail trong Chat Workflow với LLM-powered analysis."""

	def __init__(self, config: Dict[str, Any] = None):
		"""
		Initialize guardrail manager

		Args:
		    config: Configuration dictionary với các options:
		        - enable_input_guardrails: bool (default True)
		        - enable_output_guardrails: bool (default True)
		        - enable_llm_guardrails: bool (default True)
		        - use_llm_only: bool (default False) - Chỉ dùng LLM guardrails
		        - max_input_length: int (default 5000)
		        - strict_mode: bool (default False)
		        - model_name: str (default 'gemini-2.0-flash-lite')
		"""
		self.config = config or {}

		# Cấu hình mặc định
		self.enable_input_guardrails = self.config.get('enable_input_guardrails', True)
		self.enable_output_guardrails = self.config.get('enable_output_guardrails', True)
		self.enable_llm_guardrails = self.config.get('enable_llm_guardrails', True)
		self.use_llm_only = self.config.get('use_llm_only', False)
		self.max_input_length = self.config.get('max_input_length', 5000)
		self.strict_mode = self.config.get('strict_mode', False)
		self.model_name = self.config.get('model_name', 'gemini-2.0-flash-lite')

		# Initialize appropriate engine
		if self.enable_llm_guardrails:
			self.engine = LLMGuardrailEngine(enable_llm_guardrails=True, model_name=self.model_name)
			color_logger.info(
				f'🧠 {Colors.BOLD}LLM GUARDRAIL MANAGER:{Colors.RESET} Initialized with AI-powered protection',
				Colors.BRIGHT_GREEN,
				llm_enabled=True,
				model=self.model_name,
				use_llm_only=self.use_llm_only,
			)
		else:
			self.engine = GuardrailEngine()
			color_logger.info(
				f'🛡 {Colors.BOLD}TRADITIONAL GUARDRAIL MANAGER:{Colors.RESET} Initialized with rule-based protection',
				Colors.BRIGHT_BLUE,
				llm_enabled=False,
			)

		# Setup additional guardrails if not LLM-only mode
		if not self.use_llm_only:
			self._setup_traditional_guardrails()

	def _setup_traditional_guardrails(self):
		"""Setup traditional rule-based guardrail rules as backup/complement."""

		if self.enable_input_guardrails:
			# Input guardrails (as backup or complement to LLM)
			self.engine.add_input_guardrail(ProfanityGuardrail())
			self.engine.add_input_guardrail(SpamGuardrail())
			self.engine.add_input_guardrail(LengthGuardrail(max_length=self.max_input_length))
			self.engine.add_input_guardrail(PersonalInfoGuardrail())
			self.engine.add_input_guardrail(InjectionGuardrail())
			self.engine.add_input_guardrail(EnterViuContextGuardrail())

		if self.enable_output_guardrails:
			# Output guardrails (as backup or complement to LLM)
			self.engine.add_output_guardrail(HallucinationGuardrail())
			self.engine.add_output_guardrail(FactualityGuardrail())
			self.engine.add_output_guardrail(ToxicityGuardrail())
			self.engine.add_output_guardrail(BrandSafetyGuardrail())
			self.engine.add_output_guardrail(ResponseQualityGuardrail())
			self.engine.add_output_guardrail(EnterViuConsistencyGuardrail())

	def check_user_input(self, user_input: str, context: Dict[str, Any] = None) -> GuardrailResult:
		"""
		Kiểm tra input từ user với LLM-powered analysis

		Args:
		    user_input: Input từ user
		    context: Context thêm (user_id, conversation_id, etc.)

		Returns:
		    GuardrailResult với thông tin vi phạm và content đã sửa đổi (nếu có)
		"""
		if not self.enable_input_guardrails:
			return GuardrailResult(passed=True, violations=[])

		# Enhanced context for LLM analysis
		enhanced_context = context or {}
		enhanced_context.update({
			'analysis_type': 'input',
			'strict_mode': s


porterStatusAGENTSTATUSDONE captures enum value "AGENT_STATUS_DONE"
	GetAgentOKBodyPostgresExporterStatusAGENTSTATUSDONE string = "AGENT_STATUS_DONE"

	// GetAgentOKBodyPostgresExporterStatusAGENTSTATUSUNKNOWN captures enum value "AGENT_STATUS_UNKNOWN"
	GetAgentOKBodyPostgresExporterStatusAGENTSTATUSUNKNOWN string = "AGENT_STATUS_UNKNOWN"
)

// prop value enum
func (o *GetAgentOKBodyPostgresExporter) validateStatusEnum(path, location string, value string) error {
	if err := validate.EnumCase(path, location, value, getAgentOkBodyPostgresExporterTypeStatusPropEnum, true); err != nil {
		return err
	}
	return nil
}

func (o *GetAgentOKBodyPostgresExporter) validateStatus(formats strfmt.Registry) error {
	if swag.IsZero(o.Status) { // not required
		return nil
	}

	// value enum
	if err := o.validateStatusEnum("getAgentOk"+"."+"postgres_exporter"+"."+"status", "body", *o.Status); err != nil {
		return err
	}

	return nil
}

var getAgentOkBodyPostgresExporterTypeLogLevelPropEnum []interface{}

func init() {
	var res []string
	if err := json.Unmarshal([]byte(`["LOG_LEVEL_UNSPECIFIED","LOG_LEVEL_FATAL","LOG_LEVEL_ERROR","LOG_LEVEL_WARN","LOG_LEVEL_INFO","LOG_LEVEL_DEBUG"]`), &res); err != nil {
		panic(err)
	}
	for _, v := range res {
		getAgentOkBodyPostgresExporterTypeLogLevelPropEnum = append(getAgentOkBodyPostgresExporterTypeLogLevelPropEnum, v)
	}
}

const (

	// GetAgentOKBodyPostgresExporterLogLevelLOGLEVELUNSPECIFIED captures enum value "LOG_LEVEL_UNSPECIFIED"
	GetAgentOKBodyPostgresExporterLogLevelLOGLEVELUNSPECIFIED string = "LOG_LEVEL_UNSPECIFIED"

	// GetAgentOKBodyPostgresExporterLogLevelLOGLEVELFATAL captures enum value "LOG_LEVEL_FATAL"
	GetAgentOKBodyPostgresExporterLogLevelLOGLEVELFATAL string = "LOG_LEVEL_FATAL"

	// GetAgentOKBodyPostgresExporterLogLevelLOGLEVELERROR captures enum value "LOG_LEVEL_ERROR"
	GetAgentOKBodyPostgresExporterLogLevelLOGLEVELERROR string = "LOG_LEVEL_ERROR"

	// GetAgentOKBodyPostgresExporterLogLevelLOGLEVELWARN captures enum value "LOG_LEVEL_WARN"
	GetAgentOKBodyPostgresExporterLogLevelLOGLEVELWARN string = "LOG_LEVEL_WARN"

	// GetAgentOKBodyPostgresExporterLogLevelLOGLEVELINFO captures enum value "LOG_LEVEL_INFO"
	GetAgentOKBodyPostgresExporterLogLevelLOGLEVELINFO string = "LOG_LEVEL_INFO"

	// GetAgentOKBodyPostgresExporterLogLevelLOGLEVELDEBUG captures enum value "LOG_LEVEL_DEBUG"
	GetAgentOKBodyPostgresExporterLogLevelLOGLEVELDEBUG string = "LOG_LEVEL_DEBUG"
)

// prop value enum
func (o *GetAgentOKBodyPostgresExporter) validateLogLevelEnum(path, location string, value string) error {
	if err := validate.EnumCase(path, location, value, getAgentOkBodyPostgresExporterTypeLogLevelPropEnum, true); err != nil {
		return err
	}
	return nil
}

func (o *GetAgentOKBodyPostgresExporter) validateLogLevel(formats strfmt.Registry) error {
	if swag.IsZero(o.LogLevel) { // not required
		return nil
	}

	// value enum
	if err := o.validateLogLevelEnum("getAgentOk"+"."+"postgres_exporter"+"."+"log_level", "body", *o.LogLevel); err != nil {
		return err
	}

	return nil
}

func (o *GetAgentOKBodyPostgresExporter) validateMetricsResolutions(formats strfmt.Registry) error {
	if swag.IsZero(o.MetricsResolutions) { // not required
		return nil
	}

	if o.MetricsR


ormHead
	 */
	private void refreshFormFieldOrderNum(CgFormHeadEntity cgFormHead) {
		Collections.sort(cgFormHead.getColumns(),new FieldNumComparator());
		for(int i = 0;i<cgFormHead.getColumns().size();i++){
			cgFormHead.getColumns().get(i).setOrderNum(i+1);
		}
	}

	/**
	 * 判断这个表格是不是已经存在
	 *
	 * @param cgFormHead
	 * @param oldTable
	 * @return
	 */
	private CgFormHeadEntity judgeTableIsNotExit(CgFormHeadEntity cgFormHead, CgFormHeadEntity oldTable,StringBuffer msg) {
		String message = "";
		CgFormHeadEntity table = cgFormFieldService.findUniqueByProperty(CgFormHeadEntity.class, "tableName",cgFormHead.getTableName());
		if (StringUtil.isNotEmpty(cgFormHead.getId())) {
			if(table != null && !oldTable.getTableName().equals(cgFormHead.getTableName())){
				message = "重命名的表已经存在";
				table = null;
			}else{
				if(table == null){//重命名了表
					cgFormHead.setIsDbSynch("N");
				}
				table = table == null?oldTable:table;
				try {
					MyBeanUtils.copyBeanNotNull2Bean(cgFormHead, table);
				} catch (Exception e) {
					e.printStackTrace();
				}
				message = "修改成功";
			}
		} else {
			message = table != null? "表已经存在":"创建成功";
		}
		msg.append(message);
		return table;
	}

	/**
	 * 自动生成表属性列表页面跳转
	 *
	 * @return
	 */
	@RequestMapping(params = "addorupdate")
	public ModelAndView addorupdate(CgFormHeadEntity cgFormHead,
			HttpServletRequest req) {
		if (StringUtil.isNotEmpty(cgFormHead.getId())) {
			cgFormHead = cgFormFieldService.getEntity(
					CgFormHeadEntity.class, cgFormHead.getId());
			//停用jform这个前缀
			//cgFormHead.setTableName(cgFormHead.getTableName().replace(CgAutoListConstant.jform_, ""));
			req.setAttribute("cgFormHeadPage", cgFormHead);
		}

		List<TSType> typeList = ResourceUtil.allTypes.get(MutiLangUtil.getMutiLangInstance().getLang("bdfl"));
		req.setAttribute("typeList", typeList);

		return new ModelAndView("jeecg/cgform/config/cgFormHead");
	}
	/**
	 * 获取表格具体的属性列
	 *
	 * @return
	 */
	@RequestMapping(params = "getColumnList")
	@ResponseBody
	public List<CgFormFieldEntity> getColumnList(CgFormHeadEntity cgFormHead,String type,
			HttpServletRequest req) {

		List<CgFormFieldEntity> columnList = new ArrayList<CgFormFieldEntity>();
		if (StringUtil.isNotEmpty(cgFormHead.getId())) {
			CriteriaQuery cq = new CriteriaQuery(CgFormFieldEntity.class);
			cq.eq("table.id", cgFormHead.getId());
			cq.add();
			columnList = cgFormFieldService
					.getListByCriteriaQuery(cq, false);
			//对字段列按顺序排序
			Collections.sort(columnList,new FieldNumComparator());
		}else{
//			CgFormFieldEntity field = new CgFormFieldEntity();
//			field.setFieldName("id");
//			field.setLength(36);
//			field.setContent("主键");
//			field.setIsKey("Y");
//			field.setIsNull("N");
//			field.setOrderNum(1);
//			field.setType("string");
//			field.setPointLength(0);
//			field.setIsShow("N");
//			field.setIsShowList("N");
//			field.setFieldLength(120);
//			columnList.add(field);
			columnList=getInitDataList();
		}
		return columnList;
	}

	/**


isplay-#{$display} {
    @include font-size($font-size);
    font-weight: $display-font-weight;
    line-height: $display-line-height;
  }
}

//
// Emphasis
//
.small {
  @extend small;
}

.mark {
  @extend mark;
}

//
// Lists
//

.list-unstyled {
  @include list-unstyled();
}

// Inline turns list items into inline-block
.list-inline {
  @include list-unstyled();
}
.list-inline-item {
  display: inline-block;

  &:not(:last-child) {
    margin-right: $list-inline-padding;
  }
}

//
// Misc
//

// Builds on `abbr`
.initialism {
  @include font-size($initialism-font-size);
  text-transform: uppercase;
}

// Blockquotes
.blockquote {
  margin-bottom: $blockquote-margin-y;
  @include font-size($blockquote-font-size);

  > :last-child {
    margin-bottom: 0;
  }
}

.blockquote-footer {
  margin-top: -$blockquote-margin-y;
  margin-bottom: $blockquote-margin-y;
  @include font-size($blockquote-footer-font-size);
  color: $blockquote-footer-color;

  &::before {
    content: "\2014\00A0"; // em dash, nbsp
  }
}
// Bootstrap functions
//
// Utility mixins and functions for evaluating source code across our variables, maps, and mixins.

// Ascending
// Used to evaluate Sass maps like our grid breakpoints.
@mixin _assert-ascending($map, $map-name) {
  $prev-key: null;
  $prev-num: null;
  @each $key, $num in $map {
    @if $prev-num == null or unit($num) == "%" or unit($prev-num) == "%" {
      // Do nothing
    } @else if not comparable($prev-num, $num) {
      @warn "Potentially invalid value for #{$map-name}: This map must be in ascending order, but key '#{$key}' has value #{$num} whose unit makes it incomparable to #{$prev-num}, the value of the previous key '#{$prev-key}' !";
    } @else if $prev-num >= $num {
      @warn "Invalid value for #{$map-name}: This map must be in ascending order, but key '#{$key}' has value #{$num} which isn't greater than #{$prev-num}, the value of the previous key '#{$prev-key}' !";
    }
    $prev-key: $key;
    $prev-num: $num;
  }
}

// Starts at zero
// Used to ensure the min-width of the lowest breakpoint starts at 0.
@mixin _assert-starts-at-zero($map, $map-name: "$grid-breakpoints") {
  @if length($map) > 0 {
    $values: map-values($map);
    $first-value: nth($values, 1);
    @if $first-value != 0 {
      @warn "First breakpoint in #{$map-name} must start at 0, but starts at #{$first-value}.";
    }
  }
}

// Internal Bootstrap function to turn maps into its negative variant.
// It prefixes the keys with `n` and makes the value negative.
@function negativify-map($map) {
  $result: ();
  @each $key, $value in $map {
    @if $key != 0 {
      $result: map-merge($result, ("n" + $key: (-$value


2\cdot18 \Rightarrow \gcd=18$.
Back-substitute: $18=4\cdot54-198=4(252-198)-198=4\cdot252-5\cdot198$.

4) $\gcd(15,21)=3 \mid 6$. One solution from $21-15=6$: $x=-1,y=1$. General:
$x=-1+7t,\ y=1-5t$, $t \in \mathbb{Z}$.

---

### MEDIUM STUFF

1) Prove any square is $3k$ or $3k+1$.

2) Show any cube is $9k, 9k+1,$ or $9k+8$.

3) Prove $3a^2-1$ is never a perfect square.

4) If $a=qb+r$, prove $\gcd(a,b)=\gcd(b,r)$.

5) Prove Euclid's lemma: if $\gcd(a,b)=1$ and $a \mid bc$, then $a \mid c$.

6) Compute $\gcd(84,330)$ and $\operatorname{lcm}(84,330)$.

7) Solve $18x+5y=48$ in integers; list all positive solutions.

8) Solve $54x+21y=906$ in integers; give one small positive solution and the general form.

9) Prove: if $d=\gcd(a,b)$ then $\gcd(a/d,b/d)=1$.

10) Show no base-10 repunit $11\ldots1$ is a perfect square.

**sketches**

1) Cases $n=3q,3q+1,3q+2$ give $9q^2,9q^2+6q+1,9q^2+12q+4\equiv 0,1,1\pmod3$.

2) Cases mod $9$: cubes are $\equiv 0, \pm1 \pmod9$.

3) From (1), $a^2\equiv 0,1\pmod3 \Rightarrow 3a^2-1\equiv -1,2\pmod3$. Squares are $0,1\pmod3$, contradiction.

4) Common divisors of $a,b$ are exactly common divisors of $b,r=a-qb$. Maximal ones match.

5) With $\gcd(a,b)=1$, take $ax+by=1$. Multiply by $c$: $c=a(cx)+b(cy)$. If $a \mid bc$, then $a \mid c$.

6) Euclid gives $\gcd(84,330)=6$. Then $\operatorname{lcm}=\frac{84\cdot330}{6}=4620$.

7) Mod $5$: $18x\equiv48\equiv3 \Rightarrow 3x\equiv3 \Rightarrow x\equiv1\pmod5$. Take $x=1$, then $y=6$.
General: $x=1+5t,\ y=6-18t$. Positivity forces $t=0 \Rightarrow (1,6)$.

8) $\gcd(54,21)=3 \mid 906 \Rightarrow$ reduce: $18x+7y=302$. Mod $7$: $18x\equiv302\equiv1 \Rightarrow 4x\equiv1 \Rightarrow x\equiv2\pmod7$.
Take $x=2 \Rightarrow y=38$. General: $x=2+7t,\ y=38-18t$.

9) From $d=ax_0+by_0$, divide by $d$: $1=(a/d)x_0+(b/d)y_0 \Rightarrow$ coprime.

10) Write $R_n=11\ldots1= (10^{n}-1)/9$. Note $R_n\equiv 3\pmod4$.
Squares are $0,1\pmod4$, so $R_n$ is not a square.

---

### HARD STUFF

**Find the positive integers $x,y$ minimizing $x+y$ subject to $158x-57y=7$. Also give the full solution set.**

**sketch.** $\gcd(158,57)=1$. Extended Euclid yields $1=-22\cdot158+61\cdot57$.
Multiply by $7$: $7=(-154)\cdot158+427\cdot57$, so a particular solution is $(x_0,y_0)=(-154,-427)$.
General solution:

$$
x = -154 - 57t, \quad y = -427 - 158t, \quad t \in \mathbb{Z}
$$

Set $t=-k$: $x=-154+57k,\ y=-427+158k$.
Positivity needs


mages/tree/drop-append.gif);
}

/* line 5, ../../../ext-theme-neutral/sass/src/tree/ViewDropZone.scss */
.x4-tree-drop-ok-above .x4-dd-drop-icon {
  background-image: url(images/tree/drop-above.gif);
}

/* line 9, ../../../ext-theme-neutral/sass/src/tree/ViewDropZone.scss */
.x4-tree-drop-ok-below .x4-dd-drop-icon {
  background-image: url(images/tree/drop-below.gif);
}

/* line 13, ../../../ext-theme-neutral/sass/src/tree/ViewDropZone.scss */
.x4-tree-drop-ok-between .x4-dd-drop-icon {
  background-image: url(images/tree/drop-between.gif);
}

/* line 17, ../../../ext-theme-neutral/sass/src/tree/ViewDropZone.scss */
.x4-tree-ddindicator {
  height: 1px;
  border-width: 1px 0px 0px;
  border-style: dotted;
  border-color: green;
}

/* including package ext-theme-classic */
/* line 2, ../../../ext-theme-classic/sass/src/dom/Element.scss */
.x4-box-tl {
  background: transparent no-repeat 0 0;
  zoom: 1;
}

/* line 7, ../../../ext-theme-classic/sass/src/dom/Element.scss */
.x4-box-tc {
  height: 8px;
  background: transparent repeat-x 0 0;
  overflow: hidden;
}

/* line 13, ../../../ext-theme-classic/sass/src/dom/Element.scss */
.x4-box-tr {
  background: transparent no-repeat right -8px;
}

/* line 17, ../../../ext-theme-classic/sass/src/dom/Element.scss */
.x4-box-ml {
  background: transparent repeat-y 0;
  padding-left: 4px;
  overflow: hidden;
  zoom: 1;
}

/* line 24, ../../../ext-theme-classic/sass/src/dom/Element.scss */
.x4-box-mc {
  background: repeat-x 0 -16px;
  padding: 4px 10px;
}

/* line 29, ../../../ext-theme-classic/sass/src/dom/Element.scss */
.x4-box-mc h3 {
  margin: 0 0 4px 0;
  zoom: 1;
}

/* line 34, ../../../ext-theme-classic/sass/src/dom/Element.scss */
.x4-box-mr {
  background: transparent repeat-y right;
  padding-right: 4px;
  overflow: hidden;
}

/* line 40, ../../../ext-theme-classic/sass/src/dom/Element.scss */
.x4-box-bl {
  background: transparent no-repeat 0 -16px;
  zoom: 1;
}

/* line 45, ../../../ext-theme-classic/sass/src/dom/Element.scss */
.x4-box-bc {
  background: transparent repeat-x 0 -8px;
  height: 8px;
  overflow: hidden;
}

/* line 51, ../../../ext-theme-classic/sass/src/dom/Element.scss */
.x4-box-br {
  background: transparent no-repeat right -24px;
}

/* line 55, ../../../ext-theme-classic/sass/src/dom/Element.scss */
.x4-box-tl, .x4-box-bl {
  padding-left: 8px;
  overflow: hidden;
}

/* line 60, ../../../ext-theme-classic/sass/src/dom/Element.scss */
.x4-box-tr, .x4


}

/** REGIONAL INDICATOR SYMBOL LETTERS DK : flag-dk */
[data-emoji="\1F1E9\1F1F0"]{
    background-image: url("../emoji/1f1e9-1f1f0.png");
}

/** REGIONAL INDICATOR SYMBOL LETTERS DM : flag-dm */
[data-emoji="\1F1E9\1F1F2"]{
    background-image: url("../emoji/1f1e9-1f1f2.png");
}

/** REGIONAL INDICATOR SYMBOL LETTERS DO : flag-do */
[data-emoji="\1F1E9\1F1F4"]{
    background-image: url("../emoji/1f1e9-1f1f4.png");
}

/** REGIONAL INDICATOR SYMBOL LETTERS DZ : flag-dz */
[data-emoji="\1F1E9\1F1FF"]{
    background-image: url("../emoji/1f1e9-1f1ff.png");
}

/** REGIONAL INDICATOR SYMBOL LETTERS EA : flag-ea */
[data-emoji="\1F1EA\1F1E6"]{
    background-image: url("../emoji/1f1ea-1f1e6.png");
}

/** REGIONAL INDICATOR SYMBOL LETTERS EC : flag-ec */
[data-emoji="\1F1EA\1F1E8"]{
    background-image: url("../emoji/1f1ea-1f1e8.png");
}

/** REGIONAL INDICATOR SYMBOL LETTERS EE : flag-ee */
[data-emoji="\1F1EA\1F1EA"]{
    background-image: url("../emoji/1f1ea-1f1ea.png");
}

/** REGIONAL INDICATOR SYMBOL LETTERS EG : flag-eg */
[data-emoji="\1F1EA\1F1EC"]{
    background-image: url("../emoji/1f1ea-1f1ec.png");
}

/** REGIONAL INDICATOR SYMBOL LETTERS EH : flag-eh */
[data-emoji="\1F1EA\1F1ED"]{
    background-image: url("../emoji/1f1ea-1f1ed.png");
}

/** REGIONAL INDICATOR SYMBOL LETTERS ER : flag-er */
[data-emoji="\1F1EA\1F1F7"]{
    background-image: url("../emoji/1f1ea-1f1f7.png");
}

/** REGIONAL INDICATOR SYMBOL LETTERS ES : flag-es */
[data-emoji="\1F1EA\1F1F8"]{
    background-image: url("../emoji/1f1ea-1f1f8.png");
}

/** REGIONAL INDICATOR SYMBOL LETTERS ET : flag-et */
[data-emoji="\1F1EA\1F1F9"]{
    background-image: url("../emoji/1f1ea-1f1f9.png");
}

/** REGIONAL INDICATOR SYMBOL LETTERS EU : flag-eu */
[data-emoji="\1F1EA\1F1FA"]{
    background-image: url("../emoji/1f1ea-1f1fa.png");
}

/** REGIONAL INDICATOR SYMBOL LETTERS FI : flag-fi */
[data-emoji="\1F1EB\1F1EE"]{
    background-image: url("../emoji/1f1eb-1f1ee.png");
}

/** REGIONAL INDICATOR SYMBOL LETTERS FJ : flag-fj */
[data-emoji="\1F1EB\1F1EF"]{
    background-image: url("../emoji/1f1eb-1f1ef.png");
}

/** REGIONAL INDICATOR SYMBOL LETTERS


_array_[0].RawData() - kHistOffset;
  // ConstructGPUHistogramsAsync will return true if there are available feature groups dispatched to GPU
  bool is_gpu_used = ConstructGPUHistogramsAsync(is_feature_used,
    nullptr, smaller_leaf_splits_->num_data_in_leaf(),
    nullptr, nullptr,
    nullptr, nullptr);
  // then construct sparse features on CPU
  train_data_->ConstructHistograms<false, 0>(is_sparse_feature_used,
    smaller_leaf_splits_->data_indices(), smaller_leaf_splits_->num_data_in_leaf(),
    gradients_, hessians_,
    ordered_gradients_.data(), ordered_hessians_.data(),
    share_state_.get(),
    ptr_smaller_leaf_hist_data);
  // wait for GPU to finish, only if GPU is actually used
  if (is_gpu_used) {
    if (config_->gpu_use_dp) {
      // use double precision
      WaitAndGetHistograms<hist_t>(ptr_smaller_leaf_hist_data);
    } else {
      // use single precision
      WaitAndGetHistograms<gpu_hist_t>(ptr_smaller_leaf_hist_data);
    }
  }

  // Compare GPU histogram with CPU histogram, useful for debugging GPU code problem
  // #define GPU_DEBUG_COMPARE
  #ifdef GPU_DEBUG_COMPARE
  for (int i = 0; i < num_dense_feature_groups_; ++i) {
    if (!feature_masks_[i])
      continue;
    int dense_feature_group_index = dense_feature_group_map_[i];
    size_t size = train_data_->FeatureGroupNumBin(dense_feature_group_index);
    hist_t* ptr_smaller_leaf_hist_data = smaller_leaf_histogram_array_[0].RawData() - kHistOffset;
    hist_t* current_histogram = ptr_smaller_leaf_hist_data + train_data_->GroupBinBoundary(dense_feature_group_index) * 2;
    hist_t* gpu_histogram = new hist_t[size * 2];
    data_size_t num_data = smaller_leaf_splits_->num_data_in_leaf();
    printf("Comparing histogram for feature %d size %d, %lu bins\n", dense_feature_group_index, num_data, size);
    std::copy(current_histogram, current_histogram + size * 2, gpu_histogram);
    std::memset(current_histogram, 0, size * sizeof(hist_t) * 2);
    if (train_data_->FeatureGroupBin(dense_feature_group_index) == nullptr) {
      continue;
    }
    if (num_data != num_data_) {
      train_data_->FeatureGroupBin(dense_feature_group_index)->ConstructHistogram(
        smaller_leaf_splits_->data_indices(),
        0,
        num_data,
        ordered_gradients_.data(),
        ordered_hessians_.data(),
        current_histogram);
    } else {
      train_data_->FeatureGroupBin(dense_feature_group_index)->ConstructHistogram(
        0,
        num_data,
        gradients_,
        hessians_,
        current_histogram);
    }
    CompareHistograms(gpu_histogram, current_histogram, size, dense_feature_group_index);
    std::copy(gpu_histogram, gpu_histogram + size * 2, current_histogram);
    delete [] gpu_histogram;
  }
  #endif

  if (larger_leaf_histogram_array_ != nullptr && !use_subtract) {
    // construct larger leaf
    hist_t* ptr_larger_leaf_hist_data = larger_leaf_histogram_array_[0].RawData() - kHistOffset;
    is_gpu_used = ConstructGPUHistogramsAsync(is_feature_used,
      larger_leaf_splits_->data_indices(),


 static IGVEventBus instance;

    // This is not a singleton,  "instance" is the default bus.  Sashimi plot has its own bus.
    public static synchronized IGVEventBus getInstance() {
        if (instance == null) {
            instance = new IGVEventBus();
        }
        return instance;
    }

    public IGVEventBus() {
        this.observerMap = new HashMap<>();
    }

    public synchronized void subscribe(Class<?> eventClass, IGVEventObserver observer) {
        Set<IGVEventObserver> observerSet = observerMap.computeIfAbsent(eventClass, k -> Collections.newSetFromMap(new WeakHashMap<>()));
        observerSet.add(observer);
    }

    /**
     * Unsubscribe observer from all observer lists.  Note that if this method is not called the observer should
     * still be eligible for garbage collection, but its good practice to call this nonetheless.
     */
    public synchronized void unsubscribe(IGVEventObserver observer) {
        for (Set<IGVEventObserver> observerSet : observerMap.values()) {
            observerSet.remove(observer);
        }
    }

    public void post(IGVEvent event) {
        Set<IGVEventObserver> observerSet = observerMap.get(event.getClass());
        if (observerSet != null) {
            // Make a copy in case original is modified during loop
            Collection<IGVEventObserver> observers = new ArrayList<>(observerSet);
            for (IGVEventObserver observer : observers) {
                observer.receiveEvent(event);
            }
        }
    }

}

/*
 * The MIT License (MIT)
 *
 * Copyright (c) 2007-2015 Broad Institute
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */

package org.broad.igv.variant;

import org.broad.igv.logging.*;
import org.broad.igv.prefs.IGVPreferences;
import org.broad.igv.prefs.PreferencesManager;
import org.broad.igv.track.RenderContext;
import org.broad.igv.track.Track;
import org.broad.igv.ui.FontManager;
import org.broad.igv.ui.color.ColorUtilities;

import java.awt.*;
import java.util.HashMap;
import java.util.Map;

import static org.broad.igv.prefs.Constants.*;

/**
 * @author Jesse Whitworth
 * @api
 * @since Jul 16, 2010
 */
public class VariantRenderer { //extends FeatureRenderer {

    private static Logger log = LogManager.getLogger(VariantRenderer.class);

    private static final int BOTTOM_MARGIN = 0;
    private static final int TOP_MARGIN = 3;
    private static float alphaValue = 0.2f;

    static Map<Character, Color> nucleotideColors = new HashMap<Character, Color>();

    static {
        nucleotideColors.put('A', Color.GREEN);
        nucleotideColors.put('a', Color.GREEN);
        nucleotideColors.put('C', Color.BLUE);
        nucleotideColors.put('c', Color.BLUE);
        nucleotideColors.put('T', Color.RED);
        nucleotideColors.put('t', Color.RED);


          color: AppColors.black,
          fontWeight: FontWeight.w900,
          fontFamily: 'Metropolis',
        ), //

        //product title
        headline4: theme.textTheme.headline4?.copyWith(
          color: AppColors.black,
          fontSize: 16,
          fontWeight: FontWeight.w400,
          fontFamily: 'Metropolis',
        ),

        headline3: theme.textTheme.headline3?.copyWith(
          fontFamily: 'Metropolis',
          fontWeight: FontWeight.w400,
        ),
        //product price
        headline2: theme.textTheme.headline2?.copyWith(
          color: AppColors.lightGray,
          fontSize: 14,
          fontFamily: 'Metropolis',
          fontWeight: FontWeight.w400,
        ),
        headline1: theme.textTheme.headline1?.copyWith(
          fontFamily: 'Metropolis',
          fontWeight: FontWeight.w500,
        ),

        subtitle2: theme.textTheme.subtitle2?.copyWith(
          fontSize: 18,
          color: AppColors.black,
          fontFamily: 'Metropolis',
          fontWeight: FontWeight.w400,
        ),

        subtitle1: theme.textTheme.subtitle1?.copyWith(
          fontSize: 24,
          color: AppColors.darkGray,
          fontFamily: 'Metropolis',
          fontWeight: FontWeight.w500,
        ),
        //red button with white text
        button: theme.textTheme.button?.copyWith(
          fontSize: 14,
          color: AppColors.white,
          fontFamily: 'Metropolis',
          fontWeight: FontWeight.w500,
        ),
        //black caption title
        caption: theme.textTheme.caption?.copyWith(
          fontSize: 34,
          color: AppColors.black,
          fontFamily: 'Metropolis',
          fontWeight: FontWeight.w700,
        ),
        //light gray small text
        bodyText1: theme.textTheme.bodyText1?.copyWith(
          color: AppColors.lightGray,
          fontSize: 11,
          fontFamily: 'Metropolis',
          fontWeight: FontWeight.w400,
        ),
        //view all link
        bodyText2: theme.textTheme.bodyText2?.copyWith(
          color: AppColors.black,
          fontSize: 11,
          fontFamily: 'Metropolis',
          fontWeight: FontWeight.w400,
        ),
      )
          .apply(fontFamily: 'Metropolis'),
      buttonTheme: theme.buttonTheme.copyWith(
        minWidth: 50,
        buttonColor: AppColors.red,
      ),
    );
  }
}
// Favourite Screen Bloc Events
// Author: umair_adil@live.com
// Date: 2020-02-11

import 'package:equatable/equatable.dart';
import 'package:flutter/material.dart';
import 'package:openflutterecommerce/data/model/favorite_product.dart';
import 'package:openflutterecommerce/data/model/filter_rules.dart';
import 'package:openflutterecommerce/data/model/sort_rules.dart';

@immutable
abstract class FavouriteEvent extends Equatable {
  @override
  List<Object> get props => [];
}

@immutable
class ScreenLoadedEvent extends FavouriteEvent {
  ScreenLoadedEvent();

  @override
  List<Object> get props => [];
}

@immutable
class ProductsChangeViewEvent extends FavouriteEvent {}

@immutable
class ProductChangeSortRulesEvent extends FavouriteEvent {
  final SortRules sortBy;

  ProductChangeSortRulesEvent(this.sortBy);

  @override
  List<Object> get props => [sortBy];
}

@immutable
class ProductChangeFilterRulesEvent extends FavouriteEvent {
  final FilterRules filterRules;

  ProductChangeFilterRulesEvent(this.filterRules);

  @override
  List<Object> get props => [filterRu


        verify(restlight).daemon(false);

        final Map<ChannelOption<?>, Object> cOptions = Collections.emptyMap();
        conf.options(cOptions);
        verify(restlight).options(same(cOptions));

        conf.option(ChannelOption.SO_RCVBUF, 1);
        verify(restlight).option(same(ChannelOption.SO_RCVBUF), eq(1));

        conf.childOptions(cOptions);
        verify(restlight).childOptions(same(cOptions));

        conf.childOption(ChannelOption.SO_RCVBUF, 1);
        verify(restlight).childOption(same(ChannelOption.SO_RCVBUF), eq(1));

        final ChannelHandler handler = mock(ChannelHandler.class);
        conf.channelHandler(handler);
        verify(restlight).channelHandler(same(handler));

        final ChannelHandler handler1 = mock(ChannelHandler.class);
        conf.channelHandlers(handler, handler1);
        verify(restlight)
                .channelHandlers(same(handler), same(handler1));
        conf.channelHandlers(Collections.singleton(handler));
        verify(restlight)
                .channelHandlers(argThat((ArgumentMatcher<Collection<? extends ChannelHandler>>) t ->
                        t != null && !t.isEmpty() && t.iterator().next() == handler));

        final Deployments.Impl deployments4Spring = mock(Deployments.Impl.class);
        when(restlight.deployments()).thenReturn(deployments4Spring);
        assertSame(deployments4Spring, conf.deployments());
    }

}
/*
 * Copyright 2020 OPPO ESA Stack Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package esa.restlight.starter.actuator.autoconfigurer;

import esa.restlight.core.config.RestlightOptions;
import esa.restlight.server.config.BizThreadsOptionsConfigure;
import org.springframework.boot.context.properties.ConfigurationProperties;

/**
 * ManagementOptions
 *
 */
@ConfigurationProperties(prefix = "management.server.restlight")
public class ManagementOptions extends RestlightOptions {
    private static final long serialVersionUID = -2187295833236096900L;

    private String unixDomainSocketFile;

    public ManagementOptions() {
        setIoThreads(1);
        setBizThreads(BizThreadsOptionsConfigure.newOpts()
                .core(2)
                .max(2)
                .blockingQueueLength(128)
                .keepAliveTimeSeconds(30L).configured());
        setMaxContentLength(8 * 1024 * 1024);
        setMaxHeaderSize(8192);
        setMaxInitialLineLength(8192);
        // TODO: set ssl by ManagementServerProperties
    }

    public String getUnixDomainSocketFile() {
        return unixDomainSocketFile;
    }

    public void setUnixDomainSocketFile(String unixDomainSocketFile) {
        this.unixDomainSocketFile = unixDomainSocketFile;
    }

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder("ManagementOptions{");
        sb.append("unixDomainSocketFile='").append(unixDomainSocketFile).append('\'');
        sb.append(", http2Enable=").append(isHttp2Enable());
        sb.append(", useNativeTransports=").append(isUseNativeTransports());
        sb.append(", connectorThreads=").append(getConnectorThreads());
        sb.append(", ioThreads=").append(getIoThreads());
        sb.append(", bizThreads=").append(getBizThreads());
        sb.append(", bizTermination


          let download_icon_btn = ks_upload_parent_field_el.querySelector('.fa-download');
            let trash_icon_btn = ks_upload_parent_field_el.querySelector('.fa-trash');

            if(pencil_icon_btn){
                pencil_icon_btn.classList.remove('fa', 'fa-pencil');
                pencil_icon_btn.innerHTML += renderToString("ks_dashboard_ninja.edit_svg", {})
            }
            if(download_icon_btn){
                download_icon_btn.classList.remove('fa', 'fa-download')
                download_icon_btn.innerHTML += renderToString("ks_dashboard_ninja.trash_svg", {})
            }
            if(trash_icon_btn){
                trash_icon_btn.classList.remove('fa', 'fa-trash')
                trash_icon_btn.innerHTML += renderToString("ks_dashboard_ninja.download_svg", {})
            }
        }
   },
});/** @odoo-module */

import { registry } from "@web/core/registry";
import {globalfunction } from '@ks_dashboard_ninja/js/ks_global_functions';
import { getCurrency } from "@web/core/currency";
import { formatFloat,formatInteger } from "@web/views/fields/formatters";
import { imageUrl } from "@web/core/utils/urls";
import { url } from "@web/core/utils/urls";

const { useEffect, useRef,Component} = owl;

class KsKpiPreview extends Component {
    file_type_magic_word ={'/': 'jpg','R': 'gif','i': 'png','P': 'svg+xml'}

    ks_get_gcd(a, b) {
        return (b == 0) ? a : this.ks_get_gcd(b, a % b);
    }

    _get_rgba_format(val) {
        var rgba = val.split(',')[0].match(/[A-Za-z0-9]{2}/g);
        rgba = rgba.map(function(v) {
            return parseInt(v, 16)
        }).join(",");
        return "rgba(" + rgba + "," + val.split(',')[1] + ")";
    }

    setup() {
        super.setup();
        const self = this;
        this.ks_kpi_ref = useRef("ks_kpi");
        useEffect(() => this.ks_changes());
    }

    ksSum(count_1, count_2, item_info, field, target_1, kpi_data) {
        var self = this;
        var count = count_1 + count_2;
        if (field.ks_multiplier_active) {
            item_info['count'] = globalfunction._onKsGlobalFormatter(count * field.ks_multiplier, field.ks_data_format, field.ks_precision_digits);
            item_info['count_tooltip'] = formatFloat(count * field.ks_multiplier, { digits: [0, field.ks_precision_digits] });
        } else {
            item_info['count'] = globalfunction._onKsGlobalFormatter(count, field.ks_data_format, field.ks_precision_digits, field.ks_precision_digits);
            item_info['count_tooltip'] = formatFloat(count, {digits: [0, field.ks_precision_digits]});
        }

        if (field.ks_multiplier_active) {
            count = count * field.ks_multiplier;
        }

        var ks_selection = field.ks_unit_selection;
        if (ks_selection === 'monetary') {
            var ks_currency_id = field.ks_currency_id[0];
            var ks_data = globalfunction.ks_monetary(item_info['count'], ks_currency_id);
            item_info['count'] = ks_data;
        } else if (ks_selection === 'custom') {
            var ks_field = field.ks_chart_unit;
            item_info['count'] = ks_field + " " + item_info['count'];
        }

        item_info['target_enable'] = field.ks_goal_enable;
        var ks_color = (target_1 - count) > 0 ? "red" : "green";
        item_info.pre_arrow =


///
    sketch.setup = () => {
        setupDataConnectionStuff();
        sketch.createCanvas(320, 240);
        seqGrid = new Grid(16, 12, 320, 240);
    }
    //////////////////////////////////////////
    // p5 sketch draw()
    //////////////////////////////////////////
    sketch.draw = () => { // TODO: allow dragging to enable multiple steps

       sketch.background(200);

        // draw sequencer
        seqGrid.display();
        seqGrid.checkMouse();
        // draw beat indicator
        if(play){
            var currentTime = sketch.millis();

            if (currentTime - lastTime > (tempoSliderValue*150 + 50)){
                lastTime = currentTime;
                currentBeat++;
                currentBeat %= seqGrid.numSteps;

                // Send things out to connection from p5 here
                if(outputConnection != null){ // send a JSON packet

                        for (var j = 0; j < seqGrid.numChannels; j++){
                            //console.log(currentBeat*seqGrid.numChannels + j);
                            if(seqGrid.stepActive(currentBeat, j)){
                                //if particular table index is on
                                let mididata = new JifferSeqMidi((seqGrid.numChannels - 1) - j, -1, 127)
                                outputConnection.send(mididata.type, mididata.data)
                                // console.log((seqGrid.numChannels - 1) - j)
                            }
                        }
                }
            }
        }

        // Display data received as text
        sketch.fill(0);

    }
    ////////////////////////////////////////////////////////////
    // Grid()
    // Grid of Steps
    // specify how many steps (beats)
    // and Channels, (voices / notes) - and draw size
    ////////////////////////////////////////////////////////////
    function Grid(numSteps, numChannels, gridWidth, gridHeight){

        this.numSteps = numSteps;
        this.numChannels = numChannels;
        this.stepWidth = gridWidth/numSteps;
        this.stepHeight = gridHeight/(numChannels+1);
        this.steps = [];
        for(var i = 0; i < numSteps; i++){
            for (var j = 0; j < numChannels; j++){
                //console.log(i + " " + j);
                this.steps.push(new Step(this.stepWidth * i, this.stepHeight * j, this.stepWidth, this.stepHeight));
            }
        }

        this.display = function(){
            for(var i = 0; i < numSteps; i++){
                for (var j = 0; j < numChannels; j++){
                    this.steps[i*numChannels + j].display();
                }
            }
            // draw beat indicator
            for(var i = 0; i < numSteps; i++){
                if (play == false){
                    sketch.fill(255);
                }
                else{
                    if (currentBeat == i){
                        sketch.fill(75);
                    }
                    else{
                        sketch.fill(255);
                    }
                }
                sketch.rect(i * this.stepWidth, numChannels * this.stepHeight + 9, this.stepWidth, this.stepHeight-10);
            }
        }

        this.stepActive = function(col, row){
            return this.steps[col*numChannels + row].on;
        }

        this.checkMouse = function(){
            if(lastFrameMouseDown == false && sketch.mouseIsPressed){// new press
                // check if within grid
                if (sketch.mouseX < sketch.width && sketch.mouseY < sketch.height){
                    // check if clicking a step object
                    for(var i = 0; i < numSteps; i++){


10, MEBiomeDataConfigs.riverModifier);
        add(new Color(0x68a8de), oasis);
        pond = new MapBasedCustomBiome(MEBiomeKeys.POND, -10, MEBiomeDataConfigs.riverModifier);
        add(new Color(0x6e9ada), pond);
        mirkwoodSwamp = new MapBasedCustomBiome(MEBiomeKeys.MIRKWOOD_SWAMP, -2, MEBiomeDataConfigs.landModifier.heightModifier(0.1));
        add(new Color(0x1c6b56), mirkwoodSwamp);
        greatRiver = new MapBasedCustomBiome(MEBiomeKeys.GREAT_RIVER, -10, MEBiomeDataConfigs.riverModifier);
        add(new Color(0x638aba), greatRiver);
        wastePond = new MapBasedCustomBiome(MEBiomeKeys.WASTE_POND, -10, MEBiomeDataConfigs.riverModifier);
        add(new Color(0x4b6c8f), wastePond);
        deadMarshes = new MapBasedCustomBiome(MEBiomeKeys.DEAD_MARSHES, 0, MEBiomeDataConfigs.riverModifier.noiseModifier(0f));
        add(new Color(0x305e42), deadMarshes);
        deadMarshesWater = new MapBasedCustomBiome(MEBiomeKeys.DEAD_MARSHES_WATER, -10, MEBiomeDataConfigs.riverModifier);
        add(new Color(0x5a7ca1), deadMarshesWater);
        mangrovePond = new MapBasedCustomBiome(MEBiomeKeys.MANGROVE_POND, -3, MEBiomeDataConfigs.riverModifier);
        add(new Color(0x5ba67d), mangrovePond);

        add(new Color(0x4e637a), new MapBasedCustomBiome(MEBiomeKeys.EMYN_MUIL_POND,-4, MEBiomeDataConfigs.emynMuilModifier));
        add(new Color(0x657bf3), new MapBasedCustomBiome(MEBiomeKeys.FROZEN_OCEAN, -26, MEBiomeDataConfigs.oceanModifier));
        add(new Color(0x4250db), new MapBasedCustomBiome(MEBiomeKeys.LONG_LAKE, -26, MEBiomeDataConfigs.longLakeModifier));
        add(new Color(0x455ce4), new MapBasedCustomBiome(MEBiomeKeys.LONG_LAKE_SHORES, -14, MEBiomeDataConfigs.longLakeModifier));
        add(new Color(0x486d72), new MapBasedCustomBiome(MEBiomeKeys.MORGUL_RIVER, -13, MEBiomeDataConfigs.riverModifier));
        add(new Color(0x4f5ba1), new MapBasedCustomBiome(MEBiomeKeys.NURN_RIVER, -13, MEBiomeDataConfigs.riverModifier));
        add(new Color(0x585e82), new MapBasedCustomBiome(MEBiomeKeys.NURN_SEA, -12, MEBiomeDataConfigs.oceanModifier));
        add(new Color(0x4b6ac7), new MapBasedCustomBiome(MEBiomeKeys.OCEAN_COAST, -11, MEBiomeDataConfigs.oceanModifier));
        add(new Color(0x5381ba), new MapBasedCustomBiome(MEBiomeKeys.RIVER, -13, MEBiomeDataConfigs.smallRiverModifier));
        add(new Color(0x4d7789), new MapBasedCustomBiome(MEBiomeKeys.MIRKWOOD_RIVER, -9, MEBiomeDataConfigs.smallRiverModifier));
        add(new Color(0x42619d), new MapBasedCustomBiome(MEBiomeKeys.SEA_OF_RHUN, -8, MEBiomeDataConfigs.oceanModifier));
        add(new Color


F="/wmd/library/news/iraq/2006/12/iraq-061226-voa01.htm">Saddam Death Sentence UpheldVOA 26 Dec 2006 -- Iraq's highest appeals court has upheld the death sentence for Saddam Hussein

US Legislators, Troops & Iraq Violence VOA 24 Dec 2006 -- Continued violence and sectarian strife have led President Bush to reassess U.S. strategy in Iraq.

Turkmen President Niyazov Laid To Rest RFE/RL 24 Dec 2006 -- Thousands of mourners laid flowers and said their last farewellsTurkmenbashi

Iraqis & Sectarian Violence VOA 23 Dec 2006 -- The security situation in Baghdad continues to deteriorate as sectarian violence grows

 Leader of Turkmenistan DiesVOA 21 Dec 2006 -- The authoritarian leader of Turkmenistan, Saparmurat Niyazov, has died suddenly of cardiac arrest

Bush: Victory in Iraq Achievable AFPS 20 Dec 2006 -- Victory in Iraq is achievable, and retreat from Iraq is not an option, Pres. Bush said

Iraq Officials Assume Control in An Najaf AFPS 20 Dec 2006 -- Iraqi officials in An Najaf assumed security control of the province

Gates Arrives in Baghdad AFPS 20 Dec 2006 -- SecDef Gates arrived in Baghdad on a surprise pre-Christmas visit to meet with troops, generals and Iraqi leaders

Rep. Skelton & Strategy On Iraq RFE/RL 20 Dec 2006 -- The November 7 legislative elections gave the U.S. Democratic Party majorities in both houses of Congress.

Iraq Vice President Appeals For More Coalition Troops RFE/RL 20 Dec 2006 -- Iraqi VP al-Hashimi said he remains optimistic about Iraq's future, despite the spiraling wave of violence

Syria ready to discuss Iraq RIA Nov


_OVERVIEW_ORDER] ?: defaultOrder
        }
        _uiState.update {
            it.copy(
                orderData = orderData
            )
        }
    }

    /**
     * 主按钮点击
     */
    fun fabClick() {
        viewModelScope.launch {
            _uiState.update {
                //避免同时弹出
                if (it.showChangeDb) {
                    it.copy(
                        showChangeDb = false
                    )
                } else {
                    it.copy(
                        showDropMenu = !it.showDropMenu
                    )
                }
            }
        }
    }

    /**
     * 数据切换点击
     */
    fun changeDbClick() {
        viewModelScope.launch {
            _uiState.update {
                //避免同时弹出
                if (it.showDropMenu) {
                    it.copy(
                        showDropMenu = false
                    )
                } else {
                    it.copy(
                        showChangeDb = !it.showChangeDb
                    )
                }
            }
        }
    }

    /**
     * 关闭弹窗
     */
    fun closeAllDialog() {
        viewModelScope.launch {
            _uiState.update {
                it.copy(
                    showDropMenu = false,
                    showChangeDb = false,
                )
            }
        }
    }

    /**
     * 编辑模式
     */
    fun changeEditMode() {
        viewModelScope.launch {
            _uiState.update {
                it.copy(
                    isEditMode = !it.isEditMode
                )
            }
        }
    }

    /**
     * 编辑排序
     */
    fun updateOrderData(id: Int) {
        viewModelScope.launch {
            editOrder(
                context = MyApplication.context,
                scope = viewModelScope,
                id = id,
                key = MainPreferencesKeys.SP_OVERVIEW_ORDER
            ) { data ->
                _uiState.update {
                    it.copy(
                        orderData = data
                    )
                }
            }
        }
    }

    /**
     * 数据文件正常读取判断
     */
    private fun checkDatabaseFile() {
        viewModelScope.launch {
            val dbError = unitRepository.getCountInt() == 0
            _uiState.update {
                it.copy(
                    dbError = dbError
                )
            }
        }
    }

    /**
     * 应用更新校验
     */
    private fun checkAppUpdate() {
        viewModelScope.launch {
            _uiState.update {
                it.copy(
                    appUpdateData = AppNotice(id = -1)
                )
            }

            //应用更新
            try {
                val data = apiRepository.getUpdateContent().data ?: AppNotice(id = -2)
                //将下载链接中的域名，根据设置替换为ip
                data.url = data.url.replace(SERVER_DOMAIN, MyApplication.URL_DOMAIN)
                _uiState.update {
                    it.copy(
                        appUpdateData = data
                    )
                }
            } catch (e: Exception) {
                _uiState.update {
                    it.copy(
                        appUpdateData = AppNotice(id = -2)
                    )
                }
            }
        }
    }

    /**
     * 更新应用下载状态
     */
    fun updateApkDownloadState(state: Int) {
        viewModelScope.launch {
            _uiState.update {


 5.959a1 1 0 010-1.415l3-3a1 1 0 111.414 1.415l-3 3a1 1 0 01-1.414 0Zm4.414 8a1 1 0 01-1.414 0l-3-3a1 1 0 011.414-1.415l3 3a1 1 0 010 1.415Z"/></g></svg>';
  static const String studio_light_side_print =
      '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="20" height="20" preserveAspectRatio="xMidYMid meet" viewBox="0 0 20 20"><g fill="currentColor"><g opacity=".8"><path fill-rule="evenodd" d="M14.816 5.864C16.136 4.894 18 5.837 18 7.476v2.048c0 1.64-1.863 2.583-3.184 1.612l-1.908-1.402.907-1.234-.907-1.234 1.908-1.402Zm-.21 2.636L16 9.524V7.476L14.606 8.5Z" clip-rule="evenodd"/><path d="m12.5 8.75 3.75-2.598v5.196L12.5 8.75Z"/><path fill-rule="evenodd" d="M15.414 18.908a1 1 0 01-1.32.507L11 18.04v.962a1 1 0 11-2 0v-.962l-3.094 1.375a1 1 0 11-.812-1.827L9 15.852v-3.85a1 1 0 012 0v3.85l3.906 1.736a1 1 0 01.508 1.32Z" clip-rule="evenodd"/><path d="M7.5 7a1 1 0 011-1h3a1 1 0 011 1v3a1 1 0 01-1 1h-3a1 1 0 01-1-1V7Z"/><path fill-rule="evenodd" d="M6.5 7a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2h-3a2 2 0 01-2-2V7Zm5 0h-3v3h3V7Z" clip-rule="evenodd"/><path fill-rule="evenodd" d="M12.293 6.709a1 1 0 010-1.415l2.693-2.693a1 1 0 111.415 1.414L13.707 6.71a1 1 0 01-1.414 0Zm3.914 7.498a1 1 0 01-1.414 0l-2.5-2.498a1 1 0 011.414-1.415l2.5 2.499a1 1 0 010 1.414Z" clip-rule="evenodd"/></g><path fill-rule="evenodd" d="M14.168 4.872c.997-.665 2.332.05 2.332 1.248v3.263c0 1.198-1.335 1.913-2.332 1.248l-2.945-1.963.554-.832 2.946 1.963a.5.5 0 00.777-.416V6.12a.5.5 0 00-.777-.416l-2.946 1.964-.554-.832 2.945-1.964Zm-.711 13.083a.5.5 0 01-.66.253L9 16.521v1.73a.5.5 0 11-1 0v-1.73l-3.797 1.687a.5.5 0 11-.406-.913L8 15.427v-4.175a.5.5 0 011 0v4.175l4.203 1.868a.5.5 0 01.254.66Z" clip-rule="evenodd"/><path fill-rule="evenodd" d="M5 5.752a1.5 1.5 0 011.5-1.5h4a1.5 1.5 0 011.5 1.5v4a


= musicCursor.getColumnIndex(MediaStore.Audio.Media.ALBUM)
            val durationColumn = musicCursor.getColumnIndex(MediaStore.Audio.Media.DURATION)

            do {
                try {
                    val id = musicCursor.getLong(idColumn)
                    val title = musicCursor.getString(titleColumn)
                    val artist = musicCursor.getString(artistColumn)
                    val album = musicCursor.getString(albumColumn)
                    val duration = musicCursor.getLong(durationColumn)
                    val uri = ContentUris.withAppendedId(MediaStore.Audio.Media.EXTERNAL_CONTENT_URI, id)

                    tracks.add(MediaItemUtils.createMediaItem(id.toString(), uri, title, duration, artist, album, uri, uri.toString(), plugin = NAME))
                } catch (e: Exception) {
                    Log.w(TAG, "error while processing track", e)
                }
            } while (musicCursor.moveToNext())
        }

        musicCursor?.close()
    }

    @Throws(Exception::class)
    internal fun tracks(): ArrayList<MediaItem> {
        if (tracks.isEmpty()) {
            loadMusic()
        }
        return tracks
    }

    companion object {
        const val NAME = "Local"
        private val TAG = LocalSource::class.simpleName
    }
}/*
 * SPDX-License-Identifier: GPL-3.0-only
 */

package com.tiefensuche.soundcrowd.images

import android.content.Context
import androidx.media3.common.MediaItem
import com.bumptech.glide.load.Options
import com.bumptech.glide.load.model.ModelLoader
import com.bumptech.glide.load.model.ModelLoaderFactory
import com.bumptech.glide.load.model.MultiModelLoaderFactory
import com.tiefensuche.soundcrowd.waveform.StringKey
import java.nio.ByteBuffer

/**
 * ModelLoader for loading artworks of local music files via [com.bumptech.glide.Glide]
 *
 *
 * Created by tiefensuche on 6/29/17.
 */
internal class ArtworkLoader(private val context: Context) : ModelLoader<MediaItem, ByteBuffer> {

    override fun buildLoadData(model: MediaItem, width: Int, height: Int, options: Options): ModelLoader.LoadData<ByteBuffer> {
        return ModelLoader.LoadData(StringKey(model.mediaId), ArtworkExtractor(context, model))
    }

    override fun handles(description: MediaItem): Boolean {
        return !description.mediaMetadata.artworkUri.toString().startsWith("http")
    }

    internal class Factory(private val context: Context) : ModelLoaderFactory<MediaItem, ByteBuffer> {

        override fun build(multiFactory: MultiModelLoaderFactory): ModelLoader<MediaItem, ByteBuffer> {
            return ArtworkLoader(context)
        }

        override fun teardown() {
            // nothing
        }
    }
}package com.tiefensuche.soundcrowd.images

import androidx.media3.common.MediaItem
import com.bumptech.glide.Priority
import com.bumptech.glide.load.DataSource
import com.bumptech.glide.load.Options
import com.bumptech.glide.load.data.DataFetcher
import com.bumptech.glide.load.model.ModelLoader
import com.bumptech.glide.load.model.ModelLoaderFactory
import com.bumptech.glide.load.model.MultiModelLoaderFactory
import com.tiefensuche.soundcrowd.waveform.StringKey

/**
 * Returns the artwork ByteArray from [MediaItem] if existent.
 */
internal class MetadataArtworkLoader private constructor() : ModelLoader<MediaItem, ByteArray> {

    override fun buildLoadData(model: MediaItem, width: Int, height: Int, options: Options): ModelLoader.LoadData<ByteArray>? {
        return ModelLoader.LoadData(StringKey(model.mediaId), object: DataFetcher<ByteArray


DejaVu Sans Mono", monospace;
	font-size: 14px;
	line-height: 1.3em;
	word-wrap: break-word;
	white-space: pre;
	white-space: pre-wrap;
	white-space: -moz-pre-wrap;
	white-space: -o-pre-wrap;
}

pre.textmate-source.mac_classic {
	color: #000000;
	background: rgb(249,249,247)
}

pre.textmate-source .linenum {
	width: 75px;
	padding: 0.1em 1em 0.2em 0;
	color: #888;
	background-color: #eee;
}
pre.textmate-source.mac_classic span {
   padding-top: 0.2em;
   padding-bottom: 0.1em;
}
pre.textmate-source.mac_classic ::selection {
	background-color: rgba(77, 151, 255, 0.33);
}
/* Comment */
pre.textmate-source.mac_classic .comment {
	color: #0066FF;
	font-style: italic;
}

/* Keyword */
pre.textmate-source.mac_classic .keyword, pre.textmate-source.mac_classic .storage {
	color: #0000FF;
	font-weight: bold;
}

/* Number */
pre.textmate-source.mac_classic .constant_numeric {
	color: #0000CD;
}

/* User-defined constant */
pre.textmate-source.mac_classic .constant {
	color: #C5060B;
	font-weight: bold;
}

/* Built-in constant */
pre.textmate-source.mac_classic .constant_language {
	color: #585CF6;
	font-weight: bold;
}

/* Variable */
pre.textmate-source.mac_classic .variable_language, pre.textmate-source.mac_classic .variable_other {
	color: #318495;
}

/* String */
pre.textmate-source.mac_classic .string {
	color: #036A07;
}

/* String interpolation */
pre.textmate-source.mac_classic .constant_character_escape, pre.textmate-source.mac_classic .string .source {
	color: #26B31A;
}

/* Preprocessor line */
pre.textmate-source.mac_classic .meta_preprocessor {
	color: #1A921C;
}

/* Preprocessor directive */
pre.textmate-source.mac_classic .keyword_control_import {
	color: #0C450D;
	font-weight: bold;
}

/* Function name */
pre.textmate-source.mac_classic .entity_name_function, pre.textmate-source.mac_classic .support_function_any-method {
	color: #0000A2;
	font-weight: bold;
}

/* Type name */
pre.textmate-source.mac_classic .entity_name_type {
	text-decoration: underline;
}

/* Inherited class name */
pre.textmate-source.mac_classic .entity_other_inherited-class {
	font-style: italic;
}

/* Function parameter */
pre.textmate-source.mac_classic .variable_parameter {
	font-style: italic;
}

/* Function argument and result types */
pre.textmate-source.mac_classic .storage_type_method {
	color: #70727E;
}

/* Section */
pre.textmate-source.mac_classic .meta_section .entity_name_section, pre.textmate-source.mac_classic .declaration_section .entity_name_section {
	font-style: italic;
}

/* Library function */
pre.textmate-source.mac_classic .support_function {
	color: #3C4C72;
	font-weight: bold;
}

/* Library object */
pre.textmate-source.mac_cla


09rem 0 0.09rem white;
}
.pokeball:after {
  -webkit-transform-origin: top center;
          transform-origin: top center;
  -webkit-transform: rotateX(180deg);
          transform: rotateX(180deg);
  bottom: 0.063rem;
}

.info {
  display: inline-block;
  margin-right: 1rem;
  margin-bottom: 14px;
}

.subheading {
  font-size: 18px;
  line-height: 28px;
}

p {
  line-height: 18px;
  margin: 0;
  margin-bottom: 1rem;
}

a {
  -webkit-transition:  opacity 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
  transition: opacity 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
}
a, a:active, a:visited {
  color: white;
}
a:hover {
  opacity: 0.8;
}

html {
  background: -webkit-radial-gradient(50vmin 50vmin, #feb4ff, #a3a3ec);
  background: radial-gradient(50vmin 50vmin, #feb4ff, #a3a3ec);
  background-position: -20vw center;
  background-repeat: no-repeat;
  background-color: #a3a3ec;
}
@media (max-width: 600px) {
  html {
    background-position: center -20vw;
  }
}
@media (max-width: 300px) {
  html {
    background-position: center -30vw;
  }
}

html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  font-size: 14px;
}

*, *:before, *:after {
  box-sizing: border-box;
  position: relative;
}
/*
** reset
*/

body, div, dl, dt, dd, ul, ol, li, h1, h2, h3, h4, h5, h6, pre, form, fieldset, input, p, blockquote, th, td {
  margin  : 0;
  padding : 0;
}

h1, h2, h3, h4, h5, h6 {
  font-size : 100%;
}

ol, ul {
  list-style : none;
}

address, caption, cite, code, dfn, em, strong, th, var {
  font-style  : normal;
  font-weight : normal;
}

table {
  border-collapse : collapse;
  border-spacing  : 0;
}

fieldset, img {
  border : 0;
}

caption, th {
  text-align : left;
}

q:before, q:after {
  content :'';
}

/*
** body
*/

body {
  margin      : 1em;

  background  : white;
  color       : black;

  font-family : Arial, Helvetica, sans-serif;
  font-size   : 10pt;
  text-align  : justify;
}

/*
** headings
*/

h1, h2, h3, h4 {
  font-variant   : small-caps;
  letter-spacing : 1px;
  color          : #5B852E;
  font-weight    : bold;
}
h1 { font-size   : 16pt; }
h2 { font-size   : 14pt; }
h3 { font-size   : 12pt; }
h4 { font-size   : 10pt; }

h1, h2, h3 {
  margin-top    : .5em;
  margin-bottom : .5em;
}

/*
** inlines
*/

q        { font-style : italic; }
q:before { content    : '"';    }
q:after  { content    : '"';    }

p {
  padding : .5em 1em 0    1em;
  margin  : 0    0   .5em 0;
}

/*
** lists
*/

ul, ol {
  margin  : 0