# Define paths
$sourceRoot = "C:\temp\copyfiles_src" # <-- Change this for real run
$localTarget = "C:\temp\copyfiles_dest" # <-- Change this for real run
$listPath = "$PSScriptRoot\folderlist.txt"
$logFile = "$PSScriptRoot\copy_log.txt"
# Start a fresh log file
"Copy Process Started: $(Get-Date)" | Out-File -FilePath $logFile
# Ensure destination folder exists
if (-not (Test-Path $localTarget)) {
New-Item -ItemType Directory -Path $localTarget | Out-Null
}
# Process each folder
/**
* @param {number[]} nums
* @param {number} minK
* @param {number} maxK
* @return {number}
*/
var countSubarrays = function(nums, minK, maxK) {
// Initialize variables to keep track of indices and result
let minI = -1; // Index of the last occurrence of minK
let maxI = -1; // Index of the last occurrence of maxK
let ans = 0; // Total count of valid subarrays
let leftBoundary = -1; // Left boundary of the current subarray
// Iterate through the input array
for
offender vs perpetrator = same
rubbery vs burglary = 99% same, burglary nobody in building, robbery other people are inside building
informal gathering
chat about life
eat,drink and be merry
look into smth or investigate
make a profifit
Bedside manner
Daunting- scary, overwhelming
combat the crime
make a record
record the crime
Potholes- holes in the road
# async context manager
## __aenter__ & __aexit__
\_\_aenter\_\_ 是 Python 中异步上下文管理器(async context manager)的一个特殊方法。它是异步版本的 \_\_enter\_\_ 方法。当我们使用 async with 语句时,这个方法会被自动调用。
\_\_aexit\_\_ 方法,用于异步清理资源。
完整的调用流程:
```python
async with some_async_context() as context:
# 在这里使用context
# __aenter__在进入时被调用
# __aexit__在退出时被调用
```
可以手动调用 \_\_aenter\_\_ 来手动管理生命周期。
add_action('wpcf7_before_send_mail', function($contact_form) {
$submission = WPCF7_Submission::get_instance();
if (!$submission) return;
$post_id = url_to_postid($submission->get_meta('url'));
if (!$post_id) return;
$pdf_url = get_field('pdf_file', $post_id);
if ($pdf_url) {
$mail = $contact_form->prop('mail');
$mail['body'] = str_replace('[acf_pdf_url]', $pdf_url, $mail['body']);
$contact_form->set_properties(['mail' => $mail]);
}
});
`À > alt-0192`
`É > alt-0201 / alt-144`
`È > alt-0200`
`Ç > alt-0199 / alt-128`
`À > alt-0192`
`É > alt-0201 / alt-144`
`È > alt-0200`
`Ç > alt-0199 / alt-128`
/**
* @param {number[]} nums
* @param {number} modulo
* @param {number} k
* @return {number}
*/
var countInterestingSubarrays = function(nums, modulo, k) {
let res = 0; // Stores the count of interesting subarrays
let pre = 0; // Prefix sum tracking occurrences of nums[i] % mod === k
let map = new Map([[0, 1]]); // Map to store frequencies of prefix sums modulo 'mod'
for (let i = 0; i < nums.length; i++) {
// Increment prefix sum when nums[i] % mod equals k (using i
import { Suspense, lazy } from 'react';
const MyComponent = ({choiceType}) => {
// Dynamically import the choice component based on choiceType (factory pattern)
const Choice = lazy(() => {
switch (choiceType) {
case 'image':
return import('./ChoiceImage.jsx');
case 'default':
return import('./Choice.jsx');
}
});
return (
<Suspense fallback={'Loading...'}>
<Choice/>
<Suspense/>
);
}
// Could also abstract it to useChoiceFactory hook
rsync -aHvz --force --delete --sparse src dst
lvcreate -l 100%FREE -n
```sh
npm completion >> ~/.bashrc
source ~/.bashrc
```
```sh
pip install argcomplete
activate-global-python-argcomplete
```
{# templates/component/_headline.html.twig #}
{% use "@Contao/component/_headline.html.twig" %}
{% block headline_attributes -%}
{% set headline = headline|merge({attributes: attrs().addClass('foobar').mergeWith(headline.attributes|default)}) %}
{{ parent() }}
{%- endblock %}
```sh
sudo apt install bash-completion
source /usr/share/bash-completion/completions/docker
```
```sh
_django_completion() {
COMPREPLY=( $( COMP_WORDS="${COMP_WORDS[*]}" \
COMP_CWORD=$COMP_CWORD \
DJANGO_AUTO_COMPLETE=1 $1 ) )
}
complete -F _django_completion django-admin
complete -F _django_completion manage.py
```