;
            """.trimIndent()
        }
        val updateCS = computeStyle {
            computePreamble = """
                const float margin = 16.0;
                void updateParticle(inout Particle p) {
                    // Add velocity to position
                    p.pos += p.velocity;

                    // Deal with the particle trying to escape the window
                    if(p.pos.x < -margin) {
                      p.pos.x += p_windowSize.x + 2.0 * margin;
                    }
                    if(p.pos.y < -margin) {
                      p.pos.y += p_windowSize.y + 2.0 * margin;
                    }
                    if(p.pos.x > p_windowSize.x + margin) {
                      p.pos.x = -margin;
                    }
                    if(p.pos.y > p_windowSize.y + margin) {
                      p.pos.y = -margin;
                    }
                }
            """.trimIndent()
            computeTransform = """
                // The id of the element being currently processed
                uint id = gl_GlobalInvocationID.x;
                updateParticle(b_particles.particle[id]);

                // Calculate the vertices of a directed triangle
                // pointing towards `velocity`. Hint:
                // vel (x,y) has two normals (-y, x) and (y, -x).
                vec2 pos = b_particles.particle[id].pos;
                vec2 vel = b_particles.particle[id].velocity * margin;
                vec2 n0 = vec2(-vel.y, vel.x) * 0.5;
                b_vb.vertex[id * 3 + 0].position = vec3(pos + vel, 0.0);
                b_vb.vertex[id * 3 + 1].position = vec3(pos + n0, 0.0);
                b_vb.vertex[id * 3 + 2].position = vec3(pos - n0, 0.0);
            """.trimIndent()
        }

        // Execute initCS
        initCS.buffer("vb", vb.shaderStorageBufferView())
        initCS.buffer("particles", particleSSBO)
        initCS.execute(particleCount / initCS.workGroupSize.x)

        extend {
            updateCS.buffer("vb", vb.shaderStorageBufferView())
            updateCS.buffer("particles", particleSSBO)
            updateCS.parameter("windowSize", drawer.bounds.dimensions)
            updateCS.execute(particleCount / updateCS.workGroupSize.x)

            drawer.fill = ColorRGBa.WHITE
            drawer.shadeStyle = shadeStyle {
                // The color of every triangle's pixel is interpolated using
                // its three vertex colors
                fragmentTransform = "x_fill = va_color;"
            }
            drawer.vertexBuffer(vb, DrawPrimitive.TRIANGLES)
        }
    }
}package patterns

import org.openrndr.application
import org.openrndr.color.ColorRGBa
import org.openrndr.extra.camera.Camera2D
import org.openrndr.extra.color.presets.NAVY
import org.openrndr.extra.color.presets.PEACH_PUFF
import org.openrndr.extra.shadestyles.fills.FillUnits
import org.openrndr.extra.shadestyles.fills.patterns.pattern

/**
 * Demonstrates the use of the `xorMod2` variant of the `pattern` shade style;
 * an algorithmic and intricate pattern.
 */
fun main() = application {
    configure {
        width = 720
        height = 720
    }
    program {
        extend(Camera2D())
        extend {
            drawer.shadeStyle = pattern {
                backgroundColor = ColorRGBa.NAVY
                foregroundColor = ColorRGBa.PEACH_PUFF
                patternUnits = FillUnits.WORLD
                parameter("time", seconds * 0.1)
                scale = 1.0
                xorMod2 {
                    patternMod = 13
                    patternOffset = (seconds * 1).toInt()
                    patternMask = 1
                }
            }


ormat: ui.ImageByteFormat.png);
    final ui.ImmutableBuffer imageBuffer = await ui.ImmutableBuffer.fromUint8List(
      imageData!.buffer.asUint8List(),
    );

    final ui.Codec codec = await ui.instantiateImageCodecFromBuffer(imageBuffer);
    codec.dispose();
    image.dispose();

    expect(imageBuffer.debugDisposed, isTrue);
  });

  test('instantiateImageCodecWithSize dispose buffer', () async {
    // getTargetSize is null, so the image is not scaled.
    final ui.Image image = await _createImage();
    final ByteData? imageData = await image.toByteData(format: ui.ImageByteFormat.png);
    final ui.ImmutableBuffer nullTargetSizeImageBuffer = await ui.ImmutableBuffer.fromUint8List(
      imageData!.buffer.asUint8List(),
    );

    final ui.Codec codec = await ui.instantiateImageCodecWithSize(nullTargetSizeImageBuffer);
    codec.dispose();
    image.dispose();

    expect(nullTargetSizeImageBuffer.debugDisposed, isTrue);

    // getTargetSize is not null, so the image is scaled.
    final ui.Image scaledImage = await _createImage();
    final ByteData? scaledImageData = await scaledImage.toByteData(format: ui.ImageByteFormat.png);
    final ui.ImmutableBuffer scaledImageBuffer = await ui.ImmutableBuffer.fromUint8List(
      scaledImageData!.buffer.asUint8List(),
    );

    final ui.Codec scaledCodec = await ui.instantiateImageCodecWithSize(
      scaledImageBuffer,
      getTargetSize: (w, h) => ui.TargetImageSize(width: w ~/ 2, height: h ~/ 2),
    );
    scaledCodec.dispose();
    scaledImage.dispose();

    expect(scaledImageBuffer.debugDisposed, isTrue);
  });

  test('instantiateImageCodecWithSize disposes temporary image', () async {
    final Set<ui.Image> activeImages = <ui.Image>{};
    ui.Image.onCreate = activeImages.add;
    ui.Image.onDispose = activeImages.remove;

    final ui.Image image = await _createImage();
    final ByteData? imageData = await image.toByteData(format: ui.ImageByteFormat.png);
    final ui.ImmutableBuffer imageBuffer = await ui.ImmutableBuffer.fromUint8List(
      imageData!.buffer.asUint8List(),
    );
    image.dispose();

    final ui.Codec codec = await ui.instantiateImageCodecWithSize(
      imageBuffer,
      getTargetSize: (w, h) => ui.TargetImageSize(width: w ~/ 2, height: h ~/ 2),
    );
    final ui.FrameInfo frameInfo = await codec.getNextFrame();

    expect(activeImages.length, 1);

    frameInfo.image.dispose();
    codec.dispose();

    expect(activeImages.length, 0);
  });
}

Future<ui.Image> _createImage() => _createPicture().toImage(10, 10);

ui.Picture _createPicture() {
  final ui.PictureRecorder recorder = ui.PictureRecorder();
  final ui.Canvas canvas = ui.Canvas(recorder);
  const ui.Rect rect = ui.Rect.fromLTWH(0.0, 0.0, 100.0, 100.0);
  canvas.clipRect(rect);
  return recorder.endRecording();
}
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

import 'package:test/bootstrap/browser.dart';
import 'package:test/test.dart';
import 'package:ui/ui.dart';

import '../common/test_initialization.dart';

void main() {
  internalBootstrapBrowserTest(() => testMain);
}


   y = true;
  }
  y.expectStaticType<Exactly<bool>>();
}

void testLogicalOrRhsMatches(Object x) {
  // Trivially exhaustive because the RHS always matches
  bool? y;
  switch (x) {
    case _ || int _:
      y = true;
  }
  y.expectStaticType<Exactly<bool>>();
}

void testLogicalOrNeitherMatches(Object x) {
  // Not exhaustive because neither side always matches
  bool? y;
  switch (x) {
    case int _ || String _:
      y = true;
  }
  y.expectStaticType<Exactly<bool?>>();
}

void testNullCheckAlwaysMatches(Object x) {
  // Trivially exhaustive because the matched value type is non-nullable and the
  // subpattern always matches
  bool? y;
  switch (x) {
    case _?:
      //  ^
      // [analyzer] STATIC_WARNING.UNNECESSARY_NULL_CHECK_PATTERN
      y = true;
  }
  y.expectStaticType<Exactly<bool>>();
}

void testNullCheckNullableMatchedValueType(Object? x) {
  // Not exhaustive because the matched value type is nullable
  bool? y;
  switch (x) {
    case _?:
      y = true;
  }
  y.expectStaticType<Exactly<bool?>>();
}

void testNullCheckSubpatternMayFailToMatch(Object x) {
  // Not exhaustive because the subpattern may fail to match
  bool? y;
  switch (x) {
    case int _?:
      //      ^
      // [analyzer] STATIC_WARNING.UNNECESSARY_NULL_CHECK_PATTERN
      y = true;
  }
  y.expectStaticType<Exactly<bool?>>();
}

void testNullAssertSubpatternAlwaysMatches(Object? x) {
  // Trivially exhaustive because the subpattern always matches
  bool? y;
  switch (x) {
    case _!:
      y = true;
  }
  y.expectStaticType<Exactly<bool>>();
}

void testNullAssertSubpatternAlwaysMatchesObjectPattern(bool? x) {
  // Trivially exhaustive because the subpattern always matches
  bool? y;
  switch (x) {
    case bool()!:
      y = true;
  }
  y.expectStaticType<Exactly<bool>>();
}

void testNullAssertSubpatternMayFailToMatch(Object x) {
  // Not exhaustive because the subpattern may fail to match
  bool? y;
  switch (x) {
    case int _!:
      //      ^
      // [analyzer] STATIC_WARNING.UNNECESSARY_NULL_ASSERT_PATTERN
      y = true;
  }
  y.expectStaticType<Exactly<bool?>>();
}

void testObjectSubtype(Object x) {
  // Not exhaustive
  bool? y;
  switch (x) {
    case int():
      y = true;
  }
  y.expectStaticType<Exactly<bool?>>();
}

void testObjectSupertype(Object x) {
  // Trivially exhaustive
  bool? y;
  switch (x) {
    case dynamic():
      y = true;
  }
  y.expectStaticType<Exactly<bool>>();
}

void testObjectUnrelatedType(List<String> x) {
  // Not exhaustive
  bool? y;
  switch (x) {
    case List<int>():
      y = true;
  }
  y.expectStaticType<Exactly<bool?>>();
}

void testObjectSubpatternAlwaysMatches(Object x) {
  // Trivially exhaustive because the hashCode always matches
  bool? y;
  switch (x) {
    case Object(hashCode: _):
      y = true;
  }
  y.expectStaticType<Exactly<bool>>();


ID(), resources[0].ID)
	assert.Equal(t, keys[0].PublicKeyString(), resources[0].PublicKey)
}
package web

import (
	"context"

	"github.com/gin-gonic/gin"
	"github.com/manyminds/api2go/jsonapi"

	"github.com/smartcontractkit/chainlink-common/pkg/types"

	"github.com/smartcontractkit/chainlink/v2/core/logger/audit"
	"github.com/smartcontractkit/chainlink/v2/core/services/chainlink"
	"github.com/smartcontractkit/chainlink/v2/core/web/presenters"
)

type NodesController interface {
	// Index lists nodes, and optionally filters by chain id.
	Index(c *gin.Context, size, page, offset int)
}

type NetworkScopedNodeStatuser struct {
	network  string
	relayers chainlink.RelayerChainInteroperators
}

func (n *NetworkScopedNodeStatuser) NodeStatuses(ctx context.Context, offset, limit int, relayIDs ...types.RelayID) (nodes []types.NodeStatus, count int, err error) {
	return n.relayers.NodeStatuses(ctx, offset, limit, relayIDs...)
}

type nodesController[R jsonapi.EntityNamer] struct {
	relayers    chainlink.RelayerChainInteroperators
	newResource func(status types.NodeStatus) R
	auditLogger audit.AuditLogger
}

func NewNodesController(
	relayers chainlink.RelayerChainInteroperators, auditLogger audit.AuditLogger,
) NodesController {
	return &nodesController[presenters.NodeResource]{
		relayers:    relayers,
		newResource: presenters.NewNodeResource,
		auditLogger: auditLogger,
	}
}

func (n *nodesController[R]) Index(c *gin.Context, size, page, offset int) {
	id := c.Param("ID")
	network := c.Param("network")

	var nodes []types.NodeStatus
	var count int
	var err error

	relayers := n.relayers
	if network != "" {
		relayers = relayers.List(chainlink.FilterRelayersByType(network))
	}

	ctx := c.Request.Context()
	if id == "" {
		// fetch all nodes
		nodes, count, err = relayers.NodeStatuses(ctx, offset, size)
	} else {
		// fetch nodes for chain ID
		// backward compatibility
		var rid types.RelayID
		err = rid.UnmarshalString(id)
		if err != nil {
			rid.ChainID = id
			rid.Network = network
		}
		nodes, count, err = relayers.NodeStatuses(ctx, offset, size, rid)
	}

	var resources []R
	for _, node := range nodes {
		res := n.newResource(node)
		resources = append(resources, res)
	}

	paginatedResponse(c, "node", size, page, resources, count, err)
}
package web

import (
	"context"
	"database/sql"
	"fmt"
	"net/http"
	"strings"

	"github.com/jackc/pgconn"

	"github.com/smartcontractkit/chainlink-common/pkg/assets"
	"github.com/smartcontractkit/chainlink/v2/core/bridges"
	"github.com/smartcontractkit/chainlink/v2/core/logger/audit"
	"github.com/smartcontractkit/chainlink/v2/core/services/chainlink"
	"github.com/smartcontractkit/chainlink/v2/core/store/models"
	"github.com/smartcontractkit/chainlink/v2/core/web/presenters"

	"github.com/gin-gonic/gin"
	"github.com/pkg/errors"
)

// ValidateBridgeTypeNotExist checks that a bridge has not already been created
func ValidateBridgeTypeNotExist(ctx context.Context, bt


>> 32;
    v2 += v1;
    v0 += v3;
    v1 = (v1 << 17) | v1 >>> 47;
    v3 = (v3 << 21) | v3 >>> 43;
    v1 ^= v2;
    v3 ^= v0;
    v2 = (v2 << 32) | v2 >>> 32;
    // }
    // SIPROUND {
    v0 += v1;
    v2 += v3;
    v1 = (v1 << 13) | v1 >>> 51;
    v3 = (v3 << 16) | v3 >>> 48;
    v1 ^= v0;
    v3 ^= v2;
    v0 = (v0 << 32) | v0 >>> 32;
    v2 += v1;
    v0 += v3;
    v1 = (v1 << 17) | v1 >>> 47;
    v3 = (v3 << 21) | v3 >>> 43;
    v1 ^= v2;
    v3 ^= v0;
    v2 = (v2 << 32) | v2 >>> 32;
    // }
    // SIPROUND {
    v0 += v1;
    v2 += v3;
    v1 = (v1 << 13) | v1 >>> 51;
    v3 = (v3 << 16) | v3 >>> 48;
    v1 ^= v0;
    v3 ^= v2;
    v0 = (v0 << 32) | v0 >>> 32;
    v2 += v1;
    v0 += v3;
    v1 = (v1 << 17) | v1 >>> 47;
    v3 = (v3 << 21) | v3 >>> 43;
    v1 ^= v2;
    v3 ^= v0;
    v2 = (v2 << 32) | v2 >>> 32;
    // }
    return v0 ^ v1 ^ v2 ^ v3;
  }

  /**
   * Version of SipHash which computes the hash of the input concatenated with the
   * reversed input in order to minimize the risk of collisions (for a collision to be
   * an actual value, it must have the same structure as the original input, i.e. be a palindrome).
   *
   * @param k0     the k 0
   * @param k1     the k 1
   * @param data   the data
   * @param offset the offset
   * @param len    the len
   * @return long
   */
  public static long hash24_palindromic(long k0, long k1, byte[] data, int offset, int len) {
    long v0 = 0x736f6d6570736575L ^ k0;
    long v1 = 0x646f72616e646f6dL ^ k1;
    long v2 = 0x6c7967656e657261L ^ k0;
    long v3 = 0x7465646279746573L ^ k1;
    long m;
    int last = (2 * len) / 8 * 8;

    // Current position in the buffer
    int idx = 0;

    int offset2 = offset + len + len - 1;

    // processing 8 bytes blocks in data

    int len8 = len - (len % 8);

    if (last > 0) {
      while (idx < len8) {
        m = getLong(data, offset + idx);

        idx += 8;

        // MSGROUND {
        v3 ^= m;

        /*
         * SIPROUND wih hand reordering
         *
         * SIPROUND in siphash24.c:
         * A: v0 += v1;
         * B: v1=ROTL(v1,13);
         * C: v1 ^= v0;
         * D: v0=ROT


, 0.2);
}

.svg .wp-badge {
	background-image: url(../images/classicpress-logo-white.svg?ver=202303);
}

.about-wrap .wp-badge {
	position: absolute;
	top: 0;
	right: 0;
}

/* Tabs */

.about-wrap .nav-tab {
	padding-right: 15px;
	padding-left: 15px;
	font-size: 18px;
	line-height: 1.33333333;
}

/* x.2.1 - Typography */

.about-wrap h1 {
	margin: 0.2em 200px 0 0;
	padding: 0;
	color: #32373c;
	line-height: 1.2;
	font-size: 2.8em;
	font-weight: 400;
}

.about-wrap h2 {
	margin: 40px 0 0.6em;
	font-size: 2.7em;
	line-height: 1.3;
	font-weight: 300;
	text-align: center;
}

.about-wrap h3 {
	margin: 1.25em 0 0.6em;
	font-size: 1.4em;
	line-height: 1.5;
}

.about-wrap h4 {
	font-size: 16px;
	color: #23282d;
}

.about-wrap p {
	line-height: 1.5;
	font-size: 16px;
}

.about-wrap code,
.about-wrap ol li p {
	font-size: 14px;
	font-weight: 400;
}

.about-wrap figcaption {
	font-size: 13px;
	text-align: center;
	color: white;
	text-overflow: ellipsis;
}

.about-wrap .about-description,
.about-wrap .about-text {
	margin-top: 1.4em;
	font-weight: 400;
	line-height: 1.6;
	font-size: 19px;
}

.about-wrap .about-text {
	margin: 1em 200px 1em 0;
	color: #555d66;
}

/* x.2.2 - Structure */

.about-wrap .has-1-columns,
.about-wrap .has-2-columns,
.about-wrap .has-3-columns,
.about-wrap .has-4-columns {
	display: grid;
	max-width: 800px;
	margin-top: 40px;
	margin-left: auto;
	margin-right: auto;
}

.about-wrap .column {
	margin-right: 20px;
	margin-left: 20px;
}

.about-wrap .is-wide {
	max-width: 760px;
}

.about-wrap .is-fullwidth {
	max-width: 100%;
}

.about-wrap .has-1-columns {
	display: block;
	max-width: 680px;
	margin: 0 auto 40px;
}

.about-wrap .has-2-columns {
	grid-template-columns: 1fr 1fr;
}

.about-wrap .has-2-columns .column:nth-of-type(2n+1) {
	grid-column-start: 1;
}

.about-wrap .has-2-columns .column:nth-of-type(2n) {
	grid-column-start: 2;
}

.about-wrap .has-2-columns.is-wider-right {
	grid-template-columns: 1fr 2fr;
}

.about-wrap .has-2-columns.is-wider-left {
	grid-template-columns: 2fr 1fr;
}

.about-wrap .has-3-columns {
	grid-template-columns: repeat(3, 1fr);
}

.about-wrap .has-3-columns .column:nth-of-type(3n+1) {
	grid-column-start: 1;
}

.about-wrap .has-3-columns .column:nth-of-type(3n+2) {
	grid-column-start: 2;
}

.about-wrap .has-3-columns .column:nth-of-type(3n) {
	grid-column-start: 3;
}

.about-wrap .has-4-columns {
	grid-template-columns: repeat(4, 1fr);
}

.about-wrap .has-4-columns .column:nth-of-type(4n+1) {


ing used for creating cmd renew flags.
func newCertificateOptions() *certificateOptions {
	return &certificateOptions{
		caCertHashes:             make([]string, 0),
		unsafeSkipCAVerification: true,
		yurthubServer:            yurtconstants.DefaultYurtHubServerAddr,
	}
}

// NewCmdCertificate returns "yurtadm renew certificate" command.
func NewCmdCertificate() *cobra.Command {
	o := newCertificateOptions()

	certificateCmd := &cobra.Command{
		Use:   "certificate",
		Short: "Create bootstrap file for yurthub to update certificate",
		RunE: func(certificateCmd *cobra.Command, args []string) error {
			if err := o.validate(); err != nil {
				klog.Fatalf("validate options: %v", err)
			}

			// Check if YurtHub's certificate is ready or not.
			// No update if ready.
			if ok := yurthub.CheckYurthubReadyzOnce(o.yurthubServer); ok {
				klog.Infoln("The certificate is still valid and does not need to be renewed")
				return nil
			}

			us, err := parseRemoteServers(o.serverAddr)
			if err != nil {
				return err
			}

			// 1.Create a temporary bootstrap file and set to /var/lib/yurthub directory.
			if err := yurthub.SetHubBootstrapConfig(us[0].Host, o.token, o.caCertHashes); err != nil {
				return err
			}

			// 2.Check if YurtHub's certificates is ready or not.
			if err := yurthub.CheckYurthubReadyz(o.yurthubServer); err != nil {
				return err
			}

			// 3.Delete temporary bootstrap file.
			if err := yurthub.CleanHubBootstrapConfig(); err != nil {
				return err
			}

			klog.Infoln("Certificate renewed successfully")

			return nil
		},
	}

	addCertificateConfigFlags(certificateCmd.Flags(), o)
	return certificateCmd
}

func (options *certificateOptions) validate() error {
	if len(options.serverAddr) == 0 {
		return fmt.Errorf("server-address is empty")
	}

	if len(options.token) == 0 {
		return fmt.Errorf("bootstrap token is empty")
	}

	if len(options.caCertHashes) == 0 && !options.unsafeSkipCAVerification {
		return fmt.Errorf("set --discovery-token-unsafe-skip-ca-verification flag as true or pass CACertHashes to continue")
	}

	return nil
}

func parseRemoteServers(serverAddr string) ([]*url.URL, error) {
	servers := strings.Split(serverAddr, ",")
	us := make([]*url.URL, 0, len(servers))
	remoteServers := make([]string, 0, len(servers))
	for _, server := range servers {
		u, err := url.Parse(server)
		if err != nil {
			klog.Errorf("could not parse server address %s, %v", servers, err)
			return us, err
		}
		if u.Scheme == "" {
			u.Scheme = "https"
		} else if u.Scheme != "https" {
			return us, fmt.Errorf("only https scheme is supported for server address(%s)", serverAddr)
		}
		us = append(us, u)
		remoteServers = append(remoteServers, u.String())
	}

	if len(us) < 1 {
		return us, fmt.Errorf("no server address is set, can not connect remote server")
	}
	klog.Infof("%s would connect remote servers: %s", projectinfo.GetHubName(), strings.Join(remoteServers, ","))

	return us, nil
}

// addCertificateConfigFlags adds certificate flags bound to the config to the specified flagset
func addCertificateConfigFlags(flagSet *flag.FlagSet, certificate


.deferredOutputVariables {
		if output.SourceComponent.Name() == r.Name() {
			g.Fgenf(w, "%s", g.Indent)
			expr, temps := g.lowerExpression(output.Expr, output.Expr.Type())
			g.genTemps(w, temps)
			if _, ok := output.Expr.(*model.ScopeTraversalExpression); ok {
				g.Fgenf(w, "resolve_%s(%v)\n", PyName(output.Name), expr)
			} else {
				g.Fgenf(w, "resolve_%s(pulumi.Output.from_input(%v))\n", PyName(output.Name), expr)
			}
		}
	}

	g.genTrivia(w, r.Definition.Tokens.GetCloseBrace())
}

func (g *generator) genTemps(w io.Writer, temps []*quoteTemp) {
	for _, t := range temps {
		// TODO(pdg): trivia
		g.Fgenf(w, "%s%s = %.v\n", g.Indent, t.Name, t.Value)
	}
}

func (g *generator) genConfigVariable(w io.Writer, v *pcl.ConfigVariable) {
	// TODO(pdg): trivia

	if !g.configCreated {
		g.Fprintf(w, "%sconfig = pulumi.Config()\n", g.Indent)
		g.configCreated = true
	}

	getType := "_object"
	switch v.Type() {
	case model.StringType:
		getType = ""
	case model.NumberType:
		getType = "_float"
	case model.IntType:
		getType = "_int"
	case model.BoolType:
		getType = "_bool"
	}

	getOrRequire := "get"
	if v.DefaultValue == nil {
		getOrRequire = "require"
	}

	var defaultValue model.Expression
	var temps []*quoteTemp
	if v.DefaultValue != nil {
		defaultValue, temps = g.lowerExpression(v.DefaultValue, v.DefaultValue.Type())
	}
	g.genTemps(w, temps)

	if v.Description != "" {
		for _, line := range strings.Split(v.Description, "\n") {
			g.Fgenf(w, "%s# %s\n", g.Indent, line)
		}
	}
	name := PyName(v.Name())
	g.Fgenf(w, "%s%s = config.%s%s(\"%s\")\n", g.Indent, name, getOrRequire, getType, v.LogicalName())
	if defaultValue != nil {
		g.Fgenf(w, "%sif %s is None:\n", g.Indent, name)
		g.Indented(func() {
			g.Fgenf(w, "%s%s = %.v\n", g.Indent, name, defaultValue)
		})
	}
}

func (g *generator) genLocalVariable(w io.Writer, v *pcl.LocalVariable) {
	value, temps := g.lowerExpression(v.Definition.Value, v.Type())
	g.genTemps(w, temps)

	g.genTrivia(w, v.Definition.Tokens.Name)
	g.Fgenf(w, "%s%s = %.v\n", g.Indent, PyName(v.Name()), value)
}

func (g *generator) genOutputVariable(w io.Writer, v *pcl.OutputVariable) {
	value, temps := g.lowerExpression(v.Value, v.Type())
	g.genTemps(w, temps)

	// TODO(pdg): trivia
	g.Fgenf(w, "%spulumi.export(\"%s\", %.v)\n", g.Indent, v.LogicalName(), value)
}

func (g *generator) genNYI(w io.Writer, reason string, vs ...any) {
	message := "not yet implemented: " + fmt.Sprintf(reason, vs...)
	g.diagnostics = append(g.diagnostics, &hcl.Diagnostic{
		Severity: hcl.DiagError,
		Summary:  message,
		Detail:   message,
	})


+
		"\30\3\30\3\30\3\30\3\30\3\30\3\30\3\30\3\30\3\30\5\30\u04a7\n\30\3\30"+
		"\3\30\3\31\3\31\3\31\5\31\u04ae\n\31\3\31\3\31\3\31\5\31\u04b3\n\31\3"+
		"\31\5\31\u04b6\n\31\3\31\3\31\3\31\5\31\u04bb\n\31\3\31\3\31\3\31\3\31"+
		"\3\31\3\31\5\31\u04c3\n\31\3\31\3\31\3\31\3\31\5\31\u04c9\n\31\3\31\3"+
		"\31\5\31\u04cd\n\31\3\32\5\32\u04d0\n\32\3\32\3\32\3\32\5\32\u04d5\n\32"+
		"\3\32\5\32\u04d8\n\32\3\32\3\32\5\32\u04dc\n\32\3\32\5\32\u04df\n\32\3"+
		"\32\3\32\5\32\u04e3\n\32\3\32\5\32\u04e6\n\32\3\33\3\33\3\33\3\33\3\33"+
		"\3\33\5\33\u04ee\n\33\5\33\u04f0\n\33\3\34\3\34\3\34\7\34\u04f5\n\34\f"+
		"\34\16\34\u04f8\13\34\3\34\3\34\3\34\5\34\u04fd\n\34\3\34\3\34\3\34\3"+
		"\34\7\34\u0503\n\34\f\34\16\34\u0506\13\34\5\34\u0508\n\34\3\34\3\34\3"+
		"\34\7\34\u050d\n\34\f\34\16\34\u0510\13\34\5\34\u0512\n\34\5\34\u0514"+
		"\n\34\3\35\3\35\3\35\3\35\5\35\u051a\n\35\3\36\3\36\3\36\3\36\5\36\u0520"+
		"\n\36\3\36\3\36\3\37\3\37\3\37\3\37\3\37\3\37\3\37\3\37\3\37\3\37\3\37"+
		"\3\37\3\37\5\37\u0531\n\37\3 \3 \3 \3 \3 \5 \u0538\n \3!\3!\3!\3\"\3\""+
		"\5\"\u053f\n\"\3\"\3\"\3\"\3\"\3\"\3\"\3\"\3\"\3\"\5\"\u054a\n\"\3#\5"+
		"#\u054d\n#\3#\3#\3#\3$\3$\3$\3%\3%\3%\3%\3%\5%\u055a\n%\3%\3%\3%\3%\3"+
		"%\3%\3%\3%\3%\3%\3%\5%\u0567\n%\3%\3%\3%\5%\u056c\n%\3&\3&\3&\3&\3&\3"+
		"&\3&\3&\3&\3&\3&\3&\3&\3&\5&\u057c\n&\3\'\3\'\


.Wait()

	if scn.ScanLogger != nil {
		scn.ScanLogger.logger.Info().
			Any("count", len(paths)).
			Msg("Retrieved file paths from all directories")
	}

	// Invoke ScanFilePathsRetrieved hook
	fpEvent := &ScanFilePathsRetrievedEvent{
		FilePaths: paths,
	}
	_ = hook.GlobalHookManager.OnScanFilePathsRetrieved().Trigger(fpEvent)
	paths = fpEvent.FilePaths

	// +---------------------+
	// |    Local files      |
	// +---------------------+

	localFiles := make([]*anime.LocalFile, 0)

	// Get skipped files depending on options
	skippedLfs := make(map[string]*anime.LocalFile)
	if (scn.SkipLockedFiles || scn.SkipIgnoredFiles) && scn.ExistingLocalFiles != nil {
		// Retrieve skipped files from existing local files
		for _, lf := range scn.ExistingLocalFiles {
			if scn.SkipLockedFiles && lf.IsLocked() {
				skippedLfs[lf.GetNormalizedPath()] = lf
			} else if scn.SkipIgnoredFiles && lf.IsIgnored() {
				skippedLfs[lf.GetNormalizedPath()] = lf
			}
		}
	}

	// Create local files from paths (skipping skipped files)
	localFiles = lop.Map(paths, func(path string, _ int) *anime.LocalFile {
		if _, ok := skippedLfs[util.NormalizePath(path)]; !ok {
			// Create a new local file
			return anime.NewLocalFileS(path, libraryPaths)
		} else {
			return nil
		}
	})

	// Remove nil values
	localFiles = lo.Filter(localFiles, func(lf *anime.LocalFile, _ int) bool {
		return lf != nil
	})

	// Invoke ScanLocalFilesParsed hook
	parsedEvent := &ScanLocalFilesParsedEvent{
		LocalFiles: localFiles,
	}
	_ = hook.GlobalHookManager.OnScanLocalFilesParsed().Trigger(parsedEvent)
	localFiles = parsedEvent.LocalFiles

	if scn.ScanLogger != nil {
		scn.ScanLogger.logger.Debug().
			Any("count", len(localFiles)).
			Msg("Local files to be scanned")
		scn.ScanLogger.logger.Debug().
			Any("count", len(skippedLfs)).
			Msg("Skipped files")

		scn.ScanLogger.logger.Debug().
			Msg("===========================================================================================================")
	}

	for _, lf := range localFiles {
		if scn.ScanLogger != nil {
			scn.ScanLogger.logger.Trace().
				Str("path", lf.Path).
				Str("filename", lf.Name).
				Interface("parsedData", lf.ParsedData).
				Interface("parsedFolderData", lf.ParsedFolderData).
				Msg("Parsed local file")
		}
	}

	if scn.ScanLogger != nil {
		scn.ScanLogger.logger.Debug().
			Msg("===========================================================================================================")
	}

	// DEVNOTE: Removed library path checking because it causes some issues with symlinks

	// +---------------------+
	// |  No files to scan   |
	// +---------------------+

	// If there are no local files to scan (all files are skipped, or a file was deleted)
	if len(localFiles) == 0 {
		scn.WSEventManager.SendEvent(events.EventScanProgress, 90)
		scn.WSEventManager.SendEvent(events.EventScanStatus, "Verifying file integrity...")
		// Add skipped files
		if len(skippedLfs) > 0 {
			for _, sf := range skippedLfs {
				if filesystem.FileExists(sf.Path) { // Verify that the file still exists
					localFiles = append(localFiles, sf)
				}
			}
		}
		scn.Logger.Debug().Msg("scanner: Scan completed")
		scn.WSEventManager.SendEvent(events.EventScanProgress,


Converter.Int64BitsToDouble (StaticShort);
		}

		byte InstanceByte;
		double InstanceDouble;

		public double InstanceFieldBad ()
		{
			return InstanceDouble + BitConverter.Int64BitsToDouble (InstanceByte);
		}

		public double LocalVariableBad ()
		{
			int x = 42;
			return BitConverter.Int64BitsToDouble (x);
		}

		public double CallBad (double d)
		{
			return BitConverter.Int64BitsToDouble (d.GetHashCode ());
		}

		[Test]
		public void Bad ()
		{
			AssertRuleFailure<ReviewUseOfInt64BitsToDoubleTest> ("ParametersBad", 2);
			AssertRuleFailure<ReviewUseOfInt64BitsToDoubleTest> ("StaticFieldBad", 1);
			AssertRuleFailure<ReviewUseOfInt64BitsToDoubleTest> ("InstanceFieldBad", 1);
			AssertRuleFailure<ReviewUseOfInt64BitsToDoubleTest> ("LocalVariableBad", 1);
			AssertRuleFailure<ReviewUseOfInt64BitsToDoubleTest> ("CallBad", 1);
		}

		public double ParametersGood (long x, long y)
		{
			return BitConverter.Int64BitsToDouble (x) + BitConverter.Int64BitsToDouble (y);
		}

		static ulong StaticULong = 16;

		public double StaticFieldGood ()
		{
			return unchecked (BitConverter.Int64BitsToDouble ((long)StaticULong));
		}

		long InstanceLong;

		public double InstanceFieldGood ()
		{
			return InstanceDouble + BitConverter.Int64BitsToDouble (InstanceLong);
		}

		public double LocalVariableGood ()
		{
			long x = 42;
			return BitConverter.Int64BitsToDouble (x);
		}

		public double CallGood (long x)
		{
			return BitConverter.Int64BitsToDouble (x);
		}

		[Test]
		public void Ok ()
		{
			// no conversion of [u]long
			AssertRuleDoesNotApply<ReviewUseOfInt64BitsToDoubleTest> ("ParametersGood");
			AssertRuleDoesNotApply<ReviewUseOfInt64BitsToDoubleTest> ("StaticFieldGood");
			AssertRuleDoesNotApply<ReviewUseOfInt64BitsToDoubleTest> ("InstanceFieldGood");
			AssertRuleDoesNotApply<ReviewUseOfInt64BitsToDoubleTest> ("CallGood");
			// a conversion occurs in this case because the value is assigned from a int (42)
			AssertRuleSuccess<ReviewUseOfInt64BitsToDoubleTest> ("LocalVariableGood");
		}
	}
}


timesScalar = force1*scalar;
  const Torque torque1timesScalar = torque1*scalar;
  Wrench wrench1timesScalar = wrench1*scalar;
  KINDR_ASSERT_DOUBLE_MX_EQ(force1timesScalar.toImplementation(), wrench1timesScalar.getForce().toImplementation(), Scalar(0.5), "multiply");
  KINDR_ASSERT_DOUBLE_MX_EQ(torque1timesScalar.toImplementation(), wrench1timesScalar.getTorque().toImplementation(), Scalar(0.5), "multiply");

  // Divides by a scalar.
  const Force force1DivideByScalar = force1/scalar;
  const Torque torque1DivideByScalar = torque1/scalar;
  Wrench wrench1DivideByScalar = wrench1/scalar;
  KINDR_ASSERT_DOUBLE_MX_EQ(force1DivideByScalar.toImplementation(), wrench1DivideByScalar.getForce().toImplementation(), Scalar(0.5), "divide");
  KINDR_ASSERT_DOUBLE_MX_EQ(torque1DivideByScalar.toImplementation(), wrench1DivideByScalar.getTorque().toImplementation(), Scalar(0.5), "divide");

  // Addition and assignment
  Wrench wrenchAddAssing = wrench1;
  wrenchAddAssing += wrench2;
  KINDR_ASSERT_DOUBLE_MX_EQ(force1p2.toImplementation(), wrenchAddAssing.getForce().toImplementation(), Scalar(0.5), "subtract");
  KINDR_ASSERT_DOUBLE_MX_EQ(torque1p2.toImplementation(), wrenchAddAssing.getTorque().toImplementation(), Scalar(0.5), "subtract");

  // Subtraction and assignment
  Wrench wrenchSubtractAssing = wrench1;
  wrenchSubtractAssing -= wrench2;
  KINDR_ASSERT_DOUBLE_MX_EQ(force1m2.toImplementation(), wrenchSubtractAssing.getForce().toImplementation(), Scalar(0.5), "subtract and assign");
  KINDR_ASSERT_DOUBLE_MX_EQ(torque1m2.toImplementation(), wrenchSubtractAssing.getTorque().toImplementation(), Scalar(0.5), "subtract and assign");

  // Multiplication and assignment
  Wrench wrenchMultiplyAssign = wrench1;
  wrenchMultiplyAssign *= scalar;
  KINDR_ASSERT_DOUBLE_MX_EQ(force1timesScalar.toImplementation(), wrenchMultiplyAssign.getForce().toImplementation(), Scalar(0.5), "multiply and assign");
  KINDR_ASSERT_DOUBLE_MX_EQ(torque1timesScalar.toImplementation(), wrenchMultiplyAssign.getTorque().toImplementation(), Scalar(0.5), "multiply and assign");

  // Division and assignment
  Wrench wrenchDivideAssign = wrench1;
  wrenchDivideAssign /= scalar;
  KINDR_ASSERT_DOUBLE_MX_EQ(force1DivideByScalar.toImplementation(), wrenchDivideAssign.getForce().toImplementation(), Scalar(0.5), "divide and assign");
  KINDR_ASSERT_DOUBLE_MX_EQ(torque1DivideByScalar.toImplementation(), wrenchDivideAssign.getTorque().toImplementation(), Scalar(0.5), "divide and assign");

}
/*
 * Copyright (c) 2013, Christian Gehring, Hannes Sommer, Paul Furgale, Remo Diethelm
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *     * Redistributions of source code must retain the above copyright
 *       notice, this list of conditions and the following disclaimer.
 *     * Redistributions in binary form must reproduce the above copyright
 *       notice, this list of conditions and the following disclaimer in the
 *       documentation and/or other materials provided with the distribution.
 *     * Neither the name of the Autonomous Systems Lab, ETH Zurich nor the
 *       names of its con


   system.set_bond_potential(
            ("O", "H"),
            Box::new(Harmonic {
                x0: 1.4,
                k: units::from(122.0, "kJ/mol/A^2").unwrap(),
            }),
        );

        system.set_angle_potential(
            ("O", "O", "H"),
            Box::new(Harmonic {
                x0: f64::to_radians(120.0),
                k: units::from(150.0, "kJ/mol/deg^2").unwrap(),
            }),
        );

        system.set_dihedral_potential(
            ("H", "O", "O", "H"),
            Box::new(Harmonic {
                x0: f64::to_radians(180.0),
                k: units::from(800.0, "kJ/mol/deg^2").unwrap(),
            }),
        );

        system.set_coulomb_potential(Box::new(Wolf::new(5.0)));

        for particle in system.particles_mut() {
            if particle.name == "O" {
                *particle.charge = -0.5;
            } else if particle.name == "H" {
                *particle.charge = 0.5;
            }
        }
        system
    }

    #[test]
    fn cache_energy() {
        let system = testing_system();
        let mut cache = EnergyCache::new();
        cache.init(&system);

        assert_ulps_eq!(cache.energy(), system.potential_energy());
    }

    #[test]
    #[allow(clippy::unreadable_literal)]
    fn move_molecule() {
        let mut system = testing_system();
        let mut cache = EnergyCache::new();
        let old_energy = system.potential_energy();
        cache.init(&system);
        assert_ulps_eq!(cache.energy(), old_energy);

        let new_positions = &[
            Vector3D::new(-0.987061, 0.59401, 0.427533),
            Vector3D::new(-1.0744137409578138, 1.2111820514074991, -0.2893833856814936),
            Vector3D::new(-1.4352068561309008, 2.5425486908430286, 0.24698514382209652),
            Vector3D::new(-1.5225595970887147, 3.159720742250528, -0.46993124185939705),
        ];
        let cost = cache.move_molecule_cost(&system, 0, new_positions);

        system.particles_mut().position[0] = new_positions[0];
        system.particles_mut().position[1] = new_positions[1];
        system.particles_mut().position[2] = new_positions[2];
        system.particles_mut().position[3] = new_positions[3];
        let new_energy = system.potential_energy();
        assert_relative_eq!(cost, new_energy - old_energy, max_relative = 1e-9);

        cache.update(&mut system);
        assert_ulps_eq!(cache.energy(), new_energy);

        // Check that the cache is really updated
        let old_energy = new_energy;
        let new_positions = &[
            Vector3D::new(-0.49138099999999996, 1.08969, 0.923213),
            Vector3D::new(-1.0139188773839494, 1.7555242433058806, 1.3546291257885033),
            Vector3D::new(-2.4014453359903767, 1.2663193861239206, 1.5154051637316108),
            Vector3D::new(-2.923983213374326, 1.9321536294298012, 1.946821289520114),
        ];
        let cost = cache.move_molecule_cost(&system, 0, new_positions);
        system.particles_mut().position[0] = new_positions[0];
        system.particles_mut().position[1] = new_positions[1];


 sulfide":"[化] 三硫化二锑",
"antimonsoon":"n. 反季风",
"antimony":"n. 锑\\n[化] 锑Sb",
"antimony aniline-tartrate":"[医] 酒石酸苯胺锑",
"antimony barium tartrate":"[化] 酒石酸锑钡",
"antimony black":"[化] 锑黑; 硫化锑; 五硫化锑",
"antimony bloom":"[化] 锑华; 锑花(指Sb-2S-3或Sb-2O-3)",
"antimony butter":"[化] 三氯化锑",
"antimony chloride":"[化] (三或五)氯化锑\\n[医] 三氯化锑(腐蚀剂)",
"antimony cinnabar":"[化] 锑朱砂; 硫氧化锑",
"antimony compound":"[机] 锑化合物",
"antimony crocus":"[化] 锑藏红(三氧化二锑和三硫化二锑的共融体)",
"antimony electrode":"[机] 锑电极",
"antimony flowers":"[化] 锑华; 锑花(指Sb-2S-3或Sb-2O-3)",
"antimony glance":"[化] 辉锑矿",
"antimony glass":"[化] 锑镜",
"antimony golden sulfide":"[化] 金色硫化锑(即五硫化二锑)",
"antimony halide":"[化] 卤化锑",
"antimony halides":"[机] 卤化锑",
"antimony hydride":"[化] 锑化氢",
"antimony lactate":"[机] 乳酸锑",
"antimony lead":"[机] 锑铅",
"antimony lithium thiomalate":"[医] 硫代苹果酸锑锂(抗血吸虫病药)",
"antimony liver":"[化] 锑肝(全硫(代)锑酸钙和全硫(代)亚锑酸钙的混和物)",
"antimony metal":"[机] 锑金属",
"antimony mirror":"[机] 锑镜",
"antimony needles":"[机] 锑针",
"antimony ochre":"[化] 黄锑矿",
"antimony orange":"[化] 锑橙(主要成分为硫化锑)",
"antimony ore":"[机] 锑矿",
"antimony oxide":"[医] 氧化锑, 五氧化二锑",
"antimony oxychloride":"[医] 氯氧锑",
"antimony pentachloride":"[化] 五氯化锑\\n[医] 五氯化锑",
"antimony pentalfluoride":"[机] 五氟化锑",
"antimony pentasulfide":"[化] 五硫化二锑",
"antimony pentoxide":"[化] 五氧化二锑; (不宜称)过氧化锑\\n[医] 五氧化二锑",
"antimony peroxide":"[化] 五氧化二锑; (不宜称)过氧化锑",
"antimony persulfide":"[化] 五硫化二锑; (不宜称)过硫化锑",
"antimony poisoning":"[化] 锑中毒",
"antimony potassium oxalate":"[医] 草酸锑钾",
"antimony potassium tartrate":"[医]


tr = ValueForKey(b->owner, "texture");
	b->lightTexture = -1;
	if (str && strlen(str) > 0) {
		const idMaterial	*q = Texture_LoadLight(str);
		if (q) {
			b->lightTexture = q->GetEditorImage()->texnum;
		}
	}

	str = ValueForKey(b->owner, "light_right");
	if (str && *str) {
		idVec3	vRight, vUp, vTarget, vTemp;

		if (GetVectorForKey(b->owner, "light_start", b->lightStart)) {
			b->startEnd = true;
			if (!GetVectorForKey(b->owner, "light_end", b->lightEnd)) {
				GetVectorForKey(b->owner, "light_target", b->lightEnd);
			}

			VectorAdd(b->lightEnd, *origin, b->lightEnd);
			VectorAdd(b->lightStart, *origin, b->lightStart);
			VectorAdd(b->lightStart, offset, b->lightStart);
		}
		else {
			b->startEnd = false;
		}

		GetVectorForKey(b->owner, "light_right", vRight);
		GetVectorForKey(b->owner, "light_up", vUp);
		GetVectorForKey(b->owner, "light_target", vTarget);
		if (offset.x || offset.y || offset.z) {
			CString str;
			VectorAdd(vTarget, offset, vTarget);
			SetKeyVec3(b->owner, "light_target", vTarget);
		}

		VectorAdd(vTarget, *origin, b->lightTarget);
		VectorAdd(b->lightTarget, vRight, b->lightRight);
		VectorAdd(b->lightTarget, vUp, b->lightUp);

		UpdateSelectablePoint(b, Brush_TransformedPoint(b, b->lightUp), LIGHT_UP);
		UpdateSelectablePoint(b, Brush_TransformedPoint(b, b->lightRight), LIGHT_RIGHT);
		UpdateSelectablePoint(b, Brush_TransformedPoint(b, b->lightTarget), LIGHT_TARGET);
		UpdateSelectablePoint(b, Brush_TransformedPoint(b, b->lightStart), LIGHT_START);
		UpdateSelectablePoint(b, Brush_TransformedPoint(b, b->lightEnd), LIGHT_END);
		b->pointLight = false;
	}
	else {
		b->pointLight = true;

		if (GetVectorForKey(b->owner, "light_center", vCenter)) {

			if (offset.x || offset.y || offset.z) {
				CString str;
				VectorAdd(vCenter, offset, vCenter);
				SetKeyVec3(b->owner, "light_center", vCenter);
			}

			VectorAdd(vCenter, *origin, b->lightCenter);
			UpdateSelectablePoint(b, b->lightCenter, LIGHT_CENTER);
		}

		if (!GetVectorForKey(b->owner, "light_radius", b->lightRadius)) {
			float	f = FloatForKey(b->owner, "light");
			if (f == 0) {
				f = 300;
			}

			b->lightRadius[0] = b->lightRadius[1] = b->lightRadius[2] = f;
		}
		else {
		}
	}

	g_bScreenUpdates = false;
	g_pParentWnd->GetCamera()->BuildEntityRenderState(b->owner, true);
	g_bScreenUpdates = true;

}

/*
================
Brush_BuildWindings
================
*/
void Brush_BuildWindings(brush_t *b, bool bSnap, bool keepOnPlaneWinding, bool updateLights, bool makeFacePlanes) {
	idWinding	*w;
	face_t		*face;
	float		v;

	// clear the mins/maxs bounds
	b->mins


sets/Fonts/Inter-Black.otf";
        final int interExtraBoldFontSize = 16;
        interExtraBold = io.getFonts().addFontFromFileTTF(interExtraBoldPath, interExtraBoldFontSize, noMergeConf);

        io.getFonts().build();
        fontConfig.destroy();
    }

    // - - - start function because constructors are pointless
    public static void initImGui(long HANDLE)
    {
        windowPtr = HANDLE;
        Logger.FORGE_LOG_INFO("Created imgui for window " + HANDLE);
        // IMPORTANT!!
        // This line is critical for Dear ImGui to work.
        ImGui.createContext();
        Logger.FORGE_LOG_INFO("context created for imgui rendering");

        // - - - Initialize ImGuiIO config
        io = ImGui.getIO();

        io.setIniFilename("Configurations/editorLayout.justForgeFile"); // We don't want to save .ini file
        if (ConfigFlags.dockingEnable) io.addConfigFlags(ImGuiConfigFlags.DockingEnable); // enable docking
        if (ConfigFlags.viewportsEnable) io.addConfigFlags(ImGuiConfigFlags.ViewportsEnable); // enable docking
        io.setBackendPlatformName("imgui_java_impl_glfw");

        setInputMapping();
        setKeyboardCallbacks();
        setMouseCallbacks();
        setClipboardCallbacks();
        if (!Forge.isRelease) setFontAtlas();

        Forge.getCurrentTheme().applyTheme();
        imGuiGl3.init("#version 410 core");
        Logger.FORGE_LOG_INFO("Editor GUI ready");

        addRenderWindow(KeyboardControls::editorUpdate, Icons.Keyboard + "  Keyboard Controls");
        addRenderWindow(SceneHierarchyWindow::editorGUI, Icons.Video + "  Scene Hierarchy Window");
        addRenderWindow(GameViewport::render, Icons.Gamepad + "  Game Viewport");
        addRenderWindow(ComponentsWindow::render, Icons.CodeBranch + "  Components Window");
        addRenderWindow(CameraControlWindow::render, Icons.Camera + "  Camera Controls");
        addRenderWindow(FPSGraph::render, Icons.ChartLine + "  FPS Graph");
        addRenderWindow(GridControls::render, Icons.DigitalTachograph + "  Grid Controls");
        addRenderWindow(Logs::render, Icons.Terminal + "  Logs");
        addRenderWindow(PrefabManager::render, Icons.Copy + "  Prefabs");
        addRenderWindow(Settings::editorGUI, Icons.Cog + "  Settings");
        addRenderWindow(AssetPoolDisplay::render, Icons.Images + "  Asset Pool Display");
    }

    // - - - GUI usage functions - - -

    public static void update(float DELTA_TIME, Scene SCENE)
    {
        try
        {
            startFrame(DELTA_TIME);
            switch (Forge.currentState)
            {
                case isEditor:
                    if (ConfigFlags.dockingEnable) setupDockSpace();
                    SCENE.editorGUI();
                    MenuBar.render();

                    for (int i = 0; i < toRender.size(); ++i)
                    {
                        if (toRender.get(i))
                        {
                            renderWindows.get(i).run();
                        }
                    }
                    ImGui.end();
                    break;

                case isSplashScreen:
                    SplashScreen.render(DELTA_TIME);
                    break;
            }

            ImGui.render();
            endFrame();
        }
        catch (Exception e)
        {
            Logger.FORGE_LOG_FATAL(e.getMessage());
        }
    }

    private static void startFrame(final float DELTA_TIME)
    {
        // - - - Get window properties and mouse position
        float[] winWidth = {GameWindow.get().getWidth()};
        float[] winHeight = {GameWindow.get().getHeight()};
        double[] mousePosX = {0


">十万级

奇安信评级

高危

CVSS 评分

7.7、8.1

威胁类型

信息泄露、代码执行

<strong style="max-inline-size: 100%;margin: 0px;padding: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;outline: none 0px !important;cursor: text;color: #000000;font-size: 17px;text-align: -webkit-left;caret-color: #ff0000;text-decoration-thickness: initial;font-family: 微软雅黑, "Microsoft YaHei&


// Copyright (c) 2006-2008 Max-Planck-Institute Saarbruecken (Germany).
// All rights reserved.
//
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation; either version 3 of the License,
// or (at your option) any later version.
//
// Licensees holding a valid commercial license may use this file in
// accordance with the commercial license agreement provided with the software.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
//
// $URL: https://github.com/CGAL/cgal/blob/releases/CGAL-4.14/Number_types/include/CGAL/Sqrt_extension/Scalar_factor_traits.h $
// $Id: Scalar_factor_traits.h 0698f79 %aI Sébastien Loriot
// SPDX-License-Identifier: LGPL-3.0+
//
//
// Author(s)     : Michael Hemmer   <hemmer@mpi-inf.mpg.de>

#ifndef CGAL_SQRT_EXTENSION_SCALAR_FACTOR_TRAITS_H
#define CGAL_SQRT_EXTENSION_SCALAR_FACTOR_TRAITS_H

#include <CGAL/basic.h>

namespace CGAL {

// This is the specialization for Sqrt_extension
template <class COEFF, class ROOT, class ACDE_TAG,class FP_TAG>
class Scalar_factor_traits< Sqrt_extension<COEFF, ROOT, ACDE_TAG,FP_TAG> > {
public:

    //! the number type for which this instance has been instantiated
    typedef Sqrt_extension<COEFF, ROOT,ACDE_TAG,FP_TAG> NT;
      //! the number type of scalars that can be extracted from NT
    typedef typename Scalar_factor_traits<COEFF>::Scalar Scalar;

    class Scalar_factor
    {
    public:
        //! argument type
        typedef NT argument_type;
        //! first argument type
        typedef NT first_argument_type;
        //! second argument type
        typedef Scalar second_argument_type;
        //! result type
        typedef Scalar result_type;

        Scalar
        operator () (const NT& x, const Scalar& d_ = Scalar(0) ) {
            typename Scalar_factor_traits<COEFF>::Scalar_factor sfac;

            Scalar d(d_);
            Scalar unity(1);
            if(d==unity) return d;
            d=sfac(x.a0(),d);
            if(d==unity) return d;
            if(x.is_extended())
                d=sfac(x.a1(),d);
            return d;
        }
    };

    class Scalar_div
    {
    public:
        //! first_argument_type
        typedef NT first_argument_type;
        //! second_argument_type
        typedef Scalar second_argument_type;
        //! divides an extension \c a by a scalar factor \c b
        void operator () (NT& a, const Scalar& b) {
            CGAL_precondition(b != Scalar(0));
            typename Scalar_factor_traits<COEFF>::Scalar_div sdiv;
            sdiv(a.a0(), b); sdiv(a.a1(), b); // perform division in place
        }
    };
};

} //namespace CGAL

#endif


data-no-autofocus"},34170:e=>{"use strict";e.exports=function(e,n){var r,o,i,a=e||"",s=n||"div",l={},c=0;for(;c<a.length;)t.lastIndex=c,i=t.exec(a),(r=a.slice(c,i?i.index:a.length))&&(o?"#"===o?l.id=r:l.className?l.className.push(r):l.className=[r]:s=r,c+=r.length),i&&(o=i[0],c++);return{type:"element",tagName:s,properties:l,children:[]}};var t=/[#.]/g},58130:(e,t,n)=>{"use strict";var r=n(50843),o=n(86693),i=n(34170),a=n(32685).q,s=n(96402).q;e.exports=function(e,t,n){var o=n?function(e){var t,n=e.length,r=-1,o={};for(;++r<n;)o[(t=e[r]).toLowerCase()]=t;return o}(n):null;return function(e,n){var r,a=i(e,t),s=Array.prototype.slice.call(arguments,2),u=a.tagName.toLowerCase();a.tagName=o&&l.call(o,u)?o[u]:u,n&&function(e,t){return"string"===typeof e||"length"in e||function(e,t){var n=t.type;if("input"===e||!n||"string"!==typeof n)return!1;if("object"===typeof t.children&&"length"in t.children)return!0;if(n=n.toLowerCase(),"button"===e)return"menu"!==n&&"submit"!==n&&"reset"!==n&&"button"!==n;return"value"in t}(t.tagName,e)}(n,a)&&(s.unshift(n),n=null);if(n)for(r in n)p(a.properties,r,n[r]);c(a.children,s),"template"===a.tagName&&(a.content={type:"root",children:a.children},a.children=[]);return a};function p(t,n,o){var i,l,c;null!==o&&void 0!==o&&o===o&&(l=(i=r(e,n)).property,"string"===typeof(c=o)&&(i.spaceSeparated?c=a(c):i.commaSeparated?c=s(c):i.commaOrSpaceSeparated&&(c=a(s(c).join(" ")))),"style"===l&&"string"!==typeof o&&(c=function(e){var t,n=[];for(t in e)n.push([t,e[t]].join(": "));return n.join("; ")}(c)),"className"===l&&t.className&&(c=t.className.concat(c)),t[l]=function(e,t,n){var r,o,i;if("object"!==typeof n||!("length"in n))return u(e,t,n);o=n.length,r=-1,i=[];for(;++r<o;)i[r]=u(e,t,n[r]);return i}(i,l,c))}};var l={}.hasOwnProperty;function c(e,t){var n,r;if("string"!==typeof t&&"number"!==typeof t)if("object"===typeof t&&"length"in t)for(n=-1,r=t.length;++n<r;)c(e,t[n]);else{if("object"!==typeof t||!("type"in t))throw new Error("Expected node, nodes, or string, got `"+t+"`");e.push(t)}else e.push({type:"text",value:String(t)})}function u(e,t,n){var r=n;return e.number||e.positiveNum


adingDoneSpy(&c1, &KuesaUtils::SceneConfiguration::loadingDone);
            QSignalSpy c1UnloadingDoneSpy(&c1, &KuesaUtils::SceneConfiguration::unloadingDone);

            QSignalSpy c2LoadingDoneSpy(&c2, &KuesaUtils::SceneConfiguration::loadingDone);
            QSignalSpy c2UnloadingDoneSpy(&c2, &KuesaUtils::SceneConfiguration::unloadingDone);

            // THEN
            QVERIFY(c1LoadingDoneSpy.isValid());
            QVERIFY(c1UnloadingDoneSpy.isValid());

            QVERIFY(c2LoadingDoneSpy.isValid());
            QVERIFY(c2UnloadingDoneSpy.isValid());

            // WHEN
            view.setActiveScene(&c1);
            c1LoadingDoneSpy.wait();

            // THEN
            QCOMPARE(c1LoadingDoneSpy.count(), 1);
            QCOMPARE(c1UnloadingDoneSpy.count(), 0);
            QCOMPARE(c2LoadingDoneSpy.count(), 0);
            QCOMPARE(c2UnloadingDoneSpy.count(), 0);
            Qt3DRender::QGeometryRenderer *mesh0C1 = view.mesh(QStringLiteral("Mesh_0"));
            QVERIFY(mesh0C1);

            // WHEN
            view.setActiveScene(&c2);
            c2LoadingDoneSpy.wait();

            // THEN
            QCOMPARE(c1LoadingDoneSpy.count(), 1);
            QCOMPARE(c1UnloadingDoneSpy.count(), 1);
            QCOMPARE(c2LoadingDoneSpy.count(), 1);
            QCOMPARE(c2UnloadingDoneSpy.count(), 0);
            Qt3DRender::QGeometryRenderer *mesh0C2 = view.mesh(QStringLiteral("Mesh_0"));
            QVERIFY(mesh0C1);

            // Different pointers because collection was cleared and reloaded
            QVERIFY(mesh0C1 != mesh0C2);
        }

        // THEN
        QVERIFY(view.activeScene() == nullptr);
        QCOMPARE(view.animationPlayers().size(), 0UL);
        QCOMPARE(view.source(), QUrl());
    }

    void checkSceneConfigurationParenting()
    {
        // GIVEN
        KuesaUtils::View3DScene view;

        {
            // WHEN -> Scene with no parent
            KuesaUtils::SceneConfiguration conf;

            // THEN
            QVERIFY(conf.parentNode() == nullptr);
            QVERIFY(conf.parent() == nullptr);

            // WHEN
            view.setActiveScene(&conf);

            // THEN
            QVERIFY(conf.parentNode() == &view);
            QVERIFY(conf.parent() == &view);

            // WHEN -> Switching scene
            view.setActiveScene(nullptr);

            // THEN -> Parent should have been reset
            QVERIFY(conf.parentNode() == nullptr);
            QVERIFY(conf.parent() == nullptr);
        }

        {
            // WHEN -> Scene with QNode parent
            Qt3DCore::QNode node;
            KuesaUtils::SceneConfiguration *conf = new KuesaUtils::SceneConfiguration(&node);

            // THEN
            QVERIFY(conf->parentNode() == &node);
            QVERIFY(conf->parent() == &node);

            // WHEN
            view.setActiveScene(conf);

            // THEN
            QVERIFY(conf->parentNode() == &node);
            QVERIFY(conf->parent() == &node);

            // WHEN -> Switching scene
            view.setActiveScene(nullptr);

            // THEN -> Parent should have been restored/untouched
            QVERIFY(conf->parentNode() == &node);
            QVERIFY(conf->parent() == &node);
        }

        {
            // WHEN -> Scene with QNode parent
            QObject node;
            KuesaUtils::SceneConfiguration *conf = new KuesaUtils::SceneConfiguration();
            static_cast<QObject *>(conf)->setParent(&


ine
    unsigned int abs_da = 3;  // 3 steps in dominant direction
    unsigned int abs_db = 0;  // 0 steps in non-dominant direction
    int error_b = 0;
    int offset_a = 1;  // Move 1 cell right each step
    int offset_b = 0;  // No movement in y direction
    unsigned int offset = 1 * costmap_width_ + 1;  // Start at (1, 1)
    unsigned int max_length = 5;
    int resolution_cut_factor = 1;

    bresenham2D(ray_tracer, abs_da, abs_db, error_b, offset_a, offset_b,
                offset, max_length, resolution_cut_factor);

    auto traced_cells = ray_tracer.getCells();
    EXPECT_GT(traced_cells.size(), 0);  // Should have traced some cells
}

TEST_F(HelpersTest, Bresenham2DVerticalLine)
{
    std::vector<nav2_costmap_2d::MapLocation> cells;
    RayTracedCells ray_tracer(costmap_.get(), cells, 254, 254, 0, 253);

    // Test a vertical line
    unsigned int abs_da = 3;  // 3 steps in dominant direction (y)
    unsigned int abs_db = 0;  // 0 steps in non-dominant direction (x)
    int error_b = 0;
    int offset_a = costmap_width_;  // Move 1 cell up each step
    int offset_b = 0;  // No movement in x direction
    unsigned int offset = 1 * costmap_width_ + 1;  // Start at (1, 1)
    unsigned int max_length = 5;
    int resolution_cut_factor = 1;

    bresenham2D(ray_tracer, abs_da, abs_db, error_b, offset_a, offset_b,
                offset, max_length, resolution_cut_factor);

    auto traced_cells = ray_tracer.getCells();
    EXPECT_GT(traced_cells.size(), 0);  // Should have traced some cells
}

TEST_F(HelpersTest, Bresenham2DDiagonalLine)
{
    std::vector<nav2_costmap_2d::MapLocation> cells;
    RayTracedCells ray_tracer(costmap_.get(), cells, 254, 254, 0, 253);

    // Test a diagonal line
    unsigned int abs_da = 3;  // 3 steps in dominant direction
    unsigned int abs_db = 3;  // 3 steps in non-dominant direction
    int error_b = abs_da / 2;
    int offset_a = 1;  // Move 1 cell right each step
    int offset_b = costmap_width_;  // Move 1 cell up when error accumulates
    unsigned int offset = 1 * costmap_width_ + 1;  // Start at (1, 1)
    unsigned int max_length = 5;
    int resolution_cut_factor = 1;

    bresenham2D(ray_tracer, abs_da, abs_db, error_b, offset_a, offset_b,
                offset, max_length, resolution_cut_factor);

    auto traced_cells = ray_tracer.getCells();
    EXPECT_GT(traced_cells.size(), 0);  // Should have traced some cells
}

TEST_F(HelpersTest, Bresenham2DResolutionCutFactor)
{
    std::vector<nav2_costmap_2d::MapLocation> cells;
    RayTracedCells ray_tracer(costmap_.get(), cells, 254, 254, 0, 253);

    // Test with resolution_cut_factor = 2 (should skip every other cell)
    unsigned int abs_da = 4;
    unsigned int abs_db = 0;
    int error_b = 0;
    int offset_a = 1;
    int offset_b = 0;
    unsigned int offset = 0 * costmap_width_ + 0;  // Start at (0, 0)
    unsigned int max_length = 10;


aValidException("服务器"+defaultClient.getServer().getRemark()+"不存在"+modelWarehouseEntity.getModelName()+"模型!请联系管理员或修正服务器的模型扫描目录");
                    }
                    V1Pod pod = null;
                    try {
                        pod  = kubernetesPodHandler.getPod(defaultClient, MaasConst.TRIAN_PLAN_NSPACE, trainPlanEntity.getCode());
                    }catch (Exception e){
                        e.printStackTrace();
                        throw new Exception("服务器异常请联系管理员!");
                    }
                    if(Objects.nonNull(pod)){
                        throw new Exception(trainPlanEntity.getName()+"方案正在运行..请先中止");
                    }
                }
                continue;
            }
            KubernetesApiClient defaultClient = FileControllerService.getCustomClient(serverId);
            //检查当前服务器是否有该模型
            JSONObject jsonObject = fileControllerService.execModelCommand(defaultClient.getServer(), new String[]{"ls",modelPath});
            if (jsonObject.getString("msg").contains("cannot access")){
                logger.info("异常路径"+modelPath);
                throw new DataValidException("服务器"+defaultClient.getServer().getRemark()+"不存在"+modelWarehouseEntity.getModelName()+"模型!请联系管理员或修正服务器的模型扫描目录");
            }
            V1Pod pod = null;
            try {
                pod  = kubernetesPodHandler.getPod(defaultClient, MaasConst.TRIAN_PLAN_NSPACE, trainPlanEntity.getCode());
            }catch (Exception e){
                e.printStackTrace();
                throw new Exception("服务器异常请联系管理员!");
            }
            if(Objects.nonNull(pod)){
                throw new Exception(trainPlanEntity.getName()+"方案正在运行..请先中止");
            }
        }

        for(TrainPlanEntity trainPlanEntity:trainPlanEntities){
            if (JsonResultUtil.isNull(trainPlanEntity.getMode())){
                throw new Exception("请设置有效的微调方案类型");
            }
            if (StringUtils.isEmpty(trainPlanEntity.getCustomGpuCard()) && trainPlanEntity.getPreGpucache() == 0){
                throw new Exception("微调方案"+trainPlanEntity.getName()+"未配置对应模型框架的预估GPU显存配置!请联系管理员!");
            }
            //偏好数据格式 不能和奖励模型混在一起
            if (trainPlanEntity.getDoWay() == 2 && StringUtils.isNotBlank(trainPlanEntity.getRewardId())){
                throw new Exception("微调方案"+trainPlanEntity.getName()+"中选择了偏好格式。但该不支持奖励模型评价");
            }
            if (!doModels.contains(trainPlanEntity.getModelName())){
                newDoModels+=trainPlanEntity.getModelName();
            }
            if(Objects.isNull(trainPlanEntity) || Objects.isNull(trainPlanEntity.getId())){
                throw new Exception("无效的方案数据!请确认是否删除或者重新选择方案");
            }
            String serverId = trainPlanEntity.getServerId();
            if(StringUtils.isEmpty(serverId)){
                throw new Exception("未选择服务器!");
            }
            if (StringUtils.isEmpty(trainPlanEntity.getCode())) {
                throw new Exception("编码是必填项");
            }
            String code = trainPlanEntity.getCode();
            if (WebParamHandler.isHasNullAtPart(trainPlanEntityMap)) {
                logger.info("错误字段" + WebParamHandler.getFailField(trainPlanEntityMap));
                throw new Exception("无效的启动参数!请联系管理员!");


(format!(
                                "http://localhost:{}/remoteCandidate",
                                remote_http_port
                            ))
                            .header("content-type", "application/json")
                            .body(Body::from(c.marshal()))
                        {
                            Ok(req) => req,
                            Err(err) => {
                                println!("{}", err);
                                return;
                            }
                        };
                        let resp = match client3.request(req).await {
                            Ok(resp) => resp,
                            Err(err) => {
                                println!("{}", err);
                                return;
                            }
                        };
                        println!("Response from remoteCandidate: {}", resp.status());
                    }
                })
            },
        ))
        .await;

    // When ICE Connection state has change print to stdout
    ice_agent
        .on_connection_state_change(Box::new(|c: ConnectionState| {
            Box::pin(async move {
                println!("ICE Connection State has changed: {}", c);
            })
        }))
        .await;

    // Get the local auth details and send to remote peer
    let (local_ufrag, local_pwd) = ice_agent.get_local_user_credentials().await;

    let req = match Request::builder()
        .method(Method::POST)
        .uri(format!("http://localhost:{}/remoteAuth", remote_http_port))
        .header("content-type", "application/json")
        .body(Body::from(format!("{}:{}", local_ufrag, local_pwd)))
    {
        Ok(req) => req,
        Err(err) => return Err(Error::new(format!("{}", err)).into()),
    };
    let resp = match client.request(req).await {
        Ok(resp) => resp,
        Err(err) => return Err(Error::new(format!("{}", err)).into()),
    };
    println!("Response from remoteAuth: {}", resp.status());

    let (remote_ufrag, remote_pwd) = {
        let mut rx = REMOTE_AUTH_CHANNEL.1.lock().await;
        if let Some(s) = rx.recv().await {
            let fields: Vec<String> = s.split(':').map(|s| s.to_string()).collect();
            (fields[0].clone(), fields[1].clone())
        } else {
            panic!("rx.recv() empty");
        }
    };
    println!("remote_ufrag: {}, remote_pwd: {}", remote_ufrag, remote_pwd);

    let ice_agent2 = Arc::clone(&ice_agent);
    tokio::spawn(async move {
        let mut rx = REMOTE_CAND_CHANNEL.1.lock().await;
        while let Some(s) = rx.recv().await {
            if let Ok(c) = unmarshal_candidate(s).await {
                println!("add_remote_candidate: {}", c);
                let c: Arc<dyn Candidate + Send + Sync> = Arc::new(c);
                let _ = ice_agent2.add_remote_candidate(&c).await;
            }
        }
    });

    ice_agent.gather_candidates().await?;
    println!("Connecting...");

    let (_cancel_tx, cancel_rx) = mpsc::channel(1);
    // Start the ICE Agent. One side must be controlled, and the other must be controlling
    let conn: Arc<dyn Conn + Send + Sync> = if is_controlling {
        ice_agent.dial(cancel_rx, remote_ufrag, remote_pwd).await?
    } else {
        ice_agent
            .accept(cancel_rx, remote_ufrag, remote_pwd)
            .await?
    };

    // Send messages in a loop to the remote peer
    let conn_tx = Arc::clone(&conn);
    tokio::spawn(async


;
        }

        .social-links-grid {
            gap: 3rem;
        }
    }
/*
 * This file is copied from the upstream ReadTheDocs Sphinx
 * theme. To aid upgradability this file should *not* be edited.
 * modifications we need should be included in theme_extra.css.
 *
 * https://github.com/readthedocs/sphinx_rtd_theme
 */

 /* sphinx_rtd_theme version 1.2.0 | MIT license */
html{box-sizing:border-box}*,:after,:before{box-sizing:inherit}article,aside,details,figcaption,figure,footer,header,hgroup,nav,section{display:block}audio,canvas,video{display:inline-block;*display:inline;*zoom:1}[hidden],audio:not([controls]){display:none}*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}html{font-size:100%;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}body{margin:0}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:700}blockquote{margin:0}dfn{font-style:italic}ins{background:#ff9;text-decoration:none}ins,mark{color:#000}mark{background:#ff0;font-style:italic;font-weight:700}.rst-content code,.rst-content tt,code,kbd,pre,samp{font-family:monospace,serif;_font-family:courier new,monospace;font-size:1em}pre{white-space:pre}q{quotes:none}q:after,q:before{content:"";content:none}small{font-size:85%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}dl,ol,ul{margin:0;padding:0;list-style:none;list-style-image:none}li{list-style:none}dd{margin:0}img{border:0;-ms-interpolation-mode:bicubic;vertical-align:middle;max-width:100%}svg:not(:root){overflow:hidden}figure,form{margin:0}label{cursor:pointer}button,input,select,textarea{font-size:100%;margin:0;vertical-align:baseline;*vertical-align:middle}button,input{line-height:normal}button,input[type=button],input[type=reset],input[type=submit]{cursor:pointer;-webkit-appearance:button;*overflow:visible}button[disabled],input[disabled]{cursor:default}input[type=search]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}textarea{resize:vertical}table{border-collapse:collapse;border-spacing:0}td{vertical-align:top}.chromeframe{margin:.2em 0;background:#ccc;color:#000;padding:.2em 0}.ir{display:block;border:0;text-indent:-999em;overflow:hidden;background-color:transparent;background-repeat:no-repeat;text-align:left;direction:ltr;*line-height:0}.ir br{display:none}.hidden{display:none!important;visibility:hidden}.visuallyhidden{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.visuallyhidden.focusable:active,.visuallyhidden.focusable:focus{clip:auto;height:auto;margin:0;overflow:visible;position:static;width:auto}.invisible{visibility:hidden}.relative{position:relative}big,small{font-size:100%}@media print{body,html,section{background:none!important}*{box-shadow:none!important;text-shadow:none!important;filter:none!important;-ms-filter:none!important}a,a:visited{text-decoration:underline}.ir a:after,a[href^="#"


from typing import Iterable
import scrapy
from scrapy.http import Request

class DlSpider(scrapy.Spider):
    name = "dl"
    # allowed_domains = ["www.17k.com"]
    start_urls = ["https://user.17k.com/ck/user/myInfo/96139098?appKey=2406394919"]
    # cookie = 'GUID=80747f5d-a689-4552-90c3-1b7061fd799d; c_channel=0; c_csc=web; accessToken=avatarUrl%3Dhttps%253A%252F%252Fcdn.static.17k.com%252Fuser%252Favatar%252F18%252F98%252F90%252F96139098.jpg-88x88%253Fv%253D1650527904000%26id%3D96139098%26nickname%3D%25E4%25B9%25A6%25E5%258F%258BqYx51ZhI1%26e%3D1712629641%26s%3Df880d38740c7322c; sensorsdata2015jssdkcross=%7B%22distinct_id%22%3A%2296139098%22%2C%22%24device_id%22%3A%2218b1f6e3519734-03efaa8be28a39-26031e51-1296000-18b1f6e351ae02%22%2C%22props%22%3A%7B%22%24latest_traffic_source_type%22%3A%22%E7%9B%B4%E6%8E%A5%E6%B5%81%E9%87%8F%22%2C%22%24latest_referrer%22%3A%22%22%2C%22%24latest_referrer_host%22%3A%22%22%2C%22%24latest_search_keyword%22%3A%22%E6%9C%AA%E5%8F%96%E5%88%B0%E5%80%BC_%E7%9B%B4%E6%8E%A5%E6%89%93%E5%BC%80%22%7D%2C%22first_id%22%3A%2280747f5d-a689-4552-90c3-1b7061fd799d%22%7D; Hm_lvt_9793f42b498361373512340937deb2a0=1697039398,1697072905,1697118848; Hm_lpvt_9793f42b498361373512340937deb2a0=1697118857'
    # k_v = cookie.split(';')
    # cookie_dict = {i.split('=')[0].strip():i.split('=')[1] for i in cookie.split(';')}
    # for i in k_v:
    #     l = i.split('=')
    #     cookie_dict[l[0].strip()] = l[1].strip()
    def start_requests(self):
        cookie = 'GUID=80747f5d-a689-4552-90c3-1b7061fd799d; c_channel=0; c_csc=web; accessToken=avatarUrl%3Dhttps%253A%252F%252Fcdn.static.17k.com%252Fuser%252Favatar%252F18%252F98%252F90%252F96139098.jpg-88x88%253Fv%253D1650527904000%26id%3D96139098%26nickname%3D%25E4%25B9%25A6%25E5%258F%258BqYx51ZhI1%26e%3D1712629641%26s%3Df880d38740c7322c; sensorsdata2015jssdkcross=%7B%22distinct_id%22%3A%2296139098%22%2C%22%24device_id%22%3A%2218b1f6e3519734-03efaa8be28a39-26031e51-1296000-18b1f6e351ae02%22%2C%22props%22%3A%7B%22%24latest_traffic_source_type%22%3A%22%E7%9B%B4%E6%8E%A5%E6%B5%81%E9%87%8F%22%2C%22%24latest_referrer%22%3A%22%22%2C%22%24latest_referrer_host%22%3A%22%22%2C%22%24latest_search_keyword%22%3A%22%E6%9C%AA%E5%8F%96%E5%88%B0%E5%80%BC_%E7%9B%B4%E6%8E%A5%E6%89%93%E5%BC%80%22%7D%2C%22first_id%22%3A%2280747f5d-a689-4552-90c3-1b7061fd799d%22%7D; Hm_lvt_9793f42b498361373512340937deb2a0=1697039398,1697072905,1697118848; Hm_lpvt_9793f42b498361373512340937deb2a0=1697119250'
        cookie_dict = {i.split('=')[0].strip(): i.split('=')[1].strip() for i in cookie.split(';')}
        for url in self.start_urls:
            yield scrapy.Request(url,cookies=cookie_dict)

    def parse(self, response):
        print(response.text)


 is, InputStreamReader isr, BufferedReader br) {
//        try {
//            if (is != null)
//                is.close();
//            if (isr != null)
//                isr.close();
//            if (br != null)
//                br.close();
//        } catch (IOException ioe) {
//            System.out.println(ioe.getMessage());
//        }
//    }
//
//    /**
//     * 读取CPU信息
//     *
//     * @param proc
//     * @return
//     */
//    private long[] readCpu(final Process proc) {
//        long[] retn = new long[2];
//        try {
//            proc.getOutputStream().close();
//            InputStreamReader ir = new InputStreamReader(proc.getInputStream());
//            LineNumberReader input = new LineNumberReader(ir);
//            String line = input.readLine();
//            if (line == null || line.length() < FAULTLENGTH) {
//                return null;
//            }
//            int capidx = line.indexOf("Caption");
//            int cmdidx = line.indexOf("CommandLine");
//            int rocidx = line.indexOf("ReadOperationCount");
//            int umtidx = line.indexOf("UserModeTime");
//            int kmtidx = line.indexOf("KernelModeTime");
//            int wocidx = line.indexOf("WriteOperationCount");
//            // Caption,CommandLine,KernelModeTime,ReadOperationCount,ThreadCount,UserModeTime,WriteOperationCount
//            long idletime = 0;
//            long kneltime = 0;
//            long usertime = 0;
//            while ((line = input.readLine()) != null) {
//                if (line.length() < wocidx) {
//                    continue;
//                }
//                // 字段出现顺序：Caption,CommandLine,KernelModeTime,ReadOperationCount,
//                // ThreadCount,UserModeTime,WriteOperation
//                String caption = this.substring(line, capidx, cmdidx - 1).trim();
//                String cmd = this.substring(line, cmdidx, kmtidx - 1).trim();
//                if (cmd.indexOf("javaw.exe") >= 0) {
//                    continue;
//                }
//                // log.info("line="+line);
//                if (caption.equals("System Idle Process") || caption.equals("System")) {
//                    idletime += Long.valueOf(this.substring(line, kmtidx, rocidx - 1).trim()).longValue();
//                    idletime += Long.valueOf(this.substring(line, umtidx, wocidx - 1).trim()).longValue();
//                    continue;
//                }
//
//                kneltime += Long.valueOf(this.substring(line, kmtidx, rocidx - 1).trim()).longValue();
//                usertime += Long.valueOf(this.substring(line, umtidx, wocidx - 1).trim()).longValue();
//            }
//            retn[0] = idletime;
//            retn[1] = kneltime + usertime;
//            return retn;
//        } catch (Exception ex) {
//            ex.printStackTrace();
//        } finally {
//            try {
//                proc.getInputStream().close();
//            } catch (Exception e) {
//                e.printStackTrace();
//            }
//        }
//        return null;
//    }
//
//    /**
//     * 获取网口上下行速率
//     *
//     * @param input
//     * @return
//     */
//    public String[] readInLine(BufferedReader input, Stri


Of(InteractionContextType.GUILD, InteractionContextType.BOT_DM, InteractionContextType.PRIVATE_CHANNEL)

        subcommand(I18N_PREFIX.Tiodopave.Label, I18N_PREFIX.Tiodopave.Description, UUID.fromString("d03d2226-eb5b-44ab-b05e-40bfbd4d71a4")) {
            alternativeLegacyAbsoluteCommandPaths.apply {
                add("piada")
            }
            executor = TioDoPaveExecutor(loritta)
        }

        subcommand(I18N_PREFIX.Faustao.Label, I18N_PREFIX.Faustao.Description, UUID.fromString("148ce41b-102b-4753-a7f4-4dffe3794583")) {
            alternativeLegacyAbsoluteCommandPaths.apply {
                add("faustao")
            }
            executor = FaustaoExecutor(loritta)
        }

        subcommand(I18N_PREFIX.Kenji.Label, I18N_PREFIX.Kenji.Description, UUID.fromString("2663b682-c43b-4cf2-91fb-1a3338988eab")) {
            alternativeLegacyAbsoluteCommandPaths.apply {
                add("kenji")
                add("bembolada")
            }

            executor = BemBoladaExecutor(loritta)
        }
    }

    class FaustaoExecutor(private val loritta: LorittaBot) : LorittaSlashCommandExecutor(), LorittaLegacyMessageCommandExecutor {
        // TODO: Localization
        private val frases = listOf(
            "Que isso bicho, ó u cara lá ó",
            "Vamos ver as vídeo cassetadas!",
            "Voltamos já com vídeo cassetadas!",
            "ERRRROOOOOOOOOUUUUUUUU!!!!",
            "E agora, pra desligar essa merda aí, meu. Porra ligou, agora desliga! Tá pegando fogo, bicho!",
            "TÁ PEGANDO FOGO, BICHO!",
            "OLOCO!",
            "Essa fera ai, bicho!",
            "Essa fera ai, meu!",
            "Você destruiu o meu ovo! \uD83C\uDF73",
            "Ih Serjão, sujou! \uD83C\uDFC3\uD83D\uDCA8",
            "ERROU! ⚠",
            "Você vai morrer ⚰",
            "Olha o tamanho da criança",
            "Oito e sete",
            "Ô loco meu!",
            "É brincadera, bicho!",
            "Se vira nos 30!",
            "Quem sabe faz ao vivo!",
            "A TV é chata no domingo, é para quem não tem dinheiro nem o que fazer. Eu trabalho no domingo por isso. O domingo é chato. Para quem pode viajar e passear, o domingo é maravilhoso.",
            "Logo após os reclames do plim-plim!",
            "Olha só o que faz a maldita manguaça, bicho!",
            "{user} é bom tanto no pessoal quanto no profissional.",
            "Essa fera {user} aqui no domingão!"
        )

        private val avatars = listOf(
            "http://i.imgur.com/PS61w6I.png",
            "http://i.imgur.com/ofr6Tkj.png",
            "http://i.imgur.com/nABrbqD.png",
            "http://i.imgur.com/igpGeyg.png",
            "http://i.imgur.com/db2TFRm.png",
            "http://i.imgur.com/RAPYIU9.png",
            "http://i.imgur.com/rVmgwZC.png",
            "http://i.imgur.com/z7Ec5I3.png"
        )

        override suspend fun execute(
            context: UnleashedContext,
            args: SlashCommandArguments
        )


util.concurrent.TimeUnit;

/**
 *

 *  企业付款测试类.
 *  Created by BinaryWang on 2017/12/19.
 *

 *
 * @author Binary Wang
 */
@Test
@Guice(modules = ApiTestModule.class)
@Slf4j
public class EntPayServiceImplTest {
  private final Logger logger = LoggerFactory.getLogger(this.getClass());

  @Inject
  private WxPayService payService;

  /**
   * Test ent pay.
   *
   * @throws WxPayException the wx pay exception
   */
  @Test
  public void testEntPay() throws WxPayException {
    EntPayRequest request = EntPayRequest.newBuilder()
      .partnerTradeNo("Eb6Aep7uVTdbkJqrP4")
      .openid("ojOQA0y9o-Eb6Aep7uVTdbkJqrP5")
      .amount(100)
      .spbillCreateIp("10.10.10.10")
      .checkName(CheckNameOption.NO_CHECK)
      .description("描述信息")
      .build();

    log.info(this.payService.getEntPayService().entPay(request).toString());
  }

  /**
   * Test query ent pay.
   *
   * @throws WxPayException the wx pay exception
   */
  @Test
  public void testQueryEntPay() throws WxPayException {
    log.info(this.payService.getEntPayService().queryEntPay("11212121").toString());
  }

  /**
   * Test get public key.
   *
   * @throws Exception the exception
   */
  @Test
  public void testGetPublicKey() throws Exception {
    log.info(this.payService.getEntPayService().getPublicKey());
  }

  /**
   * Test pay bank.
   *
   * @throws Exception the exception
   */
  @Test
  public void testPayBank() throws Exception {
    EntPayBankResult result = this.payService.getEntPayService().payBank(EntPayBankRequest.builder()
      .bankCode("aa")
      .amount(1)
      .encBankNo("1")
      .encTrueName("2")
      .partnerTradeNo("3")
      .description("11")
      .build());
    log.info(result.toString());
  }

  /**
   * Test query pay bank.
   *
   * @throws Exception the exception
   */
  @Test
  public void testQueryPayBank() throws Exception {
    log.info(this.payService.getEntPayService().queryPayBank("123").toString());
  }

  /**
   * 发送企业红包
   *
   * @throws Exception the exception
   */
  @Test
  public void testSendEnterpriseRedpack() {
    EntPayRedpackRequest request = new EntPayRedpackRequest();
    request.setMchId("1");
    //商户单号
    request.setMchBillNo(request.getMchId() + "20191202" + "1");
    //企业微信corpid即为此appId
    request.setWxAppId("1");
//    request.setSenderName("1");
//    request.setSenderHeaderMediaId("2");
    request.setAgentId("1");
    request.setReOpenid("1");
    //目前企业微信api红包最低1块钱
    request.setTotalAmount(1000);
    request.setWishing("1");
    re


  private formatDuration(obj): string {
    return lpad(obj.hours()) + ":" + lpad(obj.minutes()) + ":" + lpad(obj.seconds());
  }
}

class Pace {
  constructor(private paceStr:string) {}
}

class Segment {
  private uuid: UUID;

  constructor(private distance: number, private duration: Duration, private pace: Pace) {
    this.uuid = new UUID();
  }

  set distance(distance: number): void {

  }

  /**
   * @return mm:ss String
   */
  private makePace(obj): Pace {
    let durationObj = moment.duration(obj.duration),
      seconds = durationObj.asSeconds(),
      paceObj = moment.duration(Math.round(seconds / obj.distance), "seconds");
    return new Pace(lpad(paceObj.minutes()) + ":" + lpad(paceObj.seconds()));
  };

  /**
   * @return hh:mm:ss String as: pace * distance. ex: 5:10 * 12.93 km = 1:6:48
   */
  private makeDuration(obj): Duration {
    let paceObj = moment.duration(obj.pace),
      seconds = paceObj.asSeconds() / 60,
      totalSeconds = Math.round(seconds * obj.distance),
      durationObj = moment.duration(totalSeconds, "seconds");
    return new Duration(formatDuration(durationObj));
  };

  /**
   * @return float calculated distance based on duration / pace
   */
  private makeDistance(obj): Number {
    let paceObj = moment.duration(obj.pace),
      durationObj = moment.duration(obj.duration),
      durationSeconds = durationObj.asSeconds(),
      paceSeconds = paceObj.asSeconds() / 60;
    return new Number(durationSeconds / paceSeconds);
  }
}

/**
 * Model object concerning the concept of a "Training"
 * TODO support imperial units by config.
 */
class Training {

  private segments:Array<Segment>;
  private name: string;

  constructor(training) {
    if (training) {
      this.segments = training.segments;
      this.segments.forEach((segment) => {
        this.augmentSegmentData(segment);
      });
      this.name = training.name;
    } else {
      this.segments = [];
      this.name = "new training";
    }
  }

  public addSegment(obj, overwriteUuid): void {
    if (!obj.uuid || overwriteUuid == true) {
      obj.uuid = new UUID();
    }
    augmentSegmentData(obj);
    this.segments.push(obj);
  }

  public updateSegment(obj): void {
    augmentSegmentData(obj);
    let i = 0;
    this.segments.forEach((segment) => {
      if (segment.uuid === obj.uuid) {
        this.segments[i] = obj;
      }
      i++;
    });
  }

  public removeSegment(obj): void {
    let i = 0;
    this.segments.forEach((segment) => {
      if (segment.uuid === obj.uuid) {
        this.segments.splice(i, 1);
      }
      i++;
    });
  }

  private augmentSegmentData(obj) {
    if (obj.duration === undefined || obj.duration === "00:00:00") {
      obj.duration = makeDuration(obj);
    }
    if (obj.pace === undefined || obj.pace === "00:00") {
      obj.pace = makePace(obj);
    }
    if (obj.distance === undefined || obj.distance === 0) {
      obj.distance = makeDistance(obj);
    }
  }

  /**
   * @return Object
   */
  public total() {
    let totalObj = {
      distance: new Number(0),
      duration: "00:00:00",
      pace: "00:00"
    }
    if (this.segments.length === 0) {
      return totalObj;
    } else {
      console.log(JSON.stringify(this.segments[0]));
      this.segments.forEach((segment) => {
        totalObj.distance += parseFl


Settings);
            return new gaxgrpc::GrpcPagedEnumerable<SearchTargetPolicyBindingsRequest, SearchTargetPolicyBindingsResponse, PolicyBinding>(_callSearchTargetPolicyBindings, request, callSettings);
        }

        /// <summary>
        /// Search policy bindings by target. Returns all policy binding objects bound
        /// directly to target.
        /// </summary>
        /// <param name="request">The request object containing all of the parameters for the API call.</param>
        /// <param name="callSettings">If not null, applies overrides to this RPC call.</param>
        /// <returns>A pageable asynchronous sequence of <see cref="PolicyBinding"/> resources.</returns>
        public override gax::PagedAsyncEnumerable<SearchTargetPolicyBindingsResponse, PolicyBinding> SearchTargetPolicyBindingsAsync(SearchTargetPolicyBindingsRequest request, gaxgrpc::CallSettings callSettings = null)
        {
            Modify_SearchTargetPolicyBindingsRequest(ref request, ref callSettings);
            return new gaxgrpc::GrpcPagedAsyncEnumerable<SearchTargetPolicyBindingsRequest, SearchTargetPolicyBindingsResponse, PolicyBinding>(_callSearchTargetPolicyBindings, request, callSettings);
        }
    }

    public partial class ListPolicyBindingsRequest : gaxgrpc::IPageRequest
    {
    }

    public partial class SearchTargetPolicyBindingsRequest : gaxgrpc::IPageRequest
    {
    }

    public partial class ListPolicyBindingsResponse : gaxgrpc::IPageResponse<PolicyBinding>
    {
        /// <summary>Returns an enumerator that iterates through the resources in this response.</summary>
        public scg::IEnumerator<PolicyBinding> GetEnumerator() => PolicyBindings.GetEnumer


nEntity(outsideLoc, EntityType.POLAR_BEAR);
		BoundingBox box = BoundingBox.of(centerLoc, 1, 64, 8);
		assertEquals(2, world.getNearbyEntities(box, (e) -> e instanceof LlamaMock).size());
	}

	@Test
	void getChunkAt_DifferentLocations_DifferentChunks()
	{
		WorldMock world = server.addSimpleWorld("world");
		ChunkMock chunk1 = world.getChunkAt(0, 0);
		ChunkMock chunk2 = world.getChunkAt(1, 0);
		assertNotEquals(chunk1, chunk2);
	}

	@Test
	void getChunkAt_SameLocations_EqualsChunks()
	{
		WorldMock world = server.addSimpleWorld("world");
		ChunkMock chunk1 = world.getChunkAt(0, 0);
		ChunkMock chunk2 = world.getChunkAt(0, 0);
		assertEquals(chunk1, chunk2);
	}

	@Test
	void getName_NameSet_NameExactly()
	{
		WorldMock world = new WorldMock();
		world.setName("world name");
		assertEquals("world name", world.getName());
	}

	@Test
	void setGameRule_CorrectValue_GameRuleSet()
	{
		WorldMock world = new WorldMock();
		assertTrue(world.setGameRule(GameRule.DO_DAYLIGHT_CYCLE, true));
		assertTrue(world.getGameRuleValue(GameRule.DO_DAYLIGHT_CYCLE));
		assertTrue(world.setGameRule(GameRule.DO_DAYLIGHT_CYCLE, false));
		assertFalse(world.getGameRuleValue(GameRule.DO_DAYLIGHT_CYCLE));
	}

	@Test
	void spawnZombieTest()
	{
		WorldMock world = new WorldMock();
		assertTrue(world.getEntities().isEmpty());
		Location location = new Location(world, 100, 20, 50);
		Entity zombie = world.spawnEntity(location, EntityType.ZOMBIE);
		assertEquals(100, zombie.getLocation().getBlockX());
		assertEquals(20, zombie.getLocation().getBlockY());
		assertEquals(50, zombie.getLocation().getBlockZ());
		assertFalse(world.getEntities().isEmpty());
	}

	@Test
	void onCreated_WeatherDurationSetToZero()
	{
		WorldMock world = new WorldMock();
		assertEquals(0, world.getWeatherDuration(), "Weather duration should be zero");
	}

	@Test
	void setWeatherDuration_AnyPositiveValue_WeatherDurationSet()
	{
		WorldMock world = new WorldMock();
		int duration = 5;
		world.setWeatherDuration(duration);
		assertEquals(duration, world.getWeatherDuration(), "Weather duration should be set");
	}

	@Test
	void onCreated_NotStorming()
	{
		WorldMock world = new WorldMock();
		assertFalse(world.hasStorm(), "The world should not be storming");
	}

	@Test
	void setStorm_True_Storming()
	{
		WorldMock world = new WorldMock();
		assertFalse(world.hasStorm());
		world.setStorm(true);
		assertTrue(world.hasStorm(), "The world should be storming");
	}

	@Test
	void onCreated_ThunderDurationSetToZero()
	{
		WorldMock world = new WorldMock();
		assertEquals(0, world.getThunderDuration(), "Weather duration should be zero");
		assertFalse(world.isThundering());
	}

	@Test
	void setThunderDuration_AnyPositiveValue_ShouldBeThundering()
	{
		WorldMock world = new WorldMock();
		int duration = 20;
		world.setThunderDuration(duration);
		assertEquals(duration, world.getThunderDuration(), "Weather duration should be more than zero");
		assertFalse(world.isThundering());
	}

	@Test
	void setThundering_True_ThunderDurationShouldBePositive()


Name, deploymentName+"-")
}
package daemonsets

import (
	"fmt"

	"github.com/maruel/natural"
	"k8s.io/apimachinery/pkg/types"

	"sort"
	"time"

	appV1 "k8s.io/api/apps/v1"
)

type DaemonSetList struct {
	UID          types.UID         `json:"uid"`
	Namespace    string            `json:"namespace"`
	Name         string            `json:"name"`
	Generation   int64             `json:"generation"`
	NodeSelector map[string]string `json:"nodeSelector"`
	Age          time.Time         `json:"age"`
	Status       Status            `json:"status"`
}

type Status struct {
	CurrentNumberScheduled int32 `json:"currentNumberScheduled"`
	NumberMisscheduled     int32 `json:"numberMisscheduled"`
	DesiredNumberScheduled int32 `json:"desiredNumberScheduled"`
	NumberReady            int32 `json:"numberReady"`
	ObservedGeneration     int64 `json:"observedGeneration"`
	UpdatedNumberScheduled int32 `json:"updatedNumberScheduled"`
	NumberAvailable        int32 `json:"numberAvailable"`
}

func TransformDaemonSetList(daemonSets []appV1.DaemonSet) []DaemonSetList {
	list := make([]DaemonSetList, 0)

	for _, d := range daemonSets {
		list = append(list, TransformDaemonSetItem(d))
	}
	sort.Slice(list, func(i, j int) bool {
		return natural.Less(fmt.Sprintf("%s-%s", list[i].Name, list[i].Namespace), fmt.Sprintf("%s-%s", list[j].Name, list[j].Namespace))
	})

	return list
}

func TransformDaemonSetItem(d appV1.DaemonSet) DaemonSetList {
	nodeSelector := make(map[string]string)
	if len(d.Spec.Template.Spec.NodeSelector) > 0 {
		nodeSelector = d.Spec.Template.Spec.NodeSelector
	}
	return DaemonSetList{
		UID:          d.GetUID(),
		Namespace:    d.GetNamespace(),
		Name:         d.GetName(),
		Generation:   d.Generation,
		NodeSelector: nodeSelector,
		Age:          d.CreationTimestamp.Time,
		Status: Status{
			CurrentNumberScheduled: d.Status.CurrentNumberScheduled,
			NumberMisscheduled:     d.Status.NumberMisscheduled,
			DesiredNumberScheduled: d.Status.DesiredNumberScheduled,
			NumberReady:            d.Status.NumberReady,
			ObservedGeneration:     d.Status.ObservedGeneration,
			UpdatedNumberScheduled: d.Status.UpdatedNumberScheduled,
			NumberAvailable:        d.Status.NumberAvailable,
		},
	}
}
package statefulset

import (
	"encoding/json"
	"fmt"
	"net/http"

	"github.com/kubewall/kubewall/backend/handlers/base"
	"github.com/kubewall/kubewall/backend/handlers/helpers"
	appV1 "k8s.io/api/apps/v1"

	"github.com/kubewall/kubewall/backend/container"
	"github.com/labstack/echo/v4"
)

type StatefulSetHandler struct {
	BaseHandler base.BaseHandler
}

func NewStatefulSetRouteHandler(container container.Container, routeType base.RouteType) echo.HandlerFunc {
	return func(c echo.Context) error {
		handler := NewSatefulSetHandler(c, container)

		switch routeType {
		case base.GetList:
			return handler.BaseHandler.GetList(c)
		case base.GetDetails:
			return handler.


28:
/* 80296428 00293228  94 21 FF F0 */	stwu r1, -0x10(r1)
/* 8029642C 0029322C  7C 08 02 A6 */	mflr r0
/* 80296430 00293230  90 01 00 14 */	stw r0, 0x14(r1)
/* 80296434 00293234  93 E1 00 0C */	stw r31, 0xc(r1)
/* 80296438 00293238  7C 9F 23 78 */	mr r31, r4
/* 8029643C 0029323C  93 C1 00 08 */	stw r30, 8(r1)
/* 80296440 00293240  7C 7E 1B 79 */	or. r30, r3, r3
/* 80296444 00293244  41 82 00 28 */	beq lbl_8029646C
/* 80296448 00293248  48 00 61 99 */	bl func_8029C5E0
/* 8029644C 0029324C  80 7E 00 08 */	lwz r3, 8(r30)
/* 80296450 00293250  28 03 00 00 */	cmplwi r3, 0
/* 80296454 00293254  41 82 00 08 */	beq lbl_8029645C
/* 80296458 00293258  48 0F 67 21 */	bl func_8038CB78
lbl_8029645C:
/* 8029645C 0029325C  7F E0 07 35 */	extsh. r0, r31
/* 80296460 00293260  40 81 00 0C */	ble lbl_8029646C
/* 80296464 00293264  7F C3 F3 78 */	mr r3, r30
/* 80296468 00293268  48 0F 67 11 */	bl func_8038CB78
lbl_8029646C:
/* 8029646C 0029326C  80 01 00 14 */	lwz r0, 0x14(r1)
/* 80296470 00293270  7F C3 F3 78 */	mr r3, r30
/* 80296474 00293274  83 E1 00 0C */	lwz r31, 0xc(r1)
/* 80296478 00293278  83 C1 00 08 */	lwz r30, 8(r1)
/* 8029647C 0029327C  7C 08 03 A6 */	mtlr r0
/* 80296480 00293280  38 21 00 10 */	addi r1, r1, 0x10
/* 80296484 00293284  4E 80 00 20 */	blr

.global func_80296488
func_80296488:
/* 80296488 00293288  94 21 FF E0 */	stwu r1, -0x20(r1)
/* 8029648C 0029328C  7C 08 02 A6 */	mflr r0
/* 80296490 00293290  90 01 00 24 */	stw r0, 0x24(r1)
/* 80296494 00293294  39 61 00 20 */	addi r11, r1, 0x20
/* 80296498 00293298  48 11 76 BD */	bl _savegpr_27
/* 8029649C 0029329C  7C 9E 23 78 */	mr r30, r4
/* 802964A0 002932A0  7C 7F 1B 78 */	mr r31, r3
/* 802964A4 002932A4  83 A4 00 00 */	lwz r29, 0(r4)
/* 802964A8 002932A8  28 1D 00 00 */	cmplwi r29, 0
/* 802964AC 002932AC  41 82 01 C0 */	beq lbl_8029666C
/* 802964B0 002932B0  83 9D 00 00 */	lwz r28, 0(r29)
/* 802964B4 002932B4  28 1C 00 00 */	cmplwi


_code_block .DataType     { color: #0000ff; }
.dx_code_block .DecVal       { color: #00007f; }
/* .dx_code_block .Error        { color: #ff0000; font-weight:bold; font-style:italic; } */
.dx_code_block .Float        { color: #00007f; }
.dx_code_block .Function     { color: #007f00; }
.dx_code_block .IString      { color: #ff0000; }
.dx_code_block .Keyword      { color: #337700; font-weight:bold; }
.dx_code_block .Normal       { color: #000000; }
.dx_code_block .Operator     { color: #aa8500; }
.dx_code_block .Others       { color: #b03060; }
.dx_code_block .RegionMarker { color: #96b9ff; font-style:italic; }
.dx_code_block .Reserved     { color: #0066aa; font-weight:bold; }
.dx_code_block .String       { color: #ff0000; }
.dx_code_block .Variable     { color: #0000ff; font-weight:bold; }
.dx_code_block .Warning      { color: #0000ff; font-weight:bold; font-style:italic; }

.dx_code_block .Comment .Keyword      { color: #7f7f7f; font-style:italic; font-weight:normal; }

.dx_markup_block {
	margin-left: 50px;
	padding: 5px;
	font-family: arial,sans-serif;
	border: 1px solid #3c3;
	background-color: #efe;
	font-size: 9pt;
}

.dx_markup_block .Alert        { color: #0000ff; }
.dx_markup_block .BaseN        { color: #007f00; }
.dx_markup_block .BString      { color: #c9a7ff; }
.dx_markup_block .Char         { color: #ff00ff; }
.dx_markup_block .Comment      { color: #7f7f7f; font-style:italic; }
.dx_markup_block .DataType     { color: #0000ff; }
.dx_markup_block .DecVal       { color: #00007f; }
/* .dx_markup_block .Error        { color: #ff0000; font-weight:bold; font-style:italic; } */
.dx_markup_block .Float        { color: #00007f; }
.dx_markup_block .Function     { color: #007f00; }
.dx_markup_block .IString      { color: #ff0000; }
.dx_markup_block .Keyword      { color: #337700; font-weight:bold; }
.dx_markup_block .Normal       { color: #000000; }
.dx_markup_block .Operator     { color: #ffa500; }
.dx_markup_block .Others       { color: #b03060; }
.dx_markup_block .RegionMarker { color: #96b9ff; font-style:italic; }
.dx_markup_block .Reserved     { color: #9b30ff; font-weight:bold; }
.dx_markup_block .String       { color: #000000; }
.dx_markup_block .Variable     { color: #0000ff; font-weight:bold; }
.dx_markup_block .Warning      { color: #0000ff; font-weight:bold; font-style:italic; }

.dx_text_block {
	margin-left: 50px;
	padding: 5px;
	font-family: courier,monospace;
	background-color: #fff;
	font-size: 9pt;
}


== ValueTransient.YES)
				errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, EpatchTestLanguagePackage.Literals.MODEL_IMPORT__NAME));
			if (transientValues.isValueTransient(semanticObject, EpatchTestLanguagePackage.Literals.RESOURCE_IMPORT__URI) == ValueTransient.YES)
				errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, EpatchTestLanguagePackage.Literals.RESOURCE_IMPORT__URI));
		}
		SequenceFeeder feeder = createSequencerFeeder(context, semanticObject);
		feeder.accept(grammarAccess.getResourceImportAccess().getNameIDTerminalRuleCall_1_0(), semanticObject.getName());
		feeder.accept(grammarAccess.getResourceImportAccess().getUriSTRINGTerminalRuleCall_3_0(), semanticObject.getUri());
		feeder.finish();
	}

	/**
	 * <pre>
	 * Contexts:
	 *     SingleAssignmentValue returns AssignmentValue
	 *
	 * Constraint:
	 *     (
	 *         keyword='null' |
	 *         value=STRING |
	 *         (refObject=[NamedObject|ID] (refFeature=ID refIndex=INT?)?) |
	 *         newObject=CreatedObject |
	 *         (import=[Import|ID] impFrag=FRAGMENT)
	 *     )
	 * </pre>
	 */
	protected void sequence_SingleAssignmentValue(ISerializationContext context, AssignmentValue semanticObject) {
		genericSequencer.createSequence(context, semanticObject);
	}

}
/*******************************************************************************
 * Copyright (c) 2014, 2016 itemis AG (http://www.itemis.eu) and others.
 * This program and the accompanying materials are made available under the
 * terms of the Eclipse Public License 2.0 which is available at
 * http://www.eclipse.org/legal/epl-2.0.
 *
 * SPDX-License-Identifier: EPL-2.0
 *******************************************************************************/
package org.eclipse.xtend.ide.common.contentassist.antlr.internal;

import java.io.IOException;
import java.io.Reader;

import org.antlr.runtime.CommonToken;
import org.antlr.runtime.Token;
import org.antlr.runtime.TokenSource;
import org.eclipse.xtend.core.parser.InternalFlexer;

/**
 * @author Sebastian Zarnekow - Initial contribution and API
 */
public class ContentAssistTokenSource implements TokenSource {

	private final InternalFlexer flexer;
	private int offset;

	protected ContentAssistTokenSource(InternalFlexer flexer) {
		this.flexer = flexer;
		offset = 0;
	}

	public void reset(Reader reader) {
		flexer.yyreset(reader);
		offset = 0;
	}

	@Override
	public Token nextToken() {
		try {
			int type = flexer.advance();
			if (type == Token.EOF) {
				return Token.EOF_TOKEN;
			}
			int length = flexer.getTokenLength();
			CommonToken result = new CommonTokenWithoutText(type, Token.DEFAULT_CHANNEL, offset, length);
			offset += length;
			return result;
		} catch (IOException e) {
			throw new RuntimeException(e);
		}
	}

	@Override
	public String getSourceName() {
		return "FlexTokenSource";
	}

	public static class CommonTokenWithoutText extends CommonToken {

		private static final long serialVersionUID = 1L;

		public CommonTokenWithoutText(int type, int defaultChannel, int offset, int length) {
			super(null, type, defaultChannel, offset, offset + length - 1);
		}

	}

}
/**
 * Copyright (c) 2010, 2023 itemis AG (http://www.itemis.eu) and others.
 * This program and the accompanying materials are made available under the
 * terms of the Eclipse Public License 2.0 which is available at
 * http://www.eclipse.org/legal/epl-2.0.
 *
 * SPDX-License-Identifier: E


.ui.card .meta {
  font-size: 1em;
  color: rgba(0, 0, 0, 0.4);
}

.ui.cards > .card .meta *,
.ui.card .meta * {
  margin-right: 0.3em;
}

.ui.cards > .card .meta :last-child,
.ui.card .meta :last-child {
  margin-right: 0em;
}

.ui.cards > .card .meta [class*="right floated"],
.ui.card .meta [class*="right floated"] {
  margin-right: 0em;
  margin-left: 0.3em;
}

/*--------------
      Links
---------------*/

/* Generic */

.ui.cards > .card > .content a:not(.ui),
.ui.card > .content a:not(.ui) {
  color: '';
  -webkit-transition: color 0.1s ease;
  transition: color 0.1s ease;
}

.ui.cards > .card > .content a:not(.ui):hover,
.ui.card > .content a:not(.ui):hover {
  color: '';
}

/* Header */

.ui.cards > .card > .content > a.header,
.ui.card > .content > a.header {
  color: rgba(0, 0, 0, 0.85);
}

.ui.cards > .card > .content > a.header:hover,
.ui.card > .content > a.header:hover {
  color: #1e70bf;
}

/* Meta */

.ui.cards > .card .meta > a:not(.ui),
.ui.card .meta > a:not(.ui) {
  color: rgba(0, 0, 0, 0.4);
}

.ui.cards > .card .meta > a:not(.ui):hover,
.ui.card .meta > a:not(.ui):hover {
  color: rgba(0, 0, 0, 0.87);
}

/*--------------
     Buttons
---------------*/

.ui.cards > .card > .buttons,
.ui.card > .buttons,
.ui.cards > .card > .button,
.ui.card > .button {
  margin: 0px -1px;
  width: calc(100% +  2px );
}

/*--------------
      Dimmer
---------------*/

.ui.cards > .card .dimmer,
.ui.card .dimmer {
  background-color: '';
  z-index: 10;
}

/*--------------
     Labels
---------------*/

/*-----Star----- */

/* Icon */

.ui.cards > .card > .content .star.icon,
.ui.card > .content .star.icon {
  cursor: pointer;
  opacity: 0.75;
  -webkit-transition: color 0.1s ease;
  transition: color 0.1s ease;
}

.ui.cards > .card > .content .star.icon:hover,
.ui.card > .content .star.icon:hover {
  opacity: 1;
  color: #FFB70A;
}

.ui.cards > .card > .content .active.star.icon,
.ui.card > .content .active.star.icon {
  color: #FFE623;
}

/*-----Like----- */

/* Icon */

.ui.cards > .card > .content .like.icon,
.ui.card > .content .like.icon {
  cursor: pointer;
  opacity: 0.75;
  -webkit-transition: color 0.1s ease;
  transition: color 0.1s ease;
}

.ui.cards > .card > .content .like.icon:hover,
.ui.card > .content .like.icon:hover {
  opacity: 1;
  color: #FF2733;
}

.ui.cards > .card > .content .active.like.icon,
.ui.card > .content .active.like.icon {
  color: #FF2733;
}

/*----