Alternative to pomodoro: put work and break on each half hour time interval’s todo list, and don’t let a break overlap two time intervals.
The emacs eshell is an interactive shell for entering commands written in elisp. I like it because it feels like a normal emacs buffer and I can easily move around and copy and paste, without switching to a copy mode. It loses many of the features of bash, but when I need them I can use bash, inside or outside of emacs.
I had a hard time figuring out how to set the path it uses when I type commands, though. I wound up finding a way that worked for me by reading the source of the which
function and then the code of eshell-search-path
, which the which
function uses to find executables in the path.
The variable is eshell-path-env
and it’s a colon-separated list of directories. I needed to add my nodebrew directory to it, and I did so by adding the following to ~/.emacs.d/init.el
:
(setq eshell-path-env (concat "/Users/bat/.nodebrew/current/bin" ":" eshell-path-env))
I’m not sure that this is the best answer, but it took me a while to find and answer that worked so I thought I’d share it.
XML/HTML are centered around elements. An element is something that has an opening tag and a closing tag, or simply has a single self-closing tag (The slash before the closing angle bracket is required in XML and XHTML but not HTML). For example, this has six elements:
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title>Hello, world.</title> </head> <body> <p>Hello, world.</p> </body> </html>
In this example each tag name is only used once. The elements are (by order of first appearance) html, head, meta, title, body, p. The DOCTYPE definition is special and is not considered to be an HTML or XML element. The charset part of this document is an attribute.
What does element mean in JSON? Something a bit different. An XML element is a compound data type. A JSON element is part of a compound data type.
If you look at the white box on the right part of json.org detailing the grammar, you can see that it has names for items in JSON’s compound data types, objects and arrays. An item in an object is called a pair, and an item in an array is called an element.
It helps when building APIs for processing data formats to have names for things. The terminology for XML is used in XML tools, and has made them easier to understand. For instance, the jQuery API docs use the terms element and attribute heavily.
I think the JSON community should adopt the terms pair and element and use them more frequently, to enhance understanding of the data. It’s useful to talk about a pair rather than a key and a value, because when you add something to a JavaScript object that’s what your adding. You aren’t adding just a value. A JavaScript array can include multiple copies of the same value, so when you’re removing a single occurrence of a value, it makes more sense to say you’re removing an element than removing a value.
JSON has been popular for years now, in many vital technology communities, but it is still lacking in processing support compared to XML. I think clear terminology is one thing that XML has right, and indeed the JSON spec has clear terminology. What’s lacking is widespread use of the terminology.