1458. Max Dot Product of Two Subsequences

Given two arrays nums1 and nums2. Return the maximum dot product between non-empty subsequences of nums1 and nums2 with the same length. A subsequence of a array is a new array which is formed from the original array by deleting some (can be none) of the characters without disturbing the relative positions of the remaining characters. (ie, [2,3,5] is a subsequence of [1,2,3,4,5] while [1,5,3] is not).
/**
 * @param {number[]} nums1
 * @param {number[]} nums2
 * @return {number}
 */
var maxDotProduct = function(nums1, nums2) {
    const m = nums1.length;
    const n = nums2.length;

    // Create a DP table where:
    // dp[i][j] = max dot product using nums1[0..i-1] and nums2[0..j-1]
    //
    // We initialize everything to -Infinity because:
    // - We want to allow negative numbers.
    // - We want to ensure that taking no elements is never considered valid.
    const dp = Array.from({ l

Switch user in Linux (Ubuntu) e.g. edit file with ownership

sudo -u <user> bash

Search Substring

- Given 2 sheets: sheet 1 and sheet 2 
 - Sheet 1 contains column sku
 - Sheet 2 contains column compatibility (comma separated string which may contain
 the sku from sheet 1 column sku)
 - Result: Sheet 3, for every sku in sheet 1, find the compatible part in sheet 2
 return the part name, comma seperated

### Sheet 1
id | sku
---|---
1 | ABC

### Sheet 2
Part ID | Model Compatibilty
--|--
1039228 | "ABC, DEF"
AB9034-89 | "VDR, ABC"
HUDH90-0122 | "BDN, EDF"

### Sheet 3
sku | compatibilities
--

C1 U12

B
outing
unwind
idle
avid
pastime
gym bunny
hiking
couch potato

how to iterate an array in Go?

fruits := [4]string{"Apple", "Banana", "Orange", "Grapes"}

for index, fruit := range fruits {
    fmt.Println(position, fruitName)
}

for i, v := range fruits {
    fmt.Println(i, v)
}

for position, fruitName := range fruits {
    fmt.Println(position, fruitName)
}

Hide extra product option woocommerce single product page

div#tm-extra-product-options {
    display: none;
}

.tm-totals-form-main.tc-show {
    display: none;
}

xpra

Xpra 

If anyone is facing issues restarting their Xpra server after yesterday’s reboot, please try the following steps:
xpra list – to check whether there is an existing (possibly expired) session
xpra stop – to stop any existing session, if found
. start_xpra – to start the Xpra server again
Please feel free to reach out if you have any questions or need assistance.
 

1339. Maximum Product of Splitted Binary Tree

Given the root of a binary tree, split the binary tree into two subtrees by removing one edge such that the product of the sums of the subtrees is maximized. Return the maximum product of the sums of the two subtrees. Since the answer may be too large, return it modulo 109 + 7. Note that you need to maximize the answer before taking the mod and not after taking it.
/**
 * Definition for a binary tree node.
 * function TreeNode(val, left, right) {
 *     this.val = (val===undefined ? 0 : val)
 *     this.left = (left===undefined ? null : left)
 *     this.right = (right===undefined ? null : right)
 * }
 */
/**
 * @param {TreeNode} root
 * @return {number}
 */
var maxProduct = function(root) {
    const MOD = 1_000_000_007;

    // ---------------------------------------------
    // First pass: compute total sum of the tree
    // --------------------------

Encode / Decode .env file

# encrypt_decrypt_file.py
# Encrypt/decrypt a file using cryptography

from cryptography.hazmat.primitives.kdf.scrypt import Scrypt
from cryptography.hazmat.primitives.ciphers.aead import AESGCM
from cryptography.exceptions import InvalidTag
import os
import sys
from pathlib import Path
from datetime import datetime
from getpass import getpass

BASE_DIR = Path(__file__).resolve().parent  # Current folder: /poetry/utils
APP_ROOT_DIR = BASE_DIR.parent  # Current app root: /poetry
PRO

убрать фон с атрибутов на странице товара

<style>/* Убираем фон у всей области атрибутов */
.elementor-widget-woocommerce-product-add-to-cart 
.variations,
.elementor-widget-woocommerce-product-add-to-cart 
.variations tr,
.elementor-widget-woocommerce-product-add-to-cart 
.variations th,
.elementor-widget-woocommerce-product-add-to-cart 
.variations td,
.elementor-widget-woocommerce-product-add-to-cart 
.variable-items-wrapper {
    background: transparent !important;
}

/* Убираем фон у самих атрибутов */
.elementor-wid

fix style *4 в наявності*

<style>/* Стиль "в наявності" в Add to Cart */
.elementor-widget-woocommerce-product-add-to-cart
.single_variation_wrap
.woocommerce-variation-availability
.stock.in-stock {
    color: var(--e-global-color-f3d70e7);
    font-family: "Montserrat Alternates", Sans-serif;
    font-size: 16px;
    font-weight: 300;
}
</style>

add to card elementor

для случая когда глобальные атрибуты не возможно пододвинуть к краю контейнера 
Код переводит таблицу во флекс 

3 col grid

first col fixed, rest 2 col equal
.grid-row {
  display: grid;
  grid-template-columns: 42px repeat(2, minmax(0, 1fr));
}

cari alacak verecek detay çalışma

SELECT 
CLCARD.LOGICALREF,
    CLCARD.CODE AS [CARİ KODU],
    CLCARD.DEFINITION_ AS [CARİ ÜNVANI],
    -- Vadesi bugün veya geçmiş olanların NET bakiyesi (PAYTRANS üzerinden)
    (SELECT ROUND(SUM(
        CASE WHEN SIGN = 0 THEN TOTAL -- Borç ise (Fatura vb)
             WHEN SIGN = 1 THEN -TOTAL -- Alacak ise (Ödeme vb)
             ELSE 0 END), 2)
     FROM LG_050_01_PAYTRANS 
     WHERE CARDREF = CLCARD.LOGICALREF 
       AND CANCELLED = 0 
       AND DATE_ <= GETDATE() -- Gerçe

cari listesi filtreli


SELECT 
LOGICALREF,
    CODE AS [Kodu],
    DEFINITION_ AS [Firma Ünvanı],
    REPLACE(REPLACE(ADDR1, CHAR(13)+CHAR(10), ' '), CHAR(10), ' ') AS [Adres1],
    REPLACE(REPLACE(ADDR2, CHAR(13)+CHAR(10), ' '), CHAR(10), ' ') AS [Adres2],
    DISTRICT AS [İlçe],
    CITY AS [İl],
    COUNTRY AS [Ülke],
    TELNRS1 AS [Tlf1],
    TELNRS2 AS [Tlf2],
    FAXNR AS [Fax],
    POSTCODE AS [Posta Kodu],
    INCHARGE AS [İlgili Kişi],
    EMAILADDR AS [E Posta],
    TCKNO AS [Tc Kimlik No],

cari için alacak verecek listesi

  --SPI2026000000008

  SELECT *  FROM [LOGODB].[dbo].[LG_050_01_STFICHE] (NOLOCK) where FICHENO LIKE 'EIM2025%' 
  
  SELECT *  FROM [LOGODB].[dbo].LG_500_CLCARD (NOLOCK) where CODE='120.01.018'

  
  select 
  cari.CODE as CariKodu,
  item.CODE as StokKodu,
  [LG_500_01_STLINE].AMOUNT,
  [LG_500_01_STLINE].* from [dbo].[LG_500_01_STLINE]  (NOLOCK) 
  JOIN [dbo].[LG_500_ITEMS] item on item.LOGICALREF = [LG_500_01_STLINE].STOCKREF
  JOIN [dbo].[LG_500_CLCARD] cari on cari.LOGICALREF