Quantcast
Channel: User Schwern - Stack Overflow
Browsing all 581 articles
Browse latest View live
↧

Comment by Schwern on RSpec How to test when a condition is not met, methods...

If the test works and you're looking for whether it can be improved, you might want to try CodeReview.SE instead. Two observations. 1) That you have to call a private method is questionable. 2) Are...

View Article


Comment by Schwern on Git: retrieving the name of the original name of a...

@Chexpeare Add --stat to show the filename and renames. git log --follow --stat <current filename>. The original filename is the last (oldest) one.

View Article


Comment by Schwern on Git: retrieving the name of the original name of a...

This will only work if there are lines unchanged from before the file was renamed.

View Article

Comment by Schwern on How to test in Rspec that Sidekiq async job sends job...

1) Try adding p subject.jobs before and after subject.perform_async(claim.id). 2) Try using one expect block with an and. expect { ... }.to raise_error(...).and change(...).by(1)

View Article

Comment by Schwern on perl module circular dependencies

Perl should ship with ExtUtils::MakeMaker, Test::Simple, and Test::Harness, referred to as "core modules", tho possibly older versions. I wrote/maintained them. If you're using the Perl which came with...

View Article


Comment by Schwern on Does int_leastX_t differ from intX_t?

If both int and long are 32 bit integers, does it matter?

View Article

Answer by Schwern for Git: retrieving the name of the original name of a...

If you have a file and you want to know when it was renamed...git log --follow --summary --format= <filename>--follow will continue listing history through renames. --format= suppresses the usual...

View Article

Comment by Schwern on GitHub merge branch with 0 changes

git log --graph --decorate --oneline --all will show us the true state of the repository and help understand the situation. Would you post the relevant parts of that?

View Article


Comment by Schwern on How does one use CTEs in a stored procedure in Snowflake?

The CTE is part of the query. res := with sample_cte as (...) select example_col FROM sample_cte;?

View Article


Answer by Schwern for perl module circular dependencies

tl;dr Leave the vendor installed Perl alone. Install your own Perl. perlbrew makes this easy.Test::Simple, Test::Harness, and ExtUtils::MakeMaker all ship with Perl (known as "core modules"). These...

View Article

Comment by Schwern on How can I optimize a SQL query to efficiently count...

"I'm concerned about performance, especially with large databases" Does performance matter? This should not be part of any normal process. How often do you plan to run this, and to what purpose? It...

View Article

Comment by Schwern on In this situation git pull vs git rebase

git pull is not normally what you use to merge branches, so it's unclear what's actually happening here. Could you show us the actual commands you ran?

View Article

Answer by Schwern for Which Expression in Postgresql is same as "MATCHING" in...

You can do a nearly 1-to-1 translation between matches and similar to, but most of the time like is sufficient. You only need to use similar to for character classes.matchessimilar tolike...

View Article


Comment by Schwern on Selecting todays records in postgres

@Adam The OP wants records for just one day.

View Article

Comment by Schwern on Selecting todays records in postgres

Isn't 'today' and 'tomorrow' affected by time zones?

View Article


Answer by Schwern for Selecting todays records in postgres

WHERE date_trunc('day', recordTime) = date_trunc('day', current_timestamp at time zone 'utc') I don't know if this is best practice, but it has the advantage of being explicit about its conversions. It...

View Article

Comment by Schwern on Selecting today's rows based on UTC time

@Adam The OP wants records for just one day.

View Article


Comment by Schwern on Selecting today's rows based on UTC time

Isn't 'today' and 'tomorrow' affected by time zones?

View Article

Answer by Schwern for Selecting today's rows based on UTC time

WHERE date_trunc('day', recordTime) = date_trunc('day', current_timestamp at time zone 'utc') I don't know if this is best practice, but it has the advantage of being explicit about its conversions. It...

View Article

Can I set up template inheritance inside a template? (Template Toolkit)

I have to display different medical forms according to which state the user is in. There is also a default form that many of the states share. These medical forms are all written in Template Toolkit...

View Article
Browsing all 581 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>