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 Relation.Binary.PropositionalEquality as Eq | |
open Eq using (_≡_; refl) | |
open Eq.≡-Reasoning using (begin_; _≡⟨⟩_; _∎) | |
data ℕ : Set where | |
zero : ℕ | |
suc : ℕ → ℕ | |
{-# BUILTIN NATURAL ℕ #-} |
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 Relation.Binary.PropositionalEquality as Eq | |
open Eq using (_≡_; refl; cong; sym) | |
open import Data.Nat | |
open import Data.Bool.Base | |
data Tree : Set where | |
tempty : Tree | |
tnode : ℕ -> Tree -> Tree -> Tree |
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
#lang racket | |
(provide (all-defined-out)) | |
(define any? any/c) | |
(define (until p f) | |
(define (go x) | |
(match x | |
[(? p x) x] | |
[_ (go (f x))])) |
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
load .env inline: | |
env $(cat .env | xargs) mix release | |
sqlite ls tables: | |
SELECT table_name FROM information_schema.tables WHERE table_schema = 'public’; | |
SELECT * FROM sqlite_master where type='table'; -- d1 ok | |
PRAGMA table_info(table_name); | |
postgres ls tables: | |
SELECT * FROM pg_catalog.pg_tables WHERE schemaname='public'; |
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
func Deref(s *string) string { | |
if s != nil { | |
return *s | |
} | |
return "" | |
} | |
func ParseInt64OrDefault(s string) int64 { | |
n, strconvErr := strconv.ParseInt(s, 10, 64) | |
if strconvErr != nil { |
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
-- https://www.ma.imperial.ac.uk/~buzzard/xena/natural_number_game/ | |
-- 1. TUTORIAL | |
-- world=1&level=1 "using refl" | |
example : forall x : Nat, x = x := by | |
intro x | |
exact Eq.refl x | |
-- world=1&level=2 "using rw" | |
example |
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
export function objectCopy(obj) { | |
if (typeof obj === "object") { | |
return JSON.parse(JSON.stringify(obj)); | |
} else { | |
console.log(obj); | |
} | |
} |
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
<script> | |
export let display; | |
import ModalInternals from "./ModalInternals.svelte"; | |
let closeModal = false; | |
const handleClose = () => { | |
display = false; | |
}; | |
</script> |
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
from collections import namedtuple | |
import re | |
''' TXT structure sample: | |
"PROVINSI"(489,185),(652,185),(652,219),(489,219) | |
"JAWA"(658,185),(747,185),(747,219),(658,219) | |
"BARAT"(758,185),(866,185),(866,219),(758,219) | |
"KABUPATEN"(508,220),(704,220),(704,252),(508,252) | |
"BEKASI"(724,220),(848,220),(848,252),(724,252) |
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
# Modified from a stackoverflow answer. https://stackoverflow.com/a/52147997 | |
import imgaug as ia | |
from imgaug import augmenters as iaa | |
import numpy as np | |
import imageio | |
import os | |
number_of_output = 4 | |
result_folder = 'imgaug/' |
NewerOlder