Answer by Schwern for Best practices for writing parallel unit tests
Running tests in parallel means multiple tests may be using, modifying, creating, and destroying the same resources. That includes...FilesDirectoriesDatabasesService AccountsFor example, test 1 expects...
View ArticleComment by Schwern on save current git state of a repo
@guettli What do you mean by the branch name does not get saved? Which branch name? Saved for what purpose?
View ArticleComment by Schwern on Git - Update feature branch without redoing previous...
A tool which can solve this sort of problem is git-rerere, but it needs to record the original conflict resolution so you'll have to do the conflict resolution one more time.
View ArticleComment by Schwern on Large Multipart.File uploads directly to AWS S3
There's an official AWS SDK which handles S3 for you.
View ArticleComment by Schwern on Getting the exception "This will throw an exception in...
Does it give any other information about what "this" is?
View ArticleComment by Schwern on why can init array in struct with array-name in C
What is it you don't understand about the syntax?
View ArticleComment by Schwern on Combine two tables doing row count based on hour value...
This answer would be better with an explanation.
View ArticleComment by Schwern on SQL using Python - fetch speed issue
Different queries will take different amounts of time to execute. We'd need to see these similar cases which are faster to advise. We'd also need to see your table definition, including indexes, and a...
View ArticleComment by Schwern on Git merge does not take all files from source branch
@Crashh Depends. Did DEVELOP delete a file called AccessTokenController.php? If so, the merge will not resurrect it. What would help is git log --graph --decorate --oneline --stat develop master. That...
View ArticleComment by Schwern on Git merge does not take all files from source branch
@Crashh No, if you reset you'll lose all the work after the revert. Instead you'll have to do an interactive rebase to remove both the merge and the revert, and then Git will rewrite subsequent commits...
View ArticleAnswer by Schwern for why can init array in struct with array-name in C
I'm not entirely sure what you're asking, but here's a go..x = y is there for the convenience of the programmer. It's so they don't have to remember the exact ordering of the declaration of the struct,...
View ArticleAnswer by Schwern for Combine two tables doing row count based on hour value...
count is an aggregate function which combines the values of multiple rows together. You have to tell Postgres how to group rows with a group by clause. You want to group by hour, so GROUP BY...
View ArticleComment by Schwern on RSpec expect(...).to receive(...).with(...) return...
create(:user) also seems incorrect, should it be User.create? Please be sure you're posting the correct code which will reproduce your error. In both cases the created_at or updated_at is different. We...
View ArticleComment by Schwern on Change to Postgres indexing scheme for IS NOT NULL?
We need to see the relevant indexes and the output of explain analyze select ....
View ArticleComment by Schwern on Change to Postgres indexing scheme for IS NOT NULL?
@LaurenzAlbe Right, that's MySQL.
View ArticleComment by Schwern on PostgreSQL COPY command is much slower locally compared...
Are you saying copying a local file to a remote server is slower than copying a local file to a local server? That is, are you copying to the same server each time, only the client has moved?
View ArticleComment by Schwern on Transferring branches between two different repos with...
Feels like you're using Git as a deployment system. You can do that, but as you're learning it doesn't work very well. If you step back and tell us about your whole problem we can probably find a...
View ArticleComment by Schwern on Why Git can't merge on the server-side if there are no...
@donRumatta 1) GitOps uses pull requests for the reasons in this answer. 2) It would greatly complicate Git's networking protocol. 3) You can fetch and merge (or rebase) locally and then push the...
View ArticleComment by Schwern on What is the 2nd column in the git reflog?
@MagnusLindOxlund Not every commit has a ref (branch or tag) associated with it.
View ArticleComment by Schwern on I am trying to figure out how to incorporate a date...
"With the query I am using, I am getting this order in my results, but I dont want to" It is not clear which "this order" is. Your question would be easier to answer if you include 1) your table...
View Article