A Bash process may be:
State | Invocation |
---|---|
Login (L) | argv[0][0] == '-' , --login |
Interactive (I) | -i , stdin is tty |
Remote (R) | stdin is "network connection" (see below) |
var PIXI = require('pixi.js') | |
console.log(PIXI) |
(defn- ellipses-if-long | |
"Append \"...\" to string version of x if x's length exceeds n." | |
([x] (ellipses-if-long x 50)) | |
([x n] | |
(assert (pos? n) "n must be positive") | |
(let [s (str x)] | |
(if (> (.length s) n) | |
(str (subs s 0 n) "...") | |
s)))) |
#!/bin/bash | |
set -euo pipefail | |
API_KEY=$(cat ~/.lastfm_api_key) | |
LASTFM_USER="overthink" | |
LIMIT=1000 | |
getpage() { | |
local page="${1?need page number to fetch}" | |
curl -s "http://ws.audioscrobbler.com/2.0/?method=user.getlovedtracks&user=$LASTFM_USER&api_key=$API_KEY&format=json&limit=$LIMIT&page=$page" \ |
#!/usr/bin/python | |
# Print filenames that are duplicated at least once (by content hash) in the | |
# repo. | |
import fileinput | |
from collections import defaultdict | |
import subprocess | |
digest_to_path = defaultdict(list) | |
p = subprocess.Popen( |
object Parens { | |
def parameterless: String = "foo" | |
def emptyParens(): String = "bar" | |
def fireNukes(): String = "nukes fired" | |
def log(f: () => String): Unit = { println("fn: " + f) } | |
def log(msg: String): Unit = { println("string: " + msg) } | |
def main(args: Array[String]) { |
The issue is that the superclass gets instantiated first, and if it has an eager val that | |
calls an abstract def (or abstract lazy val, if such a thing is possible) it will capture | |
the not-yet-fully-initialized value of that val in the subclass (which is usually null). | |
scala> trait T { def f: String; val callsF = f } // *val* `callsF` calls abstract def `f` -- risky! | |
defined trait T | |
scala> object X extends T { val f = "foooo" } // `f` is implemented with a strict val -- bomb is set | |
defined object X |
Classfile /home/mark/src/clj-re/target/classes/clj_re/core$simple.class | |
Last modified 13-Jun-2018; size 1119 bytes | |
MD5 checksum 7a8f0ea3a3b22a33c335acffef1eda0a | |
Compiled from "core.clj" | |
public final class clj_re.core$simple extends clojure.lang.AFunction | |
minor version: 0 | |
major version: 49 | |
flags: ACC_PUBLIC, ACC_FINAL, ACC_SUPER | |
Constant pool: | |
#1 = Utf8 clj_re/core$simple |