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
| (ns oop-with-inheritance) | |
| (defn start [arg] | |
| (println "starting: " arg)) | |
| (defn stop [sys] | |
| (println "stopping:" sys)) | |
| (defn server-system-local [& args] | |
| (apply println "making server system:" args) |
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
| (uiop:define-package :fwoar.zipfile | |
| (:mix :cl :fwoar.lisputils) | |
| (:export )) | |
| (in-package :fwoar.zipfile) | |
| (defun read-bytes (n s) | |
| (with (seq (make-array n :element-type 'serapeum:octet)) | |
| (values seq | |
| (read-sequence seq s)))) |
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
| // | |
| // Two kinds of animals: dogs and cats | |
| // | |
| // I want greet and leave to be defined such that there are four | |
| // different behaviors corresponding to each combination of dog and | |
| // cat | |
| // | |
| class Animal { | |
| receive_operation(operation) { | |
| console.log("the animal is unresponsive"); |
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 java.lang.RuntimeException | |
| import java.util.Arrays | |
| object VariantWorld2 { | |
| class Greet : World.Visitor { | |
| fun visit(subject: Dog, arg: String): String { | |
| return "$arg is greeted" | |
| } | |
| fun visit(subject: Cat, arg: String): String { |
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
| (defun fwoar--find-lisp-project-root (dir-name) | |
| (let ((root (locate-dominating-file dir-name | |
| (lambda (n) | |
| (directory-files n nil "^[^.#][^#]*[.]asd$"))))) | |
| (when root | |
| (cons 'lisp root)))) | |
| (cl-defmethod project-roots ((project (head lisp))) | |
| (list (cdr project))) |
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
| *.tar.gz | |
| .sentinel.* |
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
| package co.fwoar.java.tree; | |
| import java.util.ArrayDeque; | |
| import java.util.Deque; | |
| public class Main { | |
| static class Tree { | |
| public int val; | |
| public Tree left; | |
| public Tree right; |
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 ch = require("cheerio"); | |
| const fetch = require("node-fetch").default; | |
| const getLeadingNum = (v) => parseInt(v.split(" ")[0], 10); | |
| function HNParser(html) { | |
| if (! (this instanceof HNParser)) { | |
| return new HNParser(html); | |
| } | |
| this.html = html; |
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
| // Available variables: | |
| // - Machine | |
| // - interpret | |
| // - assign | |
| // - send | |
| // - sendParent | |
| // - spawn | |
| // - raise | |
| // - actions | |
| // - XState (all XState exports) |
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
| First State& | |
| Animation | |
| AnimationRunning | |
| animationDone -> AnimationDone | |
| AnimationDone | |
| refresh -> Animation | |
| Screen | |
| Idle | |
| animationDone -> Ready | |
| Ready |