- Sep 2024
-
crypto.stackexchange.com crypto.stackexchange.com
-
hash digest returns an alphanumeric message which is the digest. that is incorrect, this alphanumeric message is a representation of the digest. The digest itself is a string of bits with a fixed length
-
-
bugs.ruby-lang.org bugs.ruby-lang.org
-
In practice when people use ||, they do mean ?? (whatever its spelling). It just so happens that most of the time, it does what you want, because you happen to not be dealing with Booleans. But the semantics you mean to express is not about "truthness", but about "nilness". And occasionally you get bitten because false does exist, and behaves differently.
-
- Jul 2024
-
blog.cloudflare.com blog.cloudflare.com
-
This is safe to do, because it doesn’t affect any state machine transitions, but merely preserves original 0x00 bytes and delegates their replacement to the parser in the end user’s browser.
Tags
Annotators
URL
-
- Feb 2024
-
github.com github.com
-
Its a bit tricky because of the ambiguity of how the args get presented. You can see through the little demo the args are presented the same way whether its a straight kwargs or a hash, but the assignment of the args to parameters is different. def foo(*args) puts args.inspect end def bar(x=1, a:2) puts "x:#{x} a:#{a}" end foo(:a => 1) # [{:a=>1}] foo({:a => 1}) # [{:a=>1}] bar(:a => 1). # x:1 a:1 bar({:a => 1}). # x:{:a => 1} a:2
-
- 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.
-
- Nov 2023
-
github.com github.com
-
BTW to improve the reliability of that test I believe you would need a sleep (smaller, e.g. of 0.1) between the Thread.new and assert M.works?, otherwise it's likely the M.works? runs first and then the other thread will see the constant is autoloading and wait, and anyway that thread does not check what is defined on M. For the test to fail it needs to be the Thread.new running first and defining the constant but not yet the method, before the main thread keeps running and call the method.
-
- May 2023
-
ourworldindata.org ourworldindata.orgBooks1
-
A book is defined as a published title with more than 49 pages.
[24] AI - Bias in Training Materials
-
-
www.technologyreview.com www.technologyreview.com
-
An AI model taught to view racist language as normal is obviously bad. The researchers, though, point out a couple of more subtle problems. One is that shifts in language play an important role in social change; the MeToo and Black Lives Matter movements, for example, have tried to establish a new anti-sexist and anti-racist vocabulary. An AI model trained on vast swaths of the internet won’t be attuned to the nuances of this vocabulary and won’t produce or interpret language in line with these new cultural norms. It will also fail to capture the language and the norms of countries and peoples that have less access to the internet and thus a smaller linguistic footprint online. The result is that AI-generated language will be homogenized, reflecting the practices of the richest countries and communities.
[21] AI Nuances
-
- Dec 2022
-
-
Because I am as interested in the attitudes and assumptions which are implicit in the evidence as in those which were explicitly articulated at the time, I have got into the habit of reading against the grain. Whether it is a play or a sermon or a legal treatise, I read it not so much for what the author meant to say as for what the text incidentally or unintentionally reveals.
Historians, sociologists, anthropologists, and surely other researchers must often "read against the grain" which historian Keith Thomas defines as reading a text, not so much for what the author was explicitly trying to directly communicate to the reader, but for the small tidbits that the author through the text "incidentally or unintentionally reveals."
-
-
www.rfc-editor.org www.rfc-editor.org
-
This can lead to the sending of email to the correct address but the wrong recipient.
-
-
github.com github.com
-
Mailgun, with its permanent failure webhook, is sending a message about a permanent failure of that specific message - it is Campaign that is then making a decision to translate this message, about just that one message, into a permanently bounced (suppressed) contact, and blocking all future emails to that contact - based on, what is clearly quite possibly just a temporary failure. It's really the distinction between a single message level (temporary) problem and a (permanent) contact level problem that is being lost with Campaign's current approach.
-
- Nov 2022
-
stackoverflow.com stackoverflow.com
-
replacement glyph missing glyph interpretable but unrenderable character
-
- Oct 2022
-
stackoverflow.com stackoverflow.com
-
which failed to work because of the trailing slash before the **. Removing the / made it all spring in to life as intended!
-
- May 2022
-
github.com github.com
-
No option is perfect here, but a warning seems like a decent compromise unless there's a whole bunch of other plugins that break
-
- Apr 2022
-
-
It should be | { fallthrough: true } rather than | { fallthrough: boolean } I think (there's no reason you'd have false)
-
-
stackoverflow.com stackoverflow.com
-
Caution: + continues the statement but not the string. puts "foo"+"bar".upcase gives you fooBAR, whereas puts ("foo"+"bar").upcase gives you FOOBAR. (Whether or not there's a newline after the +.) But: if you use a backslash instead of the plus sign, it will always give you FOOBAR, because combining lines into one statement, and then combining successive strings into one string, happen before the string method gets called.
-
-
github.com github.com
-
These callbacks are focused on the transactions, instead of specific model actions.
At least I think this is talking about this as limitation/problem.
The limitation/problem being that it's not good/useful for performing after-transaction code only for specific actions.
But the next sentence "This is beneficial..." seems contradictory, so I'm a bit confused/unclear of what the intention is...
Looking at this project more, it doesn't appear to solve the "after-transaction code only for specific actions" problem like I initially thought it did (and like https://github.com/grosser/ar_after_transaction does), so I believe I was mistaken. Still not sure what is meant by "instead of specific model actions". Are they claiming that "before_commit_on_create" for example is a "specific model action"? (hardly!) That seems almost identical to the (not specific enough) callbacks provided natively by Rails. Oh yeah, I guess they do point out that Rails 3 adds this functionality, so this gem is only needed for Rails 2.
-
-
-
If I create a model ActiveRecord sends NULL values for every field that is not defined. Postgres dutifully writes the NULL value into the field instead of the default value. Activerecord should either send nothing (preferable) or send DEFAULT.
Tags
Annotators
URL
-
- Mar 2022
-
askubuntu.com askubuntu.com
-
Use apt as a first choice, but if you're scripting use apt-get. Apt-get has more stable output (meaning that the output format is left alone as much as possible so as not to break scripts which parse that output automatically). Apt-get also has some low-level commands not available in apt.
-
- Feb 2022
-
bugs.ruby-lang.org bugs.ruby-lang.org
-
"Context" manipulation is one of big topic and there are many related terminologies (academic, language/implementation specific, promotion terminologies). In fact, there is confusing. In few minutes I remember the following related words and it is good CS exam to describe each :p Thread (Ruby) Green thread (CS terminology) Native thread (CS terminology) Non-preemptive thread (CS terminology) Preemptive thread (CS terminology) Fiber (Ruby/using resume/yield) Fiber (Ruby/using transfer) Fiber (Win32API) Generator (Python/JavaScript) Generator (Ruby) Continuation (CS terminology/Ruby, Scheme, ...) Partial continuation (CS terminology/ functional lang.) Exception handling (many languages) Coroutine (CS terminology/ALGOL) Semi-coroutine (CS terminology) Process (Unix/Ruby) Process (Erlang/Elixir) setjmp/longjmp (C) makecontext/swapcontext (POSIX) Task (...)
-
- Jan 2022
-
blog.atomist.com blog.atomist.com
-
The callback executed by setTimeout is not expected to return anything, it just ignores the returned value. Since once you enter the promise/async world in JavaScript you cannot escape, I was left to wonder what happens when the setTimeout callback returns a promise?
-
-
stackoverflow.com stackoverflow.com
-
test2 being marked async does wrap your return value in a new promise:
-
const rejectedP = Promise.reject('-'); const finallyP = rejectedP.finally(); const result1 = rejectedP; const result2 = new Promise(resolve => { const rejectedP = Promise.reject('-'); const finallyP = rejectedP.finally(); resolve(rejectedP); }); we can see that the first snippet creates two promises (result1 and rejectedP being the same) while the second snippet creates three promises. All of these promises are rejected, but the rejectedP rejection is handled by the callbacks attached to it, both through ….finally() and resolve(…) (which internally does ….then(resolve, reject)). finallyP is the promise whose rejection is not handled in the both examples. In the second example, result2 is a promise distinct from rejectedP that is also not handled, causing the second event.
-
-
stackoverflow.com stackoverflow.com
-
You basically did var a = promise.then(…); var b = promise.catch(…); creating a branch in the chain. If promise is getting rejected now, the catch callback will be called and b will be a fulfilled promise just fine, but the a promise is getting rejected too and nobody handles that. Instead, you should use both arguments of then and write Requirement.create({id: id, data: req.body.data, deleted: false}) .then(requirement => { res.json(requirement); }, reason => { let err = {'error': reason}; res.json(err); });
-
- Sep 2021
-
stackoverflow.com stackoverflow.com
-
The differences are subtle
-
- Apr 2021
-
en.wikipedia.org en.wikipedia.org
-
The use of U+212B 'Angstrom sign', which was encoded due to round-trip mapping compatibility with an East-Asian character encoding, is discouraged, and the preferred representation is U+00C5 'capital letter A with ring above', which has the same glyph.
Is there a difference in semantic meaning between the two? And if so, what is it? 
-
-
stackoverflow.com stackoverflow.com
-
They cause completely different behavior for auto margins. If you have a fixed element for example with top/bottom/left/right set to zero and you stick an image in it you want to center wrapped in a div, then in order to center that div with auto margins, you MUST specify a CSS width/height, because specifying an HTML attribute width/height has no effect and the margins remain zero. I have no idea why the difference exists.
-
-
unix.stackexchange.com unix.stackexchange.com
-
unbuffer is able to pass along the return code of a process under normal circumstance, but if the process you are unbuffering is killed, for instance with a segfault, I see $? as 0 while I expect 139. How can I get it to pass along the 139?
-
The expect wait command returns more arguments if the spawned process is killed but unbuffer just always returns the 3rd argument.
-
-
english.stackexchange.com english.stackexchange.com
-
Some humor is just funny on a surface level, or incorporates words that sound funny. What makes dry humor unique is that it isn't always obviously funny, especially with a deadpan delivery; you often need to think about it. The humor is entirely within the meaning of the words.
-
-
en.wikipedia.org en.wikipedia.org
-
STREAMS originated in Version 8 Research Unix, as Streams (not capitalized).
-
-
unix.stackexchange.com unix.stackexchange.com
-
Unfortunately, unlike what is described in SWdream solution, --ignore-missing-args has no impact on vanished files. It will simply ignore source arguments that doesn't exist.
-
-
boardgamegeek.com boardgamegeek.com
-
The central decision of the game is when to play your houses. And you didn't even really talk about that.
-
Few real decisions to make....Not in my experience, either in tile placement or in disk placement. Of possible interest is the thread:Informal experiment: how easy to find "the optimal disk placement" in various positions?wherein we see that even in the second phase, which people often complain is "automatic" or "obvious", the decisions are not necessarily obvious.
-
-
www.rdrop.com www.rdrop.com
-
Requirement #2 contains an unwarranted assumption. The body needs to flow not around the sidebar, but around the sidebar's position. That may seem like splitting hairs, but it isn't -- because what if there were something floated where we want to put the sidebar? The body would flow around that space. If we could put the sidebar in that same location, we'd have a solution.
-
-
stackoverflow.com stackoverflow.com
-
In my opinion, the W3C definition is unnecessarily confusing and restrictive. The dictionary definition of aside is "a temporary departure from a main theme or topic", and the spec should just stick to that, rather than introducing subtle distinctions.
-
I believe the accepted answer is not quite correct. According to the HTML5 working draft, the <aside> element can be used to mark up side notes in certain, but not all cases:
-
- Mar 2021
-
en.wikipedia.org en.wikipedia.org
-
The distinction in computer programming between classes and objects is related, though in this context, "class" sometimes refers to a set of objects (with class-level attribute or operations) rather than a description of an object in the set, as "type" would.
-
-
en.wikipedia.org en.wikipedia.org
-
Sometimes lexicography is considered to be a part or a branch of lexicology, but properly speaking, only lexicologists who write dictionaries are lexicographers.
-
Not to be confused with lexicography.
-
-
en.wikipedia.org en.wikipedia.org
-
The "Pluridisciplinary" or "multidisciplinarity" level The genuine cross-disciplinary level: "interdisciplinarity" The discipline-forming level "transdisciplinarity"
-
- Feb 2021
-
unix.stackexchange.com unix.stackexchange.com
-
In any case signal handling in shells is one of the least reliable and portable aspects. You'll find behaviours vary greatly between shells and often between different versions of a same shell. Be prepared for some serious hair pulling and head scratching if you're going to try to do anything non-trivial.
-
-
unix.stackexchange.com unix.stackexchange.com
-
Also, this code will fail if $$ is not the process group leader, such as when the script is run under strace. Since a call to setsid(2) is probably tricky from a shell script, one approach might be to ps and obtain the process group ID from that.
-
you really need #!/bin/sh -m for correct behavior of nested subshells. fg, bg, and wait wont work correctly otherwise
-
-
en.wikipedia.org en.wikipedia.org
-
The term encapsulation is often used interchangeably with information hiding. Not all agree on the distinctions between the two though; one may think of information hiding as being the principle and encapsulation being the technique. A software module hides information by encapsulating the information into a module or other construct which presents an interface.
-
-
en.wikipedia.org en.wikipedia.org
-
Remix occurs when the original meme is altered in some way, while mimicry occurs when the meme is recreated in a different fashion to the original.
I don't even understand the difference (yet)
-
-
-
I agree that validation is a process that determines the property of validity of a certain object
-
- Dec 2020
-
www.quora.com www.quora.com
- Nov 2020
-
en.wikipedia.org en.wikipedia.org
-
Often the term intransitive is used to refer to the stronger property of antitransitivity.
-
-
-
If I use import { createEventDispatcher } from 'svelte/internal'; instead of import { createEventDispatcher } from 'svelte'; then it seems to work because it's loading from the same module.
-
If current_component is never used outside of svelte/internal, it will be fine.
-
-
github.com github.com
-
When using the exact same Button code, the binding only works for the local Svelte module.
-
-
github.com github.com
-
If I, however, copy the content of index.svelte directly into the other project, it works fine. What can I do to fix that?
-
-
-
This is the kind of bug we don't want to have, since it can be subtle, non-obvious, and hard to reproduce.
-
- Oct 2020
-
github.com github.com
-
docker --tlsverify ps executes just fine, while docker-compose --tlsverify up -d --force-recreate gives me an error: SSL error: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed
-
-
github.com github.com
-
When using a method in a top-level object to modify its state, such object isn't updated either.
-
- Sep 2020
-
github.com github.com
-
It looks like the issue stems from having "svelte" as a dependency instead of a devDependencies in package.json within the sapper project. This causes import 'svelte' to load the rollup excluded npm package's set_current_component instead of from within the sapper generated server.js.
-
-
docs.google.com docs.google.com
-
I’ve seen some version of this conversation happen more times than I can remember. And someone will always say ‘it’s because you’re too used to thinking in the old way, you just need to start thinking in hooks’.
But after seeing a lot of really bad hooks code, I’m starting to think it’s not that simple — that there’s something deeper going on.
-
- Jul 2020
-
bugs.ruby-lang.org bugs.ruby-lang.org
-
Arrays are not sets. Trying to treat them as if they are is an error, and will create subtle problems. What should be the result of the following operations? [1, 1] | [1] [1] | [1, 1] Of course, there are more interesting examples. These two are to get you started. I don't care what the results currently are. I don't care what you think they should be. I can present extremely strong arguments for various answers. For this reason, I believe that #| is an ill-defined concept. Generalizing an ill-defined concept is a world of pain. If you insist on treating objects of one class as if they were members of a different class, there should be bumps in the road to at least warn you that maybe this is a bad idea. I'm not going to argue that we should remove or deprecate #|. I don't think of myself as a fanatic. But encouraging this sort of abuse of the type system just creates problems.
-
- Apr 2017
-
-
Borgia-like
The House of Borgia was an Italo-Spanish family who rose to power underhandedly during the Renaissance. Although they influence two popes being elected, they were suspected of many murders by poisoning, as this painting by John Collier "A glass of wine with Ceasar Borgia" shows the hesitancy in the young man about to have his wine glass filled with possibly poisonous wine. Sara Willis here relates to Thoreau's disdain for those who seek to destroy their opponents and obtain a majority who makes all of the important decisions.
Tags
Annotators
URL
-