37 Matching Annotations
  1. Dec 2023
    1. && nil

      first sighting: I don't think I've seen someone write exactly && nil before.

      Apparently to avoid having the return value from errors.add — which should be done solely for its side effect, not to get a return value -- inadvertently being used as a return value for user. It wouldn't make sense to return from user. That should only return a User or nil. And more statically typed languages would allow that to be expressed/enforced from type annotations alone, which would have caught the mistake of returning errors.add if someone had accidentally attempted to return that.

      Having user (and therefore call) return nil is key to the unless @current_user working.

    2. nil

      I appreciate the attention to detail of returning nil if that's what should be returned (rather than accidentally just returning the return value from the last line of code, errors.add.

  2. Dec 2022
  3. Nov 2022
    1. Changing the second line to: foo.txt text !diff would restore the default unset-ness for diff, while: foo.txt text diff will force diff to be set (both will presumably result in a diff, since Git has presumably not previously been detecting foo.txt as binary).

      comments for tag: undefined vs. null: Technically this is undefined (unset, !diff) vs. true (diff), but it's similar enough that don't need a separate tag just for that.

      annotation meta: may need new tag: undefined/unset vs. null/set

    1. Unspecified No pattern matches the path, and nothing says if the path has or does not have the attribute, the attribute for the path is said to be Unspecified.
    2. Unset The path has the attribute with special value "false"; this is specified by listing the name of the attribute prefixed with a dash - in the attribute list.
  4. Sep 2022
    1. Otherwise behaves according to the value of null_value_treatment which must be one of 'raise_exception', 'use_json_null', 'delete_key', or 'return_target'. The default is 'use_json_null'.
  5. Apr 2022
    1. 4.3.9 undefined value primitive value used when a variable has not been assigned a value 4.3.11 null value primitive value that represents the intentional absence of any object value
  6. Feb 2022
  7. Dec 2021
    1. How do I format files on save? See the following snippet: require("null-ls").setup({ -- you can reuse a shared lspconfig on_attach callback here on_attach = function(client) if client.resolved_capabilities.document_formatting then vim.cmd("autocmd BufWritePre <buffer> lua vim.lsp.buf.formatting_sync()") end end, })

      [[null-lsで保存時に自動フォーマットする]]

    1. これは Prettier の設定例です。あらかじめグローバルにprettierをインストールしておく必要があります。 init.lua use { "jose-elias-alvarez/null-ls.nvim", requires = { "nvim-lua/plenary.nvim" } } local nullls = require "null-ls" nullls.config { sources = { nullls.builtins.formatting.prettier, }, } require("lspconfig")["null-ls"].setup {}
    2. neovim でフォーマッタを動かす方法はいろいろありますが、ここではnull-lsを紹介します。 これは様々なツールの出力を LSP の形式に変換して nvim-lsp に送るという仕組みになっています。似たようなツールにdiagnostic-languageserverやefm-langserverがありますが、null-lsはあくまで neovim のプラグインなので外部依存がないことが利点です。
  8. Nov 2021
  9. Sep 2021
  10. Aug 2021
  11. Jul 2021
    1. Prof Nichola Raihani on Twitter: “Submitted a paper reporting null results to a mid tier journal. Guess how it went. I literally don’t care at this point but I do feel bad for the first author (who I won’t name here). Https://t.co/sX5lTcEl29” / Twitter. (n.d.). Retrieved July 16, 2021, from https://twitter.com/nicholaraihani/status/1415308025179656194

  12. Jun 2021
  13. Mar 2021
    1. // WRONG ❌ - values.myField might be undefined! if (!values.myField.match(/myexpression/)) {
    2. If you are doing a regular expression check, your function should handle undefined as a potential value.
  14. Feb 2021
    1. There are times where it is useful to know whether a value was passed to run or the result of a filter default. In particular, it is useful when nil is an acceptable value.

      Yes! An illustration in ruby:

      main > h = {key_with_nil_value: nil}
      => {:key_with_nil_value=>nil}
      
      main > h[:key_with_nil_value]
      => nil
      
      main > h[:missing_key]  # this would be undefined in JavaScript (a useful distinction) rather than null, but in Ruby it's indistinguishable from the case where a nil value was actually explicitly _supplied_ by the caller/user
      => nil
      
      # so we have to check for "missingness" ("undefinedness"?) differently in Ruby
      
      main > h.key?(:key_with_nil_value)
      => true
      
      main > h.key?(:missing_key)
      => false
      

      This is one unfortunate side effect of Ruby having only nil and no built-in way to distinguish between null and undefined like in JavaScript.

  15. Sep 2020
  16. Aug 2020
    1. That's exactly why I use xargs -0 in conjunction with find -print0. The latter prints filenames with a NUL terminator and the former receives files that way. Why? Filenames in Unix can contain newline characters. But they cannot contain NUL characters.
  17. Mar 2020
    1. . However, the data did not support a meresimilarity effect: Our results were robust to controlling for partic-ipants’ own moral judgments, such that participants who made adeontological judgment (the majority) strongly preferred a deon-tological agent, whereas participants who made a consequentialistjudgment (the minority) showed no preference between the two

      But this is a lack of a result in the context of a critical underlying assumption. Yes, the results were 'robust', but could we really be statistically confident that this was not driving the outcome? How tight are the error bounds?

  18. Nov 2019
    1. Null Components should never have children - they'd never be rendered.
    2. Aligning closely with the <Injector_ > naming convention, Null Components are denoted with a prefix and postfix _ (e.g. <_NullComponent_ />).
    3. The idea is that the additional prefix _ of a Null Component symbolizes that it adds even less to the DOM than an Injector. I picture the name falling through to become just the _, like the unused argument convention in javascript functions: const handleEvent = (_, id) => { console.log(id) } .
  19. Oct 2019
  20. Aug 2019
  21. Jun 2018