Skip to content

Instantly share code, notes, and snippets.

View weilueluo's full-sized avatar
code ^ sleep

Weilue Luo weilueluo

code ^ sleep
View GitHub Profile
@weilueluo
weilueluo / Java types by args and return
Last active December 29, 2022 00:09
Differences between Supplier, Consumer, Callable, Runnable, Function, BiFunction, Predicate, UnaryOperator, BinaryOperator
Supplier () -> x
Consumer x -> ()
Callable () -> x throws ex
Runnable () -> ()
Function x -> y
BiFunction x,y -> z
Predicate x -> boolean
UnaryOperator x1 -> x2
BinaryOperator x1,x2 -> x3
@weilueluo
weilueluo / multihead_attention.py
Created April 10, 2021 22:22
minimum multi-head attention implementation
import torch
from torch import nn
class MultiHeadAttention(nn.Module):
def __init__(self, in_size, n_heads=1, scaled=True):
super().__init__()
# in_size = d_k in the paper
self.scale = in_size ** 0.5 if scaled else 1
@weilueluo
weilueluo / UOM CGVI Links.md
Created October 3, 2021 09:25
[UOM CGVI Links] #links
@weilueluo
weilueluo / conda_create_http_error.md
Last active October 8, 2021 15:53
[CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://repo.anaconda.com/pkgs/main/win-64/current_repodata.json>] #conda

Just copy these:-

1)libcrypto-1_1-x64.dll

2)libssl-1_1-x64.dll

from D:\Anaconda3\Library\bin to D:\Anaconda3\DLLs.

@weilueluo
weilueluo / content.txt
Created November 8, 2021 15:02
slow stroke-dashoffset animation/transition in chrome
https://bugs.chromium.org/p/chromium/issues/detail?id=167569
@weilueluo
weilueluo / z component of the cross product.txt
Created November 12, 2021 10:51
z component of the cross product
cross(a, b)'s z component:
z = a.x * b.y - a.y * b.x
@weilueluo
weilueluo / git-reset-pull-master-all.sh
Created November 22, 2022 13:50
for every repo in the current directory, checkout master, reset --hard and pull
find . -mindepth 1 -maxdepth 1 -type d -print | xargs -I {} bash -c 'git -C {} rev-parse --is-inside-work-tree &> /dev/null && echo {} && git -C {} checkout master && git -C {} reset --hard && git -C {} pull'
{
"compilerOptions": {
// type checking
"strict": true,
// modules
"module": "esnext",
"moduleResolution": "nodenext",
"paths": {
"@/*": ["./src/*"]

Fonts

  • Alaska
  • Baloo 2