Skip to content

Instantly share code, notes, and snippets.

View kjsman's full-sized avatar

Jinseo Kim kjsman

View GitHub Profile
@kjsman
kjsman / chacha20poly1305.js
Last active February 12, 2024 17:55
ChaCha20-Poly1305 in 779 bytes
encrypt=async(P,Q,K,N)=>{I=-64;do{T=U=Uint32Array,J=0;O=await(A=async(...V)=>W(await(new Blob(V)).arrayBuffer()))("expand 32-byte k",K,(W=x=>new U(x))([I/64+1]),N),R=O.slice(),(D=b=>(S=[7,8,12,L=16],J<80&&(B=(W,Z,Y,X)=>(s=S.pop())&&(w=O[W]^=O[X]+=O[Y],O[W]<<=s,O[W]|=w>>>-s,B(Y,X,W,Z)))((M=i=>i*4+((J/4&1&&i)+J)%4)(3),M(2),M(1),J++%4)+D()))();for(i=L;i;O[--i]+=R[i]);U=Uint8Array;O=await A(O);P=I?P:W(P);Y=I<0?O:Y;for(i=0;i<64;i++)P[I++]^=O[i]}while(P[I]+1);r=(F=(a,i,j)=>(j??=L)?BigInt(a[i])+F(a,i+1,--j)*(Z=256n):0n)(Y,0)&0xffffffc0ffffffc0ffffffc0fffffffn;a=0n;p=P[l='length'],q=Q[l],k=(1<<30)*4,Q=await A(Q,(X=x=>W(x%L&&L-x%L))(q),P,X(p),new T([q,q/k,p,p/k]));for(I=0;Q[I]+1;I+=L)a=(a+F(Q,I)+(1n<<128n))*r%((1n<<130n)-5n);a+=F(Y,L);return[P,W(L).map(t=>(r=a%Z,a/=Z,`${r}`))]}
Model Release date Max resolution Low resolution Effective pixels Zoom wide (W) Zoom tele (T) Normal focus range Macro focus range Storage included Weight (inc. batteries) Dimensions Price
Agfa ePhoto 1280 1997 1024.0 640.0 0.0 38.0 114.0 70.0 40.0 4.0 420.0 95.0 179.0
Agfa ePhoto 1680 1998 1280.0 640.0 1.0 38.0 114.0 50.0 0.0 4.0 420.0 158.0 179.0
Agfa ePhoto CL18 2000 640.0 0.0 0.0 45.0 45.0 0.0 0.0 2.0 0.0 0.0 179.0
Agfa ePhoto CL30 1999 1152.0 640.0 0.0 35.0 35.0 0.0 0.0 4.0 0.0 0.0 269.0
Agfa ePhoto CL30 Clik! 1999 1152.0 640.0 0.0 43.0 43.0 50.0 0.0 40.0 300.0 128.0 1299.0
Agfa ePhoto CL45 2001 1600.0 640.0 1.0 51.0 51.0 50.0 20.0 8.0 270.0 119.0 179.0
Agfa ePhoto CL50 1999 1280.0 640.0 1.0 34.0 102.0 0.0 0.0 8.0 0.0 0.0 179.0
Canon PowerShot 350 1997 640.0 0.0 0.0 42.0 42.0 70.0 3.0 2.0 320.0 93.0 149.0
Canon PowerShot 600 1996 832.0 640.0 0.0 50.0 50.0 40.0 10.0 1.0 460.0 160.0 139.0
n, m = map(int, input().split())
g = {i: [] for i in range(n)}
for _ in range(m):
a, b, c = map(int, input().split())
g[a - 1].append([b - 1, c])
ds = [0] + [float('inf')] * (n - 1)
@kjsman
kjsman / definitions.units
Created August 1, 2021 00:00
GNU Units database
#
# This file is the units database for use with GNU units, a units conversion
# program by Adrian Mariano adrianm@gnu.org
#
# September 2020 Version 3.09
#
# Copyright (C) 1996-2002, 2004-2020
# Free Software Foundation, Inc
#
# This program is free software; you can redistribute it and/or modify
@kjsman
kjsman / divided.txt
Last active June 29, 2021 13:02
대전과학고등학교 급식 메뉴
차수수밥
부대찌개/사리면
콰트로치즈돈까스
돌김자반
열무김치
%%
브로콜리감자양파스프
베이컨스크램블드에그/케첩
바나나
@kjsman
kjsman / birds.py
Created March 5, 2021 18:30
새떼 시뮬레이션 by Boids algorithm
# 2021, By Jinseo Kim
# CC BY 4.0으로 배포됩니다.
import random
import math
import time
import os
# Screen size
X = 200
@kjsman
kjsman / imagenet_classes.txt
Created December 7, 2020 09:20
ImageNet에 포함되는 사진 데이터의 클래스 목록.
tench, Tinca tinca
goldfish, Carassius auratus
great white shark, white shark, man-eater, man-eating shark, Carcharodon carcharias
tiger shark, Galeocerdo cuvieri
hammerhead, hammerhead shark
electric ray, crampfish, numbfish, torpedo
stingray
cock
hen
ostrich, Struthio camelus
@kjsman
kjsman / README.md
Last active June 21, 2021 04:56
Autograd

Autograd

Warning

  • 어디선가 오류 날 가능성 100%
  • 변수명 다 쌩까고 단일 변수로 취급함. 따라서 편미분 못함 ㅎㅎ

Update Log

파희

아희로 구현한 원주율 계산기입니다. Spigot 알고리즘을 이용하여 원주율의 (정수부 포함) 15000자리를 계산하여 출력합니다. reference.c를 바탕으로 만들었습니다.

알파희로 그냥 실행하면 Segmentation fault (core dumped)가 뜹니다. -O0으로 최적화를 꺼주면 잘 실행됩니다.

총 계산에 대략 8초 소요됩니다.

$ time ./rpaheui-c pi.aheui

저는 f064408af1c8438815d567045e933eac23825ff6cb7f945fbc9927bad77cf9aa (SHA-256) 로 된 문서를 KST 2020-05-01 23:25 부터 배포하고 있습니다.

그렇다고요.