- Nov 2023
-
stackoverflow.com stackoverflow.com
-
ArgumentError: arguments passed to url_for can't be handled. Please require routes or provide your own implementation
-
-
www.rfc-editor.org www.rfc-editor.org
-
An identifier embodies the information required to distinguish what is being identified from all other things within its scope of identification. Our use of the terms "identify" and "identifying" refer to this purpose of distinguishing one resource from all other resources, regardless of how that purpose is accomplished (e.g., by name, address, or context).
Tags
Annotators
URL
-
-
www.rfc-editor.org www.rfc-editor.org
Tags
Annotators
URL
-
-
github.com github.com
-
For more details, see RFC 6570.
-
- Oct 2023
-
en.wikipedia.org en.wikipedia.org
-
usage is also, however, a concern for the prescriptive tradition, for which "correctness" is a matter of arbitrating style
-
In the descriptive tradition of language analysis, by way of contrast, "correct" tends to mean functionally adequate for the purposes of the speaker or writer using it, and adequately idiomatic to be accepted by the listener or reader
-
-
www.thoughtco.com www.thoughtco.com
-
Usage seems to us peculiarly a matter of ear. Everyone has his own set of rules, his own list of horribles.
-
"Usage is trendy, arbitrary, and above all, constantly changing, like all other fashions--in clothing, music, or automobiles. Grammar is the rationale of a language; usage is the etiquette."
-
But when they ask, 'Does spelling count?' we tell them that in writing, as in life, everything counts. For academic writers, as for writers in a wide variety of fields (business, journalism, education, etc.), correctness in both content and expression is vital.
-
although we do point out the mistakes.
-
What interests us far more is that these apprentice writers have interesting ideas to convey, and manage to support their arguments well.
only partial match: the most important thing is the information (more than presentation/formatting)
-
New words, and new senses and uses of words, are not sanctioned or rejected by the authority of any single body: they arise through regular use and, once established, are recorded in dictionaries and grammars.
-
In this book, grammar refers to the manner in which the language functions, the ways that the blocks of speech and writing are put together. Usage refers to using specific words in a manner that will be thought of as either acceptable or unacceptable. The question of whether or not to split an infinitive is a consideration of grammar; the question of whether one should use literally in a nonliteral sense is one of usage."
-
Rules of proper usage are tacit conventions. Conventions are unstated agreements within a community to abide by a single way of doing things--not because there is any inherent advantage to the choice, but because there is an advantage to everyone making the same choice. Standardized weights and measures, electrical voltages and cables, computer file formats, the Gregorian calendar, and paper currency are familiar examples.
-
-
auth0.com auth0.com
-
after they log out
They're not even consistent within this same page.
-
after they logout
They're not even consistent within this same page.
-
-
grammarist.com grammarist.com
-
Tags
Annotators
URL
-
-
codereview.stackexchange.com codereview.stackexchange.com
-
stackoverflow.com stackoverflow.com
-
github.com github.com
-
www.amazon.com www.amazon.com
-
Installation took about an hour following these directions -[...]
annoying automatic censorship removed important detail
-
-
stackoverflow.com stackoverflow.com
-
Browsers can of course choose to ignore this. Again, CORS protects your client - not you.
-
-
www.kickstarter.com www.kickstarter.com
-
There is no place for luck in this game. This is all about strategy.
-
-
www.imdb.com www.imdb.com
-
Not much to say except I'm really annoyed by the critics sometimes. This movie is solid. Has a vintage old-time feel to it. Well acted. Deals with the problems of the times (racism, bullying, war, alcoholism, death) in a dramatic, humorous and clever way.Great story. Whole family loved it. They dealt with faith in a reasonable way. They pulled heartstrings without being saccharine. The critics are just so dead-set on hating any movie that deals with faith, especially the Christian faith.
-
-
en.wikipedia.org en.wikipedia.org
-
The term "Hobson's choice" is often used to mean an illusion of choice, but it is not a choice between two equivalent options, which is a Morton's fork, nor is it a choice between two undesirable options, which is a dilemma. Hobson's choice is one between something or nothing.
-
A Hobson's choice is different from:
Tags
Annotators
URL
-
-
docs.gitlab.com docs.gitlab.com
-
User impersonation workflow
-
-
yourdailygerman.com yourdailygerman.com
-
So, here is what the German zwar does:zwar sets up a but.
-
-
www.techradar.com www.techradar.com
Tags
Annotators
URL
-
-
www.npr.org www.npr.org
-
seeking to exonerate people who participated in the Jan. 6, 2021, siege of the U.S. Capitol as civic-minded people who were being politically persecuted
-
-
www.techradar.com www.techradar.com
-
You also have an editable display name. As I do with all social media, I went with my full name.
-
Instead of centralized services, which, Dorsey now regrets creating with Twitter, it's distributed so that anyone can build an interface to display the data and activity flowing underneath. It's also designed so that your identity and information is easily transferable to any other platform that supports the protocol (Authenticated Transfer Protocol).
-
-
en.wikipedia.org en.wikipedia.org
-
-
www.figma.com www.figma.com
-
edgeguides.rubyonrails.org edgeguides.rubyonrails.org
-
options.delete(:expires_in) { ActiveStorage.urls_expire_in }
What is the contents of the block for? When is it invoked?
I assume this is a type, and should have been
fetch() { }
instead?
-
-
www.youtube.com www.youtube.com
-
-
flaxengine.com flaxengine.com
-
-
www.youtube.com www.youtube.com
-
-
www.youtube.com www.youtube.com
-
-
stackoverflow.com stackoverflow.com
-
When a language presumes to know more than its user, that's when there's trouble.
-
Just because a language has a feature that might be dangerous doesn't mean it's inherently a bad thing. When a language presumes to know more than its user, that's when there's trouble.
-
I'd argue that when you find a programming language devoid of danger, you've found one that's not very useful.
-
The reason eval is there is because when you need it, when you really need it, there are no substitutes. There's only so much you can do with creative method dispatching, after all, and at some point you need to execute arbitrary code.
-
-
When is eval justified? In pragmatic terms, when you say it is. If it's your program and you're the programmer, you set the parameters.
Tags
- who's the boss
- Ruby
- programming languages
- software that presumes to know more than its user
- programmers
- quotable
- balance
- useful feature removed from software
- powerful
- there is no substitute
- pragmatic
- dangerous (programming)
- programming languages: dangerous feature
- useful
- eval
- who should decide?
Annotators
URL
-
-
www.merriam-webster.com www.merriam-webster.com
-
transitive verb
It's hard for me to see the difference between the transitive and intransitive forms of this verb.
Is that the transitive form can/must be used with a noun following it, like "presume something", while the intransitive form cannot be followed by a noun, but can (and often is) followed by a prepositional phrase, "presume that something"? Pretty subtle difference, but I guess it's there...
Tags
Annotators
URL
-
-
ell.stackexchange.com ell.stackexchange.com
-
The main usage difference is that dependency can be used in a second sense as a "concrete" noun to mean a person or thing which depends on something/someone else. But note that in the programming context it's not uncommon to see it used to mean a software resource upon which some piece of software depends (i.e. - reversing the need/provide relationship).
Is that really true? Can dependency refer to a person or thing which depends on something/someone else?? I'm only used to it the other way.
-
as a native speaker I'd probably tend to refer to his drug dependency, but his dependence on drugs (maybe because I see one as a problem he has, and the other as something he's doing, I don't know).
-
And as others have pointed out, there is potential for ambiguity: if A is dependent on B, then a dependence or dependency (relationship) exists; but referring to either A or B as the dependency demands context.
"demands context" :)
-
I think that "dependency" is usually the thing that you depend on, whereas dependence is the state of depending on it. But there are certainly cases where you could use either interchangeably.
-
If you want the easy way out (which looks like the way majority usage is going anyway), you can probably get away with using dependency all the time.
-
Dependence and dependency can both be used in the state/condition of being dependent sense.
.
-
-
There are certainly cases where you can use dependency and cannot use dependence: for example "The UK's overseas dependencies", or "This software releases has dependencies on Unix and Java". So if the dependent things are discrete and countable, it should definitely be "dependency".
-
-
english.stackexchange.com english.stackexchange.com
-
I think "dependence" and "dependency" are like "competence" and "competency". Both are nouns. Yet, "dependence" emphasizes the quality of being dependent. So, it may also be abstract. Whereas, "dependency" focuses on the state of being dependent. It is likely to be concrete.
This seemed reasonable at first, but I'm not convinced it's the best explanation.
The conclusion at https://oneminuteenglish.org/en/dependence-or-dependency/ was a bit clearer, although mostly the same:
Just remember that “dependence” is the quality and “dependency” is the state of having to rely on someone or something else.
https://ell.stackexchange.com/questions/41528/differences-between-dependence-and-dependency/41561#41561 disagrees with the claim that "state" makes it likely to be concrete. And I like how it clarifies state as "state/condition" (condition is a lot clearer to me):
Dependence and dependency can both be used in the state/condition of being dependent sense. By definition, all words referencing such "states" are abstract nouns, so I don't see any justification for OP's abstract/concrete distinction in that sense.
-
-
I don't understand the distinction between quality and state.
Now that I mention it, neither do I. What's the difference between a quality and a state?
-
-
oneminuteenglish.org oneminuteenglish.org
-
Just remember that “dependence” is the quality and “dependency” is the state of having to rely on someone or something else.
While I agree with this... What's the difference between a quality and a state?
-
-
github.com github.com
Tags
Annotators
URL
-
-
stackoverflow.com stackoverflow.com
-
git branch --delete --remotes origin/X git branch -dr origin/X # Shorter
-
they're not wrong, but they don't teach what you don't know you don't know, whereas the one I link to makes this critical unknown unknown become a known unknown and then a known known. I didn't know you had a 1) local branch, 2) locally-stored remote-tracking branch, and 3) remote branch until I read that answer. Prior to that I thought there was only a local branch and remote branch. The locally-stored remote-tracking branch was an unknown unknown. Making it go from that to a known known is what makes that answer the best.
-
-
steamcommunity.com steamcommunity.com
-
I just want to tell you how wonderfully helpful, thorough, and precise your reviews are. I really appreciate them, and finding this review has led me to read others of yours. I don't think I've ever read a better review. Thank you!
-
-
tapoueh.org tapoueh.org
-
rubynor-web-next-lime.vercel.app rubynor-web-next-lime.vercel.app
-
where("period @> date ? ", shares_at)
-
t.daterange :period
-
- Sep 2023
-
docs.rubocop.org docs.rubocop.org
-
The indentation of the remaining lines can be corrected with other cops such as IndentationConsistency and EndAlignment.
-
-
superuser.com superuser.com
-
-
One thing for the impatient: after the program displays number of messages in both accounts, it seems that it has hung up. But it does something in the background and one has to wait a longer while before it starts displaying info about copied messages.
-
-
imapsync.lamiral.info imapsync.lamiral.info
-
Good feedback is always welcome! and bad feedback is very often welcome It may sounds crazy but I do reply personally to every single email message I receive, so don't hesitate to spend time writing to me about your email problems, you're sure to get my attention and my time.
personally replies to every single email message they receive
-
-
www.linuxbabe.com www.linuxbabe.com
-
-
--stop-after-configfile-check
-
Kamatera is a very good option to run a mail server because They don’t block port 25, so you can send unlimited emails (transactional email and newsletters) without spending money on SMTP relay service. Kamatera doesn’t have any SMTP limits. You can send a million emails per day. The IP address isn’t on any email blacklist. (At least this is true in my case. I chose the Dallas data center.) You definitely don’t want to be listed on the dreaded Microsoft Outlook IP blacklist or the spamrats blacklist. Some blacklists block an entire IP range and you have no way to delist your IP address from this kind of blacklist. You can edit PTR record to improve email deliverability. They allow you to send newsletters to your email subscribers with no hourly limits or daily limits, whatsoever. You can order multiple IP addresses for a single server. This is very useful for folks who need to send a large volume of emails. You can spread email traffic on multiple IP addresses to achieve better email deliverability.
-
-
mailinabox.email mailinabox.email
-
-
Mass electronic surveillance by governments revealed over the last several years has spurred a new movement to re-decentralize the web, a movement to empower individuals to be their own service providers again.
-
-
www.iredmail.org www.iredmail.org
-
www.imdb.com www.imdb.com
-
If you are watching this show with non-Chinese subtitles you are massively missing out. The Chinese dialogue is written with the skill of a bard. The language is sophisticated, succinct, elegant and poetic - as beautiful as the visuals. In comparison, the English subtitles were dull and prosaic, an abominable shadow of the original dialogue, using the vocabulary of a primary school student. It's as if the varying shades of blue - cerulean, sapphire, teal, indigo were translated into "blue, blue, blue, blue". I was truly disappointed by the English subtitles
-
-
www.dovecot.org www.dovecot.org
-
-
-
-
This allows reading your email offline without the need for your mail reader (MUA) to support IMAP operations. Need an attachment from a message without internet connection? No problem, the message is still there.
-
IMAP's main downside is that you have to trust your email provider to not lose your email.
-
-
modoboa.org modoboa.orgModoboa2
-
Modoboa is an alternative to those 3 options. It frees you from dependence on email providers and makes accessible to all the creation his own secure email server.
-
use the services of free email providers (Gmail, Live, Yahoo...) which are limited and your data is used for commercial purposes. Install your own email server, which requires important technical knowledge to setup and configure the system.
-
-
mysqldump-secure.org mysqldump-secure.org
-
cron mode (--cron) which only produces stderr output to prevent cron from sending mails on sucessful run
-
-
mysqldump-secure.org mysqldump-secure.org
-
wrapper script for mysqldump
-
-
github.com github.com
-
Besides that ffscreencast can act as an ffmpeg command generator. Every available option can also just show the corresponding ffmpeg command instead of executing it. Non-ffmpeg commands, such as how the camera resolution is pulled and others can also be shown instead of being executed.
-
-
allows fool-proof screen recording via the command line
-
a shell wrapper for ffmpeg
-
-
mywiki.wooledge.org mywiki.wooledge.org
-
-
If IFS is unset, or its value is exactly <space><tab><newline>, the default, then any sequence of IFS characters serves to delimit words. If IFS has a value other than the default, then sequences of the whitespace characters space and tab are ignored at the beginning and end of the word, as long as the whitespace character is in the value of IFS (an IFS whitespace character). Any character in IFS that is not IFS whitespace, along with any adjacent IFS whitespace characters, delimits a field. A sequence of IFS whitespace characters is also treated as a delimiter. If the value of IFS is null, no word splitting occurs.
-
-
docs.github.com docs.github.com
-
Inspect the proposed changes in the pull request and ensure that you are comfortable running your workflows on the pull request branch. You should be especially alert to any proposed changes in the .github/workflows/ directory that affect workflow files.
-
-
github.com github.com
-
github.com github.com
-
www.everythingcli.org www.everythingcli.org
-
-
I add it as a cron from webmin - a Web GUI for administering any linux box
-
linux-timemachine
-
sudo apt-get install backup-manager
-
-
github.com github.com
-
-
it should provide one task only and do it well
-
without the need of external requirements and only rely on default installed tools
-
tree -L 2 /dst
tree
-
-
stackoverflow.com stackoverflow.com
-
Exclude and include rules are resolved relative to the root of the transfer, but finding rule files (e.g. --exclude-from='exclude-list') is done relative to the working directory of the rsync process (which it inherits from the process that ran it).
-
-
www.xmodulo.com www.xmodulo.com
-
ldd --version
-
-
www.maketecheasier.com www.maketecheasier.com
-
www.howtogeek.com www.howtogeek.com
-
-
For example, still not over the death of Google Reader after all these years? Why not host your own RSS aggregator like Sismics Reader that nobody can ever take away from you?
-
Self-hosting is when you---either using a computer on your local network at home or a remote "bare metal" server host you've purchased---host your own services for various purposes.
-
-
en.wikipedia.org en.wikipedia.org
-
redecentralize.org redecentralize.org
-
In the author’s view, using a combination of content-addressing, signed content, and petnames would help decentralise that layer. It keeps centralisation around aggregators (because of the scarcity of attention), but mitigates their harmful lock-in.
-
“Perhaps there is a rule of thumb here? If you decentralize, the system will recentralize, but one layer up. Something new will be enabled by decentralization. That sounds like evolution through layering, like upward-spiraling complexity. That sounds like progress to me.”
-
“But our everyday reality using the computer does not feel empowering. You want to use the internet without being tracked? Almost impossible. Want to message a friend? I hope you have read and agree to the WhatsApp Terms of Service and Privacy Policy. Want to install some software on your Apple device? It better be in the App Store. Perhaps you want to lend an Amazon eBook to your sister? Well you don’t actually own it, so you’ll have to ask Amazon.”
-
-
en.wikipedia.org en.wikipedia.org
-
-
Business logic in theory occupies the middle tier of a 3-tier architecture.
Tags
Annotators
URL
-
-
nlnet.nl nlnet.nl
-
It funds those with ideas to fix the internet.
Tags
Annotators
URL
-
-
redecentralize.org redecentralize.org
Tags
Annotators
URL
-
-
www.digitalocean.com www.digitalocean.com
-
In many ways, mail server stacks represent a collision between the tools and values of the early internet — self-hosting open source software using well-defined standards and interoperable protocols — and the reality of the modern internet — a few centralized, trusted authorities.
-
-
www.dekudeals.com www.dekudeals.com
Tags
Annotators
URL
-
-
www.kickstarter.com www.kickstarter.com
-
"All skill, no luck. There may be dice, but they're not for rolling. Beating your opponent is pure skill."
-
-
www.kickstarter.com www.kickstarter.com
-
lifehacker.com lifehacker.com
-
You do not need to buy the expensive Cascade Plus surfactant. You can use any clear shampoo you can find at Dollar Tree. The application rate is 3 ounces per 1,000 square feet. If you have 2,000 square feet to spray, put 6 ounces of shampoo into a hose-end sprayer, fill the jug carefully with water, and spray it out as evenly as you can over the entire yard. If you use too much, no problem. A friend of mine sprayed at 64 ounces per 1,000 and never had a problem. So spray your yard and follow that up with 1/2 to 1 inch of rain or irrigation. Wait 3 full weeks for the magic to happen. Once it does you will find that after a rain or deep irrigation the soil will become unsettlingly soft and it will return to very firm/hard underfoot when the soil dries out.
This is not my rant alone. I’m simply conveying what is well known in some of the better lawn care forums online. I did not believe in the shampoo treatment until I tried it. Before that all I knew was that core aeration did nothing for my lawn. So I spent a dollar on some cheap shampoo, and it worked way beyond my expectations. Also one treatment seems to last for many years as long as you don’t neglect watering for many weeks during a very hot/dry summer.
-
-
stackoverflow.com stackoverflow.com
-
Annoyingly, git fetch --depth=<N> won't pick up new tags
-
-
stackoverflow.com stackoverflow.com
-
git fetch --depth 1 origin <sha1>
-
-
www.digitalocean.com www.digitalocean.com
-
Well-thought-out, idiomatic APIs
-
-
-
www.digitalocean.com www.digitalocean.com
-
It is open sourced and you can find it at https://github.com/digitalocean/droplet-agent
-
-
The above diagram depicts the details of a session creation.
-
Since the Console UI is a web-based app running on the customer’s browser, there are a few challenges we had to overcome due to the limitation set by the browser environment. Typically, the SSH protocol runs over a TCP connection. However, a raw TCP connection isn’t allowed by most browsers. Moreover, even if we had a way to support a direct TCP connection from within the browser, the Console UI still would not be able to connect to the target Droplet due to CORS limitation unless we assigned every Droplet a sub domain that complies with the CORS requirements, which is impractical.
-
When building the Droplet Console, we had a few options to support SSH keys-based authentication. The most straightforward way would be to directly allow the customer to specify a private key that is already set up for accessing the Droplet. However, there are some problems with this solution:
-
-
github.com github.com
-
UNIX philosophy: Do one thing and do it well!
-
NOTE: this repository is mostly unmaintained; I will review and merge PRs, but I(@zenhack) am no longer using this tool myself and am thus not motivated to otherwise actively develop it.
-
-
en.wikipedia.org en.wikipedia.org
-
the Senate passed the bill by unanimous consent, although several senators stated later that they would have objected if they had known that the bill could pass
This doesn't make sense. Why would you vote for it if you object for it? Just vote what you really mean.
Tags
Annotators
URL
-
-
stackoverflow.com stackoverflow.com
-
commands="\nthing1@this is thing 1\!\nthing2@this is thing 2!" while read line;do // do your stuff here line <<< $( echo -e "${commands}" )
Seems to work. Not used to the <<< expression...
-
-e switch tells the echo command to honour all back slashes . The same behaviour can be achieved with `shopt -s xpg_echo` ( you have to remove -e switch whenever you do that )
-
Starting in bash 4.4, you can use ${input@E} in place of $(echo -e "$input").
-
-
stackoverflow.com stackoverflow.com
-
the OP's problem can not be solved simply by changing $IFS, because $IFS doesn't apply to quoted strings.
-
Bash doesn't do word expansion on quoted strings in this context. For example: $ for i in "a b c d"; do echo $i; done a b c d $ for i in a b c d; do echo $i; done a b c d
-
-
www.faqs.org www.faqs.org
-
unix.stackexchange.com unix.stackexchange.com
-
I am a developer, mainly on embedded systems, with a computer science background and security and cryptography leanings by trade. I also have interests in various other topics.
-
-
unix.stackexchange.com unix.stackexchange.com
-
Using quotes for i in "$(cat $1)"; results in i being assigned the whole file at once. What should I change?
-
files with characters after the last newline are not text files, and those characters don't constitute a line. In many cases those bogus characters are better left ignored or removed, though there are cases where you may want to treat it as a extra line, so it's good you show how.
-
(9 years later:)Both provided answers would fail on files without a newline at the end, this will effectively skip the last line, produce no errors, would lead to disaster (learned hard way:).
-
Answers are identical because Questions are identical too !
Tags
- opinion
- good question
- better to fail loudly with an error than to fail subtly/silently
- confusing for newcomers
- differences of opinion
- necroposting (posting to a long-inactive discussion thread)
- I agree
- disagreement
- funny
- I'm not sure about this
- shell scripting: handling spaces in input
Annotators
URL
-
-
mywiki.wooledge.org mywiki.wooledge.org
-
Also, always prefix globs with "/" or "./"; otherwise, if there's a file with "-" as the first character, the expansions might be misinterpreted as options.
Tags
Annotators
URL
-
-
support.google.com support.google.com
Tags
Annotators
URL
-
-
support.google.com support.google.com
-
-
documentation.mailgun.com documentation.mailgun.com
-
www.mailgun.com www.mailgun.com
-
stackoverflow.com stackoverflow.com
-
if at all possible, you should send MIME attachments instead, unless you specifically strive to be able to communicate with the late 1980s.
-
Back in the day, the de facto standard for sending binaries across electronic mail was uuencode. It still exists, but has numerous usability problems; if at all possible, you should send MIME attachments instead, unless you specifically strive to be able to communicate with the late 1980s.
-
-
serverfault.com serverfault.com
-
There is actually no meaningful distinction between a hostname which happens to be a second-level domain and a hostname which has more parts than that. You can even have a machine at a top-level domain if you happen to be a small country or otherwise are able to create an A record for one.
-
-
-
The host itself does not handle the actual FQDN. That is handled by the DNS. FQDN (Fully Qualified Domain Name) is handled by DNS translating names into IP addresses. Using the /etc/hosts file, you are essentially overriding the DNS server.
-
-
www.mailgun.com www.mailgun.com
-
Google, one of the main email service providers (ESPs)
-
-
help.mailgun.com help.mailgun.com
-
To ensure your messages pass the DMARC check with flying colors, you'll need to make certain the domains listed in the From, Sender, and Mail-From headers match each other exactly. That is, the domain listed in the From header is the exact actual sending domain.
-
For example, if your sending domain is ABCdomain.com, but your From field shows 123domain.com instead, you will almost certainly run into DMARC issues. Sometimes, even the difference between mail.ABCdomain.com and ABCdomain.com is sufficient for a server to place your message in a spam folder. We make sure that our Email Best Practices are clear that the domain listed in the From header and the actual sending domain should match for exactly this reason.
-
-
github.com github.com
-
Note that the mere presence of this header causes premailer to be skipped, i.e., even setting skip_premailer: false will cause premailer to be skipped. The reason for that is that the skip_premailer is a simple header and the value is transformed into a string, causing 'false' to become truthy.
They should fix this!
lib/premailer/rails/hook.rb
def skip_premailer_header_present? message.header[:skip_premailer] end
-
-
bugs.ruby-lang.org bugs.ruby-lang.org
-
sums = [0] (1..gains.length).each do |i| sums[i] = sums[i - 1] + gains[i - 1] end could, if scan was introduced, be replaced with: sums = gains.scan_left(0, &:+)
-
I'd even go as far as saying each_with_object is often less readable than using a captured variable.
elaborate? what is a captured variable? I assume he means the val = 0 from outside the scope of the block, which was "captured" in the closure.
-
I think "purely functional, not a single re-assigned variable" often introduces significant extra complexity, when Ruby is a language that embraces both functional and imperative programming.
-
One of my favorite aspects of Ruby is how easy it is to write in a functional programming style, and including the scan operation would expand the number of use cases covered by functional methods.
-
each_with_object is only useful if mutating some object (typically an Array or Hash).
typically true... is it always true?
-
I think this is the crux of the issue. Because #inject needs to evaluate every element in order to return a meaningful value, it can't be partially evaluated. The "scan" operation allows for partial evaluation.
-
I think there are real-world use cases! Would you consider converting a history of transactions into a history of account balances a valid use-case? That can be done easily with a scan. For example, if you have transactions = [100, -200, 200] then you can find the history of account balances with transactions.scan_left(0, &:+) # => [0, 100, -100, 100].
-
-
stackoverflow.com stackoverflow.com
-
no mention of each_with_object having a lazy implementation which is most likely why your second example loops forever.
-
-
www.sitepoint.com www.sitepoint.com
-
stackoverflow.com stackoverflow.com
-
-
You just blew my mind Marc-André. My code just went from idiotic to idiomatic.
-
-
ruby-doc.org ruby-doc.org
-
en.wikipedia.org en.wikipedia.org
-
Circuit representation of a work-efficient 16-input parallel prefix sum
Tags
Annotators
URL
-
-
github.com github.com
-
The key differences between #inject and #scan_left are: Incremental results: #scan_left returns a series of results after processing each element of the input series. #inject returns a single value, which equals the final result in the series returned by #scan_left. Laziness: #scan_left can preserve the laziness of the input series. As each incremental result is read from the output series, the actual calculation is lazily performed against the input. #inject cannot be a lazy operation in general, as its single result reflects a calculation across every element of the input series.
-
-
-
stackoverflow.com stackoverflow.com
-
def self.make_lazy(*methods) methods.each do |method| define_method method do |*args, &block| lazy.public_send(method, *args, &block) end end end
-
I want the fact that my collection is lazy to be an implementation detail.
-
-
sendgrid.com sendgrid.com
-
In order to enable MPP, users must have Apple devices, configure their email account to use Apple Mail applications, update their operating system to the latest version, and opt into MPP.
-
-
docs.sendgrid.com docs.sendgrid.com
-
In other words, when a recipient clicks the “unsubscribe” link in your email, the recipient’s mail client will send an email to this address. It is your responsibility to receive and process these generated emails.
-
You must include at least the mailto portion of the List-Unsubscribe header, since some services only support this portion (iOS, for example). However, many inbox providers and mail clients honor both methods. To ensure that the greatest number of your recipients have the ability to unsubscribe from your emails, thus protecting your reputation as a sender, we recommend including both mailto and http.
-