- May 2024
-
stackoverflow.com stackoverflow.com
-
I can confirm that this is still actual for Rails 7 - jpEg converts to jpg and your production fails.
-
- Apr 2024
-
forums.mozillazine.org forums.mozillazine.org
-
Ain't it possible that every message I send or forward will just be replaced to the outbox and will be send by Thunderbird in the background ? I really hate it that every message sends itself away, running on top of all other windows, and it makes me wait till it has been sent from reading my other messages...
-
-
www.summet.com www.summet.com
-
Personally I don’t find necessary to see the whole progress of how a mail is sent step-by-step, I just want to send the e-mail. Can’t understand why they are showing me all these but anyway
-
- Mar 2024
-
drive.google.com drive.google.com
-
She grades their results as if they haddone the writing entirely on their own.
Surprising: This definitely surprised me seeing a professor going so far as to treat the result as if the students have done the writing entirely on their own. It definitely clashed with my previously held belief.
-
That small number may simply reflect that professors who hadexperimented with AI — even if they concluded it is a danger to learning —probably had more reason to write to us.
Many students don’t know how to use AI correctly.
-
- Feb 2024
-
drive.google.com drive.google.com
-
Law redesigned her first-year writing course to include weekly “AI infused”discussion threads and assignments.
I am surprised that there is a class about the law of AI.
-
That small number may simply reflect that professors who hadexperimented with AI — even if they concluded it is a danger to learning —probably had more reason to write to us.
It was surprising for professors to realize that many students had limited knowledge about AI
-
-
unix.stackexchange.com unix.stackexchange.com
-
The input format of the xargs command doesn't match what any other command produces.
-
The input format of the xargs command doesn't match what any other command produces. Yes, it's bizarre. With -I, xargs ignores indentation, which is why the file names with initial spaces are mangled. Do not use xargs except with the -0 option or when you know your input doesn't contain characters that would confuse it.
-
- Jan 2024
-
www.claudiokuenzler.com www.claudiokuenzler.com
-
Why would a text message service require Location (GPS) permissions? Anyway I enabled this Location permission for testing. Heureka!!! Suddenly I was able to send text messages again to all the contacts which previously didn't work. The "Not sent, tap to try again" error was gone.
-
- Dec 2023
-
docdrop.org docdrop.org
-
i commissioned some original polling for my book from abacus research and i found some very hopeful stuff and you know the public gets the emergency and incidentally i've tried to recast 00:12:46 some of the the extreme weather events we've experienced as attacks on our soil let's think about them that way yeah um and they're ready for bold action actually the public is ahead of our politics in terms of that i was surprised to see 00:12:58 that you even mentioned in alberta the numbers are much higher than you so you mentioned quebec before so the the opinion polling nationally ranges from a high in quebec in terms of their readiness fraction right to a low in alberta but even in alberta 00:13:12 the level of support is remarkably high
- for: climate crisis - Canada - surprising positive public opinion shift
-
- Nov 2023
-
-
The first example needs a custom inflection rule: loader.inflector.inflect("max_retries" => "MAX_RETRIES") Otherwise, Zeitwerk would expect the file to define MaxRetries.
Potential problem. What if you need it both ways? A constant named
MAX_RETRIES
within a certain namespace, but also a higher-level MaxRetries class? Guess you'd have to work around it, probably by just definingMAX_RETRIES
inside its parent module...
-
- Sep 2023
-
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
-
-
rubyreferences.github.io rubyreferences.github.io
-
It seems that the method is a direct equivalent of a.fdiv(b).ceil, and as such, annoyingly unnecessary, but fdiv, due to floating point imprecision, might produce surprising results in edge cases
-
-
github.com github.com
-
I agree with this statement so much. We should absolutely be failing hard rather than forcing people to debug thread safety issues at runtime. I can't think of anything more infuriating than debugging an issue that happens "sometimes".
-
The problem is that in the case where an app is multi-threaded, and we don't switch off autoload, the case would be that it probably won't blow up, but random stuff will mysteriously sometimes fail in weird ways. So ask yourself this, what would you rather want, option 1) where you can get an exception at runtime, or option 2) where you get random, unpredictable, weird, hard to explain, difficult to debug bugs at runtime. Personally, I'm going to choose option 1. The downside of thread-safety issues is so much worse than the downside of the possibility of an exception. The way you're handling it makes it sound as though thread-safety is not important, as though Rails is still optimizing for the single-threaded case. That seems like a huge step back.
-
- Aug 2023
-
itsfoss.com itsfoss.com
-
It may seem like Testing is some sort of beta, unstable version but that’s not entirely true. Debian Testing is the next Debian stable version. The actual development branch is the Debian Unstable (also known as Sid). Debian Testing lies somewhere in between the unstable and stable branch where it gets the new features before the stable release.
Tags
Annotators
URL
-
- Jun 2023
-
stackoverflow.com stackoverflow.com
-
Have you ever: Been disappointed, surprised or hurt by a library etc. that had a bug that could have been fixed with inheritance and few lines of code, but due to private / final methods and classes were forced to wait for an official patch that might never come? I have. Wanted to use a library for a slightly different use case than was imagined by the authors but were unable to do so because of private / final methods and classes? I have.
-
Been disappointed, surprised or hurt by a library etc. that was overly permissive in it's extensibility? I have not.
-
- Jan 2023
-
stackoverflow.com stackoverflow.com
-
No, in Python "[ [] foo [] boo [][]] ".strip(" []") returns "foo [] boo".
I would have expected it would remove the string " []", not the occurrences of any of the characters within the string...
-
-
www.reddit.com www.reddit.com
-
I was very surprised to discover that Finder has no native SFTP integration. As an everyday Gnome user, it is unbelievable to me, how this can even be
-
-
docdrop.org docdrop.org
-
**Use Page Notes to add annotation guidance.
INSTRUCTIONS - Make 5 new annotations using the prompts below and respond to 3 others. Use text, hashtags, emojis, and G-rated language. Be respectful always.
PROMPTS - Annotate the text for each of the following: 1. Main claim, and why you think so. 2. Evidence that supports the claim and what additional information would make the evidence stronger. 3. Reasoning that connects the evidence to the claim (or if it's missing). 4. Something new or surprising you learned from this paper. 5. What could be the researchers' next experiment?
-
-
-
dependent: :destroy associations are deleted when performing soft-destroys requiring any dependent records to also be acts_as_paranoid to avoid losing data.
-
I've worked with and have helped maintain paranoia for a while. I'm convinced it does the wrong thing for most cases. Paranoia and acts_as_paranoid both attempt to emulate deletes by setting a column and adding a default scope on the model. This requires some ActiveRecord hackery, and leads to some surprising and awkward behaviour.
-
-
-
paranoia has some surprising behaviour (like overriding ActiveRecord's delete and destroy)
-
- Dec 2022
-
github.com github.com
-
This still seems like a bug, as the expected behavior doesn't occur and it's difficult (for someone unfamiliar with the inner workings of ActionMailer) to debug. I spent a good half an hour figuring out the work around, so I'm trying to prevent others from experiencing the same thing.
Tags
Annotators
URL
-
- Nov 2022
-
stackoverflow.com stackoverflow.com
-
However after doing a bit of testing I see that this character is not used to represent missing glyphs on either my Windows 7 computer or the Android phone I've tested with (Motorola Atrix).
-
-
github.com github.com
-
I just spent a day dismantling a model, trying to find the cause of the silent rollback - taking out every association, every validation, every callback, whittling down all the code in the transaction, only to finally discover that it was return true that was the cause of it all. Or yes, an exception!
-
I think I had expected that existing rails developers would discover this problem in existing code through the deprecation warning to avoid a nasty surprise. I'm worried about my future kids learning Rails and writing perfectly looking Ruby code just to learn the hard way that return is sometimes a nono! Jokes aside, I think that no one expected that the deprecation will turn into silent rollbacks. This is a very controversial change, pretty much everyone taking part in the discussion on the deprecation PR raised some concerns about the potential consequences of this change. The only thing that was making it easier to swallow was the promise of making it clear to the user by throwing an exception after the rollback.
-
- Oct 2022
-
-
Note: For keyword parameters, use @param, not @option.
I sure was looking for @option (knowing already about @param) and assuming/expecting that (if it exists) it would totally be the right thing to use for documenting keyword parameters. So I was quite surprised to see this much-needed warning (for me and others like me who came here expecting/assuming the same thing).
-
- Aug 2022
-
github.com github.com
-
then two different listeners/renderers switching magically between each other based on the header being present or not, without the end user being informed or clear about this
-
-
stackoverflow.com stackoverflow.com
-
This is actually the most correct answer, because it explains why people (like me) are suddenly seeing this warning after nearly a decade of using git. However,it would be useful if some guidance were given on the options offered. for example, pointing out that setting pull.ff to "only" doesn't prevent you doing a "pull --rebase" to override it.
-
- Jul 2022
-
github.com github.com
-
This was a surprise to me, since we generally authenticate the record quite well, but then go on to do something like record.file.url in our view, generating a URL that is permanent and unauthenticated.
-
- Jan 2022
-
stackoverflow.com stackoverflow.com
-
Explicitly defining the dependency in the reactive declarations
-
inputValue = updateInputValue(value);
-
-
github.com github.com
-
github.com github.com
-
github.com github.com
-
maybe this just comes down to general footguns with reactivity, and being aware of them as a developer.
-
- Nov 2021
-
stackoverflow.com stackoverflow.com
-
if you put the reactive statement $: validate(inputValue); after the function updateInputValue declaration, it's working as expected:
-
-
stackoverflow.com stackoverflow.com
-
So now the question is, why does Session, an interface, not get implicit index signatures while SessionType, an identically-structured typealias, *does*? Surely, you might again think, the compiler does not simply deny implicit index signatures tointerface` types? Surprisingly enough, this is exactly what happens. See microsoft/TypeScript#15300, specifically this comment: Just to fill people in, this behavior is currently by design. Because interfaces can be augmented by additional declarations but type aliases can't, it's "safer" (heavy quotes on that one) to infer an implicit index signature for type aliases than for interfaces. But we'll consider doing it for interfaces as well if that seems to make sense And there you go. You cannot use a Session in place of a WithAdditionalParams<Session> because it's possible that someone might merge properties that conflict with the index signature at some later date. Whether or not that is a compelling reason is up for rather vigorous debate, as you can see if you read through microsoft/TypeScript#15300.
-
- Aug 2021
-
github.com github.com
-
therefore in practice it's a bit academic to worry about which lines inside that block the compiler should be happy or unhappy about. From falsehood, anythihng follows. So the compiler is free to say "if the impossible happens, then X is an error" or "if the impossible happens, then X is not an error". Both are valid (although one might be more or less surprising to developers).
-
- Jul 2021
-
stackoverflow.com stackoverflow.com
-
I don't like that I can't really use head? to know it's a HEAD request, but I (think I) understand the reasoning
-
-
www.reddit.com www.reddit.com
-
Hello, maksimets: code blocks using triple backticks (```) don't work on all versions of Reddit!Some users see this / this instead.
-
- Jun 2021
-
stackoverflow.com stackoverflow.com
-
.isnumeric() matches 430 Unicode codepoints in the BMP that float() won't accept, and there are codepoints that .isdigit() returns true for that are also not convertible.
-
-
stackoverflow.com stackoverflow.com
-
Note that & is a line terminator like ; (write command& not command&;).
-
- May 2021
-
www.gkogan.co www.gkogan.co
-
The plain, unstyled emails resulted in more opens, clicks, replies, and conversions, every time.
-
The plain email—which took no time to design or code—was opened by more recipients and had 3.3x more clicks than the designed email.
-
- Apr 2021
-
www.metacritic.com www.metacritic.com
-
the lack of touchscreen support is an odd omission considering both games previously appeared on 3DS and Wii U,
.
-
-
boardgamegeek.com boardgamegeek.com
-
Every player I've introduced this game to has looked at me as if to say, "We must be doing something wrong." But no, that game is designed that way.
-
-
stackoverflow.com stackoverflow.com
-
It's strange to me that the text returned is in all caps (how it's styled after CSS), but the matcher is actually testing against the text in the unstyled HTML. I spent a while digging through the source code and I still can't figure out why this works.
-
- Mar 2021
-
final-form.org final-form.org
-
If you change a form value to '', Final Form will set the value in its state to undefined. This can be counterintutive, because '' !== undefined in javascript.
-
-
en.wikipedia.org en.wikipedia.org
-
How is the phrase
including the production of meaning used in this article, yet the word "semantics" does not appear even once?
At least https://en.wikipedia.org/wiki/Meaning_(semiotics) ("semantics" appears exactly 1 time in that article) has a link to the article on semantics.
Seems like a missed opportunity to answer what to me is a very first immediate question that I wonder (and now I wonder if it really is a FAQ or if it's just me who wonders): how is semiotics different from semantics?
But I guess https://en.wikipedia.org/wiki/Semiotics is a better place to look for that answer, and it answers that when it says:
he defined semiotics as grouped into three branches:
- Semantics: deals with the formal properties and interrelation of signs and symbols, without regard to meaning.
- Syntactics/syntax: deals with the formal structures of signs, particularly the relation between signs and the objects to which they apply (i.e. signs to their designata, and the objects that they may or do denote).
- Pragmatics: deals with the biotic aspects of semiosis, including all the psychological, biological, and sociological phenomena that occur in the functioning of signs. Pragmatics is concerned with the relation between the sign system and sign-using agents or interpreters (i.e., the human or animal users).
Tags
Annotators
URL
-
-
en.wikipedia.org en.wikipedia.org
-
Athena is still in production use at MIT. It works as software (currently a set of Debian packages)[2] that makes a machine a thin client, that will download educational applications from the MIT servers on demand
-
-
github.com github.com
-
I don't get it. Can someone please explain? I've upgraded my Rails project to Sprockets 4, just to get source maps in production. Instead I got sourcemaps in development?
-
- Feb 2021
-
sobolevn.me sobolevn.me
-
So, despite your code is type safe it is not safe to be used.
-
-
-
My only concern with this approach is that if someone calls #valid? on the form object afterwards, it would under the hood currently delete the existing errors on the form object and revalidate. The could have unexpected side effects where the errors added by the models passed in or the service called will be lost.
-
My concern with this approach is still that it's somewhat brittle with the current implementation of valid? because whilst valid? appears to be a predicate and should have no side effects, this is not the case and could remove the errors applied by one of the steps above.
-
Another problem I found with Reform is the synchronisation with models. The object you passed in argument to reform does not have the same value than the form.
-
-
github.com github.com
-
@conference_form.submit(conference_params)
Surprised they called it
submit
, since that could imply that you're triggering an action called submit.They use other verbs to describe this:
- sync
- populate
- write
Analogous to Reform's sync / sync_models method.
Actually, the name makes a lot of sense when you see it in context:
@conference_form = ConferenceForm.new(conference) @conference_form.submit(conference_params) if @conference_form.save
-
-
-
100vw is 100% of the viewport width not accounting for scrollbars (unless the root element has anything other than overflow: auto set, but auto is the default value). Thus, when the page content overflows the viewport vertically, the browser renders the vertical scroll bar, which reduces the visible viewport area by a few pixels. But the 100vw value doesn't update to account for this, so the selected div retains the same width as before the vertical scrollbar appeared. This results in the horizontal scroll bar rendering.
-
-
www.sitepoint.com www.sitepoint.com
-
Now, however, you set width:100vw and that is going to be (in this case) 100% wide (viewport wide) + the vertical scrollbar width. That’s too wide. That induces the HORIZONTAL scrollbar.
-
-
hilton.org.uk hilton.org.uk
-
This is funny because it’s unexpected. Cache invalidation sounds like a hard thing, while naming sounds more straightforward. The joke works because it violates our expectation that hard things should be technical. It’s also funny because it’s true.
-
-
www.honeybadger.io www.honeybadger.io
-
In 2025 we plan to
Surely this is a typo and should have said 2020? Nobody would make such a specific tech plan for 5.5 years in the future ... would they?
Tags
Annotators
URL
-
- Jan 2021
-
www.impressivewebs.com www.impressivewebs.com
-
It seems like this should be one of the easiest things to understand in CSS. If you want a block-level element to fill any remaining space inside of its parent, then it’s simple — just add width: 100% in your CSS declaration for that element, and your problem is solved. Not so fast. It’s not quite that easy. I’m sure CSS developers of all skill levels have attempted something similar to what I’ve just described, with bizarre results ultimately leading to head scratching and shruggingly resorting to experimenting with absolute widths until we find just the right fit. This is just one of those things in CSS that seems easy to understand (and really, it should be), but it’s sometimes not — because of the way that percentages work in CSS.
-
-
css-tricks.com css-tricks.com
-
min-width: 0;
Wouldn't expect the solution to "width grows too wide" to be to assign a (seemingly meaningless, since how could it be less than 0) a minimum width of 0.
I would have expected to solve this by applying a max-width to the problem element or one of its ancestors.
-
-
forums.theregister.com forums.theregister.com
-
It won't work if $HOME is not under /home. Really. Not even if you softlink. You need a bind mount
-
-
redfin.engineering redfin.engineering
-
In my opinion, this single-tab Refresh behavior strongly violates the principle of least surprise, and it doesn’t help us to maintain code consistency or data consistency.
-
-
github.com github.com
-
What I think is happening is that instantiating the component is immediately running the $: reactive code, which dispatches the event synchronously, before the parent component attaches the listener.
-
-
-
discourse.ubuntu.com discourse.ubuntu.com
-
But now Chromium is no more available as deb, so what to expect ?
-
- Nov 2020
-
www.npmjs.com www.npmjs.com
-
Note that when using sass (Dart Sass), synchronous compilation is twice as fast as asynchronous compilation by default, due to the overhead of asynchronous callbacks.
If you consider using asynchronous to be an optimization, then this could be surprising.
-
-
-
I also tried to use <!-- svelte-ignore unused-export-let --> before the script tag but still no chance.
-
-
github.com github.com
-
This mirrors how classes already work and avoids the issues with introducing an unexpected DOM node.
-
- Oct 2020
-
www.scispike.com www.scispike.com
-
I came up with this solution by piecing together man pages and random google result. I was surprised at how many incomplete and inaccurate answers were out there. What may have been more surprising was the complete lack of a full intact solution.
-
-
github.com github.com
-
I debugged docker-compose and docker-py and figured out that you should either use environment variables or options in command. You should not mix these . If you even specify --tls in command then you will have to specify all the options as the TLSConfig object, as now TLSConfig object is created completely from the command options and operide the TFSConfig object created from the environment variable.
-
-
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
-
I only have one set of certs. And I can't see how they can be different because docker commands work using the endpoint. It's just the docker-compose command that fails
-
docker-compose command you can not mix environment variable and command option. You can specify setting in env variable and then just use docker-compose ps. The connection will be secured with TLS protocol if DOCKER_TLS_VERIFY variable is set.
-
You dont need to pass --tls or --tlsverify option in the docker-config path as the task already sets DOCKER_TSL_VERIFY environment varaible. I debugged docker-compose and docker-py library and verified that if you pass any flag --tls or --tlsverify flag it tries to create tslConfig object out of options and not from environment
-
-
github.com github.com
-
I debugged docker-compose and docker-py and figured out that you should either use environment variables or options in command. You should not mix these . If you even specify --tls in command then you will have to specify all the options as the TLSConfig object, as now TLSConfig object is created completely from the command options and operide the TFSConfig object created from the environment variable.
-
-
stackoverflow.com stackoverflow.com
-
Library author here. I'm always fascinated by new ways people can invalidate my assumptions. I mean that in a sincerely positive way, as it results in learning.
Tags
- assumptions
- learning from others
- surprising
- author of software answering questions in community (support)
- they've thought of everything
- testing/challenging one's assumptions (either validating or invalidating them)
- invalidating one's assumptions
- not considering all use cases
- sincere
- not:
- can't support everything / all cases
- different way of thinking about something
Annotators
URL
-
-
svelte.dev svelte.dev
-
-
svelte.dev svelte.dev
-
-
svelte.dev svelte.dev
-
My version of https://svelte.dev/repl/9c7d12357a15457bb914705702f156d1?version=3.19.2 from https://github.com/sveltejs/svelte/issues/4586
to try to simplify and help me understand it better.
So the lack of synchronousness is only noticed inside handleClick.
By the time the DOM gets updated, it has a consistent/correct state.
In other words, the console.log shows wrong value, but template shows correct value. So this might not be an actual problem for many/most use cases.
-
-
svelte.dev svelte.dev
-
github.com github.com
-
-
When using a method in a top-level object to modify its state, such object isn't updated either.
-
-
github.com github.com
-
I too have been confused by behavior like this. Perhaps a clearly defined way to isolate atomic units with synchronous reactivity would help those of us still working through the idiosyncrasies of reactivity.
-
-
For performance reasons, $: reactive blocks are batched up and run in the next microtask. This is the expected behavior. This is one of the things that we should talk about when we figure out how and where we want to have a section in the docs that goes into more details about reactivity. If you want something that updates synchronously and depends on another value, you can use a derived store:
-
-
github.com github.com
-
I expected that the param being passed by reference to have the same reactivity of the variable being created in the script tag.
-
-
-
One would expect the display to be updated, but it is not... WHY is it updated the 2nd time you enter something? What is different?
-
-
medium.com medium.com
-
You can imagine how big of a surprise was finding out that model/character being a child of model/node causes an error when we import model/position.
-
-
dylanvann.com dylanvann.com
-
To fix our Svelte version you might think we could use beforeUpdate or afterUpdate, but these lifecycle functions are related to the DOM being updated, not to prop updates. We only want to rerun our fetching when the album prop is changed.
-
-
developer.mozilla.org developer.mozilla.org
-
If the user now clicks Back again, the URL bar will display https://www.mozilla.org/foo.html, and totally bypass bar.html.
-
- Sep 2020
-
engineering.mixmax.com engineering.mixmax.com
-
There'll be no more warnings. But if you open bundle.js, you'll see something shocking: it contains the entirety of React and React DOM. That's 7000 LoC!
-
-
www.wired.com www.wired.com
-
Basically, the idea is that a train tried to start with the caboose brakes stuck on. After releasing the caboose, the train still could not start. The problem was that when the train attempted to start with the caboose brake on, it stretched all the inter-car couplings so that the whole train was just like one big car. At this point, the friction from the engine train wheels was not enough to get the whole thing going. Instead, you need to just get one car moving at a time - this is why there is space between the couplings.
-
-
-
Most simple example: <script> import ChildComponent from './Child.svelte'; </script> <style> .class-to-add { background-color: tomato; } </style> <ChildComponent class="class-to-add" /> ...compiles to CSS without the class-to-add declaration, as svelte currently does not recognize the class name as being used. I'd expect class-to-add is bundled with all nested style declarations class-to-add is passed to ChildComponent as class-to-add svelte-HASH This looks like a bug / missing feature to me.
-
-
svelte.dev svelte.dev
-
It's fashionable to dislike CSS. There are lots of reasons why that's the case, but it boils down to this: CSS is unpredictable. If you've never had the experience of tweaking a style rule and accidentally breaking some layout that you thought was completely unrelated — usually when you're trying to ship — then you're either new at this or you're a much better programmer than the rest of us.
-
-
tailwindcss.com tailwindcss.com
-
Now I know what you're thinking, "this is an atrocity, what a horrible mess!" and you're right, it's kind of ugly. In fact it's just about impossible to think this is a good idea the first time you see it — you have to actually try it.
-
-
github.com github.com
-
yup.object.default({ number: 5 }); // object will be cloned every time a default is needed yup.object.default(() => ({ number: 5 })); // this is cheaper
Cloning an object is considered expensive?? Why?
-
yup.object.default({ number: 5 }); // object will be cloned every time a default is needed yup.object.default(() => ({ number: 5 })); // this is cheaper
Cloning an object is considered expensive?? Why?
-
yup.object.default({ number: 5 }); // object will be cloned every time a default is needed yup.object.default(() => ({ number: 5 })); // this is cheaper
Cloning an object is considered expensive?? Why?
-
yup.object.default({ number: 5 }); // object will be cloned every time a default is needed yup.object.default(() => ({ number: 5 })); // this is cheaper
Cloning an object is considered expensive?? Why?
-
yup.object.default({ number: 5 }); // object will be cloned every time a default is needed yup.object.default(() => ({ number: 5 })); // this is cheaper
Cloning an object is considered expensive?? Why?
-
yup.object.default({ number: 5 }); // object will be cloned every time a default is needed yup.object.default(() => ({ number: 5 })); // this is cheaper
Cloning an object is considered expensive?? Why?
-
yup.object.default({ number: 5 }); // object will be cloned every time a default is needed yup.object.default(() => ({ number: 5 })); // this is cheaper
Cloning an object is considered expensive?? Why?
-
yup.object.default({ number: 5 }); // object will be cloned every time a default is needed yup.object.default(() => ({ number: 5 })); // this is cheaper
Cloning an object is considered expensive?? Why?
Tags
Annotators
URL
-
- Aug 2020
-
-
I'm just trying out the "Reply to comment" button here. Well, it seems like it doesn't quote the text... that's really the feature I'd like to exposed. When responding to a large message (email or otherwise), I like to quote various parts and respond in line.
-
- Jul 2020
-
-
Nevertheless, this is quite confusing and has lead to a recently reported issue on the Webpacker GitHub repository.
-
-
twitter.com twitter.com
-
The inherent stealth conversion into Sets is not a good idea in my book.
-
To me the difference between [1,1,2,2,3,3] and [1,2,3] is not []
-
Code doing surprising and slightly nonsensical things... I'm weary now. And that's with ruby being more consistent than most!
-
-
github.com github.com
-
One may expect Array#- to behave like mathematical subtraction or difference when it doesn't. One could be forgiven to expect the following behavior: [1,1,2,2,3,3,4,4] - [1,2,3,4] => [1,2,3,4]
-
I'll freely admit I was surprised by this behavior myself since I needed to obtain an Array with only one instance of each item in the argument array removed.
-
- Jun 2020
-
makandracards.com makandracards.com
-
However, a ActiveRecord::Rollback within the nested transaction will be caught by the block of the nested transaction, but will be ignored by the outer transaction, and not cause a roll back! To avoid this unexpected behaviour, you have to explicitly tell rails for each transaction to indeed use proper nesting: CopyActiveRecord::Base.transaction(joinable: false, requires_new: true) do # inner code end This is a safer default for working with custom transactions.
-
-
api.rubyonrails.org api.rubyonrails.org
-
transaction calls can be nested. By default, this makes all database statements in the nested transaction block become part of the parent transaction. For example, the following behavior may be surprising: User.transaction do User.create(username: 'Kotori') User.transaction do User.create(username: 'Nemu') raise ActiveRecord::Rollback end end creates both “Kotori” and “Nemu”. Reason is the ActiveRecord::Rollback exception in the nested block does not issue a ROLLBACK. Since these exceptions are captured in transaction blocks, the parent block does not see it and the real transaction is committed.
How is this okay??
When would it ever be the desired/intended behavior for a
raise ActiveRecord::Rollback
to have absolutely no effect? What good is the transaction then??What happened to the principle of least surprise?
Is there any reason we shouldn't just always use
requires_new: true
?If, like they say, the inner transaction "become[s] part of the parent transaction", then if anything, it should roll back the parent transaction too — not roll back nothing.
-
- May 2020
-
unix.stackexchange.com unix.stackexchange.com
-
You might not care today, but your approach doesn’t allow you to have multiple spaces (Philippines 6014), leading spaces, trailing spaces, or tabs.
-
-
github.com github.com
-
Chances are that you think that you can compile a Ruby binary on a certain OS, and that users using that same OS can use your Ruby binary. Not quite. Not even when they run the same OS version as you do.
Tags
Annotators
URL
-
-
about.gitlab.com about.gitlab.com
-
If we find that GitLab doesn't work as people expect, the documentation should be updated so this is no longer a surprise. This applies whether we classify it as a feature request or a bug.
-
-
extensionworkshop.com extensionworkshop.com
-
Unexpected features “Unexpected” features are those that are unrelated to the add-on’s primary function, and are not likely from the add-on name or description to be expected by a user installing that add-on. Should an add-on include any unexpected feature that falls into one of the following categories: Potentially compromises user privacy or security (like sending data to third parties) Changes default settings like the new tab page, homepage or search engine Makes unexpected changes to the browser or web content Includes features or functionality not related to the add-on’s core function(s) Then the “unexpected” feature(s) must adhere to all of the following requirements: The add-on description must clearly state what changes the add-on makes. All changes must be “opt-in”, meaning the user has to take non-default action to enact the change. Changes that prompt the user via the permissions system don’t require an additional opt-in. The opt-in interface must clearly state the name of the add-on requesting the change.
-
- Apr 2020
-
github.com github.com
-
Capybara and Webrat use some of the same method names which leads to runtime collisions that reveal themselves in confusing ways.
-
- Mar 2020
-
stackoverflow.com stackoverflow.com
-
To be just a bit polemic, your first instinct was not to do that. And you probably wouldn't think of that in your unit tests either (the holy grail of dynamic langs). So someday it would blow up at runtime, and THEN you'd add that safeguard.
-
As many would guess: ... catch StandardError => e raise $! ... raises the same error referenced by $!, the same as simply calling: ... catch StandardError => e raise ... but probably not for the reasons one might think. In this case, the call to raise is NOT just raising the object in $!...it raises the result of $!.exception(nil), which in this case happens to be $!.
-