What does the word “literal” mean?

A literal is “any notation for representing a value within source code” (wikipedia) (Contrast this with identifiers, which refer to a value in memory.) Examples: “hey” (a string) false (a boolean) 3.14 (a real number) [1,2,3] (a list of numbers) (x) => x*x (a function) /^1?$|^(11+?)\1+$/ (a regexp) Some things that are not literals: std::cout … Read more

How do Clojure futures and promises differ?

Answering in Clojure terms, here are some examples from Sean Devlin’s screencast: (def a-promise (promise)) (deliver a-promise :fred) (def f (future (some-sexp))) (deref f) Note that in the promise you are explicitly delivering a value that you select in a later computation (:fred in this case). The future, on the other hand, is being consumed … Read more

What is inductive bias in machine learning? [closed]

Every machine learning algorithm with any ability to generalize beyond the training data that it sees has some type of inductive bias, which are the assumptions made by the model to learn the target function and to generalize beyond training data. For example, in linear regression, the model assumes that the output or dependent variable … Read more

Abstract classes vs. interfaces vs. mixins

Abstract Class An abstract class is a class that is not designed to be instantiated. Abstract classes can have no implementation, some implementation, or all implementation. Abstract classes are designed to allow its subclasses share a common (default) implementation. A (pseudocoded) example of an abstract class would be something like this abstract class Shape { … Read more

What do you call the entire first part of a URL?

It is called the origin. More generally speaking, here are the different parts of a URL, as per Location. (So at least according to how Javascript calls it) protocol://username:password@hostname:port/pathname?search#hash —————————–href—————————— —–host—- ———– origin ————- protocol – protocol scheme of the URL, including the final ‘:’ hostname – domain name port – port number pathname – … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)