無限ループスライダー(webAnimationsAPI)

<div class="slider js-slider">
  <div class="slider-main">
    <div class="slider-container">
      <div class="slider-unit">
        <div class="slider-item">1</div>
        <div class="slider-item">2</div>
        <div class="slider-item">3</div>
        <div class="slider-item">4</div>
        <div class="slider-item">5</div>
        <div class="slider-item">6</div>
      </div>
    </div>
  </div>
  <button class="slider-button" data-slider-button="prev">prev</button>
  <button class="slider

Linux Postgresql通过ssh远程访问

# Notes

## 二、创建新用户来访问PostgreSQL
先切换到Linux用户postgres,并执行psql:
```sh
[root@node71 ~]# su postgres
bash-4.2$ psql
could not change directory to "/root": Permission denied
psql (9.6.12)
Type "help" for help.

postgres=# 
```

目前位于数据库postgres下。创建tom用户。对于PostgreSQL,用户tom相当于是一种role(角色):
```sh
CREATE USER tom WITH PASSWORD '123456';
```
注意:

语句要以分号结尾。
密码要用单引号括起来。
若修改用户名的密码,将CREATE修改为ALTER.

创建数据库,如demo:
```sh
CREATE DATABASE demo OWNER tom;
```
将demo数据库的所有权限都赋予tom用户:
```sh
GRANT ALL PRIVILEGES ON DATAB

PicGO设置图床, 使用腾讯云COS

# Notes
## 简介

图床服务提供图片存储、图片加工处理、图片全网分发等功能,为全球无数的博客网站和社区论坛提供了后端图片服务支撑。开发者们可以使用腾讯云**对象存储(Cloud Object Storage,COS)**搭建图床服务,COS 是腾讯云提供的一种存储海量文件的分布式存储服务,提供了更丰富的功能、更优越的性能、更高的可靠性保障。

COS 用于图床场景的优势有:

- **低成本:**存储单价低,按量付费,用多少算多少,还有资源包优惠。
- **不限速:**上传下载不限速,不再长时间等待 loading,访问质量也更好。
- **高可用:**有高等级的 SLA 可用性保障,存储的数据有高达99.9999999999%的持久性保障。
- **容量无限:**文件分布式存储,支持海量文件,容量按需使用。


## 实践场景

### 场景1:新增图片使用 COS 搭建图床服务

本场景使用到以下工具:
- PicGo:一款支持多种云存储配置、快捷生成图片链接的工具。
- Typora:一款轻量级 Markdown 编辑器,支持多种输出格式,支持将本地图片一键上传至图床。

Struktura tabulky

<?php
		$description = $this->connection->table('customer_address')->getStructure();
		$description->getCols();

ScrollView senza Snapkit

Creare una scrollView e la relativa content senza snapkit.
private func setupScrollView() {
        view.addSubview(scrollView)
        scrollView.addSubview(contentView)
        
        scrollView.translatesAutoresizingMaskIntoConstraints = false
        contentView.translatesAutoresizingMaskIntoConstraints = false
        
        NSLayoutConstraint.activate([
            scrollView.centerXAnchor.constraint(equalTo: view.centerXAnchor),
            scrollView.widthAnchor.constraint(equalTo: view.widthAnchor),
            scrollView.topAnchor.constrai

Quote_lost_transition updated

backup date 7-12-2022
info quote;
info quote.get("Quotes.ID");
get_rec = zoho.crm.getRecordById("Quotes",quote.get("Quotes.ID"));
// info get_rec ;
if(get_rec.get("Contact_Name") != null)
{
	contId = get_rec.get("Contact_Name").get("id");
}
getQuotes = zoho.crm.getRelatedRecords("Quotes","Contacts",contId);
// info "Quotes details : "+getQuotes;
//we need the custom function to look and see if there are any other Open quotes, if there are no other open quotes then we need to move the Contact record to Remar

most_recent_trading_date

from pandas_market_calendars import get_calendar

most_recent_trading_date = str(get_calendar('NYSE').valid_days(start, end)[-2:-1].date[0])

重复队列的全排列

### 题目

求一个重复队列的全排列

### 思路

求全排列任然使用回溯法,值得注意的是数据有重复,需要在不重复数组的全排列中去掉重复情况。

当两个数相等时,则不进行交换,因为必定是重复情况,但是需要对数组进行排序,否则仍然可能出现重复情况。

由于,数组需要排序,所以在交换之后会改变数组排序状态,所以需要值传递。

```C++
class Solution {
public:
  vector<vector<int>> permuteUnique(vector<int> &nums) {
    sort(nums.begin(), nums.end());
    vector<vector<int>> res;
    permuteUniqueHelper(nums, 0, res);
    return res;
  }

  void permuteUniqueHelper(vector<int> nums, int index,
                           vector<vector<int>> &res) {
    if (ind

toggle dark mode svelte

<script>
function toggle() {
	window.document.body.classList.toggle('dark-mode')
}
</script>
<button on:click={toggle}>
	<slot/>
</button>
<style>
	button {
		background-color: #f76027;
		color: white;
		border: none;
		border-radius: 4px;
		padding: 0.5rem;
		text-transform: uppercase;
		
	}
	:global(body.dark-mode) button {
		background-color: #0084f6;
		color: white;
	}
</style>

Esempio: modificare axis StackView quando ruota lo schermo

traitCollection.preferredContentSizeCategory.isAccessibilityCategory -> Ci dice se stiamo utilizzando le dimensioni di accessibilità.
override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) {
        updateUIForPreferredContentSizeCategory()
}

private func updateUIForPreferredContentSizeCategory() {
        if traitCollection.preferredContentSizeCategory.isAccessibilityCategory {
            chipStackView.axis = .vertical
        } else {
            chipStackView.axis = .horizontal
        }
}

Funzione traitCollectionDidChange

Questa funzione fa in modo che succeda qualcosa quando lo schermo ruota.
override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) {
        // Fai qaulcosa
}

Remove via $event / $el

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>JS Bin</title>
  <script src="//unpkg.com/alpinejs" defer></script>
</head>
<body>
  <div x-data>
      <button @click="$el.remove()">remove me 1</button>
      <button @click="$event.target.remove()">remove me 2</button>
  </div>
</body>
</html>

Debug Vue code in VsCode initiated with Vite? (Chrome/Brave/Firefox)

https://stackoverflow.com/questions/66147328/is-there-a-way-to-debug-code-in-vscode-initiated-with-vite/69338180#69338180 https://stackoverflow.com/questions/53380075/how-to-attach-the-vscode-debugger-to-the-brave-browser/60130963#60130963
// launch.json for Chrome
{
    "version": "0.2.0",
    "configurations": [
        {
            "type": "chrome",
            "request": "launch",
            "name": "Debug with Chrome",
            "url": "http://localhost:4000",
            "webRoot": "${workspaceFolder}/app"
        }
    ]
}

//  launch.json for Brave
{
    "type": "chrome",
    "request": "launch",
    "name": "Debug with Brave",
    "runtimeExecutable": "/Applications/Brave Browser.app/Contents/MacOS/Brave Browser",
   

Change something via 3 ways ($refs, $el, $nextTick)

<div x-data>
  <span x-ref="foo"></span>
  <button  class="btn btn-dark" @click="$refs.foo.innerText = 'Smashing Magazine'">Click me</button>
</div>

<div x-data>
  <button  class="btn btn-secondary" @click="$el.innerHTML = 'Smashing Magazine'">Click me</button>
</div>

<div x-data="{ text: 'Click me' }">
  <button class="btn btn-primary" @click="
            text = 'Clicked';
            $nextTick(() => {
                    // This will output 'Clicked', not 'Click me'
          

全排列

### 题目

求一个不重复数组的全排列

input:

[1,2,3]

output:

[[1,2,3],[1,3,2],[2,1,3],[2,3,1],[3,1,2],[3,2,1]]

### 思路

从 0 开始,把每个数字都更换到当前位置,然后固定其位置,继续从下一位开始交换

```C++
class Solution {
public:
  vector<vector<int>> permute(vector<int> &nums) {
    vector<vector<int>> res;
    permuteHelper(nums, 0, res);
    return res;
  }

  void permuteHelper(vector<int> &nums, int index, vector<vector<int>> &res) {
    if (index >= nums.size()) {
      res.push_back(nums);
      return;
    }

    for (int i = index; i <