#if NET472_OR_GREATER || NETSTANDARD2_0
using System;
using System.Threading.Tasks;
#endif
#if NET9_0
using System;
using System.Threading.Tasks;
#endif
using FluentAssertions;
using Microsoft.Extensions.Logging;
using Mscc.GenerativeAI;
using Neovolve.Logging.Xunit;
using System.IO;
using Xunit;
using Xunit.Abstractions;

namespace Test.Mscc.GenerativeAI
{
    [Collection(nameof(ConfigurationFixture))]
    public class OpenAi_Should(ITestOutputHelper output, ConfigurationFixture fixture)
        : LoggingTestsBase(output, LogLevel.Trace)
    {
        private readonly string _model = Model.Gemini20Flash;

        [Fact]
        public async Task List_Models()
        {
            // Arrange
            var model = new OpenAIModel(logger: Logger) { ApiKey = fixture.ApiKey, Model = _model };

            // Act
            var sut = await model.ListModels();

            // Assert
            sut.Should().NotBeNull();
            sut.Data.Should().NotBeNull().And.HaveCountGreaterThanOrEqualTo(1);
            sut.Data.ForEach(x =>
            {
                output.WriteLine($"Model: {x.Id} ({x.Object} / {x.Created}) by {x.OwnedBy}");
            });
        }

        [Theory]
        [InlineData(Model.Gemini25Pro)]
        [InlineData(Model.Gemini25Flash)]
        [InlineData(Model.Gemini20Flash)]
        public async Task Get_Model_Information(string modelName)
        {
            // Arrange
            var model = new OpenAIModel(logger: Logger) { ApiKey = fixture.ApiKey, Model = modelName };

            // Act
            var sut = await model.GetModel(modelsId: modelName);

            // Assert
            sut.Should().NotBeNull();
            output.WriteLine($"Model: {sut.Id} ({sut.Object} / {sut.Created}) by {sut.OwnedBy}");
        }

        [Fact]
        public async Task ChatCompletions_Using_OpenAiModel()
        {
            // Arrange
            var model = new OpenAIModel(logger: Logger) { ApiKey = fixture.ApiKey, Model = _model };
            var request = new ChatCompletionsRequest()
                {
                    Model = _model,
                    Messages = [
                        new { Role = Role.User, Content = "Explain to me how AI works"}
                    ]
                };

            // Act
            var response = await model.Completions(request);

            // Assert
            response.Should().NotBeNull();
            output.WriteLine($"{response.Choices[0].Message.Content}");
        }

        [Fact]
        public async Task ChatCompletions_with_FileAPI_Using_OpenAiModel()
        {
            // Arrange
            var model = new OpenAIModel(logger: Logger) { ApiKey = fixture.ApiKey, Model = _model };
            var request = new ChatCompletionsRequest()
            {
                Model = _model,
                Messages = [
                    new { Role = Role.System, Content = "You are a helpful assistant in the field of space travelling."},
                    new { Role = Role.User, Content = (object[])[
                        new
                        {
                            Type = "file",
                            File = new
                            {
                                File_id = "https://generativelanguage.googleapis.com/v1beta/files/3c02j9p8oge0",
                                // MimeType = "text/plain"
                            }
                        },
                        new { Type = "text", Text = "Explain to me how the Apollo lunar module works"}
                    ]}
                ]
            };

            // Act
            var response = await model.Completions(request);

            // Assert
            response.Shoul


[j].GetName()
	})

	return ingresses
}

func makeAgentAuthTokenSecret(sdc *scyllav1alpha1.ScyllaDBDatacenter, agentAuthToken string) (*corev1.Secret, error) {
	labels := cloneMapExcludingKeysOrEmpty(sdc.Labels, nonPropagatedLabelKeys)
	maps.Copy(labels, naming.ClusterLabels(sdc))

	annotations := cloneMapExcludingKeysOrEmpty(sdc.Annotations, nonPropagatedAnnotationKeys)

	agentAuthTokenConfig, err := helpers.GetAgentAuthTokenConfig(agentAuthToken)
	if err != nil {
		return nil, fmt.Errorf("can't get agent auth token config for ScyllaDBDatacenter %q: %w", naming.ObjRef(sdc), err)
	}

	return &corev1.Secret{
		ObjectMeta: metav1.ObjectMeta{
			Name:      naming.AgentAuthTokenSecretName(sdc),
			Namespace: sdc.Namespace,
			OwnerReferences: []metav1.OwnerReference{
				*metav1.NewControllerRef(sdc, scyllav1alpha1.ScyllaDBDatacenterGVK),
			},
			Labels:      labels,
			Annotations: annotations,
		},
		Type: corev1.SecretTypeOpaque,
		Data: map[string][]byte{
			naming.ScyllaAgentAuthTokenFileName: agentAuthTokenConfig,
		},
	}, nil
}

func ImageForCluster(c *scyllav1.ScyllaCluster) string {
	return fmt.Sprintf("%s:%s", c.Spec.Repository, c.Spec.Version)
}

func getValueOrDefault[T any](v *T, def T) T {
	if v != nil {
		return *v
	}
	return def
}

func copyReferencedValue[T any](v *T) *T {
	if v != nil {
		return pointer.Ptr(*v)
	}
	return nil
}

func MakeServiceAccount(sdc *scyllav1alpha1.ScyllaDBDatacenter) *corev1.ServiceAccount {
	labels := cloneMapExcludingKeysOrEmpty(sdc.Labels, nonPropagatedLabelKeys)
	maps.Copy(labels, naming.ClusterLabels(sdc))

	annotations := cloneMapExcludingKeysOrEmpty(sdc.Annotations, nonPropagatedAnnotationKeys)

	return &corev1.ServiceAccount{
		ObjectMeta: metav1.ObjectMeta{
			Name:      naming.MemberServiceAccountNameForScyllaDBDatacenter(sdc.Name),
			Namespace: sdc.Namespace,
			OwnerReferences: []metav1.OwnerReference{
				*metav1.NewControllerRef(sdc, scyllav1alpha1.ScyllaDBDatacenterGVK),
			},
			Labels:      labels,
			Annotations: annotations,
		},
	}
}

func MakeRoleBinding(sdc *scyllav1alpha1.ScyllaDBDatacenter) *rbacv1.RoleBinding {
	saName := naming.MemberServiceAccountNameForScyllaDBDatacenter(sdc.Name)

	labels := cloneMapExcludingKeysOrEmpty(sdc.Labels, nonPropagatedLabelKeys)
	maps.Copy(labels, naming.ClusterLabels(sdc))

	annotations := cloneMapExcludingKeysOrEmpty(sdc.Annotations, nonPropagatedAnnotationKeys)

	return &rbacv1.RoleBinding{
		ObjectMeta: metav1.ObjectMeta{
			Name:      saName,
			Namespace: sdc.Namespace,
			OwnerReferences: []metav1.OwnerReference{
				*metav1.NewControllerRef(sdc, scyllav1alpha1.ScyllaDBDatacenterGVK),
			},
			Labels:      labels,
			Annotations: annotations,
		},
		Subjects: []rbacv1.Subject{
			{
				APIGroup:  corev1.GroupName,
				Kind:      rbacv1.ServiceAccountKind,
				Namespace: sdc.Namespace,
				Name:      saName,
			},
		},
		RoleRef: rbacv1.RoleRef{
			APIGroup: rbacv1.GroupName,
			Kind:     "ClusterRole",
			Name:     naming.ScyllaClusterMemberClusterRoleName,
		},
	}
}

func MakeJobs(sdc *scyllav1alpha1.ScyllaDBDatacenter, services map[string]*corev1.Service, podLister corev1listers.PodLister, imag


p:focus .lg\:group-focus\:shadow-outline-yellow {
    box-shadow: 0 0 0 3px rgba(250, 202, 21, 0.45);
  }

  .group:focus .lg\:group-focus\:shadow-outline-orange {
    box-shadow: 0 0 0 3px rgba(253, 186, 140, 0.45);
  }

  .group:focus .lg\:group-focus\:shadow-outline-red {
    box-shadow: 0 0 0 3px rgba(248, 180, 180, 0.45);
  }

  .group:focus .lg\:group-focus\:shadow-outline-pink {
    box-shadow: 0 0 0 3px rgba(248, 180, 217, 0.45);
  }

  .group:focus .lg\:group-focus\:shadow-outline-purple {
    box-shadow: 0 0 0 3px rgba(202, 191, 253, 0.45);
  }

  .group:focus .lg\:group-focus\:shadow-outline-indigo {
    box-shadow: 0 0 0 3px rgba(180, 198, 252, 0.45);
  }

  .lg\:hover\:shadow-xs:hover {
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.05);
  }

  .lg\:hover\:shadow-sm:hover {
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  }

  .lg\:hover\:shadow:hover {
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  }

  .lg\:hover\:shadow-md:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  }

  .lg\:hover\:shadow-lg:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  }

  .lg\:hover\:shadow-xl:hover {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  }

  .lg\:hover\:shadow-2xl:hover {
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  }

  .lg\:hover\:shadow-inner:hover {
    box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);
  }

  .lg\:hover\:shadow-outline:hover {
    box-shadow: 0 0 0 3px rgba(118, 169, 250, 0.45);
  }

  .lg\:hover\:shadow-none:hover {
    box-shadow: none;
  }

  .lg\:hover\:shadow-solid:hover {
    box-shadow: 0 0 0 2px currentColor;
  }

  .lg\:hover\:shadow-outline-gray:hover {
    box-shadow: 0 0 0 3px rgba(159, 166, 178, 0.45);
  }

  .lg\:hover\:shadow-outline-blue:hover {
    box-shadow: 0 0 0 3px rgba(164, 202, 254, 0.45);
  }

  .lg\:hover\:shadow-outline-teal:hover {
    box-shadow: 0 0 0 3px rgba(126, 220, 226, 0.45);
  }

  .lg\:hover\:shadow-outline-green:hover {
    box-shadow: 0 0 0 3px rgba(132, 225, 188, 0.45);
  }

  .lg\:hover\:shadow-outline-yellow:hover {
    box


" typeof="spdx:License">
            ZPL-2.1
            Y
            Y

Deprecated License Identifiers

SPDX endeavors to never change the SPDX license identifiers. However, sometimes there has been a compelling reason to deprecate a license identifier, such as to accommodate improved SPDX license expressions or when we have found a duplicate license. When a license identifier is "deprecated" on the SPDX License List, it effectively means that there is an updated license identifier and the deprecated license identifier, while remaining valid, should no longer be used. The URL to each deprecated license is retained and those license pages are updated to note the deprecation. Some reasons for deprecation are as follows:

Release 2.0 of the SPDX Specification introduced License Expressions that supports the ability to identify common variations of SPDX-identified licenses without the need to define each potential variation as a distinct license on the SPDX License List. This new syntax supports the ability to declare an SPDX-identified license exception using the "WITH" operator (e.g. GPL-2.0-or-later WITH Autoconf-exception-2.0), as well as the ability to use a simple "+" operator after a license short identifier to indicate "or later version". SPDX has defined a list of license exceptions to use after the "WITH" operator. As a result, a number of licenses formerly included on the SPDX License List have been deprecated, and correct usage employs the License Expression syntax as of v2.0.

Release 3.0 replaced previous Identifiers for GNU licenses with more explicit Identifiers to reflect the "this version only" or "any later version" option specific to those licenses. As such, the previously used Identifiers for those licenses are deprecated as of v3.0.

Other licenses may have been deprecated for the reasons noted.

          Full name	Identifier	Deprecated as of:

            Affero General Public License v1.0

            AGPL-1.0
            3.1

            GNU Affero General Public License v3.0

            AGPL-3.0
            3.0


        {
            return available_format.clone();
        }
    }

    return available_formats.first().unwrap().clone();
}

pub fn choose_swapchain_present_mode(
    available_present_modes: &Vec<vk::PresentModeKHR>,
) -> vk::PresentModeKHR {
    for &available_present_mode in available_present_modes.iter() {
        if available_present_mode == vk::PresentModeKHR::MAILBOX {
            return available_present_mode;
        }
    }

    vk::PresentModeKHR::FIFO
}

pub fn choose_swapchain_extent(
    capabilities: &vk::SurfaceCapabilitiesKHR,
    window_width: u32,
    window_height: u32,
) -> vk::Extent2D {
    if capabilities.current_extent.width != u32::max_value() {
        capabilities.current_extent
    } else {
        use num::clamp;

        vk::Extent2D {
            width: clamp(
                window_width,
                capabilities.min_image_extent.width,
                capabilities.max_image_extent.width,
            ),
            height: clamp(
                window_height,
                capabilities.min_image_extent.height,
                capabilities.max_image_extent.height,
            ),
        }
    }
}

pub fn create_image_views(
    device: &ash::Device,
    surface_format: vk::Format,
    images: &Vec<vk::Image>,
) -> Vec<vk::ImageView> {
    let swapchain_imageviews: Vec<vk::ImageView> = images
        .iter()
        .map(|&image| {
            create_image_view(
                device,
                image,
                surface_format,
                vk::ImageAspectFlags::COLOR,
                1,
            )
        })
        .collect();

    swapchain_imageviews
}

pub fn create_image_view(
    device: &ash::Device,
    image: vk::Image,
    format: vk::Format,
    aspect_flags: vk::ImageAspectFlags,
    mip_levels: u32,
) -> vk::ImageView {
    let imageview_create_info = vk::ImageViewCreateInfo {
        s_type: vk::StructureType::IMAGE_VIEW_CREATE_INFO,
        p_next: ptr::null(),
        flags: vk::ImageViewCreateFlags::empty(),
        view_type: vk::ImageViewType::TYPE_2D,
        format,
        components: vk::ComponentMapping {
            r: vk::ComponentSwizzle::IDENTITY,
            g: vk::ComponentSwizzle::IDENTITY,
            b: vk::ComponentSwizzle::IDENTITY,
            a: vk::ComponentSwizzle::IDENTITY,
        },
        subresource_range: vk::ImageSubresourceRange {
            aspect_mask: aspect_flags,
            base_mip_level: 0,
            level_count: mip_levels,
            base_array_layer: 0,
            layer_count: 1,
        },
        image,
    };

    unsafe {
        device
            .create_image_view(&imageview_create_info, None)
            .expect("Failed to create Image View!")
    }
}

pub fn create_render_pass(device: &ash::Device, surface_format: vk::Format) -> vk::RenderPass {
    let color_attachment = vk::AttachmentDescription {
        format: surface_format,
        flags: vk::AttachmentDescriptionFlags::empty(),
        samples: vk::SampleCountFlags::TYPE_1,
        load_op: vk::AttachmentLoadOp::CLEAR,
        store_op: vk::AttachmentStoreOp::STORE,
        stencil_load_op: vk::AttachmentLoadOp::DONT_CARE,
        stencil_store_op: vk::AttachmentStoreOp::DONT_CARE,
        initial_layout: vk::ImageLayo


)
		require.NoError(s.T(), err)

		err = collector.ProcessIncorporatedResult(s.IncorporatedResult)
		require.Error(s.T(), err)
	})

	s.Run("invalid-verifier-identities", func() {
		// delete identities for Result.BlockID
		delete(s.IdentitiesCache, s.IncorporatedResult.Result.BlockID)
		s.Snapshots[s.IncorporatedResult.Result.BlockID] = unittest.StateSnapshotForKnownBlock(s.Block, nil)
		collector, err := newVerifyingAssignmentCollector(unittest.Logger(), s.WorkerPool, s.IncorporatedResult.Result, s.State, s.Headers,
			s.Assigner, s.SealsPL, s.SigHasher, s.Conduit, s.RequestTracker, 1)
		require.Error(s.T(), err)
		require.Nil(s.T(), collector)
	})
}

// TestProcessIncorporatedResult_InvalidIdentity tests a few scenarios where verifier identity is not correct
// by one or another reason
func (s *AssignmentCollectorTestSuite) TestProcessIncorporatedResult_InvalidIdentity() {
	// mocks state to return invalid identity and creates assignment collector that will use it
	// creating assignment collector with invalid identity should result in error
	assertInvalidIdentity := func(identity *flow.Identity) {
		state := protocol.NewState(s.T())
		state.On("AtBlockID", mock.Anything).Return(
			func(blockID flow.Identifier) realproto.Snapshot {
				return unittest.StateSnapshotForKnownBlock(
					s.Block,
					map[flow.Identifier]*flow.Identity{identity.NodeID: identity},
				)
			},
		)

		collector, err := newVerifyingAssignmentCollector(unittest.Logger(), s.WorkerPool, s.IncorporatedResult.Result, state, s.Headers, s.Assigner, s.SealsPL,
			s.SigHasher, s.Conduit, s.RequestTracker, 1)
		require.Error(s.T(), err)
		require.Nil(s.T(), collector)
	}

	s.Run("verifier-zero-weight", func() {
		identity := unittest.IdentityFixture(
			unittest.WithRole(flow.RoleVerification),
			unittest.WithParticipationStatus(flow.EpochParticipationStatusActive),
			unittest.WithInitialWeight(0),
		)
		assertInvalidIdentity(identity)
	})
	s.Run("verifier-leaving", func() {
		identity := unittest.IdentityFixture(
			unittest.WithRole(flow.RoleVerification),
			unittest.WithParticipationStatus(flow.EpochParticipationStatusLeaving),
		)
		assertInvalidIdentity(identity)
	})
	s.Run("verifier-joining", func() {
		identity := unittest.IdentityFixture(
			unittest.WithRole(flow.RoleVerification),
			unittest.WithParticipationStatus(flow.EpochParticipationStatusJoining),
		)
		assertInvalidIdentity(identity)
	})
	s.Run("verifier-ejected", func() {
		identity := unittest.IdentityFixture(
			unittest.WithRole(flow.RoleVerification),
			unittest.WithParticipationStatus(flow.EpochParticipationStatusEjected),
		)
		assertInvalidIdentity(identity)
	})
	s.Run("verifier-invalid-role", func() {
		// invalid role
		identity := unittest.IdentityFixture(unittest.WithRole(flow.RoleAccess))
		assertInvalidIdentity(identity)
	})
}

// TestProcessApproval_BeforeIncorporatedResult tests scenario when approval is submitted before execution result
// is discovered, without execution result we are missing information for verification. Calling `ProcessApproval` before `ProcessApproval`
// should result in error
func (s *AssignmentCollectorTestSuite) TestProcessApproval_BeforeIncorporatedResult() {
	approval := unittest.ResultApprovalFixture(unittest.WithChunk(s.Chunks[0].In


 {
	IncludePublicKey bool
}

type Boxer interface {
	BoxFor(CryptoPayloader, PublicBoxer, BoxOpts) (*proto.Box, error)
}

type DHPublicKey interface {
	ECDSA() *ecdsa.PublicKey
	Curve25519() *proto.Curve25519PublicKey
	Export() proto.DHPublicKey
}

type DHPublicKey25519 struct {
	*proto.Curve25519PublicKey
}

type DHPublicKeyYubi struct {
	*ecdsa.PublicKey
}

func (d DHPublicKey25519) ECDSA() *ecdsa.PublicKey                { return nil }
func (d DHPublicKey25519) Curve25519() *proto.Curve25519PublicKey { return d.Curve25519PublicKey }
func (d DHPublicKey25519) Export() proto.DHPublicKey {
	return proto.NewDHPublicKeyWithCurve25519(*d.Curve25519PublicKey)
}

func (d DHPublicKeyYubi) ECDSA() *ecdsa.PublicKey                { return d.PublicKey }
func (d DHPublicKeyYubi) Curve25519() *proto.Curve25519PublicKey { return nil }
func (d DHPublicKeyYubi) Export() proto.DHPublicKey {
	return proto.NewDHPublicKeyWithP256(proto.ExportECDSAPublic(d.PublicKey))
}

type PrivateBoxer interface {
	EntityPrivate
	DHType() proto.DHType
	BoxFor(CryptoPayloader, PublicBoxer, BoxOpts) (*proto.Box, error)
	UnboxFor(CryptoPayloader, proto.Box, PublicBoxer) (DHPublicKey, error)
	UnboxForEphemeral(CryptoPayloader, proto.Box, proto.DHPublicKey) error
	UnboxForIncludedEphemeral(CryptoPayloader, proto.Box) error
	EntityID() (proto.EntityID, error)
	ExportDHPublicKey(inContextOfSigKey bool) proto.DHPublicKey
	ExportHEPK() (*proto.HEPK, error)
	PublicizeToBoxer() (PublicBoxer, error)
}

type PublicBoxer interface {
	EntityPublic
	DHType() proto.DHType
	ECDSA() (*ecdsa.PublicKey, error)
	DHPublicKey() (*proto.DHPublicKey, error)
	Curve25519() (*proto.Curve25519PublicKey, error)
	Ephemeral() (EphemeralSender, error)
	GetHostID() *proto.HostID
	ExportToMember(h proto.HostID) (*proto.Member, *proto.HEPK, error)
	ExportToTarget(h proto.HostID) (*proto.SharedKeyBoxTarget, error)
	ExportHEPK() (*proto.HEPK, error)
	KemEncapKey() (*proto.KemEncapKey, error)
}

func checkDHTypeMatch(s PrivateBoxer, r PublicBoxer) bool {
	return s.DHType() == r.DHType()
}

func AssertDHTypeMatch(s PrivateBoxer, r PublicBoxer) error {
	if !checkDHTypeMatch(s, r) {
		return BoxError("DH type mismatch")
	}
	return nil
}

var _ PrivateBoxer = (*PrivateSuite25519)(nil)
var _ PublicBoxer = (*PublicSuite25519)(nil)
var _ PublicBoxer = (*PublicSuiteECDSA)(nil)

type EphemeralSender interface {
	BoxFor(CryptoPayloader, PublicBoxer, BoxOpts) (*proto.Box, error)
	Export() *proto.DHPublicKey
}

type EphemeralSender25519 struct {
	enc *proto.Curve25519PublicKey
	dec *proto.Curve25519SecretKey
}

var _ EphemeralSender = (*EphemeralSender25519)(nil)
v


, kernel.size()), 1);
        stride.resize(std::max<size_t>(2, stride.size()), 1);
        dilation.resize(std::max<size_t>(2, dilation.size()), 1);
        pads_begin.resize(std::max<size_t>(2, pads_begin.size()), 0);
        pads_end.resize(std::max<size_t>(2, pads_end.size()), 0);

        auto& pp = params;

        pp.poolType = cldnn_2_pool_type(primitive->mode);
        pp.remainderAction = primitive->rounding_type == ov::op::RoundingType::CEIL ? kernel_selector::pool_remainder::CEIL
                                                                                : kernel_selector::pool_remainder::FLOOR;

        // check if last pooling window goes outside of input size + padding. If so the avg pooling size will be
        // adjusted to that, to work properly this calculation must take pad_end into account.
        auto dynamic_mode = false;
        for (size_t i = 0; i < spatial_rank; i++) {
            dynamic_mode |= (((output_layout.spatial(i) - 1) * stride[spatial_rank - i - 1]) + kernel[spatial_rank - i - 1]) >
                                 static_cast<size_t>(pads_end[spatial_rank - i - 1] + pads_begin[spatial_rank - i - 1] + input_layout.spatial(i));
        }

        if (primitive->mode == pooling_mode::average && dynamic_mode)
            pp.divMode = kernel_selector::kernel_divider_mode::DYNAMIC_WITH_PADDING;
        else
            pp.divMode = cldnn_2_kernel_divider_mode(primitive->mode);

        uint32_t kernel_z = kernel.size() >= 3 ? static_cast<uint32_t>(kernel[kernel.size() - 3]) : 1;
        uint32_t kernel_y = kernel.size() >= 2 ? static_cast<uint32_t>(kernel[kernel.size() - 2]) : 1;
        uint32_t kernel_x = kernel.size() >= 1 ? static_cast<uint32_t>(kernel[kernel.size() - 1]) : 1;
        pp.poolSize = {kernel_x, kernel_y, kernel_z};

        uint32_t pad_z = std::max<std::ptrdiff_t>(pads_begin.size() >= 3 ? pads_begin[pads_begin.size() - 3] : 0, 0);
        uint32_t pad_y = std::max<std::ptrdiff_t>(pads_begin.size() >= 2 ? pads_begin[pads_begin.size() - 2] : 0, 0);
        uint32_t pad_x = std::max<std::ptrdiff_t>(pads_begin.size() >= 1 ? pads_begin[pads_begin.size() - 1] : 0, 0);
        pp.poolPad  = {pad_x, pad_y, pad_z};

        uint32_t stride_z = stride.size() >= 3 ? static_cast<uint32_t>(stride[stride.size() - 3]) : 1;
        uint32_t stride_y = stride.size() >= 2 ? static_cast<uint32_t>(stride[stride.size() - 2]) : 1;
        uint32_t stride_x = stride.size() >= 1 ? static_cast<uint32_t>(stride[stride.size() - 1]) : 1;
        pp.poolStride = {stride_x, stride_y, stride_z};

        uint32_t dilation_z = dilation.size() >= 3 ? static_cast<uint32_t>(dilation[dilation.size() - 3]) : 1;
        uint32_t dilation_y = dilation.size() >= 2 ? static_cast<uint32_t>(dilation[dilation.size() - 2]) : 1;
        uint32_t dilation_x = dilation.size() >= 1 ? static_cast<uint32_t>(dilation[dilation.size() - 1]) : 1;
        pp.poolDilation = {dilation_x, dilation_y, dilation_z};

        return pa


 aplicativo Web. Se você ainda não tem uma conta do Azure, pode criá-la durante o processo de implantação ou nos links abaixo:

* [Crie uma conta do Azure para estudantes (sem necessidade de cartão de crédito)](https://azure.microsoft.com/free/students/?WT.mc_id=academic-79839-sagibbon)
* [Crie uma nova conta do Azure (requer cartão de crédito)](https://azure.microsoft.com/?WT.mc_id=academic-79839-sagibbon)

Com seu projeto aberto no Codespaces:

1. Clique no ícone do Azure na barra lateral esquerda. Faça logon se ainda não o fez e, se for novo no Azure, siga as instruções para criar sua conta.
2. No menu do Azure, clique no sinal “+” e depois em "Criar aplicativo Web estático" (Create Static Web App).
3. Se você não estiver logado no GitHub, você deverá fazer o login. Se você tiver alguma alteração de arquivo pendente, será solicitado que você confirme essas alterações.
4. Defina as informações do seu aplicativo quando solicitado:
    1. **Region**: Coloque a regição mais próxima
    2. **Project structure**: Selecione "React"
    3. **Location of application code**: `/`
    4. **Build location**: `dist`
5. Ao concluir, você verá uma notificação na parte inferior da tela e um novo fluxo de trabalho do GitHub Action será adicionado ao seu projeto. Se você clicar em "Abrir Action no GitHub", verá a ação que foi criada para você, que estará em execução.

![Azure Static Web App deploy](/__images__/swa-deploy.gif "Azure Static Web App deploy")

6. Para visualizar o status de sua publicação (implantação), localize seu recurso Static Web App na guia Azure na barra lateral esquerda do VS Code.
7. Após a conclusão da publicação (implantação), você pode visualizar seu novo aplicativo, acessível ao público clicando com o botão direito do mouse no recurso Static Web App e selecionando "Browse Site".

> **Issues?** Ao criar seu Static Web app, se você for solicitado a selecionar uma assinatura do Azure e não puder selecionar uma assinatura, verifique a guia "Accounts" no VS Code. Certifique-se de escolher as opções "Grant access to ..." (em português, "Conceder acesso a") se essas opções aparecerem. Se você receber a mensagem de erro "RepositoryToken is invalid. ..." (em português, "RepositoryToken é inválido") mude para o Visual Studio Code para a Web (vscode.dev) e repita as etapas lá.

> 🤩 **Bônus**: [Configurar um domínio personalizado para seu aplicativo Web estático do Azure](https://learn.microsoft.com/en-us/shows/azure-tips-and-tricks-static-web-apps/how-to-set-up-a-custom-domain-name-in-azure-static-web-apps-10-of-16--azure-tips-and-tricks-static-w/?WT.mc_id=academic-79839-sagibbon)

### GitHub Pages

[GitHub Pages](https://pages.github.com/) permite hospedar sites diretamente do repositório do GitHub. Este projeto já está configurado para que você possa dar deploy seu portfólio para páginas do GitHub em poucos passos.

Com seu projeto aberto em Codespaces:

1. Abre `package.json` e atualize os seguintes valores:
    1. **homepage**: defina para `http://{github-username}.g


l SQL with the statement
 * @param params array with the SQL parameters
 */
function run(
  db: sqlite3.Database,
  sql: string,
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
  params: any[]
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
): Promise<{ rows: any[] }> {
  const that = db;
  return new Promise(function (resolve, reject) {
    that.all(sql, params, function (error) {
      if (error) {
        reject(error);
      } else {
        resolve();
      }
    });
  });
}

/**
 * Creates (if not created yet and populates with tthe demo data) the database.
 */
export async function getDb(): Promise<sqlite3.Database> {
  if (!db) {
    L.info('Creating database...');
    db = new sqlite3.Database('database.sqlite');
    await populateDemoData(db);
    L.info('Database created.');
  }

  return db;
}

/**
 * Adds the demo data to the database.
 *
 * @param db database to populate the demo data with
 */
async function populateDemoData(db: sqlite3.Database): Promise<void> {
  L.info('Populating demo data...');

  const vehicles: VehicleModel[] = [
    { id: 1, licensePlate: '111-111', lat: 38.7197108, lng: -9.1569673 },
    { id: 2, licensePlate: '222-222', lat: 38.7755936, lng: -9.1375607 },
    { id: 3, licensePlate: '333-333', lat: 38.7755922, lng: -9.1529299 },
  ];
  const pathSteps = 20;

  await run(
    db,
    `
      CREATE TABLE IF NOT EXISTS vehicle
      (
        vehicle_id INTEGER PRIMARY KEY,
        license_plate TEXT NOT NULL UNIQUE
      )
    `,
    []
  );
  await run(
    db,
    `
      CREATE TABLE IF NOT EXISTS vehicle_position
      (
        vehicle_position_id INTEGER PRIMARY_KEY,
        vehicle_id INTEGER NOT NULL,
        recorded_at TEXT NOT NULL,
        lat REAL NOT NULL,
        lng REAL NOT NULL,
        FOREIGN KEY (vehicle_id)
          REFERENCES vehicle (vehicle_id)
            ON DELETE CASCADE
            ON UPDATE NO ACTION
      )
    `,
    []
  );

  const sql = `
    INSERT INTO vehicle
    (
      vehicle_id,
      license_plate
    )
    VALUES
    (
      (?),
      (?)
    )
  `;

  await run(db, 'DELETE FROM vehicle_position', []);
  await run(db, 'DELETE FROM vehicle', []);

  vehicles.forEach(async (v) => {
    const params = [v.id, v.licensePlate];
    await run(db, sql, params);

    for (let i = 0; i < pathSteps; i++) {
      const sql2 = `
        INSERT INTO vehicle_position
        (
          vehicle_position_id,
          vehicle_id,
          recorded_at,
          lat,
          lng
        )
        VALUES
        (
          (?),
          (?),
          (?),
          (?),
          (?)
        )
      `;
      const params2 = [
        v.id * 1000000 + i,
        v.id,
        new Date(new Date().getTime() + i * 1000 * 60).toISOString(),
        v.lat - (pathSteps - i - 1) * 0.001,
        v.lng - (pathSteps - i - 1) * 0.001,
      ];
      await run(db, sql2, params2);
    }
  });

  L.info('Demo data added.');
}
import frontMatter from 'front-matter'
import getRelatedTemplates from './get-related-templates'
import type { ContentfulTemplate, Template } from './types'

interface Att


x), %r14w
// CHECK: encoding: [0x66,0x44,0x8b,0x32]
movw (%rdx), %r14w

// CHECK: mulb 485498096
// CHECK: encoding: [0xf6,0x24,0x25,0xf0,0x1c,0xf0,0x1c]
mulb 485498096

// CHECK: mulb 64(%rdx)
// CHECK: encoding: [0xf6,0x62,0x40]
mulb 64(%rdx)

// CHECK: mulb 64(%rdx,%rax,4)
// CHECK: encoding: [0xf6,0x64,0x82,0x40]
mulb 64(%rdx,%rax,4)

// CHECK: mulb -64(%rdx,%rax,4)
// CHECK: encoding: [0xf6,0x64,0x82,0xc0]
mulb -64(%rdx,%rax,4)

// CHECK: mulb 64(%rdx,%rax)
// CHECK: encoding: [0xf6,0x64,0x02,0x40]
mulb 64(%rdx,%rax)

// CHECK: mulb %r14b
// CHECK: encoding: [0x41,0xf6,0xe6]
mulb %r14b

// CHECK: mulb (%rdx)
// CHECK: encoding: [0xf6,0x22]
mulb (%rdx)

// CHECK: mull 485498096
// CHECK: encoding: [0xf7,0x24,0x25,0xf0,0x1c,0xf0,0x1c]
mull 485498096

// CHECK: mull 64(%rdx)
// CHECK: encoding: [0xf7,0x62,0x40]
mull 64(%rdx)

// CHECK: mull 64(%rdx,%rax,4)
// CHECK: encoding: [0xf7,0x64,0x82,0x40]
mull 64(%rdx,%rax,4)

// CHECK: mull -64(%rdx,%rax,4)
// CHECK: encoding: [0xf7,0x64,0x82,0xc0]
mull -64(%rdx,%rax,4)

// CHECK: mull 64(%rdx,%rax)
// CHECK: encoding: [0xf7,0x64,0x02,0x40]
mull 64(%rdx,%rax)

// CHECK: mull %r13d
// CHECK: encoding: [0x41,0xf7,0xe5]
mull %r13d

// CHECK: mull (%rdx)
// CHECK: encoding: [0xf7,0x22]
mull (%rdx)

// CHECK: mulq 485498096
// CHECK: encoding: [0x48,0xf7,0x24,0x25,0xf0,0x1c,0xf0,0x1c]
mulq 485498096

// CHECK: mulq 64(%rdx)
// CHECK: encoding: [0x48,0xf7,0x62,0x40]
mulq 64(%rdx)

// CHECK: mulq 64(%rdx,%rax,4)
// CHECK: encoding: [0x48,0xf7,0x64,0x82,0x40]
mulq 64(%rdx,%rax,4)

// CHECK: mulq -64(%rdx,%rax,4)
// CHECK: encoding: [0x48,0xf7,0x64,0x82,0xc0]
mulq -64(%rdx,%rax,4)

// CHECK: mulq 64(%rdx,%rax)
// CHECK: encoding: [0x48,0xf7,0x64,0x02,0x40]
mulq 64(%rdx,%rax)

// CHECK: mulq (%rdx)
// CHECK: e


        self.bits
    }
    #[doc = r"Returns `true` if the bit is clear (0)"]
    #[inline(always)]
    pub fn bit_is_clear(&self) -> bool {
        !self.bit()
    }
    #[doc = r"Returns `true` if the bit is set (1)"]
    #[inline(always)]
    pub fn bit_is_set(&self) -> bool {
        self.bit()
    }
}
#[doc = r"Proxy"]
pub struct _SYSCTL_DCGCGPIO_D6W<'a> {
    w: &'a mut W,
}
impl<'a> _SYSCTL_DCGCGPIO_D6W<'a> {
    #[doc = r"Sets the field bit"]
    #[inline(always)]
    pub fn set_bit(self) -> &'a mut W {
        self.bit(true)
    }
    #[doc = r"Clears the field bit"]
    #[inline(always)]
    pub fn clear_bit(self) -> &'a mut W {
        self.bit(false)
    }
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub fn bit(self, value: bool) -> &'a mut W {
        self.w.bits &= !(1 << 6);
        self.w.bits |= ((value as u32) & 1) << 6;
        self.w
    }
}
#[doc = r"Value of the field"]
pub struct SYSCTL_DCGCGPIO_D7R {
    bits: bool,
}
impl SYSCTL_DCGCGPIO_D7R {
    #[doc = r"Value of the field as raw bits"]
    #[inline(always)]
    pub fn bit(&self) -> bool {
        self.bits
    }
    #[doc = r"Returns `true` if the bit is clear (0)"]
    #[inline(always)]
    pub fn bit_is_clear(&self) -> bool {
        !self.bit()
    }
    #[doc = r"Returns `true` if the bit is set (1)"]
    #[inline(always)]
    pub fn bit_is_set(&self) -> bool {
        self.bit()
    }
}
#[doc = r"Proxy"]
pub struct _SYSCTL_DCGCGPIO_D7W<'a> {
    w: &'a mut W,
}
impl<'a> _SYSCTL_DCGCGPIO_D7W<'a> {
    #[doc = r"Sets the field bit"]
    #[inline(always)]
    pub fn set_bit(self) -> &'a mut W {
        self.bit(true)
    }
    #[doc = r"Clears the field bit"]
    #[inline(always)]
    pub fn clear_bit(self) -> &'a mut W {
        self.bit(false)
    }
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub fn bit(self, value: bool) -> &'a mut W {
        self.w.bits &= !(1 << 7);
        self.w.bits |= ((value as u32) & 1) << 7;
        self.w
    }
}
#[doc = r"Value of the field"]
pub struct SYSCTL_DCGCGPIO_D8R {
    bits: bool,
}
impl SYSCTL_DCGCGPIO_D8R {
    #[doc = r"Value of the field as raw bits"]
    #[inline(always)]
    pub fn bit(&self) -> bool {
        self.bits
    }
    #[doc = r"Returns `true` if the bit is clear (0)"]
    #[inline(always)]
    pub fn bit_is_clear(&self) -> bool {
        !self.bit()
    }
    #[doc = r"Returns `true` if the bit is set (1)"]
    #[inline(always)]
    pub fn bit_is


 Fraction[][] testData = {
            { new Fraction(1), new Fraction(2), new Fraction(3)},
            { new Fraction(2), new Fraction(5), new Fraction(3)},
            { new Fraction(1), new Fraction(0), new Fraction(8)}
    };
    private Fraction[][] testDataMinus = {
            { new Fraction(-1), new Fraction(-2), new Fraction(-3)},
            { new Fraction(-2), new Fraction(-5), new Fraction(-3)},
            { new Fraction(-1),  new Fraction(0), new Fraction(-8)}
    };
    private Fraction[][] luData = {
            { new Fraction(2), new Fraction(3), new Fraction(3) },
            { new Fraction(0), new Fraction(5), new Fraction(7) },
            { new Fraction(6), new Fraction(9), new Fraction(8) }
    };

    // singular matrices
    private Fraction[][] singular = {
            { new Fraction(2), new Fraction(3) },
            { new Fraction(2), new Fraction(3) }
    };
    private Fraction[][] bigSingular = {
            { new Fraction(1), new Fraction(2),   new Fraction(3),    new Fraction(4) },
            { new Fraction(2), new Fraction(5),   new Fraction(3),    new Fraction(4) },
            { new Fraction(7), new Fraction(3), new Fraction(256), new Fraction(1930) },
            { new Fraction(3), new Fraction(7),   new Fraction(6),    new Fraction(8) }
    }; // 4th row = 1st + 2nd

    /** test dimensions */
    @Test
    void testDimensions() {
        FieldMatrix<Fraction> matrix =
            new Array2DRowFieldMatrix<Fraction>(FractionField.getInstance(), testData);
        FieldLUDecomposition<Fraction> LU = new FieldLUDecomposition<Fraction>(matrix);
        assertEquals(testData.length, LU.getL().getRowDimension());
        assertEquals(testData.length, LU.getL().getColumnDimension());
        assertEquals(testData.length, LU.getU().getRowDimension());
        assertEquals(testData.length, LU.getU().getColumnDimension());
        assertEquals(testData.length, LU.getP().getRowDimension());
        assertEquals(testData.length, LU.getP().getColumnDimension());

    }

    /** test non-square matrix */
    @Test
    void testNonSquare() {
        try {
            // we don't use FractionField.getInstance() for testing purposes
            new FieldLUDecomposition<Fraction>(new Array2DRowFieldMatrix<Fraction>(new Fraction[][] {
                    { Fraction.ZERO, Fraction.ZERO },
                    { Fraction.ZERO, Fraction.ZERO },
                    { Fraction.ZERO, Fraction.ZERO }
            }));
            fail("Expected MathIllegalArgumentException");
        } catch (MathIllegalArgumentException ime) {
            assertEquals(LocalizedCoreFormats.NON_SQUARE_MATRIX, ime.getSpecifier());
        }
    }

    /** test PA = LU */
    @Test
    void testPAEqualLU() {
        FieldMatrix<Fraction> matrix = new Array2DRowFieldMatrix<Fraction>(FractionField.getInstance(), testData);
        FieldLUDecomposition<Fraction> lu = new FieldLUDecomposition<Fraction>(matrix);
        FieldMatrix<Fraction> l = lu.getL();
        FieldMatrix<Fraction> u = lu.getU();
        FieldMatrix<Fraction> p = lu.getP();
        UnitTestUtils.customAssertEquals(p.multiply(matrix), l.multiply(u));

        matrix = new Array2DRowFieldMatrix<Fraction>(FractionField.getInstance(), testDataMinus);
        lu = new FieldLUDecomposition<Fraction>(matrix);
        l = lu.getL();
        u = lu.getU();
        p = lu.getP();
        UnitTestUt


          foreach (DataGridViewRow row in dataGridView1.Rows)
            {
                DataGridViewCheckBoxCell cell = row.Cells[0] as DataGridViewCheckBoxCell;
                cell.Value = true;
            }
        }

        private void menuItemUnCheckAll_Click(object sender, EventArgs e)
        {
            dataGridView1.RefreshEdit();
            foreach (DataGridViewRow row in dataGridView1.Rows)
            {
                DataGridViewCheckBoxCell cell = row.Cells[0] as DataGridViewCheckBoxCell;
                cell.Value = !(bool)cell.Value;
            }
        }

    }
}


impl<Ret: Debug> Debug for TableInsts<Ret> {
    fn fmt(&self, f: &mut Formatter) -> Result<(), FmtError> {
        try!(f.write_fmt(format_args!("TableInsts ({} log_classes, {} instructions):\n",
                                      self.log_num_classes,
                                      self.accept.len())));
        try!(f.write_str("Byte classes: "));
        try!(f.debug_map()
            .entries((0..256).map(|b| (b, self.byte_class[b])))
            .finish());

        let num_classes = 1 << self.log_num_classes;
        for idx in 0..self.accept.len() {
            try!(f.write_fmt(format_args!("State {}:\n", idx)));
            try!(f.debug_map()
                .entries((0usize..num_classes)
                    .map(|c| (c, self.table[(idx << self.log_num_classes) + c]))
                    .filter(|x| x.1 != u32::MAX))
                .finish());
            try!(f.write_str("\n"));
        }

        try!(f.write_str("Accept: "));
        for idx in 0..self.accept.len() {
            if let Some(ref ret) = self.accept[idx] {
                try!(f.write_fmt(format_args!("{} -> {:?}, ", idx, ret)));
            }
        }

        try!(f.write_str("Accept_at_eoi: "));
        for idx in 0..self.accept_at_eoi.len() {
            if let Some(ref ret) = self.accept_at_eoi[idx] {
                try!(f.write_fmt(format_args!("{} -> {:?}, ", idx, ret)));
            }
        }
        Ok(())
    }
}

impl<Ret: Copy + Debug> TableInsts<Ret> {
    fn next_state(&self, state: usize, input: u8) -> Option<usize> {
        let class = self.byte_class[input as usize];
        let next_state = self.table[(state << self.log_num_classes) + class as usize];
        if next_state != u32::MAX {
            Some(next_state as usize)
        } else {
            None
        }
    }

    pub fn num_states(&self) -> usize {
        self.accept.len()
    }

    pub fn find_from(&self, input: &[u8], pos: usize, state: usize)
    -> Result<(usize, Ret), usize> {
        let mut state = state as u32;
        let mut ret = Err(input.len());

        if state as usize >= self.accept.len() {
            panic!("BUG");
        }
        for pos in pos..input.len() {
            if let Some(accept_ret) = self.accept[state as usize] {
                ret = Ok((pos, accept_ret));
            }

            // We've manually inlined next_state here, for better performance (measurably better
            // than using #[inline(always)]).
            // For some reason, these bounds checks (even though LLVM leaves them in) don't seem to
            // hurt performance.
            let class = self.byte_class[input[pos] as usize];
            state = self.table[((state as usize) << self.log_num_classes) + class as usize];

            // Since everything in `self.table` is either a valid state or u32::MAX, this is the
            // same as checking if state == u32::MAX. We write it this way in the hope that
            // rustc/LLVM will be ab


) 'BackupPlanId': backupPlanId,
      if (backupPlanVersion != null) 'BackupPlanVersion': backupPlanVersion,
      if (backupRuleId != null) 'BackupRuleId': backupRuleId,
    };
  }
}

/// Contains detailed information about the recovery points stored in an Backup
/// backup vault. A backup, or recovery point, represents the content of a
/// resource at a specified time.
class AwsBackupRecoveryPointDetails {
  /// The size, in bytes, of a backup.
  final int? backupSizeInBytes;

  /// An Amazon Resource Name (ARN) that uniquely identifies a backup vault.
  final String? backupVaultArn;

  /// The name of a logical container where backups are stored. Backup vaults are
  /// identified by names that are unique to the Amazon Web Services account used
  /// to create them and the Amazon Web Services Region where they are created.
  /// They consist of lowercase letters, numbers, and hyphens.
  final String? backupVaultName;

  /// A CalculatedLifecycle object containing DeleteAt
  /// and MoveToColdStorageAt timestamps.
  final AwsBackupRecoveryPointCalculatedLifecycleDetails? calculatedLifecycle;

  /// The date and time that a job to create a recovery point is completed, in
  /// Unix format and UTC. The value of CompletionDate is accurate to
  /// milliseconds. For example, the value 1516925490.087 represents Friday,
  /// January 26, 2018 12:11:30.087 AM.
  final String? completionDate;

  /// Contains identifying information about the creation of a recovery point,
  /// including the BackupPlanArn, BackupPlanId,
  /// BackupPlanVersion, and BackupRuleId of the backup
  /// plan that is used to create it.
  final AwsBackupRecoveryPointCreatedByDetails? createdBy;

  /// The date and time a recovery point is created, in Unix format and UTC. The
  /// value of CreationDate is accurate to milliseconds. For example,
  /// the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087
  /// AM.
  final String? creationDate;

  /// The ARN for the server-side encryption key that is used to protect your
  /// backups.
  final String? encryptionKeyArn;

  /// Specifies the IAM role ARN used to create the target recovery point
  final String? iamRoleArn;

  /// A Boolean value that is returned as TRUE if the specified
  /// recovery point is encrypted, or FALSE if the recovery point is
  /// not encrypted.
  final bool? isEncrypted;

  /// The date and time that a recovery point was last restored, in Unix format
  /// and UTC. The value of LastRestoreTime is accurate to
  /// milliseconds. For example, the value 1516925490.087 represents Friday,
  /// January 26, 2018 12:11:30.087 AM.
  final String? lastRestoreTime;

  /// The lifecycle defines when a protected resource is transitioned to cold
  /// storage and when it expires. Backup transitions and expires backups
  /// automatically according to the lifecycle that you define
  final AwsBackupRecoveryPointLifecycleDetails? lifecycle;

  /// An ARN that uniquely identifies a recovery point.
  final String? recoveryPointArn;

  /// An ARN that uniquely identifies a resource. The format of the ARN depends on
  /// the resource type.
  final String? resourceArn;

  /// The type of Amazon Web Services resource saved as a recovery point, such as
  /// an Amazon EBS volume or an Amazon RDS database.
  final String? resourceType;

  /// The ARN for the backup vault w


; }
			set
			{
				UiEditorScene.SetSelectedControlNamesInList(value);
				RaiseAllProperties();
			}
		}

		public void SetSelectedIndexFromHierachy(int newSelectedIndex)
		{
			ControlListIndex = newSelectedIndex;
		}

		public int ControlListIndex
		{
			get { return UIControl.Index; }
			set { UIControl.Index = value; }
		}
		private UIControl UIControl
		{
			get { return UiEditorScene.uiControl; }
		}

		public void DeleteSelectedContent(string arg)
		{
			UiEditorScene.DeleteSelectedContent();
			SelectedControlNamesInList.Clear();
		}

		public void ClearScene(string obj)
		{
			UiEditorScene.ClearScene();
			SetMouseCommands("");
		}

		//ncrunch: no coverage start
		private void SelectContentInContentManager(ContentIconAndName content)
		{
			var type = service.GetTypeOfContent(content.Name);
			if (type != ContentType.Scene)
				return;
			UIName = content.Name;
			LoadScene();
		}//ncrunch: no coverage end

		public void LoadScene()
		{
			if (UiEditorScene.LoadScene())
				return; //ncrunch: no coverage
			UpdateIfCanSaveScene();
			SetMouseCommands("");
		}

		public ObservableCollection<string> ContentImageListList
		{
			get { return UiEditorScene.ContentImageListList; }
		}

		public ObservableCollection<string> UIImagesInList
		{
			get { return UiEditorScene.UIImagesInList; }
		}

		public ObservableCollection<string> MaterialList
		{
			get { return UiEditorScene.MaterialList; }
		}

		public ObservableCollection<string> SceneNames
		{
			get { return UiEditorScene.SceneNames; }
		}

		public string SelectedName
		{
			get { return UiEditorScene.SelectedName; }
			set { UiEditorScene.SetSelectedName(value); }
		}

		public int SelectedIndex
		{
			get { return UiEditorScene.SelectedIndex; }
			set { UiEditorScene.SetSelectedIndex(value); }
		}

		public string ControlName
		{
			get { return UiEditorScene.uiControl.ControlName; }
			set { UiEditorScene.controlChanger.ChangeControlName(value, UiEditorScene); }
		}

		public int GridWidth
		{
			get { return UiEditorScene.UISceneGrid.GridWidth; }
			set
			{
				UiEditorScene.UISceneGrid.GridWidth = value;
				UiEditorScene.UISceneGrid.DrawGrid();
			}
		}

		public int GridHeight
		{
			get { return UiEditorScene.UISceneGrid.GridHeight; }
			set
			{
				UiEditorScene.UISceneGrid.GridHeight = value;
				UiEditorScene.UISceneGrid.DrawGrid();
			}
		}

		public bool IsShowingGrid
		{
			get { return UiEditorScene.IsDrawingGrid; }
			set
			{
				UiEditorScene.IsDrawingGrid = value;
				UiEditorScene.UISceneGrid.DrawGrid();
			}
		}

		public float Entity2DWidth
		{
			get { return UIControl.EntityWidth; }
			set { ControlChanger.SetWidth(value, UiEditorScene); }
		}

		private ControlChanger ControlChanger
		{
			get { return UiEditorScene.controlChanger; }
		}

		public float Entity2DHeight
		{
			get { return UIControl.EntityHeight; }
			set { ControlChanger.Se


from ultralytics import YOLO

model = YOLO('yolov8n.pt')

results = model.train(data='mydata.yaml', epochs=10)


sth	%r21, [%r4 + %r5]
	.word 0xe6310005  ! 32: STH_R	sth	%r19, [%r4 + %r5]
	.word 0xe2712ce8  ! 32: STX_I	stx	%r17, [%r4 + 0x0ce8]
	.word 0xfa31226a  ! 32: STH_I	sth	%r29, [%r4 + 0x026a]
	.word 0xf2210005  ! 32: STW_R	stw	%r25, [%r4 + %r5]
	.word 0x26c10001  ! 32: BRLZ	brlz,a,nt	%4,<label_0x10001>
	.word 0xd831274e  ! 32: STH_I	sth	%r12, [%r4 + 0x074e]
	.word 0xde290005  ! 41: STB_R	stb	%r15, [%r4 + %r5]
	.word 0xe8710005  ! 41: STX_R	stx	%r20, [%r4 + %r5]
	.word 0xdc292442  ! 41: STB_I	stb	%r14, [%r4 + 0x0442]
	.word 0xde292bb1  ! 41: STB_I	stb	%r15, [%r4 + 0x0bb1]
	.word 0xf2712cf0  ! 41: STX_I	stx	%r25, [%r4 + 0x0cf0]
	.word 0xdc290005  ! 41: STB_R	stb	%r14, [%r4 + %r5]
	.word 0xe6212a1c  ! 41: STW_I	stw	%r19, [%r4 + 0x0a1c]
	.word 0x0ec10001  ! 41: BRGEZ	brgez  ,nt	%4,<label_0x10001>
	.word 0xd8f00ce1  ! 41: STXA_R	stxa	%r12, [%r0 + %r1] 0x67
	.word 0xe6290005  ! 50: STB_R	stb	%r19, [%r4 + %r5]
	.word 0xe4712ae8  ! 50: STX_I	stx	%r18, [%r4 + 0x0ae8]
	.word 0xe2710005  ! 50: STX_R	stx	%r17, [%r4 + %r5]
	.word 0xf8212598  ! 50: STW_I	stw	%r28, [%r4 + 0x0598]
	.word 0xea212590  ! 50: STW_I	stw	%r21, [%r4 + 0x0590]
	.word 0xfa710005  ! 50: STX_R	stx	%r29, [%r4 + %r5]
	.word 0xde312ae6  ! 50: STH_I	sth	%r15, [%r4 + 0x0ae6]
	.word 0x24800003  ! 50: BLE	ble,a	<label_0x3>
	.word 0xee712610  ! 50: STX_I	stx	%r23, [%r4 + 0x0610]
	.word 0xdc290005  ! 59: STB_R	stb	%r14, [%r4 + %r5]
	.word 0xec292af3  ! 59: STB_I	stb	%r22, [%r4 + 0x0af3]
	.word 0xe0710005  ! 59: STX_R	stx	%r16, [%r4 + %r5]
	.word 0xf8290005  ! 59: STB_R	stb	%r28, [%r4 + %r5]
	.word 0xd


plicitCallProperty);
		set => SetValue(DisposeOnlyOnExplicitCallProperty, value);
	}

	internal event RoutedEventHandler? Click;

	internal LinkButtonV2()
	{
		Width = ButtonSize;
		Height = ButtonSize;
		HorizontalAlignment = HorizontalAlignment.Center;
		VerticalAlignment = VerticalAlignment.Center;
		Background = new SolidColorBrush(Colors.Transparent);
		IsTabStop = true;

		CreateBrushes();
		CreateVisualStructure();
		CreateFlyout();
		CreateHoverTimer();
		UpdateEnabledState();

		Loaded += LinkButtonV2_Loaded;
		Unloaded += LinkButtonV2_Unloaded;
		PointerEntered += LinkButtonV2_PointerEntered;
		PointerExited += LinkButtonV2_PointerExited;
		PointerPressed += LinkButtonV2_PointerPressed;
		PointerReleased += LinkButtonV2_PointerReleased;
		PointerCanceled += LinkButtonV2_PointerCanceled;
		PointerCaptureLost += LinkButtonV2_PointerCaptureLost;
		Tapped += LinkButtonV2_Tapped;
	}

	/// <summary>
	/// Creates the flyout for link preview functionality only if enabled in settings
	/// </summary>
	private void CreateFlyout()
	{
		// Only create flyout if link previews are enabled in settings
		if (!App.Settings.LinkPreviewsForSecurityMeasure)
		{
			return;
		}

		_previewFlyout = new Flyout
		{
			Placement = FlyoutPlacementMode.Bottom,
			ShouldConstrainToRootBounds = false,
			AreOpenCloseAnimationsEnabled = false,

			// Adjusts the flyout's default padding and margin
			FlyoutPresenterStyle = new Style(typeof(FlyoutPresenter))
			{
				Setters =   {
								new Setter(MarginProperty, new Thickness(0)),
								new Setter(PaddingProperty, new Thickness(4)),
								new Setter(CornerRadiusProperty, new CornerRadius(15))
							}
			}
		};

		_previewFlyout.Opened += PreviewFlyout_Opened;
		_previewFlyout.Closed += PreviewFlyout_Closed;
	}

	/// <summary>
	/// Creates the hover timer for delayed flyout display
	/// </summary>
	private void CreateHoverTimer()
	{
		_hoverTimer = new DispatcherTimer
		{
			Interval = HoverDelay
		};
		_hoverTimer.Tick += HoverTimer_Tick;
	}

	/// <summary>
	/// Handles hover timer tick to show flyout after delay
	/// </summary>
	private void HoverTimer_Tick(object? sender, object e)
	{
		if (_isDisposed) return;

		_hoverTimer?.Stop();

		if (_isPointerOver && !_isFlyoutOpen && !string.IsNullOrWhiteSpace(LinkUrl))
		{
			ShowPreviewFlyout();
		}
	}

	/// <summary>
	/// Shows the preview flyout in a frame only if enabled in settings
	/// </summary>
	private void ShowPreviewFlyout()
	{
		// Check if link previews are enabled in settings before showing flyout
		if (_isDisposed || _previewFlyout == null || !App.Settings.LinkPreviewsForSecurityMeasure)
			return;

		try
		{
			// Clean up any existing frame first
			CleanupCurrentFrame();

			_currentPreviewFrame = new Frame
			{
				Width = 400,
				Height = 300,
				HorizontalAlignment = HorizontalAlignment.Stretch,
				VerticalAlignment = VerticalAlignment.Stretch
			};

			// Navigate to LinkPreview page
			bool navigationSucceeded = _currentPreviewFrame.Navigate(typeof(LinkPreview));

			if (!navigationSucceeded)
			{
				// Clean up frame if navigation failed
				CleanupCurrentFrame();
				return;
			}

			// Set the URL on the preview page
			if (_currentPreviewFrame.Content is LinkPreview previewPage)
			{
				previewPage.PreviewUrl = LinkUrl;
				_previewFlyout.Content = _currentPreviewFrame;
				_previewFlyout.ShowAt(this);
			}
			else
			{
				// Clean up frame if we couldn't get the preview page
				CleanupCurrentFrame();
			}
		}


32 32H80c-26.5 0-48 21.5-48 48v352c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V80c0-26.5-21.5-48-48-48zM275.8 381.4c0 43.6-25.6 63.5-62.9 63.5-33.7 0-53.2-17.4-63.2-38.5l34.3-20.7c6.6 11.7 12.6 21.6 27.1 21.6 13.8 0 22.6-5.4 22.6-26.5V237.7h42.1v143.7zm99.6 63.5c-39.1 0-64.4-18.6-76.7-43l34.3-19.8c9 14.7 20.8 25.6 41.5 25.6 17.4 0 28.6-8.7 28.6-20.8 0-14.4-11.4-19.5-30.7-28l-10.5-4.5c-30.4-12.9-50.5-29.2-50.5-63.5 0-31.6 24.1-55.6 61.6-55.6 26.8 0 46 9.3 59.8 33.7L400 290c-7.2-12.9-15-18-27.1-18-12.3 0-20.1 7.8-20.1 18 0 12.6 7.8 17.7 25.9 25.6l10.5 4.5c35.8 15.3 55.9 31 55.9 66.2 0 37.8-29.8 58.6-69.7 58.6z"],
  "jsfiddle": [576, 512, [], "f1cc", "M510.634 237.462c-4.727-2.621-5.664-5.748-6.381-10.776-2.352-16.488-3.539-33.619-9.097-49.095-35.895-99.957-153.99-143.386-246.849-91.646-27.37 15.25-48.971 36.369-65.493 63.903-3.184-1.508-5.458-2.71-7.824-3.686-30.102-12.421-59.049-10.121-85.331 9.167-25.531 18.737-36.422 44.548-32.676 76.408.355 3.025-1.967 7.621-4.514 9.545-39.712 29.992-56.031 78.065-41.902 124.615 13.831 45.569 57.514 79.796 105.608 81.433 30.291 1.031 60.637.546 90.959.539 84.041-.021 168.09.531 252.12-.48 52.664-.634 96.108-36.873 108.212-87.293 11.54-48.074-11.144-97.3-56.832-122.634zm21.107 156.88c-18.23 22.432-42.343 35.253-71.28 35.65-56.874.781-113.767.23-170.652.23 0 .7-163.028.159-163.728.154-43.861-.332-76.739-19.766-95.175-59.995-18.902-41.245-4.004-90.848 34.186-116.106 9.182-6.073 12.505-11.566 10.096-23.136-5.49-26.361 4.453-47.956 26.42-62.981 22.987-15.723 47.422-16.146 72.034-3.083 10.269 5.


 .noUi-handle.noUi-active .noUi-tooltip {
    display: block
}

.noUi-target .noUi-pips {
    color: var(--falcon-gray-400);
    margin-top: .25rem
}

.noUi-target .noUi-pips .noUi-value-sub {
    color: var(--falcon-gray-400)
}

.noUi-target .noUi-pips .noUi-marker,
.noUi-target .noUi-pips .noUi-marker-large {
    background: var(--falcon-gray-400)
}

[data-bs-theme=dark] .noUi-handle .noUi-tooltip {
    background: #232e3c;
    color: #fff
}

.table tfoot>tr>th:first-child,
.table thead>tr>th:first-child,
.table tr th:first-child,
.table tr td:first-child {
    padding-left: 1.25rem
}

.table tfoot>tr>th:last-child,
.table thead>tr>th:last-child,
.table tr th:last-child,
.table tr td:last-child {
    padding-right: 1.25rem
}

.white-space-nowrap {
    width: 1px;
    white-space: nowrap
}

th {
    font-weight: 600
}

td .dropdown-toggle:after,
td .dropdown-toggle:before {
    display: none
}

.table-dashboard {
    overflow: hidden
}

.table-dashboard th {
    border-bottom-width: 1px !important
}

h5,
.h5 {
    margin-bottom: .25rem
}

.dropcap::first-letter {
    font-size: 3em;
    float: left;
    line-height: .92;
    margin-right: .375rem
}

.ls {
    letter-spacing: .04em
}

.ls-2 {
    letter-spacing: .25em
}

.bullet-inside {
    list-style-position: inside
}

.style-check li {
    position: relative;
    list-style-type: none;
    padding-left: .25rem
}

.style-check li:before {
    content: url(data:image/svg+xml;base64,PHN2ZyBhcmlhLWhpZGRlbj0idHJ1ZSIgZGF0YS1mYS1wcm9jZXNzZWQ9IiIgZGF0YS1wcmVmaXg9ImZhbCIgZGF0YS1pY29uPSJjaGVjayIgcm9sZT0iaW1nIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA0NDggNTEyIiBjbGFzcz0ic3ZnLWlubGluZS0tZmEgZmEtY2hlY2sgZmEtdy0xNCIgc3R5bGU9ImZvbnQtc2l6ZTogNDhweDsiPjxwYXRoIGZpbGw9ImN1cnJlbnRDb2xvciIgZD0iTTQxMy41MDUgOTEuOTUxTDEzMy40OSAzNzEuOTY2bC05OC45OTUtOTguOTk1Yy00LjY4Ni00LjY4Ni0xMi4yODQtNC42ODYtMTYuOTcxIDBMNi4yMTEgMjg0LjI4NGMtNC42ODYgNC42ODYtNC42ODYgMTIuMjg0IDAgMTYuOTcxbDExOC43OTQgMTE4Ljc5NGM0LjY4NiA0LjY4NiAxMi4yODQgNC42ODYgMTYuOTcxIDBsMjk5LjgxMy0yOTkuODEzYzQuNjg2LTQuNjg2IDQuNjg2LTEyLjI4NCAwLTE2Ljk3MWwtMTEuMzE0LTExLjMxNGMtNC42ODYtNC42ODYtMTIuMjg0LTQuNjg2LTE2Ljk3IDB6IiBjbGFzcz0iIj48L3BhdGg+PC9zdmc+);
    padding-right: .1875rem;
    position: absolute;
    top: .0625rem;
    left: -1rem;


width;
        _defaultData = 'Hello World';
        _desc =
            'QR code (abbreviated from Quick Response code) is the trademark for a type of matrix barcode (or two-dimensional barcode) first designed in 1994 for the automotive industry in Japan.';
        _method = 'qrCode()';
        _barcode = Barcode.qrCode();
        break;
      case BarcodeType.Codabar:
        _defaultData = '7698-1239';
        _desc =
            'Codabar was designed to be accurately read even when printed on dot-matrix printers for multi-part forms such as FedEx airbills and blood bank forms, where variants are still in use as of 2007.';
        _method = 'codabar()';
        _barcode = Barcode.codabar();
        break;
      case BarcodeType.PDF417:
        _defaultData = 'Hello World';
        _desc =
            'PDF417 is a stacked linear barcode format used in a variety of applications such as transport, identification cards, and inventory management.';
        _method = 'pdf417()';
        _barcode = Barcode.pdf417();
        break;
      case BarcodeType.DataMatrix:
        width = 300;
        height = width;
        _defaultData = 'Hello World';
        _desc =
            'A Data Matrix is a two-dimensional barcode consisting of black and white "cells" or modules arranged in either a square or rectangular pattern, also known as a matrix.';
        _method = 'dataMatrix()';
        _barcode = Barcode.dataMatrix();
        break;
      case BarcodeType.Aztec:
        width = 300;
        height = width;
        _defaultData = 'Hello World';
        _desc =
            'Named after the resemblance of the central finder pattern to an Aztec pyramid.';
        _method = 'aztec()';
        _barcode = Barcode.aztec();
        break;
      case BarcodeType.Rm4scc:
        height = 60;
        _defaultData = 'HELLOWORLD';
        _desc =
            'The RM4SCC is used for the Royal Mail Cleanmail service. It enables UK postcodes as well as Delivery Point Suffixes (DPSs) to be easily read by a machine at high speed.';
        _method = 'rm4scc()';
        _barcode = Barcode.rm4scc();
        break;
      case BarcodeType.Postnet:
        height = 60;
        _defaultData = '55555-1237';
        _desc =
            'POSTNET (Postal Numeric Encoding Technique) is a barcode symbology used by the United States Postal Service to assist in directing mail.';
        _method = 'postnet()';
        _barcode = Barcode.postnet();
        break;
    }

    notifyListeners();
  }
}
/*
 * Copyright (C) 2017, David PHAM-VAN <dev.nfet.net@gmail.com>
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

import 'dart:io';

import 'package:pdf/pdf.dart';
import 'package:pdf/widgets.dart';
import 'package:test/test.dart';

late Document pdf;

void main() {
  setUpAll(() {
    Document.debug = true;
    RichText.debug = true;
    pdf = Document();
  });

  group('LineChart test', () {
    test('Default LineChart', () {
      pdf.addPage(Page(
        pageFormat: PdfPageFormat.standard.landscape,
        build: (Context context) => Chart(
          grid: CartesianGrid(
            xAxis: FixedAxis<int>(<int>[


_renderService.createOverlayPaneSync(initialState);
    return _createRef(pane, initialState);
  }

  /// Returns the current size of the overlay container.
  ///
  /// By default this is normally the viewport, but in some apps the container
  /// may be different dimensions (such as multiple apps alive at the same
  /// time).
  Future<Rectangle<num>> measureContainer() =>
      _renderService.measureContainer();

  static const _defaultState = OverlayState();
  static final _logger = Logger('OverlayService');

  final bool _useDomSynchronously;
  final NgZone _ngZone;
  final OverlayDomRenderService _renderService;

  OverlayRef _createRef(HtmlElement pane, OverlayState state) => OverlayRef(
      _renderService.applyState,
      _measurePane,
      _renderService.createPortalHost(pane),
      _renderService.containerElement,
      pane,
      _ngZone.runOutsideAngular,
      state: state);

  // Depending on client flags, either measure sync or async.
  Stream<Rectangle<num>> _measurePane(HtmlElement pane, {bool track = false}) {
    return _renderService.measureSize(pane,
        track: track, sync: _useDomSynchronously);
  }

  OverlayService(
      this._ngZone,
      @Inject(overlaySyncDom) this._useDomSynchronously,
      this._renderService,
      @SkipSelf() @Optional() OverlayService existingInstance) {
    assert(() {
      // Overlay service should not be injected if it is already available
      if (existingInstance != null) {
        _logger.severe('OverlayService must be a singleton: '
            'Remove nested OverlayService providers such as overlayBindings, '
            'popupBindings, datepickerBindings or materialProviders');
      }
      return true;
    }());
  }
}
// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

import 'package:angular/angular.dart';
import 'package:angular_components/laminate/overlay/overlay.dart';
import 'package:angular_components/laminate/portal/portal.dart';

/// An internal directive that is used by the modal component to hoist content.
@Directive(
  selector: '[modalController]',
)
class ModalControllerDirective extends TemplatePortal implements OnDestroy {
  ModalControllerDirective(
      TemplateRef templateRef, ViewContainerRef viewContainerRef)
      : super(templateRef, viewContainerRef);

  @override
  void ngOnDestroy() {
    if (isAttached) {
      detach();
    }
  }

  /// Attaches content to the provided [overlayRef].
  @Input('modalController')
  set overlay(OverlayRef overlayRef) {
    if (overlayRef == null) {
      if (isAttached) {
        this.detach();
      }
    } else {
      overlayRef.attach(this);
    }
  }
}
// Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

import 'dart:html';

import 'package:angular/angular.dart';

/// Adds CSS to the `document.head` location in order to use overlays.
///
/// It is possible to override the default behavior by binding your own:
///     const Provider(OverlayStyleConfig, useClass: CustomOverlayStyleConfig);
@Injectable()
class OverlayStyleConfig {
  static const _styleId = "__overlay_styles";
  // TODO(google): Move these styles out into a scss file and inline them.
  static const inlinedStyles = r'''
  #default-acx-overlay-container,
  .acx-overlay-container {
    position: absolute;


suyv7EPYR7cuEithLRLL6moW/0VriaVRtT1qTQkSER411Cyjc4pBL4/KEirPNRj4FZ3gXy5EWM+vWaIhtJQNf2GWYkg5dtWzui9bhuqn6OkVNUhE+ANjTZG91Kjrq6bDxHnGStqvcxHWsU5bQpZ0orCK3rDs21m2quXY6+DLTWBBNTP9wxbOKZZ4E63omLYZWG4r0nkQtOtwVASwdYeH723o9uTxS/3Ks+ytHk5/R3cI5LqIK2hEDw86XVkb+wV0Z+YiHDnWCjnu4Vj3Ug3DzhDn1NPacTX4HljJ6gFPr5e5RpZ74tFz6l0ezhWk5tFTYJFPEOjrLKxhrEazktWR8zVQ9vEVp1ttLYyplyeANQinN0ydIXBUnAOXR7nsrwAbgatrTbX3nu1s5Ul1oKgIRsZYMR/jy72gY0+u6a8OJMJX1P+C9MsaqDcPAseCHtANQkRTwHIoybZd21qR0Q2k1pZP0tNJSIubLhxJOr75egO/sjbekM/VIe0qY1RDb6p//PYl6/QniO0sF2tI2kBYRpBTgVrUOWqm9DPiGgghW+GWVBGj/UCvEM1E1sWinr4sKfa0/NgedhUwqsVITzvOUTOl6gxv0qmERRw5HOi/bHz2zb3VMHp28hremYQj0rq23QhGwFSQ0ZVPu8NvAfa3Use8kJkI1wzxxRhfDcYDAotrKF0GngYnRA17D599f7KVXcVzmoszLfUi7AxhfBG4GKwFPudhBacnmpfBStDwnzrkrQIhpDW8L3ExJqXV/wBA2Vs4WelquT9Qzy8FvdHnDlKR01RQ8OrJMaAp8TnYQUA7SBsEm6pzPXgcyI6PaCG7Hdu6VcVLUkuE5ONBR8ByDGb42sPGteBPEDcV0vK0ZZ2Z5C9oSCcZKzqfwO8OJK2FbCAunqYmrICRQaA3rLRejSvTWtGwTzc94Yj0DQS/O4C05nQd6VYhrIVMpEN6Wqv3crBngY4b582aR9DXgJCFTPt05T+AtKq2jNARzxLs/UBbnY/0onwLO97sXPuwj8cidQn8OuytAe0edjUyuluqh2vIPcNnPS1rIbOKfkRf0pKEGdqSJyFwM/AZ3j+2JGHXpZDWWf4+sMvlpaTal7e3xLYEsdQ4ITIIsras29AppxrKctRM5ZDRLUvv13GnLl1p5yjellylCb5BolvWkRQMgT6g6apXmnVgPWQrc/1/boJCaHVWyukAAAAASUVORK5CYII=');
  -webkit-mask-size: .86em;
  background-color: #ccc;
  -webkit-mask-repeat: no-repeat;
  margin-top: -0.43em;
}
/* line 462, ../../touch/resources/themes/stylesheets/sencha-touch/default/widgets/_form.scss */
.x-field-search .x-field-input .x-form-field {
  margin-left: 1.0em;
}

/* line 472, ../../touch/resources/themes/stylesheets


ac00\uc5d0": 4, "\uad6c\ud558\ub294": [4, 6, 7, 12, 13, 14, 16], "\ud55c\uad6d\uac70\ub798\uc18c\uc5d0\uc11c": 4, "\ud604\ud669\uacfc": 4, "\uc815\ubcf4\ub370\uc774\ud130\uc2dc\uc2a4\ud15c": 4, "\uae30\ubcf8\ud1b5\uacc4": 4, "\uc138\ubd80\uc548\ub0b4": 4, "12025": 4, "mdc": 4, "mdi": 4, "mdiload": 4, "cmd": 4, "menuid": 4, "mdc0201020506": 4, "12021": 4, "mdc0201020502": 4, "\ub370\uc774\ud130\ub4e4\uc744": 4, "\ud06c\ub864\ub9c1\uc774": [4, 5, 15], "excel": [4, 6], "\ud30c\uc77c\ub85c": [4, 6, 7, 8, 9, 14, 17], "\ub2e4\uc6b4\ub85c\ub4dc\ud558\uace0": 4, "\ube44\ud6a8\uc728\uc801\uc774\uba70": 4, "\uc774\uc6a9\ud55c\ub2e4\uba74": [4, 14], "\ud604\ud669\uc5d0": 4, "f12\ub97c": 4, "\uc5f4\uace0": 4, "\ub204\ub978\ub2e4": [4, 7, 13, 16], "\ud654\uba74\uc758": [4, 19], "\ud0ed\uc5d0\ub294": 4, "\uc0dd\uae34\ub2e4": [4, 12], "\uac70\ub798\uc18c\uc5d0\uc11c": 4, "\uacfc\uc815\uc740": [4, 17], "comm": 4, "filedn": 4, "download_excel": 4, "\ucffc\ub9ac\ub85c": [4, 17], "\ubc1c\uc1a1\ud558\uba74": 4, "otp": 4, "\ubd80\uc5ec\ubc1b\uc740": 4, "otp\ub97c": 4, "\uc81c\ucd9c\ud558\uba74": 4, "\ub2e4\uc6b4\ub85c\ub4dc\ud55c\ub2e4": 4, "1\ubc88": [4, 15], "\ub2e8\uacc4\ub97c": [4, 7, 13], "\uc81c\ucd9c\ud560": 4, "\uc8fc\uc18c\ub2e4": [4, 15], "data\uc5d0\ub294": [4, 11], "\ud56d\ubaa9\ub4e4\uc774": 4, "\uc694\uccad\ud558\uba74": 4, "\ubc1b\uc74c\uc744": 4, "2\ubc88": 4, "\ud56d\ubaa9\uc758": 4, "otp\ub294": 4, "otp\uc5d0": 4, "\ud574\ub2f9\ud55c\ub2e4": [4, 5, 6, 7, 11, 13], "\uc694\uccad\ud558\uba70": 4, "\uc81c\ucd9c": [4, 5], "\ubc1b\uc544\uc624\ub294": 4, "bytesio": [4, 5], "gen_otp_url": 4, "generateotp": 4, "gen_otp_stk": 4, "mktid": 4, "stk": 4, "trddd": 4, "monei": [4, 5, 13], "csvxls_isno": 4, "filedown": 4, "dbm":


 color = MaterialTheme.colorScheme.onSurface)
}
package org.robok.engine.ui.screens.settings.about.models

/*
 * Copyright 2025 Robok.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
import kotlinx.serialization.Serializable
import org.robok.engine.ui.screens.settings.about.components.Role

@Serializable
data class Contributor(
  val login: String = "Name",
  val id: Int = 0,
  val node_id: String = "node",
  val avatar_url: String = "avatar_url",
  val gravatar_id: String = "gravatar_id",
  val url: String = "url",
  val html_url: String = "html_url",
  val followers_url: String = "folowers_url",
  val following_url: String = "following_url",
  val gists_url: String = "gistis_url",
  val starred_url: String = "starred_url",
  val subscriptions_url: String = "subscriptions_url",
  val organizations_url: String = "organizations_url",
  val repos_url: String = "repos_url",
  val events_url: String = "events_url",
  val received_events_url: String = "received_events_url",
  val type: String = "User",
  val site_admin: Boolean = false,
  val contributions: Int = 0,
  val role: String = Role.DEVELOPER,
  val user_view_type: String = "public",
)
package org.robok.engine.templates.xml

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

import org.robok.engine.templates.CodeTemplate

open class BasicXML : CodeTemplate() {

  private var items: MutableList<Pair<String, String>>? = null
  var type: String = "item"
  var key: String = "name"
  val sb = StringBuilder()

  override var name: String = "BasicXML"
  override var packageName: String = "org.robok.empty"
  override var extension: String = ".xml"
  override var code: String = generateCode()

  private fun generateCode(): String {
    sb.clear()
    items?.forEach { (keya, value) -> sb.append(" <$type $key=\"$keya\">$value</$type>\n") }

    return """
      <resources>
        ${sb.toString()}
      </resources>
      """
      .trimIndent()
  }

  override fun regenerate() {
    code = generateCode()
  }

  fun add(keyValue: String, value: String) {
    if (items == null) {
      items = mutableListOf()
    }
    items?.add(Pair(keyValue, value))
  }
}
plugins {
  alias(libs.plugins.agp.lib)
  alias(libs.plugins.kotlin)
  alias(libs.plugins.compose.compiler)
  kotlin("plugin.serialization") version "2.1.10"
}

android {
  namespace = "org.robok.engine.feature.editor"
  compileSdk =


 {
                    next(err);
                    return;
                }

                ctx.instId = res.instId;

                console.log('Resizing disk "%s"', ctx.disk.id);
                next();
            });
        },
        function maybeWait(ctx, next) {
            if (!opts.wait) {
                next();
                return;
            }

            var cloudapi = cli.tritonapi.cloudapi;
            var waiter = cloudapi.waitForDiskResize.bind(cloudapi);

            waiter({
                id: ctx.instId,
                diskId: ctx.disk.id,
                size: size,
                waitTimeout: opts.wait_timeout * 1000
            }, function onDone(err, disk) {
                if (err) {
                    next(err);
                    return;
                }

                if (disk) {
                    var duration = Date.now() - ctx.start;
                    console.log('Resized disk "%s" in %s', disk.id,
                                common.humanDurationFromMs(duration));
                    next();
                    return;
                }

                next(new Error('Failed to resize disk'));
            });
        }
    ]}, cb);
}

do_resize.options = [
    {
        names: ['help', 'h'],
        type: 'bool',
        help: 'Show this help.'
    },
    {
        names: ['dangerous-allow-shrink'],
        type: 'bool',
        help: 'Allows the disk size to be reduced. This will truncate the ' +
              'disk. Any data previously written to the truncated area is ' +
              'permanently lost. Snapshots will not be useful to recover ' +
              'from this operation.'
    },
    {
        names: ['wait', 'w'],
        type: 'bool',
        help: 'Block until instance state indicates the action is complete.'
    },
    {
        names: ['wait-timeout'],
        type: 'positiveInteger',
        default: 120,
        help: 'The number of seconds to wait before timing out with an error. '
            + 'The default is 120 seconds.'
    }
];

do_resize.synopses = ['{{name}} {{cmd}} [OPTIONS] INST DISK SIZE'];

do_resize.help = [
    'Resize a disk for a bhyve instance.',
    '',
    '{{usage}}',
    '',
    '{{options}}'
].join('\n');

do_resize.completionArgtypes = ['tritoninstance', 'none'];

module.exports = do_resize;
/*
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 */

/*
 * Copyright 2016 Joyent, Inc.
 *
 * `triton instance tag ...`
 */

var Cmdln = require('cmdln').Cmdln;
var util = require('util');

// ---- CLI class

function InstanceTagCLI(parent) {
    this.top = parent.top;
    Cmdln.call(this, {
        name: parent.name + ' tag',
        /* BEGIN JSSTYLED */
        desc: [
            'List, get, set and delete tags on Triton instances.'
        ].join('\n'),
        /* END JSSTYLED */
        helpOpts: {
            minHelpCol: 24 /* line up with option help */
        },
        helpSubcmds: [
            'help',
            'list',
            'get',
            'set',


o.InvariantCulture) + " Y=" + this.Y.ToString(CultureInfo.InvariantCulture) + "]");
        }

        public PrinterResolutionKind Kind
        {
            get
            {
                return this.kind;
            }
            set
            {
                if (!System.Drawing.ClientUtils.IsEnumValid(value, (int) value, -4, 0))
                {
                    throw new InvalidEnumArgumentException("value", (int) value, typeof(PrinterResolutionKind));
                }
                this.kind = value;
            }
        }

        public int X
        {
            get
            {
                return this.x;
            }
            set
            {
                this.x = value;
            }
        }

        public int Y
        {
            get
            {
                return this.y;
            }
            set
            {
                this.y = value;
            }
        }
    }
}


_sz;
        CABuf< T >::cl_own_ = true;
        CABuf< T >::flags_ = _flags;

        return(ret);
    }

    int create(size_t _sz, uint _flags)
    {
        create(0, _sz, _flags);
    }

    T * & getSysMem(void) override
    {
        if (!CABuf< T >::sys_ptr_)
        {
            CABuf< T >::sys_ptr_ = m_base.getSysMem();
                                                     //todo: investigate retcode usage
            AMF_RETURN_IF_FALSE(CABuf< T >::sys_ptr_ != nullptr, CABuf< T >::sys_ptr_, L"Internal error: subbuffer's parent failed to allocate system memory");
            CABuf< T >::sys_ptr_ += m_offset;
        }

        return CABuf< T >::sys_ptr_;
    }
protected:
    cl_mem base_buf_;
    size_t m_offset;
    CABuf<T> &m_base;
};

};

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

#include "Utilities.h"
#include "GraalConv_clFFT.hpp"
#include "GraalCLUtil/GraalUtil.hpp"
#include "GraalConvOCL.hpp"
#include "../common/OCLHelper.h"
#include "OclKernels/CLKernel_amdFFT_conv_kernels.h"

#include <iostream>
#include <fstream>
#include <string>
#include <math.h>
#include <algorithm>

//to allow std::min usage
#ifdef min
#undef min
#endif

#ifndef AMF_RETURN_IF_FALSE
  #define AMF_RETURN_IF_FALSE(exp, ret_value, /*optional message,*/ ...)
#endif

#if defined DEFINE_AMD_OPENCL_EXTENSION
    #ifndef CL_MEM_USE_PERSISTENT_MEM_AMD
        #define CL_MEM_USE_PERSISTENT_MEM_AMD       (1 << 6)
    #endif
#endif

const int debug = 0;
const int debug_octave = 0;
const char testName[] = "test1";
//The clFFT supports the Hermitian data format which stores a transformed real FFT in
//about half the space (N/2 + 1) as there duplicate, but I ran into accuracty issues
const bool use_hermitian = false;

namespace graal
{

#if _MSC_VER <= 1800
    static double log2(double n)
    {
        // log(n)/log(2) is log2.
        return log(n) / log(2.);
    }
#endif

CGraalConv_clFFT::CGraalConv_clFFT()
{
}

CGraalConv_clFFT::~CGraalConv_clFFT()
{
    cleanup();
}

void CGraalConv_clFFT::


- $= true \; E_1 \; E_2$
- $= (\lambda x \; y . x) \; E_1 \; E_2$
- $= E_1$

And basic logic functions:

$not \;p \equiv if \; p \; then \; false \; else \; true$

$p \; and \; q \equiv if \; p \; then \; q \; else \; false$

$p \; or \; q \equiv if \; p \; then \; true \; else \; q$

---

### Pairs

$(E_1, E_2) \equiv \lambda f . f \; E_1 \; E_2$

$fst \;p \equiv p \; true$

$snd  \;p \equiv p \; false$

How it works:

- $fst \; (p, q) = (p, q) \; true$
- $= (\lambda f . f \; p \; q) \; true$
- $= true \; p \; q$
- $= p$

---

### Natural Numbers

$n \equiv \lambda f \; x . f^n \; x$

- $0 = \lambda f \; x . x$
- $1 = \lambda f \; x . f \; x$
- $2 = \lambda f \; x . f \; (f \; x) = \lambda f \; x . f^2 \; x$

And some arithmetic functions:

$SUC \equiv \lambda n \; f \; x . n \; f \; (f \; x)$

$ISZERO \; n \equiv n \; (\lambda x . false) \; true$

$m + n \equiv \lambda f \; x . m \; f \; (n \; f \; x)$

$m * n \equiv \lambda f \; x . m \; (n \; f) \; x$

$PREFN \equiv \lambda f \; p . (false, if \; fst \; p \; then \; snd \; p \; else \; f \; (snd \; p))$

$PRE \;n \equiv \lambda f \; x . snd \; (n, (PREFN \; f) \; (true, x))$

---

### Recursive functions

$Y \equiv \lambda f . (\lambda x . f \; (x \; x)) (\lambda x . f \; (x \; x))$

How it works:

- $Y \; f = (\lambda f . (\lambda x . f \; (x \; x)) (\lambda x . f(x \; x)))$
- $= (\lambda x . f \; (x \; x))(\lambda x . f \; (x \; x))$
- $= f \; ((\lambda x . f \; (x \; x))(\lambda x . f \; (x \; x)))$
- $= f \; (Y \; f)$

---

### Fac


Name
		}
		nodesWithMons[mon.NodeName] = mon.DaemonName

		// assign the current mon as the fallback mon
		arbitraryMon = mon.DaemonName
	}

	logger.Infof("removing arbitrary extra mon %q", arbitraryMon)
	return arbitraryMon
}

func (c *Cluster) findExtraMonToRemoveFromStretchCluster(mons []*monConfig) string {
	// Build the count of current mons per zone
	zoneCount := map[string]int{}
	monInZones := map[string]string{}
	for _, m := range mons {
		if m.Zone == "" {
			logger.Warningf("zone not found on mon %q", m.DaemonName)
			continue
		}
		zoneCount[m.Zone]++
		// We just need the name of one of the mons in the zone in case there are extra
		monInZones[m.Zone] = m.DaemonName
	}

	// Find a zone that has too many mons
	for _, zone := range c.spec.Mon.StretchCluster.Zones {
		count, ok := zoneCount[zone.Name]
		if !ok {
			// The zone isn't currently assigned to any mon, so skip it
			continue
		}
		if zone.Arbiter {
			if count > 1 {
				logger.Infof("removing extra mon %q in arbiter zone %q", monInZones[zone.Name], zone.Name)
				return monInZones[zone.Name]
			}
		} else {
			if count > 2 {
				logger.Infof("removing extra mon %q in zone %q", monInZones[zone.Name], zone.Name)
				return monInZones[zone.Name]
			}
		}
	}
	return ""
}

// failMon compares the monCount against desiredMonCount
// Returns whether the failover request was attempted. If false,
// the operator should check for other mons to failover.
func (c *Cluster) failMon(monCount, desiredMonCount int, name string) bool {
	// make sure the failed mon is marked out of quorum
	if _, err := c.trackMonInOrOutOfQuorum(name, false); err != nil {
		logger.Errorf("failed to track failed mon %q. %v", name, err)
	}

	if monCount > desiredMonCount {
		// no need to create a new mon since we have an extra
		if err := c.removeMon(name); err != nil {
			logger.Errorf("failed to remove mon %q. %v", name, err)
		}
		return true
	}

	// prevent any voluntary mon drain while failing over
	if err := c.blockMonDrain(types.NamespacedName{Name: monPDBName, Namespace: c.Namespace}); err != nil {
		logger.Errorf("failed to block mon drain. %v", err)
	}

	// bring up a new mon to replace the unhealthy mon
	if err := c.failoverMon(name); err != nil {
		logger.Errorf("failed to failover mon %q. %v", name, err)
	}

	// allow any voluntary mon drain after failover
	if err := c.allowMonDrain(types.NamespacedName{Name: monPDBName, Namespace: c.Namespace}); err != nil {
		logger.Errorf("failed to allow mon drain. %v", err)
	}
	return true
}

func (c *Cluster) removeOrphanMonResources() {
	if c.spec.Mon.VolumeClaimTemplate == nil {
		logger.Debug("skipping check for orphaned mon pvcs since using the host path")
		return
	}

	logger.Info("checking for orphaned mon resources")

	opts := metav1.ListOptions{LabelSelector: fmt.Sprintf("%s=%s", k8sutil.AppAttr, AppName)}
	pvcs, err := c.context.Clientset.CoreV1().PersistentVolumeClaims(c.Namespace).List(c.ClusterInfo.Context, opts)
	if err != nil {
		logger.Infof("failed to check for orphaned


WithTag("kind", "success"))
	initDurationDist(&f.failureTimes, key.WithTag("kind", "failure"))
}

// NewFuncStats creates a FuncStats
func NewFuncStats(key SeriesKey) (f *FuncStats) {
	f = &FuncStats{}
	initFuncStats(f, key)
	return f
}

// Reset resets all recorded data.
func (f *FuncStats) Reset() {
	atomic.StoreInt64(&f.current, 0)
	atomic.StoreInt64(&f.highwater, 0)
	f.parentsAndMutex.Lock()
	f.errors = make(map[string]int64, len(f.errors))
	f.panics = 0
	f.successTimes.Reset()
	f.failureTimes.Reset()
	f.parentsAndMutex.Unlock()
}

func (f *FuncStats) start(parent *Func) {
	f.parentsAndMutex.Add(parent)
	current := atomic.AddInt64(&f.current, 1)
	for {
		highwater := atomic.LoadInt64(&f.highwater)
		if current <= highwater ||
			atomic.CompareAndSwapInt64(&f.highwater, highwater, current) {
			break
		}
	}
}

func (f *FuncStats) end(err error, panicked bool, duration time.Duration) {
	atomic.AddInt64(&f.current, -1)
	f.parentsAndMutex.Lock()
	if panicked {
		f.panics += 1
		f.failureTimes.Insert(duration)
		f.parentsAndMutex.Unlock()
		return
	}
	if err == nil {
		f.successTimes.Insert(duration)
		f.parentsAndMutex.Unlock()
		return
	}
	f.failureTimes.Insert(duration)
	f.errors[getErrorName(err)] += 1
	f.parentsAndMutex.Unlock()
}

// Current returns how many concurrent instances of this function are currently
// being observed.
func (f *FuncStats) Current() int64 { return atomic.LoadInt64(&f.current) }

// Highwater returns the highest value Current() would ever return.
func (f *FuncStats) Highwater() int64 { return atomic.LoadInt64(&f.highwater) }

// Success returns the number of successes that have been observed
func (f *FuncStats) Success() (rv int64) {
	f.parentsAndMutex.Lock()
	rv = f.successTimes.Count
	f.parentsAndMutex.Unlock()
	return rv
}

// Panics returns the number of panics that have been observed
func (f *FuncStats) Panics() (rv int64) {
	f.parentsAndMutex.Lock()
	rv = f.panics
	f.parentsAndMutex.Unlock()
	return rv
}

// Errors returns the number of errors observed by error type. The error type
// is determined by handlers from AddErrorNameHandler, or a default that works
// with most error types.
func (f *FuncStats) Errors() (rv map[string]int64) {
	f.parentsAndMutex.Lock()
	rv = make(map[string]int64, len(f.errors))
	for errname, count := range f.errors {
		rv[errname] = count
	}
	f.parentsAndMutex.Unlock()
	return rv
}

func (f *FuncStats) parents(cb func(f *Func)) {
	f.parentsAndMutex.Iterate(cb)
}

// Stats implements the StatSource interface
func (f *FuncStats) Stats(cb func(key SeriesKey, field string, val float64)) {
	cb(f.key, "current", float64(f.Current()))
	cb(f.key, "highwater", float64(f.Highwater()))

	f.parentsAndMutex.Lock()
	panics := f.panics
	errs := make(map[string]int64, len(f.errors))
	for errname, count := range f.errors {
		errs[errname


height)))  # добавление прямоугольника в список рисунка

    draw_painting(painting)  # отрисовка рисунка

    # отрисовка курсора кисти, если выбран инструмент "кисть"
    if mouse[1] > 70 and current_tool == 'brush':
        pygame.draw.circle(screen, active_color, mouse, active_size)

    # отрисовка меню и получение списка кнопок и соответствующих значений цветов
    brushes, colors, rgbs = draw_menu(active_color, active_size)

    # обработка событий
    for event in pygame.event.get():
        if event.type == pygame.QUIT:  # если событие - выход из программы
            running = False  # завершение игрового цикла

        if event.type == pygame.MOUSEBUTTONDOWN:  # если нажата кнопка мыши
            for i in range(len(brushes)):  # проверка каждой кнопки изменения размера кисти
                if brushes[i].collidepoint(event.pos):  # если нажата кнопка изменения размера кисти
                    active_size = 20 - (i * 5)  # изменение размера кисти в зависимости от выбранной кнопки

            for i in range(len(colors)):  # проверка каждой кнопки выбора цвета
                if colors[i].collidepoint(event.pos):  # если нажата кнопка выбора цвета
                    if rgbs[i] is not None:  # если выбран цвет из заданного набора
                        active_color = rgbs[i]  # установка активного цвета
                    else:  # если выбран инструмент
                        if i == len(colors) - 2:  # если выбран инструмент "круг"
                            current_tool = 'circle'  # установка текущего инструмента "круг"
                        elif i == len(colors) - 1:  # если выбран инструмент "прямоугольник"
                            current_tool = 'rectangle'  # установка текущего инструмента "прямоугольник"

    pygame.display.flip()  # обновление экрана

pygame.quit()  # выход из pygame


_MASK));
    menuOtro.add( menuItem);

    ButtonGroup group = new ButtonGroup();
    JRadioButtonMenuItem rbMi = new JRadioButtonMenuItem( "Cats", true);
    rbMi.setMnemonic( KeyEvent.VK_G);
    group.add( rbMi);
    menuOtro.add( rbMi);

    rbMi = new JRadioButtonMenuItem( "Dogs");
    rbMi.setMnemonic( KeyEvent.VK_P);
    rbMi.setAccelerator( KeyStroke.getKeyStroke( KeyEvent.VK_P, ActionEvent.CTRL_MASK));
    group.add( rbMi);
    menuOtro.add( rbMi);

    rbMi = new JRadioButtonMenuItem( "Birds", true);
    rbMi.setEnabled( false);
    rbMi.setMnemonic( KeyEvent.VK_E);
    group.add( rbMi);
    menuOtro.add( rbMi);

    rbMi = new JRadioButtonMenuItem( "Elephants");
    rbMi.setEnabled( false);
    rbMi.setMnemonic( KeyEvent.VK_V);
    rbMi.setAccelerator( KeyStroke.getKeyStroke( KeyEvent.VK_V, ActionEvent.CTRL_MASK));
    group.add( rbMi);
    menuOtro.add( rbMi);

    menuOtro.addSeparator();

    JCheckBoxMenuItem cbMi = new JCheckBoxMenuItem( "Eat", true);
    cbMi.setMnemonic( KeyEvent.VK_C);
    menuOtro.add( cbMi);

    cbMi = new JCheckBoxMenuItem( "Drink", false);
    cbMi.setMnemonic( KeyEvent.VK_B);
    cbMi.setAccelerator( KeyStroke.getKeyStroke( KeyEvent.VK_B, ActionEvent.CTRL_MASK));
    menuOtro.add( cbMi);

    cbMi = new JCheckBoxMenuItem( "Walk", true);
    cbMi.setEnabled( false);
    cbMi.setMnemonic( KeyEvent.VK_R);
    menuOtro.add( cbMi);

    cbMi = new JCheckBoxMenuItem( "Look", false);
    cbMi.setEnabled( false);
    cbMi.setMnemonic( KeyEvent.VK_M);
    cbMi.setAccelerator( KeyStroke.getKeyStroke( KeyEvent.VK_M, ActionEvent.CTRL_MASK));
    menuOtro.add( cbMi);

    menuOtro.addSeparator();

    JMenu submenu = new JMenu( "A submenu");
    submenu.setMnemonic( KeyEvent.VK_S);

    menuItem = new JMenuItem( "An item in the submenu");
    menuItem.setAccelerator( KeyStroke.getKeyStroke( KeyEvent.VK_2, ActionEvent.ALT_MASK));
    submenu.add( menuItem);

    menuItem = new JMenuItem( "Another item");
    submenu.add( menuItem);

    menuItem = new JMenuItem( "Not enabled");
    menuItem.setEnabled( false);
    submenu.add( menuItem);

    menuItem = new JMenuItem( "Not enabled, too");
    menuItem.setAccelerator( KeyStroke.getKeyStroke( KeyEvent.VK_3, ActionEvent.ALT_MASK));
    menuItem.setEnabled( false);
    submenu.add( menuItem);

    menuOtro.add( submenu);

    JMenu masMenus = new JMenu( "Not enabled");
    masMenus.setEnabled( false);

    menuBar.add( masMenus);
  }

  private void hazConfig() {
    // Para abrir y guardar
    tNomFich = new JTextField( 20);
    tNomFich.setEditable( false);

    bOpen = new JButton( "Open");
    bOpen.a


9.set_ylim([0, 3])

    ax9.set_xlabel('Distance (m)')
    ax9.set_ylabel('m')
    '''

    # ============================================== #

    mapInitialVegetation = ax4.imshow(np_array_initial_vegetation_normalized, cmap="Greens", interpolation='nearest', vmin=0, vmax=255)

    # ============================================== #

    mapVegetation = ax6.imshow(np_array_vegetation_normalized, cmap="Greens", interpolation='nearest', vmin=0, vmax=255)

    # ============================================== #

    mapInitialYoung = ax7.imshow(np_array_initial_young_normalized, cmap='Blues', interpolation='nearest', vmin=0, vmax=255)

    # ============================================== #

    mapHeightAccumulation = ax8.imshow(np_array_height_accumulation_normalized, cmap="Blues", interpolation='nearest', vmin=0, vmax=255)

    # ============================================== #

    # TODO: Set min (YoungGround) and max (YoungGround + 1*YoungVegetation) values automatically
    """UNCOMMENT"""
    if idx % 20 == 0: # 20
        plt.savefig(dirData + str(idx) + ".png")  # save the figure to file

    # ---------------------------------------------------------------------------------------------

    # Stack the arrays into a single array
    """UNCOMMENT"""

    input_array = np.dstack((np_array_pressure_normalized,
                             np_array_initial_vegetation_normalized,
                             np_array_initial_young_normalized))

    """UNCOMMENT"""

    output_array = np.dstack((np_array_height_compression_normalized,
                              np_array_vegetation_normalized,
                              np_array_height_accumulation_normalized))

    # Save the images
    """UNCOMMENT"""

    dirRGB = r'frames/Review/SimulatorData-1/TestData-1/RGB/'  # TODO --- CHANGE! ---
    if not os.path.exists(dirRGB):
        os.makedirs(dirRGB)

    # USING IMAGEIO
    # input_array = (input_array * 65535).astype(np.uint16)
    # output_array = (output_array * 65535).astype(np.uint16)
    # input_array = (65535 * (input_array - input_array.min()) / input_array.ptp()).astype(np.uint16)
    # output_array = (65535 * (output_array - output_array.min()) / output_array.ptp()).astype(np.uint16)
    # imageio.imwrite(dirRGB + str(idx) + "-input.png", input_array, prefer_uint8=False)
    # imageio.imwrite(dirRGB + str(idx) + "-output.png", output_array, prefer_uint8=False)

    # USING PILLOW
    # Convert the numpy array to a PIL Image object with int16

    # input_image = Image.fromarray(np.uint8(input_array * 255))

    """UNCOMMENT"""

    input_image = Image.fromarray(np.uint8(input_array))

    # output_image = Image.fromarray(np.uint8(output_array * 255))

    """UNCOMMENT"""

    output_image = Image.fromarray(np.uint8(output_array))

    """UNCOMMENT"""

    input_image.save(dirRGB + str(idx) + "-input.png")
    output_image.save(dirRGB + str(idx) + "-output.png")

    # Fourth, animate
    '''
    if idx % 20 == 0:
        fig.tight_layout()
        plt.show()
    '''

    # Pause
    # Try reducing sleep time to 0.01 to see how blazingly fast it communicates
    # In the real world usage, you just need to replace time.sleep() with
    # whatever work you want python to do, maybe a machine learning task?
    time.sleep(1)


erviceInfo: NsdServiceInfo, errorCode: Int) {
    // Called when the resolve fails. Use the error code to debug.
    Timber.e("Resolve failed: $errorCode")
  }

  override fun onServiceResolved(serviceInfo: NsdServiceInfo) {
    if ((serviceInfo.attributes["id"] != null && serviceInfo.attributes["id"]!!.isNotEmpty())) {
      Timber.d(
          "Resolve Succeeded\n" +
              "    Host Service Name: ${serviceInfo.serviceName}\n" +
              "                   ID: ${
          BaseEncoding.base16().encode(serviceInfo.attributes["id"]?.let { it })
        }\n" +
              "                   NN: ${serviceInfo.attributes["nn"]?.let { String(it) }}\n" +
              "                   IP: ${serviceInfo.host.hostAddress}\n")
      resolvedDevices.add(serviceInfo)
    } else {
      Timber.e("Resolve failed")
    }
  }
}
/*
 * Copyright 2024 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.google.homesampleapp.screens.common

import android.text.method.LinkMovementMethod
import androidx.compose.material3.AlertDialog
import androidx.compose.material3.Text
import androidx.compose.material3.TextButton
import androidx.compose.runtime.Composable
import androidx.compose.ui.viewinterop.AndroidView
import androidx.core.text.HtmlCompat
import com.google.android.material.textview.MaterialTextView
import timber.log.Timber

// Information used for [MsgAlertDialog].
data class DialogInfo(
  val title: String?,
  val message: String?,
  val showConfirmButton: Boolean = true,
)

// Useful dialog that can display title, message, and confirm button.
@Composable
fun MsgAlertDialog(dialogInfo: DialogInfo?, onDismissMsgAlertDialog: () -> Unit) {
  Timber.d("MsgAlertDialog [$dialogInfo]")
  if (dialogInfo == null) return

  AlertDialog(
    title = {
      if (!dialogInfo.title.isNullOrEmpty()) {
        Text(dialogInfo.title)
      }
    },
    text = {
      if (!dialogInfo.message.isNullOrEmpty()) {
        Text(dialogInfo.message)
      }
    },
    confirmButton = {
      if (dialogInfo.showConfirmButton) {
        TextButton(onClick = onDismissMsgAlertDialog) { Text("OK") }
      }
    },
    onDismissRequest = {},
    dismissButton = {},
  )
}

@Composable
fun HtmlInfoDialog(title: String, htmlInfo: String, onClick: () -> Unit) {
  val htmlText = HtmlCompat.fromHtml(htmlInfo, HtmlCompat.FROM_HTML_MODE_LEGACY)
  AlertDialog(
    title = { Text(text = title) },
    text = {
      // See https://developer.android.com/codelabs/jetpack-compose-migration
      AndroidView(
        update = { it.text = htmlText },
        factory = {
          MaterialTextView(it).apply { movementMethod = LinkMovementMethod.getInstance() }
        },
      )
    },
    confirmButton = { TextButton(onClick = onClick) { Text("OK") } },
    onDismissRequest = {},
    dismissButton = {},
  )
}
/*
 * Copyright 2022 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at


lyric-page-open #root header{transition:opacity .25s ease-in-out;pointer-events:none;opacity:0}body.amll-lyric-page-open footer{bottom:100%}body.amll-lyric-page-open footer>*>*>*{transition:opacity .25s ease-in-out;opacity:0}body.amll-lyric-page-open #page_pc_main_nav{pointer-events:none;transition:opacity .25s ease-in-out;opacity:0}body.amll-lyric-page-open #amll-view{top:0vh;border-radius:0}.am-music-progress-control{display:flex;flex-direction:column;transition:margin-top .25s;margin-top:.8vh}@media screen and (max-height: 900px){.am-music-progress-control{margin-top:1.5vh}}.am-music-progress-tips{display:flex;margin-top:8px;font-weight:400;opacity:.3;align-items:center;justify-content:center;font-size:.55em;letter-spacing:.5px}@media screen and (max-height: 768px){.am-music-progress-tips{margin-top:.5vh}}.am-music-progress-tips>*{flex:0;height:fit-content}.am-music-progress-tips>*:first-child{flex:1}.am-music-progress-tips>*:last-child{flex:1;text-align:right}.am-music-progress-tips .am-music-quality{transform:translateY(1px);opacity:1}.lyric-player-horizonal{display:grid;width:100%;height:100%;position:relative;grid-template-rows:[drag-area] minmax(30px,1fr) [thumb] auto [cover] auto [music-info] 3fr 1fr;grid-template-columns:[info-side] .85fr [player-side] 1fr;gap:8px;transition:.5s ease-in-out;left:0%}.lyric-player-horizonal.no-lyric{left:27.027027027%}.lyric-player-horizonal.no-lyric .amll-lyric-player-wrapper{transition:opacity .5s cubic-bezier(.5,0,.5,1),transform .5s cubic-bezier(.5,0,.5,1);opacity:0;animation:amll-hide-lyric .5s step-end forwards}@keyframes animation{0%{display:inherit}to{display:none}}.lyric-player-horizonal .amll-control-thumb{grid-column:info-side;grid-row:thumb;margin:2vh}.lyric-player-horizonal .amll-lyric-player-wrapper{position:relative;transition:opacity .5s .5s cubic-bezier(.5,0,.5,1);display:inherit;opacity:1;grid-column:player-side;grid-row:1/7;width:100%;height:100%;font-weight:600;box-sizing:border-box;padding-right:10%;mix-blend-mode:var(--amll-lyric-mix-blend-mode, plus-lighter);display:flex;flex-direction:column;justify-content:center;align-items:center;gap:16px;mask-image:linear-gradient(to bottom,transparent 5%,white 20%,white 80%,transparent 95%);-webkit-mask-image:linear-gradient(to bottom,transparent 5%,white 20%,white 80%,transparent 95%)}.lyric-player-horizonal .amll-lyric-player-wrapper>*{mix-blend-mode:var(--amll-lyric-mix-blend-mode, plus-lighter)}.lyric-player-horizonal .amll-lyric-player-wrapper.load-status{opacity:.5}.lyric-player-horizonal .amll-music-info{grid-column:info-side;grid-row:music-info;max-width:min(50vh,40vw);width:min(50vh,40vw);justify-self:center;mix-blend-mode:v


import numpy as np

def initialize_solutions(pop_size, dim, lb, ub):
    population = np.random.rand(pop_size, dim) * (ub - lb) + lb
    return population