Skip to content

Instantly share code, notes, and snippets.

View himself65's full-sized avatar

Alex Yang himself65

View GitHub Profile
lastDigit :: [Integer] -> Integer
lastDigit [] = 1
lastDigit [x] = x `rem` 10
lastDigit (x:xs) = (x `rem` 10) ^ y `rem` 10
where
y =
case xs of
[k] -> (k - 1) `rem` 4 + 1
otherwise -> foldr1 f xs
f a 0 = 1
@himself65
himself65 / Zhihu Close Down?
Last active December 4, 2020 09:40
Zhihu Close Down?
知乎还没有倒闭……
Zhihu.com haven't closed down today... 😔
2020-12-04 09:40 +0000
@himself65
himself65 / Did following websites shut down
Last active December 4, 2020 09:43
Did following websites shut down
https://zhihu.com haven't shut down now...
https://baidu.com haven't shut down now...
Update at Friday, December 4th 2020, 9:43:54 +00:00
@himself65
himself65 / undefined
Last active May 24, 2021 07:33
Weibo
Pin 完善低龄未成年人犯罪规定
1 何炅 419151
2 买到核酸阳性食品是否会被传染 259536
3 迪丽热巴 黄景瑜 171031
4 英国疫情 113204
5 郭德纲 不收女徒弟是因为尊重 108208
6 有翡 103028
7 顶楼 71276
8 伦敦 63130
9 送你一朵小红花预售破5000万 58755
@himself65
himself65 / 1.gpg
Created June 2, 2021 03:10
GPG public key
-----BEGIN PGP PUBLIC KEY BLOCK-----
mDMEYLbxZRYJKwYBBAHaRw8BAQdATFdcA7J4mWJExkiE3/8DeW1DKWb030my+ZNt
vfXsAR60IWhpbXNlbGY2NSA8aGltc2VsZjY1QG91dGxvb2suY29tPoiWBBMWCAA+
FiEEOTIG5PAbpIbS2E+p1AeyLk+ZcYgFAmC28WUCGwMFCQPFGtsFCwkIBwIGFQoJ
CAsCBBYCAwECHgECF4AACgkQ1AeyLk+ZcYjwowEAtn8/B2iqtwvUU2J6mJt2WHpH
WMqGpEFaqguKDLmDcrsA/0PURfdgad2rvMZzga10Q4Wa5jrUFvmM627+JmqsSVAJ
uDgEYLbxZRIKKwYBBAGXVQEFAQEHQDxXJXdZHi1tATvVQxZa4N+fIV9ZKGIlG5mt
h5ZMiIwfAwEIB4h+BBgWCAAmFiEEOTIG5PAbpIbS2E+p1AeyLk+ZcYgFAmC28WUC
GwwFCQPFGtsACgkQ1AeyLk+ZcYg/PQD/UNCVFuS0r7y+sMDsdTJTeK4PNBFRtF8b

Keybase proof

I hereby claim:

  • I am himself65 on github.
  • I am himself65 (https://keybase.io/himself65) on keybase.
  • I have a public key ASBZaZ33kwDgLhupwfqUx_Npl5fEaOADoITAx6Bv3aXXEAo

To claim this, I am signing this object:

@himself65
himself65 / index.html
Created October 22, 2021 18:57
Blogger Code
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<title>Example 01</title>
</head>
<body>
<h1>IndexedDB example</h1>
</body>
<script type="module">
Date Close/Last Volume Open High Low
04/12/2022 $167.66 79265180 $168.02 $169.87 $166.64
04/11/2022 $165.75 72246710 $168.71 $169.03 $165.5
04/08/2022 $170.09 76575510 $171.78 $171.78 $169.2
04/07/2022 $172.14 77594650 $171.16 $173.36 $169.85
04/06/2022 $171.83 89058780 $172.36 $173.63 $170.13
04/05/2022 $175.06 73401790 $177.5 $178.3 $174.415
04/04/2022 $178.44 76545980 $174.57 $178.49 $174.44
04/01/2022 $174.31 78751330 $174.03 $174.88 $171.94
03/31/2022 $174.61 103049300 $177.84 $178.03 $174.4
INFO: 192.168.31.144:52267 - "POST /sentence_classification HTTP/1.1" 500 Internal Server Error
ERROR: Exception in ASGI application
Traceback (most recent call last):
File "/home/labelray/Code/NLP_server/venv/lib/python3.10/site-packages/uvicorn/protocols/http/httptools_impl.py", line 401, in run_asgi
result = await app(self.scope, self.receive, self.send)
File "/home/labelray/Code/NLP_server/venv/lib/python3.10/site-packages/uvicorn/middleware/proxy_headers.py", line 78, in __call__
return await self.app(scope, receive, send)
File "/home/labelray/Code/NLP_server/venv/lib/python3.10/site-packages/fastapi/applications.py", line 269, in __call__
await super().__call__(scope, receive, send)
File "/home/labelray/Code/NLP_server/venv/lib/python3.10/site-packages/starlette/applications.py", line 124, in __call__
@himself65
himself65 / main.py
Created July 12, 2022 23:03
Use pydantic to genrerate standard function type
import pydantic.validators
def plus_a_b(a: int, b: int):
return a + b
result = pydantic.validate_arguments(plus_a_b)
print(result.model.schema_json(indent=2))
# {