フォームテンプレート

<?php
/*
Template Name: お問い合わせ
*/

// セッションを開始
session_start();

$mode = "input";

// 確認ボタンが押された場合
if (isset($_POST["confirm"]) && $_POST["confirm"] === "確認") {
    // 送信された値をエスケープしてセッションへ保存
    $_SESSION["company"] = htmlspecialchars($_POST["company"], ENT_QUOTES);
    $_SESSION["email"]  = htmlspecialchars($_POST["email"], ENT_QUOTES);
    $_SESSION["phone"]  = htmlspecialchars($_POST["phone"], ENT_QUOTES);
    $_SESSION["message"] = htmlspecialchars($_POST["message"], ENT_QUOTES);

    $mode 

515. Find Largest Value in Each Tree Row

Given the root of a binary tree, return an array of the largest value in each row of the tree (0-indexed).
# Definition for a binary tree node.
# class TreeNode(object):
#     def __init__(self, val=0, left=None, right=None):
#         self.val = val
#         self.left = left
#         self.right = right
class Solution(object):
    def largestValues(self, root):
        """
        :type root: Optional[TreeNode]
        :rtype: List[int]
        """
        if not root:  # If the root is None (empty tree), return an empty list
            return []
        
        result = [] # Initialize an empty 

[测试] 哈哈哈哈测试 #检查 #检查2 # 检查3

[测试] 哈哈哈哈测试 #检查 #检查2 # 检查3
    /**
     * 检查商品信息完整度
     * @param $barcode
     * @return false
     * @throws \Exception
     */
    public function checkInfo($spuId = [])
    {
        try {
            $query = SpuModel::query();
            if (!empty($spuId)) {
                $query->whereIn('id', $spuId);
            }
            $spuList = $query->get()->toArray();
            if (empty($spuList)) {
                return false;
            }
            $config = ConfigService::instance()->getConfigValue(ConfigK

# Notes# Notes# Notes# Notes

    /**
     * 检查商品信息完整度
     * @param $barcode
     * @return false
     * @throws \Exception
     */
    public function checkInfo($spuId = [])
    {
        try {
            $query = SpuModel::query();
            if (!empty($spuId)) {
                $query->whereIn('id', $spuId);
            }
            $spuList = $query->get()->toArray();
            if (empty($spuList)) {
                return false;
            }
            $config = ConfigService::instance()->getConfigValue(ConfigK

测试

测试测试测试测试测试测试测试
    /**
     * 批量更新(限制5000条一次)
     *
     * @param array $attributes
     * @param string $conditionKey
     *
     * @return int
     * @throws \yii\db\Exception
     */
    public static function batchUpdate(array $attributes, string $conditionKey): int
    {
        if (count($attributes) > 5000) {
            throw new InfoException('批量更新单次最多支持5000条数据,请进行分批更新!');
        }

        $batchUpdate = [];
        foreach ($attributes as $attribute) {
            $columns = array_keys($attribute)

安装 gcc g++

# install gcc g++

```
sudo apt-get install aptitude

sudo aptitude install build-essential
```

行数制御

			display: -webkit-box;
			text-overflow: ellipsis;
			contain: content;
			-webkit-box-orient: block-axis;
			-webkit-line-clamp: 1;
			max-block-size: 1lh;

3203. Find Minimum Diameter After Merging Two Trees

There exist two undirected trees with n and m nodes, numbered from 0 to n - 1 and from 0 to m - 1, respectively. You are given two 2D integer arrays edges1 and edges2 of lengths n - 1 and m - 1, respectively, where edges1[i] = [ai, bi] indicates that there is an edge between nodes ai and bi in the first tree and edges2[i] = [ui, vi] indicates that there is an edge between nodes ui and vi in the second tree. You must connect one node from the first tree with another node from the second tree with an edge. Return the minimum possible diameter of the resulting tree. The diameter of a tree is the length of the longest path between any two nodes in the tree.
/**
 * @param {number[][]} edges1 - Edges of the first tree
 * @param {number[][]} edges2 - Edges of the second tree
 * @return {number} - Minimum possible diameter after merging the trees
 */
var minimumDiameterAfterMerge = function(edges1, edges2) {
    // Initialize adjacency lists for both trees
    const tree1 = new Map();
    const tree2 = new Map();
    
    // Build the adjacency list for the first tree
    for(let [u, v] of edges1) {
        tree1.set(u, [...(tree1.get(u) || []), v]);
 

Glow Effect Button


<style>
@keyframes pulse-glow {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(52, 152, 219, 0.7);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 0 0 10px rgba(52, 152, 219, 0);
  }
}

.pulse-glow {
  animation: pulse-glow 2s infinite;
}
</style>











Download GDRIVE File

import requests
import io

FILE_ID = '1e8hAGdDC2hAbEnosh1Odo9tAj_Wlzl8H'
LOCAL_FILE_NAME = 'TA_Lib-0.4.26-cp310-cp310-linux_x86_64.whl'

def download_public_file(file_id, local_file_name):
    url = f'https://drive.google.com/uc?id={file_id}'
    try:
        response = requests.get(url, stream=True)
        response.raise_for_status() # Raise an exception for bad status codes
        with open(local_file_name, 'wb') as file:
            for chunk in response.iter_content(chunk_size=8192):
     

DUNS NUMBER

https://www.dnb.com/de-de/upik-en.html

Display magenta classnames for Sections

![demo](https://p61.f2.n0.cdn.zight.com/items/8LuWJdYX/d65a0bde-c5d3-4750-994e-4fb10f184bdc.jpg?source=viewer&v=df137aa6b717ae3cef33840418eb897f)
/**
 * Display Class Names
 */

document.addEventListener('DOMContentLoaded', function () {
  var divs = document.querySelectorAll('#tm-main > div');

  divs.forEach(function (div) {
    var classNames = div.className.split(' ');
    var index = classNames.indexOf('uk-section-default');
    if (index !== -1) {
      classNames = classNames.slice(0, index);
    }

    if (classNames.length > 0) {
      classNames[classNames.length - 1] =
        '<strong style="color: white;">' +

Linux shell多行文本

Linux shell多行文本
# 多行文本写入文件,解析变量
```sh
line="一"
cat > myfile.txt <<EOF
第${line}行
第二行
第三行
EOF
cat myfile.txt
```
输出:
```
第一行
第二行
第三行
```

# 多行文本写入文件,不解析变量(EOF带引号)
```sh
line="一"
cat > myfile.txt <<"EOF"
第${line}行
第二行
第三行
EOF
cat myfile.txt
```
输出:
```
第${line}行
第二行
第三行
```


# 多行文本保存到变量
```sh
line="1"
var=$(cat <<EOF
第${line}行
第2行
第3行
EOF
)
echo "$var"
```
输出:
```
第1行
第2行
第3行
```

# 多行文本保存到变量,不解析变量(EOF带引号)
```sh
line="1"
var=$(cat <<"EOF"
第${line}行
第2行
第3行
EOF
)
echo "$var"
```
输出:
```
第${line}行
第2行
第3行
```

PHP フォームから添付ファイル(複数)を受け取り、メールに添付して送信する

<!DOCTYPE html>
<html lang="ja">

<head>
  <meta charset="utf-8" />
  <title>ファイル送信フォーム</title>
</head>

<body>
  <main class="main">
    <form action="sendmail.php" method="post" enctype="multipart/form-data">
      <label for="email">送信先メールアドレス:</label>
      <input type="email" name="email" id="email" required>

      <label for="files">ファイルを選択:</label>
      <input type="file" name="files[]" id="files" multiple>

      <button type="submit">送信</button>
    </form>
  </main>
</body>

</html>

三角形

border: solid 1px {bdc};
background-color: {bgc};
clip-path: polygon(0% 0%, 0% 100%, 100% 0%);
rotate:-45deg;

JS アニメーション処理(vanilla js)

// スムーススクロール
// topページ スムーススクロール
const links = document.querySelectorAll('a[href^="#"]');

links.forEach((link) => {
    link.addEventListener('click', (e) => {
        const href = link.getAttribute('href');
        const targetSection = document.querySelector(href);
    // スムーススクロールを同一ページ内のリンクにのみ適用
    if (targetSection) {
        e.preventDefault();
        const sectionTop = targetSection.getBoundingClientRect().top;
        const currentPos = window.scrollY;
        const gap = 84; // ヘッダーの