sbt scala format

sbt scalafmtCheckAll
sbt scalafmt 
sbt test:scalafmt 

カードの角丸キャプションをcorner-shapeで実現する

<div class="title">カードのタイトル部分</div>

角の形状を変更する

.button {
  corner-shape: squircle; /* スムーズな角丸 */
  corner-shape: bevel;
  corner-shape: notch;
  corner-shape: scoop;
}

Image Gallery with masonry grid with vertical and horizontal fills

masonry grid that allows for a stackable varying sizes. Make sure to add a `- 1` to the index in image-gallery.js for the lightbox to find correct image. Uses: packery, isotope, and imagesloaded
{% assign base_classname = 'image-gallery' %}


<div class="image-gallery-wrapper">
  {% if Module.FieldValues.Content != nil and Module.FieldValues.Content != '' %}
    <header class="element-header">{{Module.FieldValues.Content}}</header>
  {% endif %}
  <section class="{{base_classname}} col-span-{{Module.FieldValues.ColumnCount | Default: '4'}}" data-gallery="gallery-{{Module.MatrixModuleId}}">
    <div class="grid-sizer"></div>
   {% for item in List.Items %}
      {% assign rand 

Styles when any clickable child is hovered

.product-card:has(a:hover, button:hover, [role="button"]:hover, input[type="submit"]:hover) {
  
}

1061. Lexicographically Smallest Equivalent String

You are given two strings of the same length s1 and s2 and a string baseStr. We say s1[i] and s2[i] are equivalent characters. For example, if s1 = "abc" and s2 = "cde", then we have 'a' == 'c', 'b' == 'd', and 'c' == 'e'. Equivalent characters follow the usual rules of any equivalence relation: Reflexivity: 'a' == 'a'. Symmetry: 'a' == 'b' implies 'b' == 'a'. Transitivity: 'a' == 'b' and 'b' == 'c' implies 'a' == 'c'. For example, given the equivalency information from s1 = "abc" and s2 = "cde", "acd" and "aab" are equivalent strings of baseStr = "eed", and "aab" is the lexicographically smallest equivalent string of baseStr. Return the lexicographically smallest equivalent string of baseStr by using the equivalency information from s1 and s2.
/**
 * @param {string} s1
 * @param {string} s2
 * @param {string} baseStr
 * @return {string}
 */
class UnionFind {
    constructor() {
        this.parent = Array.from({ length: 26 }, (_, i) => i); // 'a' to 'z'  mapped to 0-25
    }

    // Find root of the character index
    find(x) {
        if (this.parent[x] !== x) {
            this.parent[x] = this.find(this.parent[x]); // Path compression
        }
        return this.parent[x];
    }

    // Union two sets
    union(x, y) {
        l

timeout

sudo nano /etc/default/grub
GRUB_CMDLINE_LINUX_DEFAULT="consoleblank=180"
sudo update-grub
sudo reboot

How to configure Logger in Python

import logging

logger = logging.getLogger(__name__)

logging.basicConfig(
    level=logging.INFO,
    format="%(asctime)s [%(levelname)s] %(name)s: %(message)s",
)

Pegando o URL Atual Oracle Apex

SELECT OWA_UTIL.GET_CGI_ENV('REQUEST_SCHEME') || '://' || 
               OWA_UTIL.GET_CGI_ENV('SERVER_NAME') || 
               OWA_UTIL.GET_CGI_ENV('SCRIPT_NAME') || '/'
          AS L_AI_INSTANCIA_URL
          FROM DUAL;

SSH helpful tips

Host * 
    Port 22

Host vm_*
    IdentityFile ~/.ssh/ed25519_VM
    BatchMode yes
    
Host vm_node1
    HostName 192.168.56.1 # or vm.example.com

Starting style

.modal {
  /* Hidden state */
  display: none;
  opacity: 1;
}

.modal.open {
  display: block;
  /* Regular transition works now */
  transition: opacity 300ms;
  opacity: 1;
}

/* Define starting styles when modal becomes displayed */
@starting-style {
  .modal.open {
    opacity: 0;
  }
}

内存泄露排查

# tracemalloc

```
import tracemalloc
pre_snapshot = None
tracemalloc.start()

xxx

snapshot = tracemalloc.take_snapshot()
    global pre_snapshot
    if pre_snapshot:
        top_stats = snapshot.compare_to(pre_snapshot, 'lineno')
        for stat in top_stats[:10]:
            print(stat)
    else:
        pre_snapshot = snapshot
```

Function to decode token with some params in url.

import { jwtVerify } from 'jose'
import { JWT_SECRET } from '@/constants/config'

interface IShipmentTokenPayload {
  id: string
  fields: string
  subId?: number
  nonce?: string
}

export async function decodeShipmentToken(token: string): Promise<{
  id: string
  subId?: number
  fieldsArray: Array<{ name: string; order: number }>
} | null> {
  try {
    if (!token || token.length < 10) {
      console.error('Invalid token format or length')
      return null
    }

    const { payload } = awa

3403. Find the Lexicographically Largest String From the Box I

You are given a string word, and an integer numFriends. Alice is organizing a game for her numFriends friends. There are multiple rounds in the game, where in each round: word is split into numFriends non-empty strings, such that no previous round has had the exact same split. All the split words are put into a box. Find the lexicographically largest string from the box after all the rounds are finished.
/**
 * Finds the lexicographically largest substring based on the number of friends.
 * If `numFriends` is 1, the whole word is returned.
 * Otherwise, the function finds the best substring by iterating through possible slices.
 *
 * @param {string} word - The input word.
 * @param {number} numFriends - The number of friends involved in the selection process.
 * @return {string} - The lexicographically largest substring.
 */
var answerString = function (word, numFriends) {
    // If only one fri

tokenizer

# tokenizer

```
AutoTokenizer.from_pretrained("...", use_fast=False)
```

* use_fast:默认为 ture,使用 rust 实现,多线程处理,会分配和 cpu 核数相同的线程数。

Ref.:
1. https://huggingface.co/docs/transformers/en/model_doc/auto#transformers.AutoTokenizer.from_pretrained.use_fast
2. https://github.com/huggingface/tokenizers/tree/main/tokenizers#features

Quadro Dashboard Oracle Apex

<!-- Tag <html> de abertura ao codigo html -->
<html>
    <!-- Tag <head> para incluir estilos CSS, título, codificação de caracteres, etc. -->
    <head>
        <!-- Tag <style> é usada para definir os estilos CSS  -->
        <style>
            /* Centraliza o texto da DIV e coloca a altura em 300px */
            .dashboard-total {
                text-align: center;
                height: 300px;
            }
            /* Edita o texto da tag H1 da DIV */
            .dashbo