Skip to content

Instantly share code, notes, and snippets.

View bczhc's full-sized avatar
🌴

Zhai Can bczhc

🌴
  • Jiangsu, China
  • 15:48 (UTC +08:00)
View GitHub Profile
@bczhc
bczhc / a.csv
Last active September 17, 2022 11:52
魔方成绩
No. Time Comment Scramble Date P.1
1 29.41 B2 D2 R2 U2 L2 F U2 L2 F R2 B2 R F2 U' B2 D2 B' L B 2022-05-14 17:51:12 29.41
2 31.69 L U2 F' D2 F2 R2 F' L2 U2 L2 B2 D' L B2 U' F' R2 D2 R U 2022-05-14 17:52:11 31.69
3 28.91 R' D2 F2 R D' R' B' D F R2 D2 R2 B2 R2 D' L2 U B2 U2 B2 2022-05-14 17:53:15 28.91
4 24.50 L' U2 L2 D2 F R2 B R2 F2 L2 B2 F' R' F D' B2 F2 D L F 2022-05-14 17:54:03 24.50
5 25.58 R D' L2 F2 D2 F2 U' L2 U' B2 U2 R2 F2 R U R F' L' U B2 U' 2022-05-14 17:54:59 25.58
6 28.38 F U2 R2 F2 L2 F' D2 F' D2 F D2 B U' F' L' F2 D L' F R2 B' 2022-05-19 20:51:17 28.38
7 33.91 F' L2 U L2 R2 U B2 U' R2 D' F' U2 B' L F2 U' L F' L2 2022-05-19 20:52:05 33.91
8 27.53 D2 R' B2 L' D2 B2 L D2 L F2 L2 B2 D B' D2 F D2 F2 U2 R' U 2022-05-19 20:53:02 27.53
9 23.82 U R' U F2 R2 F' U' B2 D2 L' B2 D2 R' U2 R' D2 L U2 R2 F' U 2022-05-19 20:53:59 23.82
@bczhc
bczhc / a.m
Last active July 18, 2022 11:04
魔方成绩绘图
list = Import[
"https://gist.githubusercontent.com/bczhc/\
3c650a68ae85d026385037e721078a9b/raw/\
eee00d466afa3ea8805251f4139fd8a076e3ff9d/a.csv", "CSV",
"Numeric" -> False][[2 ;;]];
intItpr = Read[StringToStream@#, Number] &;
toDateTime[str_String] :=
DateObject[intItpr /@ StringSplit[str, {"-", " ", ":"}]];
@bczhc
bczhc / a.md
Created July 20, 2022 07:12
Reciprocal Fibonacci constant formula test

$$ \sum _{n=1}^{\infty } \frac{1}{F_n}=\frac{\sqrt{5} \left(\cosh ^{-1}\left(\frac{3}{2}\right) \vartheta _2\left(\frac{1}{\phi ^2}\right){}^2+2 \psi _{\frac{1}{\phi ^4}}^{(0)}(1)-4 \psi _{\frac{1}{\phi ^2}}^{(0)}(1)+\log (5)\right)}{8 \text{csch}^{-1}(2)} $$

$F_n$: Fibonacci[n]

$\psi^{(n)}_q(z)$: QPolyGamma[n,z,q]

@bczhc
bczhc / Fourier Series.ipynb
Last active January 12, 2025 02:02
Fourier Series
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@bczhc
bczhc / a.md
Last active November 3, 2022 10:28
filefrag output
[bczhc@bczhc-arch recv]$ filefrag -v 1_ro1/a 1_ro1/b
Filesystem type is: 9123683e
File size of 1_ro1/a is 199041088 (48595 blocks of 4096 bytes)
 ext:     logical_offset:        physical_offset: length:   expected: flags:
   0:        0..     127:   40714255..  40714382:    128:             shared
   1:      128..     511:   40710611..  40710994:    384:   40714383: shared
   2:      512..     639:   40711118..  40711245:    128:   40710995: shared
   3:      640..     895:   40711365..  40711620:    256:   40711246: shared
   4:      896..    1023:   40711871..  40711998:    128:   40711621: shared
@bczhc
bczhc / sync-snap
Last active April 26, 2023 13:17
同步Btrfs快照
#!/bin/env ruby
require 'shellwords'
require 'optparse'
$dry_run = nil
MODE_LAST = "last"
MODE_SYNC = "sync"
@bczhc
bczhc / a.js
Last active September 7, 2022 09:39
获取网易云歌单歌曲列表
let table = document.getElementsByClassName("m-table")[0];
let list = Array.from(table.getElementsByTagName("tbody")[0].children).map(tr => {
let a = tr.children[1].getElementsByClassName('txt')[0].getElementsByTagName("a")[0];
let songId = a.href.match(/^.*id=(.*)$/)[1];
let title = a.children[0].title;
let artise = tr.children[3].children[0].title;
let album = tr.children[4].getElementsByTagName("a")[0].title;
return {
title: title,
@bczhc
bczhc / a.md
Created September 7, 2022 09:50
网易云音乐获取歌单列表

需要填充:HEADERSPLAYLIST_ID

@bczhc
bczhc / locate-song
Created September 7, 2022 13:33
网易云手机端下载的歌曲名与数据库中歌曲名 对应 寻找
#!/usr/bin/env ruby
require 'json'
NCM_PATH = '/mnt/hdd/data/collections/music/WEB-DL/ncm'
json = JSON.parse(File.read('/mnt/hdd/data/backup/zhc/Documents/ncm data dump/playlist/2666362456/all'))
# @return [String, nil]
def find(pattern)
@bczhc
bczhc / MainActivity.kt
Last active September 10, 2022 04:20
鸿蒙系统上悬浮窗里的Toast在应用程序外部不响应
package com.example.test
import android.content.Context
import android.content.Intent
import android.graphics.PixelFormat
import android.net.Uri
import android.os.Bundle
import android.provider.Settings
import android.view.WindowManager
import android.view.WindowManager.LayoutParams.*