This file contains hidden or 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
--- /etc/cloud/cloud.cfg 2019-09-12 07:42:33.236106056 +0000 | |
+++ /etc/cloud/cloud.cfg.dpkg-new 2021-05-11 17:22:24.000000000 +0000 | |
@@ -12,7 +12,7 @@ | |
disable_root: true | |
# This will cause the set+update hostname module to not operate (if true) | |
-preserve_hostname: true | |
+preserve_hostname: false | |
# Example datasource config |
This file contains hidden or 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
type Option<T> = T | undefined; | |
type Parser<T> = (input: string) => [Option<T>, string]; | |
const alt | |
: <T>(pa: Parser<T>, pb: Parser<T>) => Parser<T> | |
= (pa, pb) => (input) => { | |
const result = pa(input); | |
if (result[0] !== undefined) return result; | |
return pb(input); | |
}; |
This file contains hidden or 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
const HIDDEN_STYLE = ` | |
height:0 !important; | |
visibility:hidden !important; | |
overflow:hidden !important; | |
position:absolute !important; | |
z-index:-1000 !important; | |
top:0 !important; | |
right:0 !important | |
`; |
This file contains hidden or 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
// 沒限制 | |
function g(a: number[], p: (x: number) => boolean) { | |
let i; | |
for (i = 0; i < a.length; ++i) { | |
if (p(a[i])) return i; // early return | |
} | |
return i; | |
} | |
// 有限制 |
This file contains hidden or 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
use crate::arith::syntax::*; | |
use Term::*; | |
pub fn eval1(term: Term) -> Term { | |
match term { | |
// E-IfTrue | |
If(box True, box t1, _) => t1, | |
// E-IfFalse | |
If(box False, _, box t2) => t2, | |
// E-If-Wrong |
This file contains hidden or 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 { | |
Term, | |
tru, | |
fal, | |
cond, | |
succ, | |
pred, | |
isZero, | |
wrong, | |
} from '../syntax'; |
This file contains hidden or 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 React, { FC } from 'react'; | |
import * as Inter from 'interaction'; | |
export default const Foo: FC<Inter.ListProps<[string, number, string]>> = ({ value, onChange }) => { | |
return ( | |
<Inter.List value={value} onChange={onChange}> | |
<Inter.Text /> | |
<p>foobar</p> | |
<Inter.Number /> | |
<Inter.Text /> |
This file contains hidden or 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
type Anime<T> = (time: number) => T; | |
const three: Anime<number> = (time) => 3; | |
const twice: Anime<number> = (time) => 2 * time; | |
const addAnime | |
: (ax: Anime<number>, ay: Anime<number>) => Anime<number> | |
= (ax, ay) => (time) => ax(time) + ay(time); | |
This file contains hidden or 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
FLOL∀C 2020 邏輯、語言與計算暑期研習營 | |
-- | |
=================================================================== | |
2020 Formosan Summer School on Logic, Language, and Computation | |
FLOL∀C '20 | |
2020 「邏輯、語言與計算」暑期研習營 |
This file contains hidden or 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
#!/usr/bin/perl | |
my @articles; | |
my $cur_article = 0; | |
if(@ARGV != 1){ | |
open DIARY, "<./.note" or die; | |
while(<DIARY>){ | |
exit @diary if(/EOD/); | |
print; |