 status;
  }

  if (nci->pid_filename) {
    status = dn_create_pidfile(nci);
    if (status != DN_OK) {
      return status;
    }
  }

  dn_print_run(nci);

  return DN_OK;
}

/**
 * Cleanup when shutting down Dynomite. Delete the PID, print a done message,
 * and close the logging file descriptor.
 * @param[in] nci Dynomite instance.
 */
static void dn_post_run(struct instance *nci) {
  if (nci->pidfile) {
    dn_remove_pidfile(nci);
  }

  signal_deinit();

  dn_print_done();

  log_deinit();
}

/**
 * Call method to initialize buffers, messages and connections. Then start the
 * core dynomite loop to process messages. When dynomite is shutting down, call
 * method to deinitialize buffers, messages and connections.
 * @param[in] nci Dynomite instance.
 * @return rstatus_t Return status code.
 */
static rstatus_t dn_run(struct instance *nci) {
  rstatus_t status;

  THROW_STATUS(core_start(nci));

  struct context *ctx = nci->ctx;

  struct server_pool *sp = &ctx->pool;
  if (!sp->enable_gossip) core_set_local_state(ctx, NORMAL);

  /* run rabbit run */
  for (;;) {
    status = core_loop(ctx);
    if (status != DN_OK) {
      break;
    }
  }

  core_stop(ctx);
  return DN_OK;
}

/**
 * Set unlimited core dump resource limits.
 */
static void dn_coredump_init(void) {
  struct rlimit core_limits;
  core_limits.rlim_cur = core_limits.rlim_max = RLIM_INFINITY;
  setrlimit(RLIMIT_CORE, &core_limits);
}

int main(int argc, char **argv) {
  rstatus_t status;
  struct instance nci;

  dn_coredump_init();
  dn_set_default_options(&nci);

  status = dn_get_options(argc, argv, &nci);
  if (status != DN_OK) {
    dn_show_usage();
    exit(1);
  }

  if (show_version) {
    log_stderr("This is dynomite-%s" CRLF, VERSION);
    if (show_help) {
      dn_show_usage();
    }

    if (describe_stats) {
      stats_describe();
    }

    exit(0);
  }

  if (test_conf) {
    if (!dn_test_conf(&nci)) {
      exit(1);
    }
    exit(0);
  }

  status = dn_pre_run(&nci);
  if (status != DN_OK) {
    dn_post_run(&nci);
    exit(1);
  }

  status = dn_run(&nci);
  IGNORE_RET_VAL(status);

  dn_post_run(&nci);

  exit(1);
}


 "BEARER_TOKEN",
				"webModeler.restapi.clusters[1].url.zeebe.grpc": "grpc://zeebe-gateway.test-2:26500",
				"webModeler.restapi.clusters[1].url.zeebe.rest": "http://zeebe-gateway.test-2:8080",
				"webModeler.restapi.clusters[1].url.operate":    "http://operate.test-2:8080",
				"webModeler.restapi.clusters[1].url.tasklist":   "http://tasklist.test-2:8080",
				"postgresql.enabled":                            "false",
			},
			Verifier: func(t *testing.T, output string, err error) {
				var configmap corev1.ConfigMap
				var configmapApplication WebModelerRestAPIApplicationYAML
				helm.UnmarshalK8SYaml(s.T(), output, &configmap)

				e := yaml.Unmarshal([]byte(configmap.Data["application.yaml"]), &configmapApplication)
				if e != nil {
					s.Fail("Failed to unmarshal yaml. error=", e)
				}

				// then
				s.Require().Equal(2, len(configmapApplication.Camunda.Modeler.Clusters))
				s.Require().Equal("test-cluster-1", configmapApplication.Camunda.Modeler.Clusters[0].Id)
				s.Require().Equal("test cluster 1", configmapApplication.Camunda.Modeler.Clusters[0].Name)
				s.Require().Equal("8.6.0", configmapApplication.Camunda.Modeler.Clusters[0].Version)
				s.Require().Equal("NONE", configmapApplication.Camunda.Modeler.Clusters[0].Authentication)
				s.Require().Equal("grpc://zeebe-gateway.test-1:26500", configmapApplication.Camunda.Modeler.Clusters[0].Url.Zeebe.Grpc)
				s.Require().Equal("http://zeebe-gateway.test-1:8080", configmapApplication.Camunda.Modeler.Clusters[0].Url.Zeebe.Rest)
				s.Require().Equal("http://operate.test-1:8080", configmapApplication.Camunda.Modeler.Clusters[0].Url.Operate)
				s.Require().Equal("http://tasklist.test-1:8080", configmapApplication.Camunda.Modeler.Clusters[0].Url.Tasklist)
				s.Require().Equal("test-cluster-2", configmapApplication.Camunda.Modeler.Clusters[1].Id)
				s.Require().Equal("test cluster 2", configmapApplication.Camunda.Modeler.Clusters[1].Name)
				s.Require().Equal("8.7.0-alpha1", configmapApplication.Camunda.Modeler.Clusters[1].Version)
				s.Require().Equal("BEARER_TOKEN", configmapApplication.Camunda.Modeler.Clusters[1].Authentication)
				s.Require().Equal("grpc://zeebe-gateway.test-2:26500", configmapApplication.Camunda.Modeler.Clusters[1].Url.Zeebe.Grpc)
				s.Require().Equal("http://zeebe-gateway.test-2:8080", configmapApplication.Camunda.Modeler.Clusters[1].Url.Zeebe.Rest)
				s.Require().Equal("http://operate.test-2:8080", configmapApplication.Camunda.Modeler.Clusters[1].Url.Operate)
				s.Require().Equal("http://tasklist.test-2:8080", configmapApplication.Camunda.Modeler.Clusters[1].Url.Tasklist)
			},
		}, {
			Name: "TestContainerShouldNotConfigureClustersIfZeebeDisabledAndNoCustomConfiguration",
			Values: map[string]string{
				"webModeler.enabled":                  "true",
				"webModeler.restapi.mail.fromAddress": "example@example.com",
				"postgresql.enabled":                  "false",
				"zeebe.enabled":                       "false",
			},
			Verifier: func(t *testing.T, output string, err erro


le>","4":"<S3: lm>","5":"69.66667"}],"options":{"columns":{"min":{},"max":[10],"total":[5]},"rows":{"min":[10],"max":[10],"total":[48]},"pages":{}}}
  </script>

map() y tablas

map() considera tablas, como tibbles y data.frames, como operaciones de columnas y no lineas.

datos_limpios %>%
  group_by(matricula, primer, apellido) %>%
  summarise() %>%
  map(~.x)


yer. " alt="" coords="6,4,218,54"/></map>

<map name="_c_p_t_mutable_numeric_data_07_type_conversion_08" id="_c_p_t_mutable_numeric_data_07_type_conversion_08">
<area shape="rect" id="node1" href="category_c_p_t_mutable_numeric_data_07_type_conversion_08.html" title="Type conversion methods for CPTMutableNumericData. " alt="" coords="5,4,187,54"/></map>

<map name="_c_p_t_mutable_text_style_07_c_p_t_platform_specific_mutable_text_style_extensions_08" id="_c_p_t_mutable_text_style_07_c_p_t_platform_specific_mutable_text_style_extensions_08">
<area shape="rect" id="node1" href="category_c_p_t_mutable_text_style_07_c_p_t_platform_specific_mutable_text_style_extensions_08.html" title="CPTMutableTextStyle\l(CPTPlatformSpecificMutable\lTextStyleExtensions)" alt="" coords="5,4,211,73"/></map>

<map name="_c_p_t_numeric_data_07_type_conversion_08" id="_c_p_t_numeric_data_07_type_conversion_08">
<area shape="rect" id="node1" href="category_c_p_t_numeric_data_07_type_conversion_08.html" title="Type conversion methods for CPTNumericData. " alt="" coords="6,5,247,35"/></map>

<map name="_c_p_t_numeric_data_type" id="_c_p_t_numeric_data_type">
<area shape="rect" id="node1" href="struct_c_p_t_numeric_data_type.html" title="Structure that describes the encoding of numeric data samples. " alt="" coords="5,5,165,35"/></map>

<map name="_c_p_t_plot_07_abstract_methods_08" id="_c_p_t_plot_07_abstract_methods_08">
<area shape="rect" id="node1" href="category_c_p_t_plot_07_abstract_methods_08.html" title="CPTPlot abstract methods—must be overridden by subclasses. " alt="" coords="5,5,192,35"/></map>

<map name="_c_p_t_plot_space_07_abstract_methods_08" id="_c_p_t_plot_space_07_abstract_methods_08">
<area shape="rect" id="node1" href="category_c_p_t_plot_space_07_abstract_methods_08.


using UnityEngine;
using Netick;
using Netick.Unity;
using Network = Netick.Unity.Network;

namespace Netick.Samples
{
  /// <summary>
  /// This is a helper script for quick prototyping, used to show useful network information of Netick.
  /// </summary>
  [AddComponentMenu("Netick/Network Info")]
  public class NetworkInfo : NetworkEventsListener
  {
    [Header("Network Stats")]
    public Vector2 Offset                     = new Vector2(27, 20);

    [Header("Network Conditions Icons")]
    public float    MediumLatencyThreshold    = 150;
    public float    HighLatencyThreshold      = 250;
    public float    MediumPacketLossThreshold = 1;
    public float    HighPacketLossThreshold   = 10;

    public Vector2  PacketLossIconOffset      = new Vector2(-80, 30);
    public Vector2  LatencyIconOffset         = new Vector2(-80, 70);
    public Vector2  ServerLagIconOffset       = new Vector2(-80, 110);
    public float    IconSize                  = 30;

    private Texture _packetLossIcon;
    private Texture _latencyIcon;
    private Texture _serverLagIcon;

    private void Awake()
    {
      _packetLossIcon = Resources.Load<Texture>("Network Icons/PacketLoss");
      _latencyIcon    = Resources.Load<Texture>("Network Icons/Latency");
      _serverLagIcon  = Resources.Load<Texture>("Network Icons/ServerLag");
    }

    private void OnGUI()
    {
      if (Network.IsRunning)
      {
        if (Sandbox != null && Sandbox.IsConnected && Sandbox.IsVisible)
        {
          DrawText(0, "RTT",          (Sandbox.RTT * 1000f).ToString(),                         "ms");
          DrawText(1, "In",            Sandbox.InKBps.ToString(),                               "KB/s");
          DrawText(2, "Out",           Sandbox.OutKBps.ToString(),                              "KB/s");
          DrawText(3, "In Loss",      (Sandbox.InPacketLoss * 100f).ToString(),                 "%");
          DrawText(4, "Out Loss",     (Sandbox.OutPacketLoss * 100f).ToString(),                "%");
          DrawText(5, "Interp Delay", (Sandbox.InterpolationDelay * 1000f).ToString(),          "ms");
          DrawText


Info{Name: "IsNil", Params: []string{"value"}},
}

func (checker *isNilChecker) Check(params []interface{}, names []string) (result bool, error string) {
	return isNil(params[0]), ""
}

func isNil(obtained interface{}) (result bool) {
	if obtained == nil {
		result = true
	} else {
		switch v := reflect.ValueOf(obtained); v.Kind() {
		case reflect.Chan, reflect.Func, reflect.Interface, reflect.Map, reflect.Ptr, reflect.Slice:
			return v.IsNil()
		}
	}
	return
}

// -----------------------------------------------------------------------
// NotNil checker. Alias for Not(IsNil), since it's so common.

type notNilChecker struct {
	*CheckerInfo
}

// The NotNil checker verifies that the obtained value is not nil.
//
// For example:
//
//     c.Assert(iface, NotNil)
//
// This is an alias for Not(IsNil), made available since it's a
// fairly common check.
//
var NotNil Checker = &notNilChecker{
	&CheckerInfo{Name: "NotNil", Params: []string{"value"}},
}

func (checker *notNilChecker) Check(params []interface{}, names []string) (result bool, error string) {
	return !isNil(params[0]), ""
}

// -----------------------------------------------------------------------
// Equals checker.

type equalsChecker struct {
	*CheckerInfo
}

// The Equals checker verifies that the obtained value is equal to
// the expected value, according to usual Go semantics for ==.
//
// For example:
//
//     c.Assert(value, Equals, 42)
//
var Equals Checker = &equalsChecker{
	&CheckerInfo{Name: "Equals", Params: []string{"obtained", "expected"}},
}

func (checker *equalsChecker) Check(params []interface{}, names []string) (result bool, error string) {
	defer func() {
		if v := recover(); v != nil {
			result = false
			error = fmt.Sprint(v)
		}
	}()
	return params[0] == params[1], ""
}

// -----------------------------------------------------------------------
// DeepEquals checker.

type deepEqualsChecker struct {
	*CheckerInfo
}

// The DeepEquals checker verifies that the obtained value is deep-equal to
// the expected value.  The check will work correctly even when facing
// slices, interfaces, and values of different types (which always fail
// the test).
//
// For example:
//
//     c.Assert(value, DeepEquals, 42)
//     c.Assert(array, DeepEquals, []string{"hi", "there"})
//
var DeepEquals Checker = &deepEqualsChecker{
	&CheckerInfo{Name: "DeepEquals", Params: []string{"obtained", "expected"}},
}

func (checker *deepEqualsChecker) Check(params []interface{}, names []string) (result bool, error string) {
	return reflect.DeepEqual(params[0], params[1]), ""
}

// -----------------------------------------------------------------------
// HasLen checker.

type hasLenChecker struct {
	*CheckerInfo
}

// The HasLen checker verifies that the obtained value has the
// provided length. In many cases this is superior to using Equals
// in conjuction with the len function because in case the check
// fails the value itself will be printed, instead of its length,
// providing more details for figuring the problem.
//
// For example:
//
//     c.Assert(list, HasLen, 5)
//
var HasLen Checker = &hasLenChecker{
	&CheckerInfo{Name: "HasLen", Params: []string{"obtained", "n"}},
}

func (checker *hasLenChecker) Check(params []interface{}, names []string) (result bool, error string) {


fn test_cmp() -> Result<(), Error> {
        assert_eq!(
            FXP::<8, 8, false>::from_float(1.0)?,
            FXP::<8, 8, false>::from_float(1.0)?,
        );
        assert_eq!(
            FXP::<8, 8, true>::from_float(-1.0)?,
            FXP::<8, 8, true>::from_float(-1.0)?,
        );
        assert!(FXP::<8, 8, false>::from_float(1.0)? > FXP::<8, 8, false>::from_float(0.0)?);
        assert!(FXP::<8, 8, false>::from_float(0.0)? < FXP::<8, 8, false>::from_float(1.0)?);
        assert!(FXP::<8, 8, true>::from_float(-2.0)? < FXP::<8, 8, true>::from_float(-1.0)?);
        assert!(FXP::<8, 8, true>::from_float(-1.0)? < FXP::<8, 8, true>::from_float(0.0)?);
        assert!(FXP::<8, 8, true>::from_float(0.0)? < FXP::<8, 8, true>::from_float(1.0)?);
        assert!(FXP::<8, 8, true>::from_float(1.0)? > FXP::<8, 8, true>::from_float(0.0)?);
        assert!(FXP::<8, 8, true>::from_float(0.0)? > FXP::<8, 8, true>::from_float(-1.0)?);
        assert!(FXP::<8, 8, true>::from_float(-1.0)? > FXP::<8, 8, true>::from_float(-2.0)?);
        Ok(())
    }
}
//! UDP Tunnel server

use std::{io, net::SocketAddr, sync::Arc, time::Duration};

use async_trait::async_trait;
use log::{debug, error, info};
use shadowsocks::{
    lookup_then,
    net::UdpSocket as ShadowUdpSocket,
    relay::{socks5::Address, udprelay::MAXIMUM_UDP_PAYLOAD_SIZE},
    ServerAddr,
};
use tokio::{net::UdpSocket, time};

use crate::local::{
    context::ServiceContext,
    loadbalancing::PingBalancer,
    net::{UdpAssociationManager, UdpInboundWrite},
};

#[derive(Clone)]
struct TunnelUdpInboundWriter {
    inbound: Arc<UdpSocket>,
}

#[async_trait]
impl UdpInboundWrite for TunnelUdpInboundWriter {
    async fn send_to(&self, peer_addr: SocketAddr, _remote_addr: &Address, data: &[u8]) -> io::Result<()> {
        self.inbound.send_to(data, peer_addr).await.map(|_| ())
    }
}

pub struct UdpTunnel {
    context: Arc<ServiceContext>,
    time_to_live: Option<Duration>,
    capacity: Option<usize>,
}

impl UdpTunnel {
    pub fn new(context: Arc<ServiceContext>, time_to_live: Option<Duration>, capacity: Option<usize>) -> UdpTunnel {
        UdpTunnel {
            context,
            time_to_live,
            capacity,
        }
    }

    pub async fn run(
        &mut self,
        client_config: &ServerAddr,
        balancer: PingBalancer,
        forward_addr: &Address,
    ) -> io::Result<()> {
        let socket = match *client_config {
            ServerAddr::SocketAddr(ref saddr) => {
                ShadowUdpSocket::listen_with_opts(saddr


typeface).
  // Aim for 75–100 characters a line when possible, at smaller sizes type size is more important.
  // ! Make sure to have as many widths as breakpoints above.
  // Note: this was 'maxwidths' in previous versions.
  measures: <Measures>{
    'measure-0': 500, // 500px wide
    'measure-1': 550, // 550px wide
    'measure-2': 600, // 600px wide
    'measure-3': 680, // 680px wide
    'measure-4': 750 // 750px wide
  },

  // Set the max-widths for containers (based on design).
  // ! Make sure to have as many widths as breakpoints above.
  maxWidths: <MaxWidths>{
    'width-0': 500, // 500px wide
    'width-1': 600, // 600px wide
    'width-2': 800, // 800px wide
    'width-3': 1100, // 1100px wide
    'width-4': 1300 // 1300px wide
  },

  // Gutter widths
  gutterWidths: <GutterWidths>{
    small: 1, // 1rem
    medium: 2, // 2rem
    large: 4 // 4rem
  },

  // Add typefaces here.
  // Add weight and style details too.
  // ! Set cap height to set to the baseline.

  bodyType: <Font>{
    fontFamily: 'Georgia, serif',
    regular: 400,
    bold: 700,
    italic: 'italic',
    capHeight: 0.66
  },

  headingType: <Font>{
    fontFamily: 'Helvetica, sans-serif',
    regular: 400,
    bold: 700,
    capHeight: 0.66
  },

  monospaceType: <Font>{
    fontFamily: 'Menlo, monospace',
    regular: 400,
    capHeight: 0.68
  },

  baseRatios: <BaseRatios>[
    // Major Third http://www.modularscale.com/?16,28&px&1.25&web&text
    {
      base: [16, 28],
      ratio: majorThird
    },
    // Major Third http://www.modularscale.com/?17,30&px&1.25&web&text
    {
      base: [17, 30],
      ratio: majorThird
    },
    // Major Third http://www.modularscale.com/?18,32&px&1.25&web&text
    {
      base: [18, 32],
      ratio: majorThird
    },
    // Perfect Fourth http://www.modularscale.com/?20,40&px&1.333&web&text
    {
      base: [20, 40],
      ratio: perfectFourth
    },
    // Aug. Fourth http://www.modularscale.com/?22,50&px&1.414&web&text
    {
      base: [22, 50],
      ratio: augFourth
    }
  ],

  // Here are some local fonts cap-height sizes to get you started:
  // Georgia: 0.66, Times / Times New Roman: 0.65, Palatino: 0.52
  // Lucida Grande: 0.72, Helvetica: 0.66, Verdana: 0.76, Tahoma: 0.76

  // Selection of Typekit fonts cap-height sizes:
  // Proxima Nova: 0.57, Museo Slab: 0.66, JAF Facit: 0.7, Brandon Grotesque: 0.65, Clavo: 0.7, Adelle: 0.66, FF Tisa Pro: 0.82, Jubilat: 0.66, Futura PT: 0.66, Chaparral Pro: 0.5, Minion Pro: 0.66, Myriad Pro: 0.66, Adobe Caslon Pro: 0.36

  // Text colours. British English.
  headingColour: <RGBHex>'#2E2E2E',
  bodyColour: <RGBHex>'#494949',
  linkColour: <RGBHex>'#0E58F5',
  hoverColour: <RGBHex>'#0B348B',
  captionColour: <RGBHex>'#BDC8CC',
  white: <RGBHex>'#FFFFFF',
  lightAccent: <RGBHex>'#DDDAD4',
  darkAccent: <RGBHex>'#515668',
  accent: <RGBHex>'#BD8D46',
  callToAction: <


5.5 0 0 1-.41.5H3.5a.5.5 0 0 1-.5-.4V6h4Z\"/>") { } }
    public class BatteryCheckmark : Icon { public BatteryCheckmark() : base("BatteryCheckmark", IconVariant.Regular, IconSize.Size20, "<path d=\"M13.5 5A2.5 2.5 0 0 1 16 7.5v.83h1.17a.83.83 0 0 1 .83.84v1.67a.83.83 0 0 1-.83.83H16v.83a2.5 2.5 0 0 1-2.5 2.5h-2.7c.09-.34.15-.7.18-1.06h2.77c.65 0 1.18-.5 1.24-1.12l.01-.13V7.2c0-.64-.5-1.17-1.12-1.24H4.5c-.65 0-1.4.5-1.5 1.13V8.6c-.36.18-.7.4-1 .66V7.5A2.5 2.5 0 0 1 4.5 5h9ZM10 13.5a4.5 4.5 0 1 1-9 0 4.5 4.5 0 0 1 9 0Zm-2.15-1.85a.5.5 0 0 0-.7 0L4.5 14.29l-.65-.64a.5.5 0 0 0-.7.7l1 1c.2.2.5.2.7 0l3-3a.5.5 0 0 0 0-.7Z\"/>") { } }
    public class BatterySaver : Icon { public BatterySaver() : base("BatterySaver", IconVariant.Regular, IconSize.Size20, "<path d=\"M9 9.56c0-1.23-.62-3.03-1.83-5.27-.21-.39-.76-.38-1-.02-.32.51-.8 1.03-1.45 1.56l-.29.22-.65.51C2.43 7.64 1.9 8.61 2.02 10.03c.1 1.25.85 2.15 2.15 2.56-.46.54-1.06.96-1.81 1.28a.6.6 0 0 0-.32.77c.13.3.47.44.77.32a5.55 5.55 0 0 0 3.04-2.86c.22-.48.4-.96.53-1.44l.03-.12.08-.32.05-.26.04-.19.05-.37c.03-.3.05-.6.04-.88V8.5c.01-.3.26-.56.57-.56.32 0 .59.25.6.58a9.02 9.02 0 0 1-.7 3.5l-.01.07c-.02.07 0 .15.02.21.08.18.3.26.47.18l.09-.04.15-.11A3.81 3.81 0 0 0 9 9.56Zm7-2.2A2.5 2.5 0 0 0 13.5 5H9.53c-.3 0-.53.14-.53.5s.2.5.53.5h4.34c.64.06 1.13.6 1.13 1.24v5.63c-.06.63-.6 1.13-1.25 1.13H6c-.3 0-.5.2-.5.5s.2.5.5.5h7.65A2.5 2.5 0 0 0 16 12.5v-.82H17.28a.83.83 0 0 0 .72-.83V9.08a.83.83 0 0 0-.84-.73L16 8.33v-.98Z\"/>") { } }
    public class BatteryWarning : Icon { public BatteryWarning() : base("BatteryWarning", IconVariant.Regular, IconSize.Size20, "<path d=\"M13.5 5A2.5 2.5 0 0 1 16


rcx)
	vmovhpd	%xmm1, 152(%r8)
	vextracti128	$1, %ymm0, %xmm0
	vmovlpd	%xmm0, 152(%r9)
	vmovhpd	%xmm0, 152(%r10)
	vmovdqu	640(%rax), %ymm0
	vmovdqu	%xmm0, %xmm1
	vmovlpd	%xmm1, 160(%rcx)
	vmovhpd	%xmm1, 160(%r8)
	vextracti128	$1, %ymm0, %xmm0
	vmovlpd	%xmm0, 160(%r9)
	vmovhpd	%xmm0, 160(%r10)
	leaq	9184(%rsp), %rbp
	leaq	192(%rsp), %r12
	call	L_rej_uniform_avx$1
L__crypto_kem_enc_derand_jazz$57:
	movq	%rcx, %r10
	leaq	9696(%rsp), %rbp
	leaq	704(%rsp), %r12
	call	L_rej_uniform_avx$1
L__crypto_kem_enc_derand_jazz$56:
	movq	%rcx, %r11
	leaq	10208(%rsp), %rbp
	leaq	1216(%rsp), %r12
	call	L_rej_uniform_avx$1
L__crypto_kem_enc_derand_jazz$55:
	movq	%rcx, %rbx
	leaq	10720(%rsp), %rbp
	leaq	1728(%rsp), %r12
	call	L_rej_uniform_avx$1
L__crypto_kem_enc_derand_jazz$54:
	cmpq	$255, %r10
	setbe	%al
	cmpq	$255, %r11
	setbe	%dl
	orb 	%dl, %al
	cmpq	$255, %rbx
	setbe	%dl
	cmpq	$255, %rcx
	setbe	%sil
	orb 	%sil, %dl
	orb 	%al, %dl
	jmp 	L__crypto_kem_enc_derand_jazz$31
L__crypto_kem_enc_derand_jazz$32:
	leaq	4288(%rsp), %rax
	leaq	192(%rsp), %r8
	leaq	704(%rsp), %r9
	leaq	1216(%rsp), %rbp
	leaq	1728(%rsp), %r12
	leaq	-824(%rsp), %rsp
	call	L_keccakf1600_4x_avx2$1
L__crypto_kem_enc_derand_jazz$53:
	leaq	824(%rsp), %rsp
	vmovdqu	(%rax), %ymm0
	vmovdqu	%xmm0, %xmm1
	vmovlpd	%xmm1, (%r8)
	vmovhpd	%xmm1, (%r9)
	vextracti128	$1, %ymm0, %xmm0
	vmovlpd	%xmm0, (%rbp)
	vmovhpd	%xmm0, (%r12)
	vmovdqu	32(%rax), %ymm0
	vmovdqu	%xmm0, %xmm1
	vmovlpd	%xmm1, 8(%r8)
	vmovhpd	%xmm1, 8(%r9)
	vextracti128	$1, %ymm0, %xmm0
	vmovlpd	%xmm0, 8(%rbp)
	vmovhpd	%xmm0, 8(%r12)
	vmovdqu	64(%rax), %ymm0
	vmovdqu	%xmm0, %xmm


 the given specifications

:param regionType:
    (input) type of region to find (DGNLINK_REGIONTYPE_View,
    DGNLINK_REGIONTYPE_Drawing, etc.)

:param index:
    (input) if there are multiple links of regionType, then return the
    index'th link.

:param doValidation:
    (input) validate the link's target @Returns Pointer to DgnRegionLinkP
    if found, or NULL @Remarks The returned DgnRegionLinkP will be
    deleted when RegionLinkProcessor goes out of scope)doc";

/*---------------------------------------------------------------------------------**//**
* @bsimethod                                                                       2/2023
+---------------+---------------+---------------+---------------+---------------+------*/
void def_RegionLinkProcessor(py::module_& m)
    {
    //===================================================================================
    // struct RegionLinkProcessor
    py::class_< RegionLinkProcessor> c1(m, "RegionLinkProcessor");

    c1.def(py::init<ElementHandleCR>(), "eh"_a);
    c1.def(py::init<EditElementHandleR, bool>(), "eeh"_a, "editable"_a);

    c1.def("FindRegionLink", [] (RegionLinkProcessor& self, WStringCR regionType, int index, bool doValidation)
           {
           return std::unique_ptr< DgnRegionLink, py::nodelete>(self.FindRegionLink(regionType, index, doValidation));
           }, "regionType"_a, "index"_a = -1, "doValidation"_a = false, DOC(Bentley, DgnPlatform, RegionLinkProcessor, FindRegionLink));

    c1.def_property_readonly("LinkCount", &RegionLinkProcessor::GetLinkCount);
    c1.def("GetLinkCount", &RegionLinkProcessor::GetLinkCount, DOC(Bentley, DgnPlatform, RegionLinkProcessor, GetLinkCount));

    c1.def("DoesLinkExist", &RegionLinkProcessor::DoesLinkExist, "linkToMatch"_a, DOC(Bentley, DgnPlatform, RegionLinkProcessor, DoesLinkExist));

    c1.def("GetMatchingLink", [] (RegionLinkProcessor& self, WStringCR regionType, DgnDocumentMonikerCR moniker, WStringCR modelName, WStringCR targetName)
           {
           int indexOut = -1;
           auto retVal = self.GetMatchingLink(indexOut, regionType, moniker, modelName, targetName);
           return py::make_tuple(std::unique_ptr<DgnRegionLink, py::nodelete>(retVal), indexOut);
           }, "regionType"_a, "moniker"_a, "modelName"_a, "targetName"_a, DOC(Bentley, DgnPlatform, RegionLinkProcessor, GetMatchingLink));

    c1.def("HasMatchingLink", &RegionLinkProcessor::HasMatchingLink, "regionType"_a, "moniker"_a, "modelName"_a, "targetName"_a, DOC(Bentley, DgnPlatform, RegionLinkProcessor, HasMatchingLink));
    c1.def("DeleteAllLinks", &RegionLinkProcessor::DeleteAllLinks, "deleteAllLinks"_a, DOC(Bentley, DgnPlatform, RegionLinkProcessor, DeleteAllLinks));
    c1.def("AddLinkTree", &RegionLinkProcessor::AddLinkTree, DOC(Bentley, DgnPlatform, RegionLinkProcessor, AddLinkTree));
    c1.def("FindValidTargetInModel", &RegionLinkProcessor::FindValidTargetInModel, "fileName"_a, "modelName"_a, "targetName"_a, "regionType"_a, "linkIndex"_a, "validateTarget"_a, DOC(Bentley, DgnPlatform, RegionLinkProcessor, FindValidTargetInModel));
    c1.def("GetMatchingLinkIndexAndType", [] (RegionLinkProcessor& self, WStringCR fileName, WStringCR fullFileName, WStringCR modelName, WStringCP targetName)
           {
           int linkIndex = -1;
           WString linkType;
           auto retVal = self.GetMatchingLinkIndexAndType(linkIndex, &linkType, fileName, fullFileName, modelName, targetName);
           return py


io/collector/consumer"
	"go.opentelemetry.io/collector/pdata/ptrace"
	"go.uber.org/zap"
)

const (
	hostInfoMetric     = "traces_host_info"
	hostIdentifierAttr = "grafana.host.id"
)

var _ connector.Traces = (*connectorImp)(nil)

type connectorImp struct {
	config Config
	logger *zap.Logger

	started      bool
	done         chan struct{}
	shutdownOnce sync.Once

	metricsConsumer consumer.Metrics
	hostMetrics     *hostMetrics
}

func newConnector(logger *zap.Logger, config component.Config) *connectorImp {
	logger.Info("Building host_info connector")
	cfg := config.(*Config)
	return &connectorImp{
		config:      *cfg,
		logger:      logger,
		done:        make(chan struct{}),
		hostMetrics: newHostMetrics(),
	}
}

// Capabilities implements connector.Traces.
func (c *connectorImp) Capabilities() consumer.Capabilities {
	return consumer.Capabilities{MutatesData: false}
}

// ConsumeTraces implements connector.Traces.
func (c *connectorImp) ConsumeTraces(ctx context.Context, td ptrace.Traces) error {
	for i := 0; i < td.ResourceSpans().Len(); i++ {
		resourceSpan := td.ResourceSpans().At(i)

		for j := 0; j < resourceSpan.ScopeSpans().Len(); j++ {
			attrs := resourceSpan.Resource().Attributes()
			mapping := attrs.AsRaw()

			for key, val := range mapping {
				for _, attrName := range c.config.HostIdentifiers {
					if key == attrName {
						c.hostMetrics.add(val.(string))
						break
					}
				}
			}
		}
	}
	return nil
}

// Start implements connector.Traces.
func (c *connectorImp) Start(ctx context.Context, host component.Host) error {
	c.logger.Info("Starting host_info connector")
	c.started = true
	ticker := time.NewTicker(c.config.MetricsFlushInterval)
	go func() {
		for {
			select {
			case <-c.done:
				ticker.Stop()
				return
			case <-ticker.C:
				if err := c.flush(ctx); err != nil {
					c.logger.Error("Error consuming metrics", zap.Error(err))
				}
			}
		}
	}()
	return nil
}

// Shutdown implements connector.Traces.
func (c *connectorImp) Shutdown(ctx context.Context) error {
	c.shutdownOnce.Do(func() {
		c.logger.Info("Stopping host_info connector")
		if c.started {
			// flush metrics on shutdown
			if err := c.flush(ctx); err != nil {
				c.logger.Error("Error consuming metrics", zap.Error(err))
			}
			c.done <- struct{}{}
			c.started = false
		}
	})
	return nil
}

func (c *connectorImp) flush(ctx context.Context) error {
	var err error

	metrics, count := c.hostMetrics.metrics()
	if count > 0 {
		c.hostMetrics.reset()
		c.logger.Debug("Flushing metrics", zap.Int("count", count))
		err = c.metricsConsumer.ConsumeMetrics(ctx, *metrics)
	}
	return err
}
package relabel

import (
	"testing"

	"github.com/stretchr/testify/require"

	"github.com/grafana/river"
)

func TestParseConfig(t *testing.T) {
	for _, tt := range []struct {
		name      string
		cfg       string
		expectErr bool
	}{
		{
			name: "valid keepequal config",
			cfg: `
			action = "keepequal"
			target_


ile 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.
==============================================================================*/

#if GOOGLE_CUDA

#define EIGEN_USE_GPU

#include "tensorflow/core/kernels/multinomial_op.h"

#include <assert.h>
#include <stdio.h>

#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor"
#include "tensorflow/core/framework/tensor_types.h"
#include "tensorflow/core/kernels/random_op.h"
#include "tensorflow/core/lib/random/philox_random.h"
#include "tensorflow/core/lib/random/random_distributions.h"
#include "tensorflow/core/util/cuda_kernel_helper.h"

namespace tensorflow {

namespace functor {

using GPUDevice = Eigen::GpuDevice;

// Kernel for Multinomial op.  Data is interpreted to have the following shapes:
//   scores: [B, S, C];  maxima: [B, S];  output: [B, S].
__global__ void MultinomialKernel(int32 nthreads, const int32 num_classes,
                                  const int32 num_samples, const float* scores,
                                  const float* maxima, int64* output) {
  CUDA_1D_KERNEL_LOOP(index, nthreads) {
    const int maxima_idx = index / num_classes;
    if (ldg(maxima + maxima_idx) == ldg(scores + index)) {
      CudaAtomicMax(reinterpret_cast<uint64*>(output + maxima_idx),
                    static_cast<uint64>(index % num_classes));
    }
  }
}

template <typename T>
struct MultinomialFunctor<GPUDevice, T> {
  void operator()(OpKernelContext* ctx, const GPUDevice& d,
                  typename TTypes<T>::ConstMatrix logits,
                  typename TTypes<float>::Flat noises,
                  typename TTypes<float>::Flat scores,
                  typename TTypes<float>::Flat maxima, int batch_size,
                  int num_classes, int num_samples,
                  const random::PhiloxRandom& gen,
                  typename TTypes<int64>::Matrix output) {
    // Uniform, [0, 1).
    typedef random::UniformDistribution<random::PhiloxRandom, float> Dist;
    functor::FillPhiloxRandom<GPUDevice, Dist>()(ctx, d, gen, noises.data(),
                                                 noises.size(), Dist());

#if defined(EIGEN_HAS_INDEX_LIST)
    Eigen::IndexList<Eigen::type2index<2>> kTwo;
    Eigen::IndexList<int, int, int> bsc;
    bsc.set(0, batch_size);
    bsc.set(1, num_samples);
    bsc.set(2, num_classes);

    Eigen::IndexList<int, Eigen::type2index<1>, int> boc;
    boc.set(0, batch_size);
    boc.set(2, num_classes);

    Eigen::IndexList<Eigen::type2index<1>, int, Eigen::type2index<1>> oso;
    oso.set(1, num_samples);
#else
    Eigen::array<int, 1> kTwo{2};
    Eigen::array<int, 3> bsc{batch_size, num_samples, num_classes};
    Eigen::array<int, 3> boc{batch_size, 1, num_classes};
    Eigen::array<int, 3> oso{1, num_samples, 1};


.")
            dataError.toString()
        }
        return map
    }

    fun isValidEmail(email: String?): Boolean {
        return if (email == null)
            false
        else
            Regex("^\\w+([-+.']\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*\$").containsMatchIn(email)
                    && email.length > 5
                    && email.substringAfterLast(".").length > 1
    }

    @SuppressLint("DiscouragedApi")
    fun getSiteIcon(siteName: String, color: Int?): Drawable? {

        var trimmedSiteName = siteName
            .lowercase()
            .replace(" ", "")

        val svg: Sharp? = try {
            Sharp.loadResource(context.resources, context.resources.getIdentifier(trimmedSiteName, "raw", context.packageName))
        } catch (_: Exception) {
            trimmedSiteName = trimmedSiteName.replace(("[^\\w\\d ]").toRegex(), "")
            try {
                Sharp.loadResource(context.resources, context.resources.getIdentifier(trimmedSiteName, "raw", context.packageName))
            } catch (_: Exception) {
                trimmedSiteName = "_${trimmedSiteName}"
                try {
                    Sharp.loadResource(context.resources, context.resources.getIdentifier(trimmedSiteName, "raw", context.packageName))
                } catch (_: Exception) {
                    null
                }
            }
        }

        svg?.setOnElementListener(object : OnSvgElementListener {
            override fun onSvgStart(canvas: Canvas, bounds: RectF?) { }
            override fun onSvgEnd(canvas: Canvas, bounds: RectF?) { }
            override fun <T : Any> onSvgElementDrawn(id: String?, element: T, canvas: Canvas, paint: Paint?) { }

            override fun <T : Any> onSvgElement(p0: String?, p1: T, elementBounds: RectF?, canvas: Canvas, canvasBounds: RectF?, paint: Paint?): T {

                if (color != null) {
                    paint?.color = Color.argb (
                        255,
                        Color.red(color),
                        Color.blue(color),
                        Color.green(color)
                    )
                } else {
                    val palette = context.resources.getColor(android.R.attr.textColorPrimary)
                    paint?.color = Color.argb (
                        255,
                        Color.red(palette),
                        Color.blue(palette),
                        Color.green(palette)
                    )
                }

                return p1
            }

        })

        return try { svg?.drawable?.current } catch (_: Exception) { null }

    }

    fun getSiteIconFilenames (): ArrayList<String> {
        val filenames = arrayListOf<String>()
        val rawResources = raw()
        val rawClass = R.raw::class.java
        val fields: Array<out Field> = rawClass.declaredFields

        for (element in fields) {
            val filename = element.name
            filenames.add(filename)
        }

        return filenames
    }

    fun ByteArray.toHex(): String = joinToString(separator = "") { eachByte -> "%02x".format(eachByte) } // to print, not related to crypto

    fun screenLockEnabled() : Boolean {

        var isKeyguardSet = false // don't allow successful authentication by default

        try {
            val biometricManager = BiometricManager.from(context)
            val canAuthenticate = biometricManager.canAuthenticate(BiometricManager.Authenticators.BIOMETRIC_WEAK or BiometricManager.Authenticators.DEVICE_CREDENTIAL)

            isKeyguardSet = if (canAuthenticate == BiometricManager.BIOMETRIC_SUCCESS) {
                Log.d("Keyspace", "Device lock found")
                true


3TwinNormalConstMeta =>
      const TaskConstMeta(
        debugName: "handle_stream_sink_at_3_twin_normal",
        argNames: ["sink", "key", "max"],
      );

  @override
  Stream<LogTwinRustAsync>
      crateApiPseudoManualStreamTwinRustAsyncHandleStreamSinkAt3TwinRustAsync(
          {required int key, required int max}) {
    final sink = RustStreamSink<LogTwinRustAsync>();
    unawaited(handler.executeNormal(NormalTask(
      callFfi: (port_) {
        final serializer = SseSerializer(generalizedFrbRustBinding);
        sse_encode_StreamSink_log_twin_rust_async_Sse(sink, serializer);
        sse_encode_u_32(key, serializer);
        sse_encode_u_32(max, serializer);
        pdeCallFfi(generalizedFrbRustBinding, serializer,
            funcId: 819, port: port_);
      },
      codec: SseCodec(
        decodeSuccessData: sse_decode_unit,
        decodeErrorData: null,
      ),
      constMeta:
          kCrateApiPseudoManualStreamTwinRustAsyncHandleStreamSinkAt3TwinRustAsyncConstMeta,
      argValues: [sink, key, max],
      apiImpl: this,
    )));
    return sink.stream;
  }

  TaskConstMeta
      get kCrateApiPseudoManualStreamTwinRustAsyncHandleStreamSinkAt3TwinRustAsyncConstMeta =>
          const TaskConstMeta(
            debugName: "handle_stream_sink_at_3_twin_rust_async",
            argNames: ["sink", "key", "max"],
          );

  @override
  Future<List<String>> crateApiMiscTypeHandleStringListTwinNormal(
      {required List<String> names}) {
    return handler.executeNormal(NormalTask(
      callFfi: (port_) {
        final serializer = SseSerializer(generalizedFrbRustBinding);
        sse_encode_list_String(names, serializer);
        pdeCallFfi(generalizedFrbRustBinding, serializer,
            funcId: 820, port: port_);
      },
      codec: SseCodec(
        decodeSuccessData: sse_decode_list_String,
        decodeErrorData: null,
      ),
      constMeta: kCrateApiMiscTypeHandleStringListTwinNormalConstMeta,
      argValues: [names],
      apiImpl: this,
    ));
  }

  TaskConstMeta get kCrateApiMiscTypeHandleStringListTwinNormalConstMeta =>
      const TaskConstMeta(
        debugName: "handle_string_list_twin_normal",
        argNames: ["names"],
      );

  @override
  Future<List<String>>
      crateApiPseudoManualMiscTypeTwinRustAsyncHandleStringListTwinRustAsync(
          {required List<String> names}) {
    return handler.executeNormal(NormalTask(
      callFfi: (port_) {
        final serializer = SseSerializer(generalizedFrbRustBinding);
        sse_encode_list_String(names, serializer);
        pdeCallFfi(generalizedFrbRustBinding, serializer,
            funcId: 821, port: port_);
      },
      codec: SseCodec(
        decodeSuccessData: sse_decode_list_String,
        decodeErrorData: null,
      ),
      constMeta:
          kCrateApiPseudoManualMiscTypeTwinRustAsyncHandleStringListTwinRustAsyncConstMeta,
      argValues: [names],
      apiImpl: this,
    ));
  }

  TaskConstMeta
      get kCrateApiPseudoManualMiscTypeTwinRustAsyncHandleStringListTwinRustAsyncConstMeta =>
          const TaskConstMeta(
            debugName: "handle_string


f59f54,12px 9px 0 .020em #444,5px 10px 0 .020em #444,6px 10px 0 .020em,7px 10px 0 .020em,8px 10px 0 .020em,9px 10px 0 .020em,10px 10px 0 .020em #f59f54,11px 10px 0 .020em #444,6px 11px 0 .020em #444,7px 11px 0 .020em,8px 11px 0 .020em,9px 11px 0 .020em #f59f54,10px 11px 0 .020em #444,7px 12px 0 .020em #444,8px 12px 0 .020em,9px 12px 0 .020em #444,7px 13px 0 .020em #444,8px 13px 0 .020em,9px 13px 0 .020em #444,6px 14px 0 .020em #444,7px 14px 0 .020em #444,8px 14px 0 .020em,9px 14px 0 .020em #444,10px 14px 0 .020em #444,5px 15px 0 .020em #444,6px 15px 0 .020em,7px 15px 0 .020em,8px 15px 0 .020em,9px 15px 0 .020em,10px 15px 0 .020em #f59f54,11px 15px 0 .020em #444,5px 16px 0 .020em #444,6px 16px 0 .020em #444,7px 16px 0 .020em #444,8px 16px 0 .020em #444,9px 16px 0 .020em #444,10px 16px 0 .020em #444,11px 16px 0 .020em #444}}.nes-icon.trophy.is-empty::before{width:1px;height:1px;color:#adafbb;box-shadow:3px 1px,4px 1px,5px 1px,6px 1px,7px 1px,8px 1px,9px 1px,10px 1px,11px 1px,12px 1px,13px 1px,3px 2px,13px 2px,1px 3px,2px 3px,3px 3px,13px 3px,14px 3px,15px 3px,1px 4px,3px 4px,13px 4px,15px 4px,1px 5px,3px 5px,13px 5px,15px 5px,2px 6px,3px 6px,13px 6px,14px 6px,3px 7px,13px 7px,3px 8px,13px 8px,4px 9px,12px 9px,5px 10px,11px 10px,6px 11px,10px 11px,7px 12px,9px 12px,7px 13px,9px 13px,6px 14px,7px 14px,9px 14px,10px 14px,5px 15px,11px 15px,5px 16px,6px 16px,7px 16px,8px 16px,9px 16px,10px 16px,11px 16px}@supports (-moz-appearance:meterbar){.nes-icon.trophy.is-empty::before{box-shadow:3px 1px 0 .020em,4px 1px 0 .020em,5px 1px 0 .020em,6px 1px 0 .020em,7px 1px 0 .020em,8px 1px 0 .020em,9px 1px 0 .020em,10px 1px 0 .020em,11px 1px 0 .020em,12px 1px 0 .020em,13px 1px 0 .020em,3px 2px 0 .020em,13px 2px 0 .020em,1px 3px 0 .020em,2px 3px 0 .020em,3px 3px 0 .020em,13px 3px 0 .020em,14px 3px 0 .020em,15px 3px 0 .020em,1px 4px 0 .020em,3px 4px 0 .020em,13px 4px 0 .020em,15px 4px 0 .020em,1px 5px 0 .020em,3px 5px 0 .02


)
Same as `_userinfoMask` without the `:`.
// [A-Za-z0-9!$%&'()*+,\-.;=_~] (including '%')
""");
  tableEntry("_pathChar", r"!$&'()*+,\-.0-9:;=@A-Z_a-z~", r"""
Characters allowed in the path as of RFC 3986.
RFC 3986 section 3.3.
pchar = unreserved / pct-encoded / sub-delims / ":" / "@"
[A-Za-z0-9!$&'()*+,\-.:;=@_~] (without '%')
""");
  tableEntry("_pathCharOrSlash", r"!$&'()*+,\-./0-9:;=@A-Z_a-z~", r"""
Characters allowed in the path as of RFC 3986.
RFC 3986 section 3.3 *and* slash.
[A-Za-z0-9!$&'()*+,\-./:;=@_~] (without '%')
""");
  tableEntry("_queryChar", r"!$&'()*+,\-./0-9:;=?@A-Z_a-z~", r"""
Characters allowed in the query as of RFC 3986.
RFC 3986 section 3.4.
query = *( pchar / "/" / "?" )
[A-Za-z0-9!$&'()*+,\-./:;=?@_~] (without '%')
""");
  tableEntry("_zoneID", r"\-.0-9A-Z_a-z~", r"""
Characters allowed in the ZoneID as of RFC 6874.
ZoneID = 1*( unreserved / pct-encoded )
[A-Za-z0-9\-._~] + '%'
""");
  tableEntry("_tokenChar", r"!$&'*+\-.0-9A-Z^_`a-z{|}~", r"""
Table of the `token` characters of RFC 2045 in a `data:` URI.

A token is any US-ASCII character except SPACE, control characters and
`tspecial` characters. The `tspecial` category is:
'(', ')', '<', '>', '@', ',', ';', ':', '\', '"', '/', '[, ']', '?', '='.

In a data URI, we also need to escape '%' and '#' characters.
""");
  tableEntry("_uric", r"!$&'()*+,\-./0-9:;=?@A-Z_a-z~", r"""
All non-escape RFC-2396 "uric" characters.

The "uric" character set is defined by:
```
 uric        =  reserved | unreserved | escaped
 reserved    =  ";" | "/" | "?" | ":" | "@" | "&" | "=" | "+" | "$" | ","
 unreserved  =  alphanum | mark
 mark        =  "-" | "_" | "." | "!" | "~" | "*" | "'" | "(" | ")"
```
This is the same characters as in a URI query (which is URI pchar plus '?')
""");
  tableEntry("_genDelimiters", r"#/:?@[]", r"""
General delimiter characters, RFC 3986 section 2.2.
gen-delims  = ":" / "/" / "?" / "#" / "[" / "]" / "@"
[:/?#[]@]
""");
  tableEntry("_ipvFutureAddressChars", r"!$&'()*+,\-.0-9:;=A-Z_a-z~", r"""
Characters valid in an IPvFuture address, RFC 3986 section 3.2.2.
1*( unreserved / sub-delims / ":" )
[A-Za-z0-9\-._~]|[!$&'()*+,;=]|:
""");

  var table = (StringLiteralBuilder('_charTables')
        ..writeChars(bits, hexAll: true))
      .close();
  buffer
    ..writeln()
    ..write(table);

  return buffer.toString();
}

const String generatedHeader = """
// Use tools/generate_uri_parser_tables.dart to generate this code
// if necessary.""";

/// Creates a literal of the form
/// ```dart
/// const String someName = "ab\x82


   score += distanceFromBorder * 0.2;
          }
        }
        break;
      }
      case Suit.MarksmanR: {
        if (col !== 0) {
          if (absoluteBCard === 0) {
            // wasting a marksman is weird
            score -= 0.5;
          } else {
            // idk why AIs are obsessed with that move
            score -= 0.3;
          }
        }

        if (col - 1 >= 0) {
          let ourCardCount = countCards(
            lg,
            col - 1,
            row,
            Suit.MarksmanR,
            player,
          );
          score += ourCardCount * 0.8;

          if (ourCardCount > 0) {
            const distanceFromBorder = numCols - col;
            score += distanceFromBorder * 0.2;
          }
          break;
        }
      }
      case Suit.Monk: {
        let ourCardCount = countCards(lg, col, row, Suit.Monk, player);
        score += ourCardCount * 2;
        break;
      }
      case Suit.Peasant: {
        // getting rid of peasants is a neat idea
        score += 1.5;

        // placing peasants to the right of a MarksmanR is good
        for (let c = col - 1; c >= 0; c--) {
          const bc = lg.board[c + row * numCols];
          const abc = bc > 0 ? bc : -bc;
          if (abc === Suit.MarksmanR) {
            score += 0.2;
          }
        }
        // placing peasants to the left of a MarksmanL is good
        for (let c = col + 1; c < numCols; c++) {
          const bc = lg.board[c + row * numCols];
          const abc = bc > 0 ? bc : -bc;
          if (abc === Suit.MarksmanL) {
            score += 0.2;
          }
        }

        // let's try to group peasants together
        let mul = player === Color.Red ? 1 : -1;
        let adjacencyCount = 0;
        let lcol = col - 1;
        let rcol = col + 1;
        if (lcol >= 0 && lg.board[lcol + row * numCols] * mul > 0) {
          // one of our cards on the left? nice
          score += 0.1;
          adjacencyCount++;
        }
        if (rcol < numCols && lg.board[rcol + row * numCols] * mul > 0) {
          // one of our cards on the right? nice
          score += 0.1;
          adjacencyCount++;
        }

        if (adjacencyCount >= 2) {
          // cards on both sides? jackpot!
          score += 0.3;
        }
        break;
      }
    }

    return (score + scoreBonus) * scoreWeight;
  };

  const select = (root: LightMCNode): ISelectResult => {
    const path: LightMCPath = [];
    let n = root;
    let clg = cloneLightGame(lg);
    let cplayer = swapColor(player);

    while (true) {
      if (!n.children) {
        // leaf node, we're done selecting
        return { path, clg, cplayer, node: n };
      }

      let untriedIndices: number[] = [];
      let bestIndex = -1;
      let bestValue = Number.MIN_SAFE_INTEGER;

      for (let index = 0; index < n.children.length; index++) {
        if (n.children[index].numPlays === 0) {
          untriedIndices.push(index);
        }
      }

      let nextPlayer = swapColor(cplayer);

      if (untriedIndices.length > 0) {
        // if any are untried, try a random one
        bestIndex = _.sample(untriedIndices);
        firstTries++;
      } else {
        weightedTries++;
        // otherwise, start weighing
        let Ni = 0;
        for (const child of n.children) {
          Ni += child.numPlays;
        }
        const logNi = Math.log(Ni);

        for (let index


0,$4F
 .byt $7F,$60,$5F
 .byt $7F,$40,$5F
 .byt $7F,$40,$5F
 .byt $7F,$40,$47
 .byt $7F,$40,$43
 .byt $7F,$60,$47
 .byt $7F,$70,$5F
 .byt $7F,$70,$5F
 .byt $7C,$50,$5F
 .byt $78,$40,$4F
 .byt $7F,$60,$4F
 .byt $7F,$70,$5F
 .byt $7F,$7C,$5F
 .byt $7F,$7C,$5F
 .byt $7F,$7C,$7F
 .byt $7F,$7C,$7F
 .byt $7F,$7C,$4F
MSKEthanRunRight13	;3x22
 .byt $7F,$7C,$5F
 .byt $7F,$78,$4F
 .byt $7F,$78,$4F
 .byt $7F,$7C,$4F
 .byt $7F,$78,$5F
 .byt $7F,$70,$7F
 .byt $7F,$60,$7F
 .byt $7F,$60,$7F
 .byt $7F,$60,$7F
 .byt $7F,$60,$5F
 .byt $7F,$60,$4F
 .byt $7F,$70,$47
 .byt $7F,$70,$47
 .byt $7F,$40,$4F
 .byt $7E,$40,$5F
 .byt $7E,$58,$5F
 .byt $7F,$71,$7F
 .byt $7F,$63,$7F
 .byt $7F,$63,$7F
 .byt $7F,$4F,$7F
 .byt $7E,$4F,$7F
 .byt $7F,$47,$7F

BMPEthanJumpRight00	;3x8
 .byt $40,$40,$40
 .byt $40,$42,$40
 .byt $40,$4F,$40
 .byt $40,$46,$40
 .byt $40,$46,$40
 .byt $40,$43,$40
 .byt $40,$41,$60
 .byt $40,$40,$50
BMPEthanJumpRight01	;3x9
 .byt $40,$40,$40
 .byt $40,$46,$40
 .byt $40,$46,$60
 .byt $40,$44,$70
 .byt $40,$4C,$40
 .byt $40,$48,$40
 .byt $40,$48,$40
 .byt $40,$48,$40
 .byt $40,$48,$40
BMPEthanJumpRight02	;3x9
 .byt $40,$40,$40
 .byt $40,$40,$40
 .byt $40,$40,$40
 .byt $40,$40,$40
 .byt $40,$40,$70
 .byt $40,$41,$70
 .byt $40,$46,$40
 .byt $40,$48,$70
 .byt $40,$50,$60
BMPEthanJumpRight03	;3x11
 .byt $40,$40,$40
 .byt $40,$40,$40
 .byt $40,$40,$40
 .byt $40,$40,$40
 .byt $40,$40,$40
 .byt $40,$40,$4C
 .byt $40,$40,$7C
 .byt $40,$41,$60
 .byt $40,$42,$44
 .byt $40,$44,$4E
 .byt $40,$40,$48
BMPEthanJumpRight04	;3x10
 .byt $40,$40,$40
 .byt $40,$40,$40
 .byt $40,$40,$40
 .byt $40,$78,$40
 .by


程，其中涉及大量机器学习的基础知识和部分数学原理，如没有一定的相关基础，理解会较为困难。
因为，笔记并不直接复述视频原理，而是从基础开始，尽可能地创造一个较为丝滑的理解过程。

首先，经过之前的[基础补充](https://www.cnblogs.com/Goblinscholar/p/19126763)，我们了解了关于回归的一些概念，本篇我们便跟随课程的顺序进行学习，同样，会补充相当一部分的相关基础知识帮助理解。

我们以一个问题来引入，现在我们知道了回归是什么，课程中又是用逻辑回归为例讲解，但实际上，**逻辑回归是一个分类算法**。
那么问题来了，为什么一个名字叫回归的算法实际上是用来分类的？这里的回归算法和分类算法又到底差在哪呢？
我们以此开始本篇笔记的内容。

1.分类
====

1.1 什么是分类？
----------

还是先上概念：

> **分类**（Classification）是机器学习中的一种监督学习方法，其主要任务是将输入的数据样本分配到预定的类别标签中。分类的目标是通过训练模型，使其能够根据输入的特征预测一个或多个类别标签。

结合之前我们了解的回归的概念，不难发现，二者的差别实际上在**目标输出**上：
通过数据预测房价，身高，体重等，**输出连续型数值即为回归问题**。
而通过输入数据研判其属于某种标签，如输入一张猫的图片，输出这张图“是猫”或“不是猫”。
又比如输入一段新闻文字，输出其属于“军事新闻”或“娱乐新闻”等，**输出离散型结果即为分类问题**。

1.2 分类是怎么实现的？
=============

还是先回想之前提到的线性回归，假设存在\\(n\\)个输入特征的情况下，线性回归的拟合通式如下：

\\\[y=w\_{1}x\_{1}+w\_{2}x\_{2}+w\_{3}x\_{3}+w\_{4}x\_{4}+\\cdots+w\_{n}x\_{n}+b \\\]

再专业一些，用求和符号来表示：

\\\[y = \\sum\_{i=1}^{n} w\_i x\_i + b \\\]

不管哪种形式，又或者其他回归算法，让我们很轻松地理解到所谓“回归”的都是一点：**把输入代入公式得到的 \\(y\\) 即为最终输出**。


 details = vec![];

    let details_group = m
        .details
        .iter()
        .group_by(|d| d.logout_time.date())
        .into_iter()
        .map(|(key, group)| (key.day(), group.map(|d| d.flux.0).sum::<u64>()))
        .collect::<HashMap<_, _>>();
    for d in 1u32..=now.day() {
        if let Some(f) = details_group.get(&d) {
            max.0 += *f;
        }
        details.push((d as f64, max.to_gb()));
    }

    let max_flux = (max.to_gb() * 1.1).ceil().max(1.0) as u64;

    let dataset = Dataset::default()
        .marker(tui::symbols::Marker::Dot)
        .graph_type(GraphType::Line)
        .style(Style::default().fg(get_flux_color(max.0, true)))
        .data(&details);

    let chart = Chart::new(vec![dataset])
        .x_axis(
            Axis::default()
                .title(Span::from(format!("日期/{}月", now.month())))
                .bounds([1.0, now.day() as f64])
                .labels(
                    (1..=now.day())
                        .into_iter()
                        .map(|d| Span::from(d.to_string()))
                        .collect(),
                ),
        )
        .y_axis(
            Axis::default()
                .title(Span::from("流量/GB"))
                .bounds([0.0, max_flux as f64])
                .labels((0..=max_flux).map(|f| Span::from(f.to_string())).collect()),
        )
        .block(Block::default().title("流量详情").borders(Borders::all()));
    f.render_widget(chart, chunks[1]);

    let key_style = Style::default().bg(Color::Black).fg(Color::White);

    let mut spans = vec![
        Span::styled("F1", key_style),
        Span::raw("登录    "),
        Span::styled("F2", key_style),
        Span::raw("注销    "),
        Span::styled("F3", key_style),
        Span::raw("刷新流量"),
        Span::styled("F4", key_style),
        Span::raw("刷新在线"),
        Span::styled("F5", key_style),
        Span::raw("刷新图表"),
        Span::styled("F6", key_style),
        Span::raw("退出    "),
    ];

    let log = &m.log;
    if !log.is_empty() {
        spans.push(Span::styled("  ", key_style));
        spans.push(Span::raw(log.as_ref()));
    }
    if m.online_busy() {
        spans.push(Span::styled("  ", key_style));
        spans.push(Span::raw("正在刷新在线"));
    }
    if m.detail_busy() {
        spans.push(Span::styled("  ", key_style));
        spans.push(Span::raw("正在刷新图表"));
    }

    let status = Paragraph::new(Spans::from(spans))
        .block(Block::default().style(Style::default().bg(Color::LightCyan).fg(Color::Black)));
    f.render_widget(status, global_chunks[1]);
}
<filename>gen/gan1_beta1/src/lib.rs
// DO NOT EDIT !
// This file was generated automatically from 'src/mako/api/lib.rs.mako'
// DO NOT EDIT !

//! This documentation was generated from *gan* crate version *1.0.8+20130205*, where *20130205* is the exact revision of the *gan:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.8*.
//!
//! Everything else about the *gan* *v1_beta1* API can be found at the
//! [official documentation site](https://developers.google.com/aff


(res, Computicle.Prolog);

	-- Package up the parameters that may want to be passed in
	local paramname = "_params";

	table.insert(res, string.format("%s = {};", paramname));
	table.insert(res, ComputicleOps.packParams(params, paramname));
	table.insert(res, ComputicleOps.packParams(codeparams, paramname));

	-- Create the Computicle instance that is running within
	-- the Computicle
	table.insert(res,
		string.format("SELFICLE = Computicle:init(%s.HeapHandle, %s.IOCPHandle);", paramname, paramname));

	-- Stuff in the user's code
	table.insert(res, [[_cmain = function()]]);
	table.insert(res, codechunk);
	table.insert(res, [[end]]);

	-- make sure the user's code is running in a coroutine
	table.insert(res, [[Application:coop(_cmain)]]);

	-- What we want to execute after the user's code is loaded
	-- By default, this will be a message pump
	table.insert(res, Computicle.Epilog);

	return table.concat(res, '\n');
end

-- Create a new computicle
--[[
	codechunk - a simple Lua string
	codeparams - a table of cdata structs that are to be passed on
--]]

Computicle.create = function(self, codechunk, codeparams)
	-- First, create the heap that is going to be used to do stuff
	local heap = Heap:create();

	-- Create an iocompletion port as a receiver of
	-- messages for the computicle.
	local iocp = IOCompletionPort:create();

	-- Assemble the chunk of code to be passed to the thread
	local params = {
		HeapHandle = heap:getNativeHandle();
		IOCPHandle = iocp:getNativeHandle();
	};
	local threadCode = Computicle:createThreadChunk(codechunk, params, codeparams);

--print("== CODE ==");
--print(threadCode);
--print("** CODE **");

	local worker, err = TINNThread({CodeChunk = threadCode, CreateSuspended = params.CreateSuspended});
	table.insert(Computicle.Threads, worker);

	local obj = {
		Heap = heap;
		IOCP = iocp;
		Thread = worker};

	setmetatable(obj, Computicle_mt);

	return obj;
end

Computicle.createFromFile = function(self, filename, codeparams)
	local fs = io.open(filename)
	if not fs then
		return nil, 'could not load file'
	end

	local codechunk = fs:read("*all");
	fs:close();

	return self:create(codechunk, codeparams);
end

Computicle.__toEssence = function(self)
	local essence = string.format("Computicle:init(TINNThread:StringToPointer(%s),TINNThread:StringToPointer(%s));",
				arch:pointerToString(self.Heap:getNativeHandle()),
				arch:pointerToString(self.IOCP:getNativeHandle()));

	return essence;
end

Computicle.load = function(self, name, codeparams)
	local comp = self:create(string.format("require('%s');", name), codeparams);

	return comp;
end

Computicle.loadAndRun = function(self, name, codeparams)
	local comp, err = self:load(name, codeparams);
	if not comp then
		return false, err;
	end

	return comp:waitForFinish();
end

Computicle.getMessage = function(self, timeout)
	return self.IOCP:dequeue(timeout);
end

Computicle.allocData = function(self, size)
	if not size then
		return false, 'no size specified';
	end

	return self.Heap:alloc(size);
end

Computicle.freeData = function(self, dataPtr, len)
	if dataPtr ~= nil then
		self.Heap:free(dataPtr);
	end

	return self;
end

Comput


)
        self.prepare_init_latent(sd_run)

        if self.callback(state="Generating" , progress=-1  ) == "stop":
            return

        for i, t in tqdm(enumerate(sd_run.working_timesteps)):

            sd_run.current_t = t
            self.get_unet_out(sd_run)
            self.get_next_latent(sd_run)

            if self.callback(state="Generating" , progress=(100*(i+1)/len(sd_run.working_timesteps)) )  == "stop":
                return

        if self.callback(state="Decoding" , progress=-1 ) == "stop":
            return

        # Decoding stage
        sd_run.latent = sd_run.latent/0.18215
        sd_run.decoded = self.model.run_dec(sd_run.latent)

        self.run_plugin_hook("decode" , "mid" , sd_run)

        sd_run.decoded = ((sd_run.decoded + 1) / 2) * 255
        sd_run.ret = ({"img" : np.clip(sd_run.decoded, 0, 255).astype("uint8")})

        self.run_plugin_hook("generate" , "post" , sd_run)

        return sd_run.ret

    def get_sdxl_fixed_vector(self, sd_run, is_cond):
        height_emb = self.timestep_embedding(sd_run.img_height , dim=256 )
        width_emb = self.timestep_embedding(sd_run.img_width , dim=256 )
        zero_emb = self.timestep_embedding(0 , dim=256 )

        # used in refine:
        aesth_emb = self.timestep_embedding(6 , dim=256 )
        neg_aesth_emb = self.timestep_embedding(2.5 , dim=256 )

        if is_cond:
            if 49407 in list(sd_run.tokens[0]) :
                last_tok_index = list(sd_run.tokens[0]).index( 49407 )
            else:
                last_tok_index = -1
            pooled = sd_run.penultimate_context[: , last_tok_index ]
        else:
            if 49407 in list(sd_run.unconditional_tokens[0]) :
                last_tok_index = list(sd_run.unconditional_tokens[0]).index( 49407 )
            else:
                last_tok_index = -1

            pooled = sd_run.penultimate_uncond_context[: , last_tok_index ]

        pooled = pooled @ self.sdxl_pooled_emb_text_proj_mat

        vec = np.concatenate([pooled, height_emb, width_emb, zero_emb, zero_emb, height_emb, width_emb ], axis=-1)
        assert vec.shape == (1, 2816)
        return vec

    def timestep_embedding(self, timesteps, dim=320, max_period=10000):
        half = dim // 2
        freqs = np.exp(
            -math.log(max_period) * np.arange(0, half, dtype="float32") / half
        )
        args = np.array(timesteps) * freqs
        embedding = np.concatenate([np.cos(args), np.sin(args)])
        return np.reshape(embedding , (1 , -1 ))


.2675;
  color: #000000;
  font-family: Acme, 'Source Sans Pro';
  white-space: nowrap;
}
.page-home-comment-sent-like-followed-2-1rV .auto-group-nkcq-6Ey .auto-group-bmmp-cDK .auto-group-7ej7-dtR .auto-group-pv7t-qHf .auto-group-ered-7eV .auto-group-l8tv-jYh .auto-group-tqb7-1WD .auto-group-uhad-jx1 .ceo-of-pt-sern-zsw {
  width: 5.2rem;
  height: 1.3rem;
  position: absolute;
  left: 0.1rem;
  top: 1.6rem;
  font-size: 0.7rem;
  font-weight: 400;
  line-height: 1.76;
  color: rgba(82, 82, 82, 0.6000000238);
  font-family: Amiri, 'Source Sans Pro';
  white-space: nowrap;
}
.page-home-comment-sent-like-followed-2-1rV .auto-group-nkcq-6Ey .auto-group-bmmp-cDK .auto-group-7ej7-dtR .auto-group-pv7t-qHf .auto-group-ered-7eV .auto-group-l8tv-jYh .auto-group-tqb7-1WD .auto-group-uhad-jx1 .like-hGZ {
  width: 1.2rem;
  height: 1.3rem;
  position: absolute;
  left: 0.1rem;
  top: 4.2rem;
  font-size: 0.7rem;
  font-weight: 400;
  line-height: 1.76;
  color: rgba(82, 82, 82, 0.6000000238);
  font-family: Amiri, 'Source Sans Pro';
  white-space: nowrap;
}
.page-home-comment-sent-like-followed-2-1rV .auto-group-nkcq-6Ey .auto-group-bmmp-cDK .auto-group-7ej7-dtR .auto-group-pv7t-qHf .auto-group-ered-7eV .auto-group-l8tv-jYh .auto-group-tqb7-1WD .auto-group-uhad-jx1 .reply-DEu {
  width: 1.6rem;
  height: 1.3rem;
  position: absolute;
  left: 2.6rem;
  top: 4.2rem;
  font-size: 0.7rem;
  font-weight: 400;
  line-height: 1.76;
  color: rgba(82, 82, 82, 0.6000000238);
  font-family: Amiri, 'Source Sans Pro';
  white-space: nowrap;
}
.page-home-comment-sent-like-followed-2-1rV .auto-group-nkcq-6Ey .auto-group-bmmp-cDK .auto-group-7ej7-dtR .auto-group-pv7t-qHf .auto-group-ered-7eV .auto-group-l8tv-jYh .auto-group-tqb7-1WD .auto-group-uhad-jx1 .item--8cm {
  width: 0.2rem;
  height: 1.3rem;
  position: absolute;
  left: 1.9rem;
  top: 4rem;
  font-size: 0.7rem;
  font-weight: 400;
  line-height: 1.76;
  color: rgba(82, 82, 82, 0.6000000238);
  font-family: Amiri, 'Source Sans Pro';
  white-space: nowrap;
}
.page-home-comment-sent-like-followed-2-1rV .auto-group-nkcq-6Ey .auto-group-bmmp-c


    phi,
                viscosity
            )
        );
    }
}

// * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //

template<class BasicMomentumTransportModel>
bool Foam::laminarModel<BasicMomentumTransportModel>::read()
{
    if (BasicMomentumTransportModel::read())
    {
        laminarDict_ <<= this->subDict("laminar");

        coeffDict_ <<= laminarDict_.optionalSubDict(type() + "Coeffs");

        return true;
    }
    else
    {
        return false;
    }
}

template<class BasicMomentumTransportModel>
Foam::tmp<Foam::volScalarField>
Foam::laminarModel<BasicMomentumTransportModel>::nut() const
{
    return volScalarField::New
    (
        IOobject::groupName("nut", this->alphaRhoPhi_.group()),
        this->mesh_,
        dimensionedScalar(dimViscosity, 0)
    );
}

template<class BasicMomentumTransportModel>
Foam::tmp<Foam::scalarField>
Foam::laminarModel<BasicMomentumTransportModel>::nut
(
    const label patchi
) const
{
    return tmp<scalarField>
    (
        new scalarField(this->mesh_.boundary()[patchi].size(), 0.0)
    );
}

template<class BasicMomentumTransportModel>
Foam::tmp<Foam::volScalarField>
Foam::laminarModel<BasicMomentumTransportModel>::k() const
{
    return volScalarField::New
    (
        IOobject::groupName("k", this->alphaRhoPhi_.group()),
        this->mesh_,
        dimensionedScalar(sqr(dimVelocity), 0)
    );
}

template<class BasicMomentumTransportModel>
Foam::tmp<Foam::volScalarField>
Foam::laminarModel<BasicMomentumTransportModel>::epsilon() const
{
    return volScalarField::New
    (
        IOobject::groupName("epsilon", this->alphaRhoPhi_.group()),
        this->mesh_,
        dimensionedScalar(sqr(dimVelocity)/dimTime, 0)
    );
}

template<class BasicMomentumTransportModel>
Foam::tmp<Foam::volScalarField>
Foam::laminarModel<BasicMomentumTransportModel>::omega() const
{
    return volScalarField::New
    (
        IOobject::groupName("omega", this->alphaRhoPhi_.group()),
        this->mesh_,
        dimensionedScalar(dimless/dimTime, 0)
    );
}

template<class BasicMomentumTransportModel>
Foam::tmp<Foam::volSymmTensorField>
Foam::laminarModel<BasicMomentumTransportModel>::sigma() const
{
    return volSymmTensorField::New
    (
        IOobject::groupName("sigma", this->alphaRhoPhi_.group()),
        this->mesh_,
        dimensionedSymmTensor(sqr(this->U_.dimensions()), Zero)
    );
}

template<class BasicMomentumTransportModel>
void Foam::laminarModel<BasicMomentumTransportModel>::correct()
{
    BasicMomentumTransportModel::correct();
}

// ************************************************************************* //


lemento: HTMLElement;
    ocultado: boolean;

    tiempoIniciado: boolean;

    letra: string;
    //tiempo: Timer;
    tiempo: any;

    errores: Array<Registro_Error>;
    keyCode: number;
    nivel:number;

    constructor(letra: string, nivel:number) {
        //this.tiempo = new Timer();
        this.tiempo = {};
        this.letra = letra.toLowerCase();
        this.letra = eliminarDiacriticos(this.letra);
        this.validado = false;
        this.activo = false;
        this.errores = new Array();
        this.ocultado = false;

        this.nivel = nivel;

        this.elemento = document.createElement('div');
        this.elemento.className = "letra";
        this.elemento.innerText = letra;

        if (letra == " ") {
            this.elemento.classList.add("space");
            this.elemento.innerText = "_";
        }

        this.sonidoError = sonidoError;
        this.tiempoIniciado = false;
        this.keyCode = 0;

    }

    iniciarConteo() {
        //this.tiempo.iniciar();
        let fecha = new Date();
        this.tiempo.inicial = fecha.getTime();
    }

    detenerConteo() {
        //this.tiempo.detener();
        let fecha = new Date();
        this.tiempo.final = fecha.getTime();
    }

    getTiempo() {

        let tiempo = this.tiempo.final - this.tiempo.inicial;
        return tiempo / 1000;
    }

    iniciar(inicio?: boolean) {
        if (this.activo == false) {

            if (inicio != null) {
                if (inicio) {
                    this.tiempoIniciado = true;
                    this.iniciarConteo();
                } else {

                }
            } else {
                this.tiempoIniciado = true;
                this.iniciarConteo();
            }

            this.activo = true;
            this.elemento.classList.add("underline");
        }

    }

    iniciarTiempo() {
        if (this.tiempoIniciado == false) {
            this.tiempoIniciado = true;
            this.iniciarConteo();
        }
    }

    detener() {
        this.detenerConteo();
        //  let i = this.letra + ":" + this.tiempo.getTiempo() + "";
        //  this.elemento.innerHTML = i;
    }

    ocultar() {
        this.ocultado = true;
        this.elemento.innerText = "_";
        this.elemento.style.color = "transparent";
    }

    keyPressed(event: any, accion?: Function) {
        if (this.validado == false && this.activo == true) {
            let key: string = event.key;
            key = key.toLowerCase();

            for (let i = 0; i < nuevoTeclado.length; i++) {
                let tecla = nuevoTeclado[i];
                let original = tecla.original.toLowerCase();

                if (key == original) {
                    key = tecla.nuevo.toLowerCase();
                    i = nuevoTeclado.length;
                }
            }

            if (keys[key] == false || keys[key] == null) {

                keys[key] = true;

                key = eliminarDiacriticos(key);

                if (key != "capslock" && key != "backspace" && key != "shift" && key != "dead") {


                PathTemplate.create(
                    String.format(
                        "projects/{project=*}/zones/{zone_a}%s{zone_b}", invalidDelimiter)));
    Assertions.assertEquals(
        String.format(
            "parse error: invalid complex resource ID delimiter character in '%s'",
            String.format("zone_a}%s{zone_b}", invalidDelimiter)),
        exception.getMessage());
  }

  static Stream<String> invalidDelimiters() {
    return Stream.of("|", "!", "@", "a", "1", ",", ")");
  }

  @Test
  void complexResourceIdMixedSeparators() {
    // Separate by a mix of delimiters.
    PathTemplate template =
        PathTemplate.create("projects/{project}/zones/{zone_a}~{zone_b}.{zone_c}-{zone_d}");
    Map<String, String> match =
        template.match(
            "https://www.googleapis.com/compute/v1/projects/project-123/zones/europe-west3-c~us-east3-a.us-west2-b-europe-west2-b");
    Truth.assertThat(match).isNotNull();
    Truth.assertThat(match.get(PathTemplate.HOSTNAME_VAR)).isEqualTo("https://www.googleapis.com");
    Truth.assertThat(match.get("project")).isEqualTo("project-123");
    Truth.assertThat(match.get("zone_a")).isEqualTo("europe-west3-c");
    Truth.assertThat(match.get("zone_b")).isEqualTo("us-east3-a");
    Truth.assertThat(match.get("zone_c")).isEqualTo("us");
    Truth.assertThat(match.get("zone_d")).isEqualTo("west2-b-europe-west2-b");

    template = PathTemplate.create("projects/{project}/zones/{zone_a}.{zone_b}.{zone_c}~{zone_d}");
    match =
        template.match(
            "https://www.googleapis.com/compute/v1/projects/project-123/zones/europe-west3-c.us-east3-a.us-west2-b~europe-west2-b");
    Truth.assertThat(match).isNotNull();
    Truth.assertThat(match.get(PathTemplate.HOSTNAME_VAR)).isEqualTo("https://www.googleapis.com");
    Truth.assertThat(match.get("project")).isEqualTo("project-123");
    Truth.assertThat(match.get("zone_a")).isEqualTo("europe-west3-c");
    Truth.assertThat(match.get("zone_b")).isEqualTo("us-east3-a");
    Truth.assertThat(match.get("zone_c")).isEqualTo("us-west2-b");
    Truth.assertThat(match.get("zone_d")).isEqualTo("europe-west2-b");
  }

  @Test
  void collectionWildcardMatchingInParent() {
    PathTemplate template = PathTemplate.create("v1/publishers/-/books/{book}");
    Map<String, String> match =
        template.match(
            "https://example.googleapis.com/v1/publishers/publisher-abc/books/blockchain_for_babies");
    Truth.assertThat(match).isNotNull();

    template = PathTemplate.create("/v1/{parent=rooms/-}/blurbs/{blurb}");
    match = template.match("https://example.googleapis.com/v1/rooms/den/blurbs/asdf");
    Truth.assertThat(match).isNotNull();
  }

  @Test
  void collectionWildcardMatchingInvalid() {
    ValidationException exception =
        Assertions.assertThrows(
            ValidationException.class,
            () -> PathTemplate.create("v1/publishers/{publisher}/books/-"));
  }
  ;

  @Test
  void complexResourceIdPubSubDel


is distributed in the hope that it will be useful,
 *     but WITHOUT ANY WARRANTY; without even the implied warranty of
 *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *     GNU General Public License for more details.
 *
 *     You should have received a copy of the GNU General Public License
 *     along with this program.  If not, see <https://www.gnu.org/licenses/>.
 */

package cvl

import infra.CVLFlow
import org.junit.jupiter.api.Test
import kotlin.io.path.Path

class TestCVLCasts: AbstractCVLTest() {

    @Test
    fun testCastExp1() {
        testFlowWithPredicatesCVLError(
            CVLFlow().getProverQuery(Path("src/test/resources/cvl/CVLSyntax/CastExp/badExample1/badExample1.conf")), listOf(
                ExpType("to_uint256"), ExpType("assert_bool"), ExpType("to_uint256")
            )
        )
    }

    @Test
    fun testCastExp2() {
        testFlowWithPredicatesCVLError(
            CVLFlow().getProverQuery(Path("src/test/resources/cvl/CVLSyntax/CastExp/badExample2/badExample2.conf")), listOf(
                GeneralType("bad6.spec", 2, 2),
                GeneralType("bad6.spec", 8, 8),
            )
        )
    }

    @Test
    fun testCastExp3() {
        testFlowWithPredicatesCVLError(
            CVLFlow().getProverQuery(Path("src/test/resources/cvl/CVLSyntax/CastExp/badExample3/badExample3.conf")), listOf(
                ExpType("assert"), ExpType("assert"), ExpType("assert"), ExpType("to")
            )
        )
    }

    @Test
    fun testBytesk() {
        testFlowWithPredicatesCVLError(
            CVLFlow().getProverQuery(Path("src/test/resources/cvl/CVLSyntax/CastExp/BytesK/badExample/badExample.conf")), listOf(
                ExpType("to"), ExpType("to"), ExpType("to")
            )
        )
    }

    @Test
    fun testToBytesOfLessThan20BytesFromAddress() {
        val confPath = Path("src/test/resources/cvl/CVLSyntax/CastExp/BytesK/badToBytes/CastToBytes.conf")
        val primaryContractName = "CastToBytes"
        val cvlText = """
        rule disallowBytes1() {
            address a = 0x3729D00fe4f5eb341f95FDC9051B94A9b6C26160;
            bytes1 b = to_bytes1(a);
            assert false, "Type checker allowed cast to bytes1 but it should not have";
        }

        rule disallowBytes2() {
            address a = 0x3729D00fe4f5eb341f95FDC9051B94A9b6C26160;
            bytes2 b = to_bytes2(a);
            assert false, "Type checker allowed cast to bytes2 but it should not have";
        }

        rule disallowBytes3() {
            address a = 0x3729D00fe4f5eb341f95FDC9051B94A9b6C26160;
            bytes3 b = to_bytes3(a);
            assert false, "Type checker allowed cast to bytes3 but it should not have";
        }

        rule disallowBytes4() {
            address a = 0x3729D00fe4f5eb341f95FDC9051B94A9b6C26160;
            bytes4 b = to_bytes4(a);
            assert false, "Type checker allowed cast to bytes4 but it should not have";
        }

        rule disallowBytes5() {
            address a = 0x3729D00fe4f5eb341f95FDC9051B94A9b6C26160;
            bytes5 b = to_bytes5(a);
            assert false, "Type checker allowed cast to bytes5 but it should not have";
        }

        rule disallowBytes6() {
            address a = 0x3729D00fe


3018,1.07 0.0161,1.678 -0.79516,2.804 -7.60216,6.188 -2.27316,-2.612 -2.66171,-2.99567 0.47591,-0.59633 4.27533,-6.187 1.04471,0.35587 5.3023,-3.34587"},"48285":{"name":"Lavaca, TX","path":"m 500.37132,505.45814 5.38249,-0.05 0.16937,0.05 0.37084,0.225 1.08398,1.012 4.61942,5.568 -1.97542,1.632 -5.68201,4.548 -5.97796,-7.433 0.79516,-2.804 -0.0161,-1.678 1.23018,-1.07"},"48239":{"name":"Jackson, TX","path":"m 510.022,513.89514 0.36192,0.369 6.63763,6.55 -0.31379,6.581 -5.1828,-0.899 -1.30328,0.06 -2.29812,-4.268 -1.44591,-2.86 -0.1355,-0.1 -2.00216,-0.884 5.68201,-4.548"},"48321":{"name":"Matagorda, TX","path":"m 517.02155,520.81414 6.94071,-4.193 1.83279,-1.899 0.47424,0.451 0.12124,0.121 -0.0217,2.77371 1.50741,0.81469 0.0244,1.7306 2.0567,0.67051 0.45736,1.14611 1.58472,1.42738 1.22126,0.112 -0.3851,0.257 -0.84508,0.539 -0.37618,0.224 -4.55702,2.653 -1.44591,0.731 -2.3623,1.029 -1.56714,0.724 -2.8936,1.478 -1.0198,0.684 -0.0731,0.05 -1.37459,0.962 -0.60261,0.452 -0.16759,0.265 -0.0481,-0.167 0.11945,-0.195 3.26979,-2.458 0.4992,-4.219 -0.0963,-0.103 -0.13549,-0.05 -0.41185,0.06 -0.92174,0.218 -0.3958,0.128 -0.32983,0.262 -0.3851,0.678 -0.007,-0.772 0.31379,-6.581"},"48481":{"name":"Wharton, TX","path":"m 521.4805,506.19614 1.62955,3.955 1.14995,2.137 1.43877,1.6 0.62579,0.08 -0.52951,0.754 -1.83279,1.899 -6.94071,4.193 -6.63763,-6.55 0.72206,-0.409 5.15963,-3.239 0.32983,-0.957 0.96275,-1.951 2.1858,-2.25 1.73651,0.738"},"48089":{"name":"Colorado, TX","path":"m 511.89401,497.91314 0.67571,1.244 0.81834,0.742 0.20146,0.182 1.26227,0.877 0.19968,0.1 0.3548,0.07 1.33595,0.0233 0.5842,1.87374 0.84442,1.64243 1.07573,0.25457 0.49742,0.538 -2.1858,2.25 -0.96275,1.951 -0.32983,0.957 -5.15963,3.239 -0.72206,0.409 -0.36192,-0.369 1.97542,-1.632 -4.61942,-5.568 -1.08398,-1.012 -0.37084,-0.225 -0.16937,-0


l.contains("INSERT INTO catalog") -> mockTuples(createdCatalogAnswer)
            sql.contains("INSERT INTO document_wrapper") -> emptyList<Tuple>()
            sql.contains("INSERT INTO permission_group") -> emptyList<Tuple>()
            else -> throw IllegalArgumentException("Unknown query: $sql")
        }
    }

    // singleResult
    every { entityManager.createNativeQuery(capture(sqlSlot)).singleResult } answers {
        val sql = sqlSlot.captured
        println("singleResult for: $sql")
        // Assume that this is the catalog id query
        when {
            sql.contains("SELECT id FROM catalog") -> 1
            sql.contains("INSERT INTO catalog") -> CREATED_CATALOG_ID
            else -> throw IllegalArgumentException("Unknown query: $sql")
        }
    }
}
/**
 * ==================================================
 * Copyright (C) 2023-2025 wemove digital solutions GmbH
 * ==================================================
 * Licensed under the EUPL, Version 1.2 or – as soon they will be
 * approved by the European Commission - subsequent versions of the
 * EUPL (the "Licence");
 *
 * You may not use this work except in compliance with the Licence.
 * You may obtain a copy of the Licence at:
 *
 * https://joinup.ec.europa.eu/software/page/eupl
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the Licence is distributed on an "AS IS" basis,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the Licence for the specific language governing permissions and
 * limitations under the Licence.
 */
package de.ingrid.igeserver.schema.ingrid_lfubayern

import de.ingrid.igeserver.schema.SchemaUtils
import io.kotest.core.spec.style.AnnotationSpec
import io.kotest.matchers.shouldBe

class InGridInformationSystemLfuBayern : AnnotationSpec() {

    private val schema = "/ingrid/schemes/lfubayern/information-system_lfubayern.schema.json"

    @Test
    fun minimal() {
        val json = SchemaUtils.getJsonFileContent("/export/ingrid/information-system.minimal.json").replaceFirst(
            "{",
            """
            { "dataSetURI": "myUri", "fees": "my fees", "resource": { "useConstraintsComments": "my useConstraintsComments" },
        """,
        )
        val result = SchemaUtils.validate(json, schema)
        result.size shouldBe 0
    }

    @Test
    fun negativeTest() = SchemaUtils.createNegativeTestByAddingInvalidField(schema, "/export/ingrid/information-system.minimal.json")
}
/**
 * ==================================================
 * Copyright (C) 2023-2025 wemove digital solutions GmbH
 * ==================================================
 * Licensed under the EUPL, Version 1.2 or – as soon they will be
 * approved by the European Commission - subsequent versions of the
 * EUPL (the "Licence");
 *
 * You may not use this work except in compliance with the Licence.
 * You may obtain a copy of the Licence at:
 *
 * https://joinup.ec.europa.eu/software/page/eupl
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the Licence is distributed on an "AS IS" basis,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the Licence for the specific language governing permissions and
 * limitations under the Licence.
 */
package de.ingrid.igeserver.schema.ingrid_krzn

import de.ingrid.igeserver.schema.SchemaUtils
import io.kotest.core.spec.style.AnnotationSpec
import io.kotest.matchers.shouldBe

class InGridGeoDatasetKrznSchema : AnnotationSpec() {

    private val schema = "/ingrid/schemes/krzn/geo-dataset_krzn.schema.json"

    @Test
    fun minimal() {
        val json = SchemaUtils.get


 = "starts_at")
        var startsAt: String? = null,
        var recorded: Boolean = false,
) {
    constructor(session: Session) : this(
            sessionId = session.sessionId,
            title = session.title,
            subtitle = session.subtitle,
            day = session.dayIndex,
            room = session.roomName,
            slug = session.slug,
            url = session.url,
            speakers = session.speakers.joinToString(";"),
            track = session.track,
            type = session.type,
            lang = session.language,
            abstract = session.abstractt,
            description = session.description,
            links = session.links,
            startsAt = Moment.ofEpochMilli(session.dateUTC).toString(),
            recorded = !session.recordingOptOut,
    )
}
package info.metadude.android.eventfahrplan.commons.temporal

import androidx.annotation.VisibleForTesting
import org.threeten.bp.Instant
import org.threeten.bp.ZoneOffset
import org.threeten.bp.ZonedDateTime
import org.threeten.bp.format.DateTimeFormatter
import org.threeten.bp.format.DateTimeParseException

object DateParser {

    /**
     * Parses the given [text] and returns its date value represented in milliseconds.
     *
     * Expects the [text] to be provided in [ISO_DATE_TIME][DateTimeFormatter.ISO_DATE_TIME]
     * format (e.g. 2019-01-01T00:00:00Z).
     */
    fun parseDateTime(text: String): Long {
        val instant = Instant.from(DateTimeFormatter.ISO_DATE_TIME.parse(text))
        val atUtcOffset = instant.atOffset(ZoneOffset.UTC)
        return atUtcOffset.toEpochSecond() * Moment.MILLISECONDS_OF_ONE_SECOND
    }

    /**
     * Parses the given [text] and returns its time zone offset value represented in seconds.
     *
     * The [text] is expected to be provided in the [ISO_DATE_TIME][DateTimeFormatter.ISO_DATE_TIME]
     * format (e.g. 2019-01-01T00:00:00Z).
     */
    @JvmStatic
    fun parseTimeZoneOffset(text: String): Int {
        val zonedDateTime = try {
            ZonedDateTime.parse(text, DateTimeFormatter.ISO_DATE_TIME)
        } catch (e: DateTimeParseException) {
            throw TimeZoneOffsetParsingException(text)
        }
        return zonedDateTime.offset.totalSeconds
    }

}

@VisibleForTesting
internal class TimeZoneOffsetParsingException(text: String) : IllegalArgumentException(
    """Error parsing time zone offset from: "$text"."""
)
#!/usr/bin/env kotlin

@file:Repository("https://central.sonatype.com/repository/maven-snapshots")
@file:DependsOn("net.minestom:minestom:1_21_9-SNAPSHOT")

import java.io.File
import java.lang.ProcessBuilder
import net.minestom.server.instance.block.Block

val gradleCommand = if (System.getProperty("os.name").lowercase().contains("windows")) {
    "./gradlew.bat"
} else {
    "./gradlew"
}

val process: Process = ProcessBuilder(gradleCommand, ":testserver:run", "--args=gen-elements")
    .inheritIO()
    .start()

val exitCode = process.waitFor()
if (exitCode != 0) {
    throw Exception("Gradle exited with code $exitCode")
}

val ignored = File(".github/list-producer/ignored-blocks.txt").readLines()
val allWithState = Block.values()
    .filter { it.properties().keys.isNotEmpty() }
    .map { it.key().asString() }
    .filter { !ignored.contains(it) }

val supported = File(".g


vent()['${ name }']` , ()=> {
						handle( event )
					} ).get()
				} )
			}
		}

		static render_sub( node : Element , sub : ($mol_view|Node|string|number|boolean)[] ) {
			if( sub == null ) return

			const nodes = [] as Array< Node|string >

			sub.forEach( view => {
				if( view instanceof $mol_view ) {
					nodes.push( view.dom_tree() )
				} else if( view ) {
					if( typeof view === 'object' ) nodes.push( view as Node )
					else nodes.push( String( view ) )
				}
			} )

			let nextNode = node.firstChild
			for( let view_ of nodes ) {
				const view = view_.valueOf() as Node

				if( view instanceof $mol_dom_context.Node ) {

					while( true ) {
						if( !nextNode ) {
							node.appendChild( view )
							break
						}
						if( nextNode == view ) {
							nextNode = nextNode.nextSibling
							break
						} else {
							if( nodes.indexOf( nextNode ) === -1 ) {
								const nn = nextNode.nextSibling
								node.removeChild( nextNode )
								nextNode = nn
							} else {
								node.insertBefore( view , nextNode )
								break
							}
						}
					}

				} else {
					if( nextNode && nextNode.nodeName === '#text' ) {
						nextNode.nodeValue = String( view )
						nextNode = nextNode.nextSibling
					} else {
						const textNode = $mol_dom_context.document.createTextNode( String( view ) )
						node.insertBefore( textNode , nextNode )
					}
				}

			}

			while( nextNode ) {
				const currNode = nextNode
				nextNode = currNode.nextSibling
				node.removeChild( currNode )
			}

			sub.forEach( view => {
				if( view instanceof $mol_view ) view.dom_tree()
			} )
		}

		static render_attr( node : Element , attrs : { [ key : string ] : string|number|boolean } ) {
			for( let name in attrs ) {
				let val = attrs[ name ]
				if( ( val == null ) || ( val === false ) ) {
					node.removeAttribute( name )
				} else if( val === true ) {
					node.setAttribute( name , 'true' )
				} else {
					node.setAttribute( name , String( val ) )
				}
			}
		}

		static render_style( node : HTMLElement , styles : { [ key : string ] : string|number } ) {
			for( let name in styles ) {
				let val = styles[ name ] as any
				if( typeof val === 'number' ) val = `${ val }px`
				const style = node.style as any
				style[ name ] = val
			}
		}

		static render_field( node : any , field : { [ key : string ] : any } ) {
			for( let key in field ) {
				const val = field[ key ]
				if( node[ key ] !== val ) {
					node[ key ] = val
					if( node[ key ] !== val && !node.parentNode ) {
						const setter = ()=> {
							node[ key ] = val
							node.removeEventListener( 'DOMNodeInsertedIntoDocument' , setter )
						}
						node.addEventListener( 'DOMNodeInsertedIntoDocument' , setter )
					}
				}
			}
		}

		@ $mol_mem()
		dom_tree() {
			let node = this.dom_node() as HTMLElement

			try {
				this.plugins().forEach( ( plugin ) => {
					plugin.dom_tree()
				} )

				$mol_view.render_attr( node , this.attr() )
				$mol_view.render_style( node , this


tone grey")
o684.Position = Vector3.new(41.4383545, 5.16253948, 16.7545052)
o684.Rotation = Vector3.new(-0.0116382688, 0.00413251808, -90.0062866)
o684.RotVelocity = Vector3.new(-0.00183723925, -0.000236320717, -0.00238999678)
o684.Velocity = Vector3.new(0.0176555291, 0.01749238, -0.00720514264)
o684.Elasticity = 0.10000000149012
o684.FormFactor = Enum.FormFactor.Symmetric
o684.Friction = 0.5
o684.Size = Vector3.new(5, 1, 1)
o684.CFrame = CFrame.new(41.4383545, 5.16253948, 16.7545052, -0.000109683264, 0.999993503, 7.2126044e-005, -1, -0.000109697838, 0.00020312611, 0.00020313327, -7.21027245e-005, 1)
o684.BackSurface = Enum.SurfaceType.Weld
o684.BottomSurface = Enum.SurfaceType.Weld
o684.Color = Color3.new(0.388235, 0.372549, 0.384314)
o684.Position = Vector3.new(41.4383545, 5.16253948, 16.7545052)
o685.Parent = o288
o685.BrickColor = BrickColor.new("Dark stone grey")
o685.Position = Vector3.new(47.4377289, 5.16220999, 12.2528381)
o685.Rotation = Vector3.new(0.0126822628, 0.00674443459, 89.9955444)
o685.RotVelocity = Vector3.new(-0.00183723925, -0.000236320717, -0.00238999678)
o685.Velocity = Vector3.new(0.0187185779, -0.00511674583, -0.00578676071)
o685.Elasticity = 0.10000000149012
o685.FormFactor = Enum.FormFactor.Symmetric
o685.Friction = 0.5
o685.Size = Vector3.new(5, 1, 2)
o685.CFrame = CFrame.new(47.4377289, 5.16220999, 12.2528381, 7.77419846e-005, -0.999990284, 0.000117712589, 1.00000024, 7.83237701e-005, -0.000221347378, 0.000221735128, 0.000117142481, 1.0000006)
o685.BackSurface = Enum.SurfaceType.Weld
o685.BottomSurface = Enum.SurfaceType.Weld
o685.Color = Color3.new(0.388235, 0.372549, 0.384314)
o685.Position = Vector3.new(47.4377289, 5.16220999, 12.2528381)
o686.Parent = o288
o686.BrickColor = BrickColor.new("Dark stone grey")
o686.Position = Vector3.new(43.9362907, 3.66124344, -0.746004522)
o686.Rotation = Vector3.new(-0.00390832126, 0.00618108781, 179.996536)
o686.RotVelocity = Vector3.new(-0.00183723925, -0.000236320717, -0.00238999678)
o686.Velocity = Vector3.new(0.0182031691, -0.0206303056, -0.00385658769)
o686.Elasticity = 0.10000000149012
o686.FormFactor = Enum.FormFactor.Symmetric
o686.Friction = 0.5
o686.Size = Vector3.new(12, 4, 6)
o


}

String semesterLable(Map<String, String> selectedTime) {
  String year = selectedTime["year"]!;
  String semester = selectedTime["semester"]!;

  String semesterLable = "$semester - $year";
  return semesterLable;
}

String yearLable(Map<String, String> selectedTime) {
  return selectedTime["year"]!;
}

Map<String, List> semesterMap = {"spring": ["2", "3", "4", "5", "6", "7"],"fall": ["8", "9", "10", "11", "12", "1"]};

Map<String, String> getSelectedTime(DateTime date) {
  return {
    "year": date.year.toString(),
    "semester": (date.month >= 2 && date.month <= 7) ? "spring" : "fall",
    "month": date.month.toString(),
    "week": grabIsoWeekNumber(date).toString(),
    "day": date.day.toString(),
  };
}

DateTime getDateTimeFromSelectedTime(Map<String, String> selectedTime) {
  int year = int.parse(selectedTime["year"]!);
  int month = int.parse(selectedTime["month"]!);
  int day = int.parse(selectedTime["day"]!);

  // Calculate the date based on the year, month, and week
  DateTime date = DateTime(year, month, day);

  return date;
}

List<String> monthNames = [
  '',
  'January',
  'February',
  'March',
  'April',
  'May',
  'June',
  'July',
  'August',
  'September',
  'October',
  'November',
  'December'
];

Map<String, String> weekAdjustment(Map<String, String> selectedTime, bool add) {
  int year = int.parse(selectedTime["year"]!);
  int week = int.parse(selectedTime["week"]!);

  if (add) {
    week++;
  } else {
    week--;
  }
  if (week > 52) {
    year++;
    week = 1;
  } else if (week < 1) {
    year--;
    week = 52;
  }

  int month = grabMonthBasedOnYearAndWeek(year, week);

  return {
    "year": year.toString(),
    "semester": (month >= 2 && month <= 7) ? "spring" : "fall",
    "month": month.toString(),
    "week": week.toString(),
    "day": grabFirstDayOfWeekBasedOnYearAndWeek(year, week).toString(),
  };
}

Map<String, String> montAdjustment(Map<String, String> selectedTime, bool add) {
  int year = int.parse(selectedTime["year"]!);
  int month = int.parse(selectedTime["month"]!);

  if (add) {
    month++;
  } else {
    month--;
  }
  if (month > 12) {
    year++;
    month = 1;
  } else if (month < 1) {
    year--;
    month = 12;
  }

  int week = getFirstWeekOfMonth(year, month);

  return {
    "year": year.toString(),
    "semester": (month >= 2 && month <= 7) ? "spring" : "fall",
    "month": month.toString(),
    "week": week.toString(),
    "day": grabFirstDayOfWeekBasedOnYearAndWeek(year, week).toString(),
  };
}

Map<String, String> semesterAdjustment(
    Map<String, String> selectedTime, bool add) {
  int year = int.parse(selectedTime["year"]!);
  int month = int.parse(selectedTime["month"]!);
  String semester = selectedTime["semester"]!;
  int week = 0;

  if (add) {
    if (semester == "fall") {
      year++;
      month = 2;
      week = getFirstWeekOfMonth(year, month);
    } else {
      month = 8;
      week = getFirstWeekOfMonth(year, month);
    }
  } else {
    if (semester == "fall") {
      month = 2;
      week = getFirstWeekOfMonth(year, month);
    } else {
      year--;
      month = 8;
      week = getFirstWeek


ount = amount or 25 },
        },
        results = {},
        emissions_multiplier = polution,
      },
    })
  else
    bobmods.lib.error.item_of_type(name, "fluid", "Fluid")
  end
end

bobmods.plates.make_void_fluid_recipe("bob-oxygen", 25, -1)
bobmods.plates.make_void_fluid_recipe("bob-hydrogen", 20, 0.1)
bobmods.plates.make_void_fluid_recipe("bob-nitrogen", 25, -0.2)
bobmods.plates.make_void_fluid_recipe("bob-chlorine", 25, 25)
bobmods.plates.make_void_fluid_recipe("bob-hydrogen-chloride", 25, 13)
bobmods.plates.make_void_fluid_recipe("bob-sulfur-dioxide", 25, 50)
bobmods.plates.make_void_fluid_recipe("steam", 10, 0)
bobmods.plates.make_void_fluid_recipe("petroleum-gas", 10, 35)
bobmods.plates.make_void_fluid_recipe("bob-deuterium", 20, 0.1)
bobmods.plates.make_void_fluid_recipe("bob-hydrogen-sulfide", 25, 50)


s)
            {
                _modules.TryAdd(module.Name, module);
            }

            return this;
        }

        public ProjectFileBuilder WithUri(Uri uri)
        {
            _uri = uri;
            return this;
        }

        public ProjectFileBuilder WithProjectName(string name)
        {
            _name = name;
            return this;
        }

        public ProjectFileBuilder WithModule(string uri, DocClassType? supertype = null)
        {
            var name = _fileSystem.Path.GetFileNameWithoutExtension(uri);
            _modules.TryAdd(name, new()
            {
                Name = name,
                Uri = uri,
                Super = supertype
            });

            return this;
        }
        public ProjectFileBuilder WithModule(Module module)
        {
            _modules.TryAdd(module.Name, module);
            return this;
        }

        public ProjectFileBuilder WithReference(Reference reference)
        {
            _references.Add(reference);
            return this;
        }

        public ProjectFileBuilder WithFile(WorkspaceFileUri uri, bool isAutoOpen = false)
        {
            var file = File.FromWorkspaceUri(uri);
            file.IsAutoOpen = isAutoOpen;

            _files.Add(file);

            var relativeFileUri = uri.MakeRelativeUri(uri.SourceRoot);
            var relativeFolderUri = string.Join('/', relativeFileUri.Segments[..^1]);

            return WithFolder(new WorkspaceFolderUri(relativeFolderUri, uri.WorkspaceRoot));
        }

        public ProjectFileBuilder WithFolder(WorkspaceFolderUri uri)
        {
            _folders.Add(Folder.FromWorkspaceUri(uri));
            return this;
        }

        public ProjectFileBuilder WithReference(string uri, string name)
        {
            _references.Add(new()
            {
                Uri = uri,
                Name = name,
            });

            return this;
        }

        public ProjectFileBuilder WithReference(string uri, string name, string typeLibInfoUri)
        {
            _references.Add(new()
            {
                Uri = uri,
                Name = name,
                TypeLibInfoUri = typeLibInfoUri
            });

            return this;
        }

        public ProjectFileBuilder WithReference(string uri, Guid guid)
        {
            _references.Add(new()
            {
                Uri = uri,
                Guid = guid,
            });

            return this;
        }
    }
}


effectOrigin);
		    Vector3 position = gameObject2.transform.position;
		    position.z = 0.0031f;
		    gameObject2.transform.position = position;
		}
	    }
	    if (flag)
	    {
		activated = true;
		GameObject[] array = enableChildren;
		for (int i = 0; i < array.Length; i++)
		{
		    array[i].SetActive(true);
		}
		if (cap)
		{
		    cap.gameObject.SetActive(true);
		    Vector3 a = transform.position - collision.transform.position;
		    a.Normalize();
		    cap.AddForce(capHitForce * a, ForceMode2D.Impulse);
		}
		foreach (FlingPrefab fling in flingPrefabs)
		{
		    FlingObjects(fling);
		}
		PlaySound(deathSound);
		SetBroken();
		//TODO:
		GameCameras gameCameras = FindObjectOfType<GameCameras>();
		if (gameCameras)
		{
		    gameCameras.cameraShakeFSM.SendEvent("EnemyKillShake");
		}
	    }
	}
    }

    private void SetBroken()
    {
	StopCoroutine(animRoutine);
	GetComponent<MeshRenderer>().enabled = false;
	GameObject[] array = disableChildren;
	for (int i = 0; i < array.Length; i++)
	{
	    array[i].SetActive(false);
	}
	Collider2D[] array2 = disableColliders;
	for (int i = 0; i < array2.Length; i++)
	{
	    array2[i].enabled = false;
	}
    }

    private void FlingObjects(FlingPrefab fling)
    {
	if (fling.prefab)
	{
	    int num = Random.Range(fling.minAmount, fling.maxAmount + 1);
	    for (int i = 1; i <= num; i++)
	    {
		GameObject gameObject = fling.Spawn();
		gameObject.transform.position += new Vector3(fling.originVariation.x * Random.Range(-1f, 1f), fling.originVariation.y * Random.Range(-1f, 1f));
		float num2 = Random.Range(fling.minSpeed, fling.maxSpeed);
		float num3 = Random.Range(fling.minAngle, fling.maxAngle);
		float x = num2 * Mathf.Cos(num3 * 0.017453292f);
		float y = num2 * Mathf.Sin(num3 * 0.017453292f);
		Vector2 velocity;
		velocity.x = x;
		velocity.y = y;
		Rigidbody2D component = gameObject.GetComponent<Rigidbody2D>();
		if (component)
		{
		    component.velocity = velocity;
		}
	    }
	}
    }

    public void SetScuttlerAmount(int amount)
    {
	foreach (FlingPrefab flingPrefab in flingPrefabs)
	{
	    if(flingPrefab.prefab.name == "Health Scuttler")
	    {
		FlingPrefab flingPrefab2 = flingPrefab;
		flingPrefab.maxAmount = amount;
		flingPrefab.minAmount = amount;
		flingPrefab.SetupPool(transform);
		return;
	    }
	}
    }

    [System.Serializable]
    public class FlingPrefab
    {
	public GameObject prefab;
	public List<GameObject> pool = new List<GameObject>();
	public int minAmount;
	public int maxAmount;
	public Vector2 originVariation = new Vector2(0.5f, 0.5f);
	public int minSpeed;
	public int maxSpeed;
	public float minAngle;
	public float maxAngle;

	public void SetupPool(Transform parent)
	{
	    if (prefab)
	    {
		pool.Capacity = maxAmount;
		for (int i = 0; i < pool.Count; i++)
		{
		    GameObject gameObject = Instantiate(prefab, parent);
		    gameObject.transform.localPosition = Vector3.zero


 NSObject arg) {
    return _lib._objc_msgSend_466(
        _id,
        _lib._sel_cancelPerformSelector_target_argument_1,
        aSelector,
        target._id,
        arg._id);
  }

  void cancelPerformSelectorsWithTarget_(NSObject target) {
    return _lib._objc_msgSend_15(
        _id, _lib._sel_cancelPerformSelectorsWithTarget_1, target._id);
  }

  static NSRunLoop new1(SwiftLibrary _lib) {
    final _ret = _lib._objc_msgSend_2(_lib._class_NSRunLoop1, _lib._sel_new1);
    return NSRunLoop._(_ret, _lib, retain: false, release: true);
  }

  static NSRunLoop alloc(SwiftLibrary _lib) {
    final _ret = _lib._objc_msgSend_2(_lib._class_NSRunLoop1, _lib._sel_alloc1);
    return NSRunLoop._(_ret, _lib, retain: false, release: true);
  }

  static void cancelPreviousPerformRequestsWithTarget_selector_object_(
      SwiftLibrary _lib,
      NSObject aTarget,
      ffi.Pointer<ObjCSel> aSelector,
      NSObject anArgument) {
    return _lib._objc_msgSend_14(
        _lib._class_NSRunLoop1,
        _lib._sel_cancelPreviousPerformRequestsWithTarget_selector_object_1,
        aTarget._id,
        aSelector,
        anArgument._id);
  }

  static void cancelPreviousPerformRequestsWithTarget_(
      SwiftLibrary _lib, NSObject aTarget) {
    return _lib._objc_msgSend_15(_lib._class_NSRunLoop1,
        _lib._sel_cancelPreviousPerformRequestsWithTarget_1, aTarget._id);
  }

  static bool getAccessInstanceVariablesDirectly(SwiftLibrary _lib) {
    return _lib._objc_msgSend_12(
        _lib._class_NSRunLoop1, _lib._sel_accessInstanceVariablesDirectly1);
  }

  static bool useStoredAccessor(SwiftLibrary _lib) {
    return _lib._objc_msgSend_12(
        _lib._class_NSRunLoop1, _lib._sel_useStoredAccessor1);
  }

  static NSSet keyPathsForValuesAffectingValueForKey_(
      SwiftLibrary _lib, NSString? key) {
    final _ret = _lib._objc_msgSend_58(
        _lib._class_NSRunLoop1,
        _lib._sel_keyPathsForValuesAffectingValueForKey_1,
        key?._id ?? ffi.nullptr);
    return NSSet._(_ret, _lib, retain: true, release: true);
  }

  static bool automaticallyNotifiesObserversForKey_(
      SwiftLibrary _lib, NSString? key) {
    return _lib._objc_msgSend_59(
        _lib._class_NSRunLoop1,
        _lib._sel_automaticallyNotifiesObserversForKey_1,
        key?._id ?? ffi.nullptr);
  }

  static void setKeys_triggerChangeNotificationsForDependentKey_(
      SwiftLibrary _lib, NSArray? keys, NSString? dependentKey) {
    return _lib._objc_msgSend_79(
        _lib._class_NSRunLoop1,
        _lib._sel_setKeys_triggerChangeNotificationsForDependentKey_1,
        keys?._id ?? ffi.nullptr,
        dependentKey?._id ?? ffi.nullptr);
  }

  static NSArray classFallbacksForKeyedArchiver(SwiftLibrary _lib) {
    final _ret = _lib._objc_msgSend_80(
        _lib._class_NSRunLoop1, _lib._sel_classFallbacksForKeyedArchiver1);
    return NSArray._(_ret, _lib, retain: true, release: true);
  }

  static NSObject classForKeyedUnarchiver(SwiftLibrary _lib) {
    final _ret = _lib._objc_msgSend_2(