Comment by Schwern on Git workflow to overwrite remote commits with local ones
@Mark In that case, git revert them. It's much safer and you don't have to coordinate with everyone.
View ArticleComment by Schwern on Mysql 8.0.35 - I cannot get rid of filesort caused by a...
@Akina It is unnecessary, but removing it won't have an affect on the query plan.
View ArticleComment by Schwern on How to add a commit describing a git filter-repo...
@GeoffAlexander If the question is "how can I make Git track renames" the short answer is "you can't", this answer is the long answer. If you told us why you want to make Git track renames, we could...
View ArticleComment by Schwern on Before I could do a push in git but now I can’t
@user23714456 You can reply to specific users like so.
View ArticleComment by Schwern on Everytime after pc restart, i cant fetch or push to a...
Leave a comment if those answers don't help.
View ArticleComment by Schwern on Need to recover from multiple errant `git reset` commands
@j6t They look the same to me.
View ArticleComment by Schwern on What is the typical method for preventing duplicates in...
Is {"stuff", "pasta"} the same recipe as '{"pasta", "stuff"}'?
View ArticleComment by Schwern on With Action Cable, test that many messages are broadcast
You can use capture_broadcasts with rspec and get it down to: expect(messages).to eq ['first', 'second', 'third']
View ArticleComment by Schwern on Git Merge Request to Feature Branch Includes Many Old...
Can we see the relevant parts of git log --graph --decorate --all --oneline? This will show your true history of master, BranchA, featureBranch. Please be sure to sanitize the commit logs so you're not...
View ArticleComment by Schwern on What realloc() actually does in this code?
@chiranjeevi_dk There are many, many, many, many reasons why you might get an error from C code. Sometimes things which are errors on one machine aren't in others, or an error appears and disappears...
View ArticleComment by Schwern on How to create a typed child table?
You can't combine create table x of y with create table x (...) inherits (y). What is your expected result here?
View ArticleComment by Schwern on Couldnot install perl module using cpanm command
Works For Me(tm) with Strawberry 5.38.0.
View ArticleAnswer by Schwern for Redshift 1:1 left join on right table with duplicates
First, give the student's GPAs an order using the row_number window function. select student_id, gpa, row_number() over ( partition by student_id order by gpa_at desc ) as rownum from gpaThen we can...
View ArticleAnswer by Schwern for User defined function only returns first value in column
From what you described, seems like the function should only be formatting a value.create or replace function format_as_money(m float) returns text language sql immutable returns null on null input...
View ArticleAnswer by Schwern for If you are using "vi.mock" factory, make sure there are...
From the vi.mock documentation...vi.mock is hoisted (in other words, moved) to top of the file. It means that whenever you write it (be it inside beforeEach or test), it will actually be called before...
View ArticleAnswer by Schwern for C function gives wrong result when function call on...
factorial(scanf("%lu", &n)) says to pass the return value of scanf into factorial. The return value is the number of items scanned, which in this case is always going to be 0 or 1.It's as if you...
View ArticleAnswer by Schwern for Hi! Can someone please help me figure out why and how...
You have to read it from the outside in. It helps to space it all out.TRIM( leading '(' FROM LEFT( location, POSITION(',' IN location) - 1 ))POSITION(',' IN location) returns the offset of the first ,...
View ArticleAnswer by Schwern for File in the same path, one can be git trace but others...
From the gitignore docs...It is not possible to re-include a file if a parent directory of that file is excluded.* has ignored everything at the top-directory (*.* is unnecessary) including dir_b. You...
View ArticleAnswer by Schwern for How to generate a 16-digit robust not guessable coupon...
Ruby master (what may become 3.4) introduces a more robust formatting interface for SecureRandom. It's present in Ruby 3.3, but it does not appear to be fully baked. SecureRandom in 3.3.0 claims to...
View ArticleAnswer by Schwern for How to make comments on Github without being collaborator?
Unless you've explicitly limited it, anyone who can read your repository can review a pull request or comment on a commit.After a pull request is opened, anyone with read access can review and comment...
View Article