This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This is generated by v1.3.0 | |
type AccountRatereader @pgTable(name: "account_ratereader") { | |
id: Int! @unique | |
readerId: AccountMyuser @pgColumn(name: "reader_id") | |
relationshipDate: DateTime! @pgColumn(name: "relationship_date") | |
showerId: AccountMyuser @pgColumn(name: "shower_id") | |
} | |
// This is generated by v1.2.x and modified manually to deploy | |
// eg. generated `@relation(name: "account_ratereaders_readers")` -> modify `@relation(name: "AccountRatereaderReaders") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ( | |
"crypto/rand" | |
"crypto/sha256" | |
"crypto/subtle" | |
"encoding/base64" | |
"strconv" | |
"strings" | |
"time" | |
"golang.org/x/crypto/pbkdf2" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SPC | |
SPC: find file | |
, switch buffer | |
. browse files | |
: MX | |
; EX | |
< switch buffer | |
` eval | |
u universal arg | |
x pop up scratch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let input = Util.read_file "../input/y2021d1" |> List.map int_of_string | |
(* let%test _ = input = ["1"] *) | |
(* let%expect_test _ = | |
input |> List.iter (fun s -> print_endline s); | |
[%expect ""] *) | |
let prevs xs = xs |> List.rev |> List.tl |> List.rev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open Belt | |
let solution = xs => { | |
// 인용 횟수를 내림차순으로 정렬합니다. [3, 2, 1, ...] | |
// g-index가 제일 높은 경우, 논문 N개 | |
// 인용 횟수 배열의 맨 뒤부터 하나씩 sum을 비교하여, sum >= gIndex^2 인 gIndex를 찾습니다. | |
// 역으로 찾는 이유는 앞에서부터 찾는 경우 중간 이후 다시 조건을 만족하게 되는 경우를 찾을 수 없기 때문입니다. | |
// [3, 2, 1, ...] | |
let sorted = xs->List.fromArray->List.sort((a, b) => b - a)->List.toArray |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open Belt | |
// 각 문자열의 가장 뒷 글자끼리 정수로 변환하여 더한다.(a) | |
// 이전 연산의 결과로 넘어온 값 1 or 0 (b) | |
// 결과 (c) | |
// (a + b)가 10 미만인 경우 c 에 prepend 하고, 다음 연산(next)에 0을 넘겨준다. | |
// (a + b)가 10 이상인 경우 10을 뺀 값을 c에 prepend 하고, 다음 연산(next)에 1을 넘겨준다. | |
let toArray = s => s->Js.String2.split("") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open Belt | |
module rec Board: { | |
type rec t | |
and coord = (row, col) | |
and size = int | |
and col | |
and row | |
let init: size => t |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open Belt | |
module QuadTree = { | |
exception Invalid_Operation(string) | |
// P(ne, nw, sw, se) | |
type rec t = P(t, t, t, t) | White | Black | Empty | |
let empty = () => Empty | |
let fromString = s => |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 좋은 부분 문자열 | |
// 좋은 부분 문자열이란 어떤 문자열 s의 부분 문자열이면서 같은 알파벳이 두 번 이상 나타나지 않는 문자열을 말합니다. | |
// 예를들어 주어진 문자열이 "abac" 일 때, 부분 문자열 "a", "ab", "bac"등은 원래 문자열 "abac" 의 부분 문자열이면서 | |
// 문자열 내에 같은 알파벳이 두 번 이상 나타나지 않으므로 좋은 부분 문자열입니다. 그러나 "aba", "abac"는 문자열 내에 | |
// 같은 알파벳 'a'가 두 번 이상 나타나므로 좋은 부분 문자열이 아닙니다. 문자열 s가 주어질 때 좋은 부분 문자열의 개수를 | |
// return 하도록 solution 함수를 완성해주세요. | |
// "abac" => "a", "b", "c", "ab", "ba", "ac", "bac" | |
// "abcd" => "a", "b", "c", "d", "ab", "bc", "cd", "abc", "bcd", "abcd" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module ProfileFormFields = %lenses( | |
type t = { | |
nickname: string, | |
age: int, | |
} | |
) | |
module FormFields = %lenses( | |
type state = { | |
name: string, |
OlderNewer