My test environment:
- Apple MacBook Pro 2017 (15-inch)
- macOS Big Sur (v11.6 (20G165)), Darwin Kernel Version 20.6.0
- CPU: 3.1 GHz Quad-Core Intel Core i7-7920HQ
- Memory: LPDDR3 2133 MHz 8G x 2
I have tested it in four browsers:
# Requires python >= 3.10 | |
import numpy as np | |
from typing import Any, Callable | |
# ndarray 的批量操作 | |
# eval_v = np.vectorize(lambda x:x+1); y=eval_v(x) 逐个元素进行操作 | |
# np.apply_along_axis 按某个方向进行向量化操作 | |
# 简单高斯分布进化 |
import { useEffect, useState, useRef, useCallback } from 'react'; | |
import { cloneDeep, defaultsDeep, isFunction } from 'lodash'; | |
import axios, { | |
AxiosInstance, | |
AxiosRequestConfig, | |
AxiosResponse, | |
AxiosError, | |
Method, | |
} from 'axios'; |
export type EventType = string | symbol; | |
export type EventListener<P, T> = (payload: P, type: T) => void; | |
export type EventListenerSet<Events, Key extends keyof Events> = Set< | |
EventListener<Events[Key], Key> | |
>; | |
export type EventListenerSetMap<Events> = Map< | |
keyof Events | '*', | |
EventListenerSet<Events, keyof Events> | |
>; |
module-type: echarts-component | |
title: GitHubHeatMap.js | |
type: application/javascript | |
/* Written by Gk0Wk(https://github.com/Gk0Wk) */ | |
const getFilterByDate = (date, subfilter) => { | |
return `[all[tiddlers]${subfilter}sameday:created[${date}]][all[tiddlers]${subfilter}sameday:modified[${date}]]+[sort[]]`; | |
}; | |
const yearDates = {}; | |
const getData = (year, subfilter) => { |
/*\ | |
title: $:/core/modules/utils/fakedom.js | |
type: application/javascript | |
module-type: global | |
A barebones implementation of DOM interfaces needed by the rendering mechanism. | |
\*/ | |
(function() { |
tags: $:/tags/Stylesheet | |
title: 横版StoryView.tid | |
type: text/css | |
/* StoryRiver & Sidebar */ | |
:root { | |
--story-river-top: 42px; | |
--story-river-bottom: 28px; | |
--max-tiddler-width: 800px; | |
} |
(function(root, factory) { | |
if (typeof exports === "object" && typeof module === "object") | |
module.exports = factory(); | |
else if (typeof define === "function" && define.amd) | |
define([], factory); | |
else if (typeof define === "function" && define.cmd) | |
define(function(require, exports, module) { | |
module.exports = factory(); | |
}); | |
else root.MyFileIO = factory(); |
/* UMD 模块 https://blog.csdn.net/Real_Bird/article/details/54869066 不得不说没有ES6的export是真的麻烦 */ | |
/* ()包住的是表达式,js会主动运行以求得值,所以其实不要一定是括号写法,也可以是 !f1(f2) 等等,目的是自动执行这段代码 */ | |
(function(root, factory) { | |
/* 这段主要是用不同的方式去获取以一些依赖,如果没有依赖,其实可以不要这一段 */ | |
if (typeof exports === "object" && typeof module === "object") // CommonJS规范(如NodeJS) | |
/* 依赖名称,相对路径../../lib/codemirror(.js)? (假设本文件是$:/plugins/tiddlywiki/codemirror/a/b/c.js) 和 绝对路径(如下)都可以 */ | |
module.exports = factory(require("$:/plugins/tiddlywiki/codemirror/lib/codemirror.js")); | |
else if (typeof define === "function" && define.amd) // AMD规范(如require.js) | |
/* 同上,不过AMD的传参比较特殊,是把参数数组作为第一个参数,函数作为第二参数 */ | |
define(["$:/plugins/tiddlywiki/codemirror/lib/codemirror.js"], factory); |
def shuffle(lst): | |
for i in range(len(lst))[::-1]: | |
rand = random.randint(0, i) | |
tmp = lst[rand] | |
lst[rand] = lst[i] | |
lst[i] = tmp |