29 Matching Annotations
  1. Last 7 days
    1. The simple problem that I see with fragment identifiers is that their existence and functionality relies completely on the developer rather than the browser. Yes, the browser needs to read and interpret the identifier and identify the matching fragment. But if the developer doesn’t include any id attributes in the HTML of the page, then there will be no identifiable fragments. Do you see why this is a problem? Whether the developer has coded identifiers into the HTML has nothing to do with whether or not the page actually has fragments. Virtually every web page has fragments. In fact, sectioning content as defined in the HTML5 spec implies as much. Every element on the page that can contain content can theoretically be categorized as a “fragment”.

      at the mercy of author

  2. Mar 2021
    1. To the consternation of some users, 3.x employed Unicode variable names such as λ, φ, τ and π for a concise representation of mathematical operations. A downside of this approach was that a SyntaxError would occur if you loaded the non-minified D3 using ISO-8859-1 instead of UTF-8. 3.x also used Unicode string literals, such as the SI-prefix µ for 1e-6. 4.0 uses only ASCII variable names and ASCII string literals (see rollup-plugin-ascii), avoiding encoding problems.
  3. Feb 2021
  4. Jan 2021
    1. // read-only, but visible to consumers via bind:start export let start = 0;

      Can't do

      export const start = 0

      (because it needs to be mutable/assignable within this local component), so we have to do

      export let start = 0

      with a comment saying that it's read-only (by the consumer).

    1. just writing in that the example code doesn't work on the REPL... perhaps because it tries to load CSS? I am not sure, but it says “Unexpected token (Note that you need plugins to import files that are not JavaScript)”.
    1. (Note that it is not possible to grant access to multiple specific sites, nor use a partial wildcard match. It is also not possible to specify more than one Access-Control-Allow-Origin header.)
  5. Dec 2020
    1. Yarn only runs the postinstall hook after yarn and yarn add, but not after yarn remove. The postinstall-postinstall package is used to make sure your postinstall hook gets executed even after a yarn remove.
  6. Nov 2020
  7. Oct 2020
    1. Don’t indent code blocks.

      Sure, we don't need to add any additional indent. But what if your code block contains indentation (function body)? It would look silly to remove all leading indentation.

  8. Sep 2020
  9. Aug 2020
  10. Jul 2020
    1. These seem to be better reasons to support sub-nanosecond resolution. I think either storing picoseconds or storing sec fraction as 64-bit integer are better approaches than storing a rational. However, either change would be very invasive, and it seems unlikely to be worth the effort.
    1. VII, after the map block, consider arr.each_with_object([]) do |(converted_val, orig_val),uniques|...end.
    2. Creating and calling a default proc is a waste of time, and Cramming everything into one line using tortured constructs doesn't make the code more efficient--it just makes the code harder to understand.

      The nature of this "answer" is a comment in response to another answer. But because of the limitations SO puts on comments (very short length, no multi-line code snippets), comment feature could not actually be used, so this user resorted to "abusing" answer feature to post their comment instead.


  11. Jun 2020
  12. May 2020
    1. Not merge the values of the keys.

      This is one of the biggest limatations of <<: *anchor: it overwrites values of keys. It's too heavy-handed and therefore of limited use. You can only use it if you don't mind keys getting overwritten (such as if you are going to overwrite the keys below the <<:.).

  13. Jan 2020
    1. ssh doesn't let you specify a command precisely, as you have done, as a series of arguments to be passed to execvp on the remote host. Instead it concatenates all the arguments into a string and runs them through a remote shell. This stands out as a major design flaw in ssh in my opinion... it's a well-behaved unix tool in most ways, but when it comes time to specify a command it chose to use a single monolithic string instead of an argv, like it was designed for MSDOS or something!