Implement
append
in Scheme, TypeScript, Python, and Kotlin
Here is an implementation of the append
function in Scheme:
(define (append lst1 lst2)
(if (null? lst1)
PassengerId | Survived | Pclass | Lname | Name | Sex | Age | SibSp | Parch | Ticket | Fare | Cabin | Embarked | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | 0 | 3 | Braund | Mr. Owen Harris | male | 22 | 1 | 0 | A/5 21171 | 7.25 | S | ||
2 | 1 | 1 | Cumings | Mrs. John Bradley (Florence Briggs Thayer) | female | 38 | 1 | 0 | PC 17599 | 71.2833 | C85 | C | |
3 | 1 | 3 | Heikkinen | Miss. Laina | female | 26 | 0 | 0 | STON/O2. 3101282 | 7.925 | S | ||
4 | 1 | 1 | Futrelle | Mrs. Jacques Heath (Lily May Peel) | female | 35 | 1 | 0 | 113803 | 53.1 | C123 | S | |
5 | 0 | 3 | Allen | Mr. William Henry | male | 35 | 0 | 0 | 373450 | 8.05 | S | ||
6 | 0 | 3 | Moran | Mr. James | male | 0 | 0 | 330877 | 8.4583 | Q | |||
7 | 0 | 1 | McCarthy | Mr. Timothy J | male | 54 | 0 | 0 | 17463 | 51.8625 | E46 | S | |
8 | 0 | 3 | Palsson | Master. Gosta Leonard | male | 2 | 3 | 1 | 349909 | 21.075 | S | ||
9 | 1 | 3 | Johnson | Mrs. Oscar W (Elisabeth Vilhelmina Berg) | female | 27 | 0 | 2 | 347742 | 11.1333 | S |
#!/bin/sh | |
# 1. Define a base set of credentials with APPID and APPSECRET | |
. ~/.facebookrc | |
# APPID= | |
# APPSECRET= | |
function init { | |
echo | |
echo |
// Resolve a dependency graph to sequence | |
// https://web.stanford.edu/~jurafsky/slp3/15.pdf | |
const resolve = (sentence, deps) => { | |
let ops = []; | |
while (sentence.length > 0) { | |
let word = sentence.pop(); | |
if (deps.hasOwnProperty(word)) { | |
console.log('Dependencies exist for', word); |
I hereby claim:
To claim this, I am signing this object:
-----BEGIN PGP PUBLIC KEY BLOCK----- | |
mQENBF0198cBCADUXddFEe4jPV8r6NW/AWjMlLkkzIOUkAgoBpOosBWN3Q7vWJMl | |
rmkBV3rVy/qjZHXukf9TuZDeqkPQ9BumAuEDLX+KmlSvE1W+ar9gATPDofI0Cmok | |
FYhM8s+kM1M31I+wfWjvuMaGZJMOsxD7Bgr9JaXBM9yck2ZA6Gn3Am+M6UcDAh1j | |
ST6Y/ONZvjeUWVd/ysSjAcqAiL/FmCndDMq1+TaQzBp+viAPavN3hrx3w1VXR1HK | |
SnlcAzeWdlmLQBNlDAiNV0uJm1g6gKKfHb3zwetnswT52jlD7/atwoMHbPMpyKp1 | |
p5MEG89XeYbo2UrubCU3iZBJa2VZe/6T9dxDABEBAAG0H0phc29uIFdhbHNoIDxq | |
d2Fsc2gxQGNoZXd5LmNvbT6JAU4EEwEIADgWIQTzbBmWV/ol8bo1TW+0lb/m/ZrG | |
CAUCXTX3xwIbAwULCQgHAgYVCgkICwIEFgIDAQIeAQIXgAAKCRC0lb/m/ZrGCLKv |
HOST=example.com | |
npm install -g get-graphql-schema graphql-cli graphql-faker | |
mkdir graphql-faker-$HOST && cd graphql-faker-$HOST | |
graphql -p $HOST init | |
graphql -p $HOST get-schema | |
# The previous is the same as | |
# get-graphql-schema https://$HOST/graphql/ > schema.graphql | |
graphql-faker schema.graphql |
export PATH="/usr/local/sbin:$PATH" | |
[[ -r "/usr/local/etc/profile.d/bash_completion.sh" ]] && . "/usr/local/etc/profile.d/bash_completion.sh" | |
alias emacs='/Applications/Emacs.app/Contents/MacOS/Emacs' | |
if [ -f "$(brew --prefix)/opt/bash-git-prompt/share/gitprompt.sh" ]; then | |
__GIT_PROMPT_DIR=$(brew --prefix)/opt/bash-git-prompt/share | |
GIT_PROMPT_ONLY_IN_REPO=1 | |
source "$(brew --prefix)/opt/bash-git-prompt/share/gitprompt.sh" |
// Procedure: Each connection should link lower to higher | |
let layout = [ | |
[0, 1, 2], | |
[7, 8, 3], | |
[6, 5, 4], | |
]; | |
// Encoding | |
let digits = [ | |
"0107122334455667", // 0 |