Detener la rotación de partículas

Here you can stop the rotation of the particles based in age or speed

// Define when the slowdown starts and how long it takes to stop
float start_age = 1.0;  // Starts slowing down at 1 second old
float duration = 1.5;   // Takes 1.5 seconds to fully stop

if (@age > start_age) {
    // Calculate a 0 to 1 ramp based on age
    float factor = (@age - start_age) / duration;
    factor = clamp(factor, 0.0, 1.0);
    
    // Smooth the transition (optional but looks better)
    factor = smooth(0.0

AllineamentoPermessiBoNew

use [Boscolo_TravelPlace]
use [Boscolo_TravelPlace_DEV]
use [Cartorange_TravelPlace]
use [FT_TravelPlace]
use [Futura_TravelPlace]
use [Glamour_TravelPlace]
use [Going_TravelPlace]
use [Mind3_TravelPlace]
use [Mind3_TravelPlace_TEST]
use [Nicolaus_TravelPlace]
use [PT_TravelPlace]

insert into dbo.Permissions_MenuItems_Profili (IDPermission, IDMenuItem, IDProfilo)
SELECT 
	--mi.Label,
    --mi.Url,
	--p.Name,
	--p.Description,
    src.IDPermission,
    src.IDMenuItem,
    src

ContrastiveCounterfactualLow

Worked for 7s ContrastiveCounterfactualLow Multimodal Future Tactile Response Prediction for Human-Centered Material Interaction Modeling Overview ContrastiveCounterfactualLow is a multimodal learning framework for predicting future tactile responses during physical interaction. The model receives: One synchronized RGB observation A sequence of historical GelSight tactile frames A normalized contact position It then predicts the subsequent tactile sequence. The framework combines multimodal contrastive alignment, latent future-state modeling, low-rank representation learning, and counterfactual regularization to generate accurate and computationally efficient tactile predictions. Key Features Multimodal RGB, tactile, and spatial information processing Future GelSight tactile sequence prediction Contrastive visual-tactile representation alignment Counterfactual latent future-state projection Low-rank structural compression End-to-end model training Object-level evaluation on unseen test objects Support for the VisGel and Touch and Go datasets Model Architecture ContrastiveCounterfactualLow consists of three main components. Contrastive Structure Matcher The Contrastive Structure Matcher learns aligned representations from visual observations, historical tactile sequences, and contact-position information. It includes: A visual encoder for the RGB observation A tactile encoder for the historical tactile sequence A positional encoder for the contact coordinates A contrastive alignment module A multimodal fusion network Synchronized visual-spatial and tactile representations are treated as positive pairs, while representations from different interaction samples are treated as negative pairs. Counterfactual State Projector The Counterfactual State Projector estimates a latent transition from the current interaction state to a plausible future interaction state. During training, the projected future state is aligned with a latent representation encoded from the ground-truth future tactile sequence. A regularization term constrains the magnitude of the latent transition and prevents unstable or unnecessary changes. In this project, the term “counterfactual” refers to a learned latent alternative to the currently observed interaction state. The method does not require causal graphs, intervention labels, or externally annotated counterfactual samples. Low-Rank Structure Mapper The Low-Rank Structure Mapper reduces redundant information in the projected latent state through a learnable bottleneck. The default dimensions are: Shared latent dimension: 256 Low-rank dimension: 64 A reconstruction objective is used to preserve the principal interaction structure while compressing the latent representation. Training Objective The complete model is trained using a weighted combination of five objectives: Future tactile prediction loss Contrastive alignment loss Future-state alignment loss Low-rank reconstruction loss Counterfactual transition regularization The total objective is defined as: L_total = L_pred + lambda_con × L_con + lambda_state × L_state + lambda_low × L_low + lambda_cr × L_cr Task Definition The default task configuration uses: One synchronized RGB image Five historical tactile frames One normalized two-dimensional contact position Five future tactile frames as prediction targets An image resolution of 128 × 128 The model directly generates the complete five-frame tactile sequence without online adaptation or access to intermediate ground-truth frames. Datasets VisGel VisGel is a large-scale vision-touch benchmark collected using synchronized RGB cameras and GelSight tactile sensors. Each interaction sample contains visual observations, tactile sequences, and contact-location information. Touch and Go Touch and Go is a vision-touch dataset collected during real-world human exploration. It provides synchronized RGB observations, GelSight tactile sequences, and contact information. Dataset Split Both datasets use an object-level partition: 70% training 15% validation 15% testing All interaction sequences belonging to the same object are assigned to only one subset. Objects in the test set are therefore not observed during training. Data Preprocessing The default preprocessing pipeline includes: Removing incomplete or corrupted samples Synchronizing RGB, tactile, and contact data Resizing RGB and tactile images to 128 × 128 Normalizing image values to the range [-1, 1] Normalizing contact coordinates Constructing sequences with a sliding-window stride of one frame Training-only data augmentation includes: Random horizontal flipping Random cropping RGB color jittering Geometric transformations should be applied consistently to RGB images, tactile frames, and contact coordinates. Reported Performance VisGel Results Method PSNR ↑ SSIM ↑ LPIPS ↓ FVD ↓ Persistence 22.34 0.768 0.186 167.4 ConvLSTM 24.87 0.818 0.147 129.5 SVG-LP 25.43 0.831 0.136 118.9 VisGel 26.28 0.851 0.118 102.7 SimVP 26.71 0.858 0.111 94.3 MCVD 27.43 0.874 0.094 79.6 ContrastiveCounterfactualLow 28.14 0.886 0.086 71.8 Touch and Go Results Method PSNR ↑ SSIM ↑ LPIPS ↓ FVD ↓ Persistence 20.76 0.712 0.223 214.8 ConvLSTM 23.12 0.773 0.174 158.6 SVG-LP 23.67 0.789 0.161 145.2 VisGel 24.21 0.803 0.149 133.7 SimVP 24.68 0.815 0.137 121.4 MCVD 25.36 0.831 0.123 108.9 ContrastiveCounterfactualLow 26.02 0.845 0.112 97.6 Compared with the strongest baseline, the proposed framework reports: A 9.8% reduction in FVD on VisGel A 10.4% reduction in FVD on Touch and Go Computational Efficiency Method Parameters (M) ↓ FLOPs (G) ↓ Persistence 0.0 0.02 ConvLSTM 21.4 52.8 SVG-LP 34.7 78.5 VisGel 28.9 61.2 SimVP 12.6 34.9 MCVD 124.3 312.6 ContrastiveCounterfactualLow 18.7 42.1 Compared with MCVD, ContrastiveCounterfactualLow uses approximately: 85.0% fewer parameters 86.5% fewer FLOPs Default Configuration Setting Value Historical tactile frames 5 Predicted tactile frames 5 Image resolution 128 × 128 Shared latent dimension 256 Low-rank dimension 64 Optimizer AdamW Initial learning rate 1e-4 Weight decay 1e-5 Batch size 64 Maximum epochs 100 Warm-up period 5 epochs Learning-rate schedule Cosine annealing Gradient clipping Maximum norm of 1.0 Prediction-head dropout 0.5 Early-stopping patience 10 epochs Model-selection metric Validation FVD Independent runs 5 Environment The reported experiments use: Ubuntu 22.04 LTS PyTorch 2.2.1 CUDA 12.1 cuDNN 9.0 torchvision 0.17 NumPy 1.26 OpenCV 4.9 SciPy 1.11 NVIDIA A100 GPU with 40 GB memory Installation git clone https://github.com/YOUR_USERNAME/YOUR_REPOSITORY.git cd YOUR_REPOSITORY python -m venv .venv source .venv/bin/activate pip install --upgrade pip pip install -r requirements.txt Suggested Project Structure . ├── configs/ │ ├── visgel.yaml │ └── touch_and_go.yaml ├── datasets/ ├── models/ │ ├── encoders.py │ ├── contrastive_structure_matcher.py │ ├── counterfactual_state_projector.py │ ├── low_rank_structure_mapper.py │ └── model.py ├── losses/ ├── metrics/ ├── scripts/ ├── train.py ├── evaluate.py ├── requirements.txt └── README.md Usage The following commands are templates and should be updated according to the final implementation. Train on VisGel python train.py --config configs/visgel.yaml Train on Touch and Go python train.py --config configs/touch_and_go.yaml Evaluate a Checkpoint python evaluate.py \ --config configs/visgel.yaml \ --checkpoint checkpoints/best.pt Evaluation Metrics The project evaluates model performance using: PSNR for pixel-level reconstruction fidelity SSIM for structural similarity LPIPS for perceptual similarity FVD for sequence-level quality and temporal consistency Parameter count for model size FLOPs for computational cost Higher PSNR and SSIM values indicate better performance. Lower LPIPS and FVD values indicate better performance. Reproducibility The reported experiments use five random seeds: 2026 2027 2028 2029 2030 For each run: Keep the object-level dataset split fixed. Select hyperparameters using the validation set only. Select the checkpoint with the lowest validation FVD. Evaluate the selected checkpoint on the test set. Report the mean and standard deviation across all runs. Ablation Study The main ablation experiments remove one component at a time: Contrastive Structure Matcher Counterfactual State Projector Low-Rank Structure Mapper Counterfactual Regularization The reported experiments show that all four components contribute to the final performance. The largest performance degradation occurs when the Counterfactual State Projector is removed, indicating that latent future-state modeling is particularly important for tactile sequence prediction. Limitations The current study has several limitations: Evaluation is restricted to two vision-touch datasets. The prediction horizon is fixed at five frames. Robustness is evaluated using only one Gaussian-noise setting. Longer and variable-length tactile prediction is not evaluated. Broad cross-dataset generalization remains unexplored. Future work may investigate longer prediction horizons, variable-length generation, additional datasets, and robustness under more diverse sensor disturbances. Citation Publication information should be updated after the final paper is published. @article{fan_contrastivecounterfactuallow, title = {Bio-Inspired Material Interaction Modeling for Human-Centered Product Design via Multimodal Future Tactile Response Prediction}, author = {Fan, WenYu and Wu, WenYunJie and Zheng, YiFeng and Zhang, JiaLong and Lu, DaYuan and Hu, RongKun}, journal = {Manuscript}, year = {TBD} } License Add an open-source license before publishing the repository. Common options include: MIT License Apache License 2.0 BSD 3-Clause License Acknowledgments This project builds on research in vision-touch learning, GelSight sensing, multimodal representation learning, video prediction, contrastive learning, and low-rank representation learning. The repository description and reported experimental details are based on the uploaded manuscript.
# model.py

from __future__ import annotations

from dataclasses import dataclass
from typing import Dict, Optional, Tuple

import torch
import torch.nn as nn
import torch.nn.functional as F
from torch import Tensor


@dataclass
class ModelConfig:
    image_channels: int = 3
    history_length: int = 5
    prediction_length: int = 5
    image_size: int = 128

    latent_dim: int = 256
    low_rank_dim: int = 64
    base_channels: int = 32

    contrastive_temperature: flo

3501. Maximize Active Section with Trade II

You are given a binary string s of length n, where: '1' represents an active section. '0' represents an inactive section. You can perform at most one trade to maximize the number of active sections in s. In a trade, you: Convert a contiguous block of '1's that is surrounded by '0's to all '0's. Afterward, convert a contiguous block of '0's that is surrounded by '1's to all '1's. Additionally, you are given a 2D array queries, where queries[i] = [li, ri] represents a substring s[li...ri]. For each query, determine the maximum possible number of active sections in s after making the optimal trade on the substring s[li...ri]. Return an array answer, where answer[i] is the result for queries[i]. Note For each query, treat s[li...ri] as if it is augmented with a '1' at both ends, forming t = '1' + s[li...ri] + '1'. The augmented '1's do not contribute to the final count. The queries are independent of each other.
/**
 * @param {string} s
 * @param {number[][]} queries
 * @return {number[]}
 */
/**
 * SegmentTree
 * A simple max-segment-tree built over an array of numbers.
 * Supports:
 *   - build(): construct the tree in O(n)
 *   - query(L, R): get the max value in range [L, R] in O(log n)
 */
class SegmentTree {
    constructor(arr) {
        this.arr = arr;
        this.n = arr.length;
        // Segment trees need ~4x the array size to safely hold all nodes
        this.seg = new Array(this.n << 2).

3499. Maximize Active Section with Trade I

You are given a binary string s of length n, where: '1' represents an active section. '0' represents an inactive section. You can perform at most one trade to maximize the number of active sections in s. In a trade, you: Convert a contiguous block of '1's that is surrounded by '0's to all '0's. Afterward, convert a contiguous block of '0's that is surrounded by '1's to all '1's. Return the maximum number of active sections in s after making the optimal trade. Note: Treat s as if it is augmented with a '1' at both ends, forming t = '1' + s + '1'. The augmented '1's do not contribute to the final count.
/**
 * @param {string} s
 * @return {number}
 */
var maxActiveSectionsAfterTrade = function (s) {
    // Length of the string
    const n = s.length;

    // Count how many '1's are originally in the string
    let cnt1 = 0;
    for (let c of s) {
        if (c === "1") cnt1++;
    }

    // Collect lengths of ALL zero-blocks (contiguous '0' segments)
    const zeroBlocks = [];
    let i = 0;

    while (i < n) {
        const start = i;

        // Move i forward while characters match the bloc

1260. Shift 2D Grid

Given a 2D grid of size m x n and an integer k. You need to shift the grid k times. In one shift operation: Element at grid[i][j] moves to grid[i][j + 1]. Element at grid[i][n - 1] moves to grid[i + 1][0]. Element at grid[m - 1][n - 1] moves to grid[0][0]. Return the 2D grid after applying shift operation k times.
/**
 * @param {number[][]} grid
 * @param {number} k
 * @return {number[][]}
 */
var shiftGrid = function(grid, k) {
    const m = grid.length;
    const n = grid[0].length;
    const total = m * n;

    // Flatten the grid into a 1D array
    const flat = [];
    for (let i = 0; i < m; i++) {
        for (let j = 0; j < n; j++) {
            flat.push(grid[i][j]);
        }
    }

    // Effective rotation
    k = k % total;

    // Rotate by slicing
    const rotated = flat.slice(total - k).co

devin

cog_j35zccdhljzxbdmdd7zw3dywcavplws4p4iihz4tz5v7gw4q6s3q

devin.md

cog_j35zccdhljzxbdmdd7zw3dywcavplws4p4iihz4tz5v7gw4q6s3q

how to connect development beacon ui to a development project?

yarn link on beacon-ui project
yarn link "@mybeaconlabs/beacon-ui" on IBP project

groq

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

Function

ALTER FUNCTION [dbo].[split](
    @delimited NVARCHAR(MAX),
    @delimiter NVARCHAR(100)
) RETURNS @t TABLE (id INT IDENTITY(1,1), val NVARCHAR(MAX))
AS
BEGIN

    DECLARE @xml XML , @Result NVARCHAR(MAX)

	SET @Result = CASE WHEN RIGHT(@delimited, 1) IN (',') --- Removing comma as Last Character
						THEN left(@delimited, len(@delimited)-1)
						ELSE @delimited END
	

    SET @xml = N'<t>' + REPLACE(@Result,@delimiter,'</t><t>') + '</t>'
    INSERT INTO @t(val)
    SELECT  r.v

[Powershell] Podman/Docker image clearup

#!/usr/bin/env pwsh
<#
.SYNOPSIS
    Removes outdated podman or docker images, keeping only the newest tag(s) per repository.

.DESCRIPTION
    Groups every tagged image by repository, orders each group by creation date and
    removes everything past the newest -Keep tags. Repositories with a single tag
    (base images such as mcr.microsoft.com/dotnet/sdk) are therefore never touched.

    Images referenced by a container - running or stopped - are always skipped, and
    untagged <none> lefto

Similarweb × Ahrefs × SEMrush 实战教程

# Similarweb × Ahrefs × SEMrush 实战教程

> 面向初学者的完整操作指南 · 以 PetSourcingAgent(B2B 宠物用品代采平台,面向欧美买家)为实战案例
> 最后更新:2026 年 7 月

---

## 第 0 章 · 先建立正确的心智模型

初学者最容易犯的错误,是把这三个工具当成"三个差不多的东西",结果每个都学了一点、每个都不会用。它们其实分工不同,记住下面这句话你就不会迷路:

**Similarweb 帮你看"整个市场和对手长什么样",Ahrefs 帮你把"关键词和外链这两件事做到最深",SEMrush 帮你把"从调研到执行到追踪的全流程串起来"。**

| 工具 | 一句话定位 | 最强的地方 | 在你的 SEO 流程中主要负责 |
|------|-----------|-----------|------------------------|
| **Similarweb** | 市场与流量情报 | 估算任意网站的总流量、流量来源构成、受众画像、行业大盘 | 竞品调研、市场规模判断、找到"真正的对手是谁" |
| **A

1081. Smallest Subsequence of Distinct Characters

Given a string s, return the lexicographically smallest subsequence of s that contains all the distinct characters of s exactly once.
/**
 * @param {string} s
 * @return {string}
 */
var smallestSubsequence = function(s) {
    // Step 1: Record the last index where each character appears
    const lastIndex = {};
    for (let i = 0; i < s.length; i++) {
        lastIndex[s[i]] = i;
    }

    const stack = [];        // will hold the final subsequence
    const used = new Set();  // tracks which characters are already in the stack

    for (let i = 0; i < s.length; i++) {
        const c = s[i];

        // If we've already us

1979. Find Greatest Common Divisor of Array

Given an integer array nums, return the greatest common divisor of the smallest number and largest number in nums. The greatest common divisor of two numbers is the largest positive integer that evenly divides both numbers.
/**
 * @param {number[]} nums
 * @return {number}
 */
var findGCD = function(nums) {
    // Find the smallest number in the array
    let mn = Math.min(...nums);

    // Find the largest number in the array
    let mx = Math.max(...nums);

    // Euclid's algorithm for computing GCD
    const gcd = (a, b) => {
        // Base case: when b becomes 0, a is the GCD
        if (b === 0) return a;

        // Recursive step: compute GCD of (b, a % b)
        return gcd(b, a % b);
    };

    // The p

VIM Tips

Vi Tips

1) Para reemplazar en todo el buffer con nada

:%s/''//ge


2) ^G (control G) Muestra info del buffer

3) :n Pasa al siguiente buffer

4) :N Pasa al buffer anterior

5) Marca una posicion del buffer con una letra

   m Letra  
   Ejemplo: mt 
   Luego presionando t uno va a la posicion donde se puso la marca.

6) Para traducir TABs a espacios poner
   :set expandtab

7) Si la linea no entra en la pantalla porque es muy larga, en vez de mostrarla abajo q continue.

   :set nowrap

8) Par