- Chương trình chạy: A cần làm đề cương
async
: A gửi tin nhắn cho B, nhờ làm hộ đề cương rồi chụpawait
: A chờ B gửi bàinew promise
: B hứa sẽ làm đề cương giúp Apromise<pending>
: B làm đề cương giúp Apromise<fulfilled>
: B hoàn thành đề cương và chụp vở gửi cho A
promise
: B không làm đề cương giúp và để lại chữ "seen" cho A
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
h f g x = f (f g) (g x) -- JS equivalent: let h = f => g => x => f(f(g))(g(x)) | |
a y x = y x + 1 | |
b x = x * 2 | |
h a b 1 -- Guess the value |
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
// lib220 | |
/** | |
* Pixel: The type of each element in a canvas. | |
* Each number in pixel represents R, G, B, respectively. | |
*/ | |
type Pixel = [number, number, number]; | |
interface Canvas { | |
/** | |
* The drawLine function draws a line on the canvas that stretches from a designated |
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
const zlib = require("zlib"); | |
const fs = require("fs"); | |
function decode(s) { | |
let dec = zlib.inflateSync(s); | |
let res = dec.toString("utf8"); | |
return res; | |
} | |
function encode(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
import zlib | |
from sys import argv | |
def decode(s): | |
dec = zlib.decompress(s) | |
res = dec.decode("utf-8") | |
return res | |
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
g++ -CC -P -undef -nostdinc -dDI -E "$1" |
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
g++ -CC -P -undef -nostdinc -dDI -E "%1" |
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
#include <iostream> | |
#include <string> | |
#include <algorithm> | |
using namespace std; | |
#define _ ; | |
#define __ int | |
#define ___ main | |
#define ____ ( | |
#define _____ ) |
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
{ | |
"version": "2.0.0", | |
"tasks": [ | |
{ | |
"label": "Build C++17", | |
"group": "build", | |
"command": "g++", | |
"args": [ | |
"-std=c++17", | |
"-O3", |
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
@echo off | |
set _excode= | |
REM Check commands if available | |
where ffmpeg.exe | |
set ffmpeg_check=%errorlevel% | |
where gifski.exe | |
set gifski_check=%errorlevel% |
NewerOlder