0%

1. 防抖 (debounce)

  • 当事件触发时,相应的函数并不会立即触发,而是会等待一定的时间;
  • 当事件密集触发时,函数的触发会被频繁的推迟;
  • 只有等待了一段时间也没有事件触发,才会真正的执行响应函数;
Read more »

1
2
3
4
5
6
7
8
9
10
11
12
import os
from PyPDF2 import PdfFileMerger

target_path = 'Desktop'
pdf_lst = [f for f in os.listdir(target_path) if f.endswith('.pdf')]
pdf_lst = [os.path.join(target_path, filename) for filename in pdf_lst]

file_merger = PdfFileMerger()
for pdf in pdf_lst:
file_merger.append(pdf)

file_merger.write("merge.pdf")

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Sub PasswordBreaker()
Dim i As Integer, j As Integer, k As Integer
Dim l As Integer, m As Integer, n As Integer
Dim i1 As Integer, i2 As Integer, i3 As Integer
Dim i4 As Integer, i5 As Integer, i6 As Integer
On Error Resume Next
For i = 65 To 66: For j = 65 To 66: For k = 65 To 66
For l = 65 To 66: For m = 65 To 66: For i1 = 65 To 66
For i2 = 65 To 66: For i3 = 65 To 66: For i4 = 65 To 66
For i5 = 65 To 66: For i6 = 65 To 66: For n = 32 To 126
ActiveSheet.Unprotect Chr(i) & Chr(j) & Chr(k) & Chr(l) & Chr(m) & Chr(i1) & Chr(i2) & Chr(i3) & Chr(i4) & Chr(i5) & Chr(i6) & Chr(n)
If ActiveSheet.ProtectContents = False Then
MsgBox "One usable password is " & Chr(i) & Chr(j) & Chr(k) & Chr(l) & Chr(m) & Chr(i1) & Chr(i2) & Chr(i3) & Chr(i4) & Chr(i5) & Chr(i6) & Chr(n)
ActiveWorkbook.Sheets(1).Select
Range("a1").FormulaR1C1 = Chr(i) & Chr(j) & Chr(k) & Chr(l) & Chr(m) & Chr(i1) & Chr(i2) & Chr(i3) & Chr(i4) & Chr(i5) & Chr(i6) & Chr(n)
Exit Sub
End If
Next: Next: Next: Next: Next: Next
Next: Next: Next: Next: Next: Next
End Sub

如果某公司采购了一些物品,这些物品都在搞活动,可以中奖,如果中奖了,这个奖品该如何计。

比如买水,刚好水在搞活动,有概率再来一瓶或者中奖现金5000元,如果中了5000元,这5000元怎么处理。

Read more »

1
2
3
4
5
for /l %%n in (1,1,3000) do (

type 1.txt >> 1.doc

)

1
2
3
4
5
-- 视频整体转码ts
ffmpeg -y -i input.mp4 -vcodec copy -acodec copy -vbsf h264_mp4toannexb output.ts

-- ts 文件切片
ffmpeg -i input.mp4 -c:v libx264 -c:a aac -strict -2 -f hls -hls_time 2 -hls_list_size 0 index.m3u8

从本地读取对应的cookie,用来应付像钉钉这种应用

可以使用Navicat来查看Cookie文件

Read more »

Devices: Ubuntu 18.04 & Windows 10

  1. set proxy allow other devices to connect

  2. set ubuntu system proxy(can also set it at Settings/Network/Network Proxy)

Read more »