- Sep 2024
-
github.com github.com
-
false is a perfectly non-nil object, and you're excluding it out of convenience!
-
- Dec 2023
-
www.pluralsight.com www.pluralsight.com
-
&& 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 foruser
. It wouldn't make sense to return fromuser
. 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 returningerrors.add
if someone had accidentally attempted to return that.Having
user
(and thereforecall
) return nil is key to theunless @current_user
working. -
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
.
-
- Dec 2022
-
www.zhihu.com www.zhihu.com
-
Js中Null类型有何用处?
Tags
Annotators
URL
-
- Nov 2022
-
stackoverflow.com stackoverflow.com
-
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
-
-
git-scm.com git-scm.com
-
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.
-
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.
Tags
Annotators
URL
-
- Sep 2022
-
www.postgresql.org www.postgresql.org
-
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'.
-
- Apr 2022
-
stackoverflow.com stackoverflow.com
-
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
-
- Feb 2022
-
bugs.ruby-lang.org bugs.ruby-lang.org
- Dec 2021
-
github.com github.com
-
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で保存時に自動フォーマットする]]
Tags
Annotators
URL
-
-
zenn.dev zenn.dev
-
これは 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 {}
-
neovim でフォーマッタを動かす方法はいろいろありますが、ここではnull-lsを紹介します。 これは様々なツールの出力を LSP の形式に変換して nvim-lsp に送るという仕組みになっています。似たようなツールにdiagnostic-languageserverやefm-langserverがありますが、null-lsはあくまで neovim のプラグインなので外部依存がないことが利点です。
Tags
Annotators
URL
-
- Nov 2021
-
-
Check whether a value is defined (non-nullable), meaning it is neither `null` or `undefined`. This can be useful as a type guard, as for example, `[1, null].filter(Boolean)` does not always type-guard correctly.
-
- Sep 2021
-
twitter.com twitter.com
-
Jonathan Robinson on Twitter. (n.d.). Twitter. Retrieved 6 September 2021, from https://twitter.com/jon_m_rob/status/1431734411335176199
-
-
twitter.com twitter.com
-
ReconfigBehSci on Twitter: ‘there is a literature on arguments from ignorance (viewed from a Bayesian perspective) that can help here, I think https://t.co/tg1Jlrlldg’ / Twitter. (n.d.). Retrieved 3 September 2021, from https://twitter.com/SciBeh/status/1432409133957869572
-
- Aug 2021
-
stackoverflow.com stackoverflow.com
-
This could be achieved using a dummy validating function. const validateType = <T> (obj:T) => undefined
-
-
github.com github.com
-
<ITest>foo; //a useless javascript line, but checks the var `foo` is assignable to `ITest`
-
-
stackoverflow.com stackoverflow.com
-
If you really don't want to use any, you could use an empty interface - {} - instead:
-
- Jul 2021
-
www.postgresql.org www.postgresql.org
-
(The null result should not be confused with a SQL NULL; see the examples.)
-
-
twitter.com twitter.com
-
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
-
- Jun 2021
-
psyarxiv.com psyarxiv.com
-
Lantian, A., & Rose, M. (2021). No Evidence That Believers in Conspiracy Theories Have More Negative Attitudes Toward Transhumanism. PsyArXiv. https://doi.org/10.31234/osf.io/pt8j7
-
-
dba.stackexchange.com dba.stackexchange.com
-
Careful, Instead of != you may need to IS DISTINCT FROM operator which also compares NULL value
-
-
www.postgresql.org www.postgresql.org
-
The field/element/path extraction operators return NULL, rather than failing, if the JSON input does not have the right structure to match the request; for example if no such key or array element exists.
-
- Mar 2021
-
final-form.org final-form.org
-
// WRONG ❌ - values.myField might be undefined! if (!values.myField.match(/myexpression/)) {
-
If you are doing a regular expression check, your function should handle undefined as a potential value.
-
-
dry-rb.org dry-rb.org
-
Dry::Types::Undefined
Cool! I workaround for the fact that Ruby has no undefined type distinct from nil.
-
- Feb 2021
-
github.com github.com
-
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 betweennull
andundefined
like in JavaScript.
-
- Sep 2020
-
twitter.com twitter.com
-
Daniël Lakens on Twitter. (n.d.). Twitter. Retrieved September 23, 2020, from https://twitter.com/lakens/status/1308115862247952386
-
- Aug 2020
-
www.journalofsurgicalresearch.com www.journalofsurgicalresearch.com
-
Althouse, A. D. (2020). Post Hoc Power: Not Empowering, Just Misleading. Journal of Surgical Research, 0(0). https://doi.org/10.1016/j.jss.2019.10.049
-
-
stackoverflow.com stackoverflow.com
-
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.
-
- Mar 2020
-
www.the-brights.net www.the-brights.net
-
. 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?
-
- Nov 2019
-
gist.github.com gist.github.com
-
Null Components should never have children - they'd never be rendered.
-
Aligning closely with the <Injector_ > naming convention, Null Components are denoted with a prefix and postfix _ (e.g. <_NullComponent_ />).
-
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) } .
-
- Oct 2019
-
devblogs.microsoft.com devblogs.microsoft.com
-
Nullish Coalescing
-
- Aug 2019
-
github.com github.com
-
Null Coalescing Operator
-
- Jun 2018
-
stackoverflow.com stackoverflow.com
-
if you need to pull out these rows and examine them
-