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

Comment by Schwern on Create an index with concatenation of text fields,...

@IvanYuzafatau You need backwards compatibility. A strategy I like when I want to improve a schema and maintain backwards compatibility is to create the table with a different name and my schema...

View Article


Answer by Schwern for Re-designing implementation to solve a Diamond problem

Notice that Facility, Warehouse, and ShippingCenter have no methods in common. This is a strong indication that they are not subclasses but traits or the watered-down mixin. A mixin is just a bundle of...

View Article


Answer by Schwern for Using Python to replace triple double quotes with...

That file looks to be in RFC 4180 format. "" is how you write a single " inside a double-quoted field.If double-quotes are used to enclose fields, then a double-quoteappearing inside a field must be...

View Article

Comment by Schwern on How do I do an `update ... from` in ActiveRecord?

This might have finally been added. I'll investigate once I'm at a keyboard. github.com/rails/rails/pull/53950

View Article

Comment by Schwern on Ignore specific file for linting in Visual Studio Code

If you just need a buffer to temporarily put text for pasting, open a new file (ctrl-n), paste in there, set it to Plain Text, and don't save it. Or use Notepad.

View Article


Comment by Schwern on Indexes on Date column with greater than or less than...

Dates are just numbers. A default B-Tree index will work fine for < and > on dates. However, there are many reasons Postgres may choose not to use an index. So we need to see all that stuff DaleK...

View Article

Comment by Schwern on Is SELECT ... INTO #temptable the only fast operation...

@smatofu Like has been said, 1) update and insert are different operations, one cannot replace the other. Update has to first check if each value is in the table (read) then it modifies the row or...

View Article

Comment by Schwern on Is SELECT ... INTO #temptable the only fast operation...

@smatofu It would help us to help you provided the clarifications we've been asking for. 1) Is my version of your question correct? You want SQL Server to turn the update into a select ... into plus a...

View Article


Comment by Schwern on PostgreSQL (Neon/Vercel) always returns TIMESTAMP...

What is the class of result.rows[0].start_date? I'm guessing it's Date. What Javascript calls Date is really a timestamp. So your PostgreSQL Date is being turned into a Javascript Date (timestamp)....

View Article


Comment by Schwern on PostgreSQL (Neon/Vercel) always returns TIMESTAMP...

Rather than doing it every query, you can set the time zone for the whole session once when you connect.

View Article

Comment by Schwern on Is there a "changed files" variable in gitlab?

Could you give an example of a merge request, your proposed template, and your desired result? "is there any best practices for writing the merge request template and other things i can use to make it...

View Article

Comment by Schwern on Compare TZINFO Country

I cannot reproduce your problem. TZInfo::Country.all.each do |c| puts "#{c}: #{c.zone_identifiers}" end; shows Australia: ["Australia/Lord_Howe", "Antarctica/Macquarie", "Australia/Hobart",...

View Article

Comment by Schwern on git keeps "empty" folders when switching branches

@ArkadiuszDrabczyk Git doesn't track folders, only files. A folder exists within Git if there is a file in it. That's why some projects put a .keep file in otherwise empty folders. Look up tree objects...

View Article


Answer by Schwern for git keeps "empty" folders when switching branches

Git will not delete untracked files, and that's a good thing. For example, it's very common to ignore artifacts of your build process like compiled files. You don't want Git deleting those...

View Article

Comment by Schwern on How to speed up a database query inserting indexes

You may wish to look into moving your long term data to a data warehouse better suited to statistical queries and business intelligence. Then you can periodically truncate your runtime database so it...

View Article


Comment by Schwern on What are the differences between Null, Zero and Blank...

There is one place in SQL where "blank" is well defined: POSIX regex character classes. [[:blank:]]in POSIX is locale specific and by default include only two characters, space and tab. This is often...

View Article

Comment by Schwern on Iterating to create contexts from a class

1) Where is user_flow defined? 2) What is the error message? 3) You don't have to use let, nor make individual variables for each key/value pair. Try using one hash.

View Article


Comment by Schwern on Workaround to using function arguments in create table

Needing to create lots of similar tables is a red flag. It's probable you can do this with one table. If you describe what you're trying to solve with this, maybe we can come up with a simpler table...

View Article

Answer by Schwern for Iterating to create contexts from a class

It's easy to get fixated on declaring everything with let, but you don't have to. Use let to take advantage of its lazy-evaluation, but let is most useful with shared examples as we'll see below.If...

View Article

Comment by Schwern on Trying to delete items in source control

"* have tried to remove the repo where I saved my files.*" How did you try to delete the repo?

View Article
Browsing all 581 articles
Browse latest View live


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