Comment by Schwern on Regular expression for letters of any alphabet
Which regex implementation are you using?
View ArticleAnswer by Schwern for Regular expression for letters of any alphabet
That is, need something like /[[:alpha:]]+/g which is only for Latin...That is mistaken.[:alpha:] is a POSIX character class. Depending on your regex implementation what alpha matches either depends on...
View ArticleComment by Schwern on Query performance does not improve when storing sorted...
select a, sum(b) from table1 group by a; has to scan the whole table, so order shouldn't matter. Please show us the explain analyze for your queries, that will provide information about how PostgreSQL...
View ArticleComment by Schwern on should git checkout work when the index is dirty?
@SteveSummit The rule of thumb is Git will strive to not lose your work. Consider if it worked as you described. You're in the middle of resolving that big merge conflict, go to lunch, and when you...
View ArticleComment by Schwern on Golang DB.Query(query, values...) doesn't work while...
1) Clarify "doesn't work". 2) Is the path to your SQLite database relative? Then it will be relative to the directory in which the code is executed.
View ArticleComment by Schwern on Query bypassing SQLx compile-time checks for missing...
"Restarted my database to ensure changes are applied." You do not need to do this. SQL tables are meant to be altered while the database continues to run.
View ArticleComment by Schwern on Query bypassing SQLx compile-time checks for missing...
@cafce25 That's a neat feature, thanks. I rewrote the answer with the real issue.
View ArticleAnswer by Schwern for Why are BigInt chunks-of-bits called "limbs"?
According to the GNU MP manual 3.2 Nomenclature and Types...A limb means the part of a multi-precision number that fits in a single machine word. (We chose this word because a limb of the human body is...
View ArticleComment by Schwern on MySQL convert column data type from DECIMAL(10,5) to...
Note that decimal(10,5) means 10 digits, 5 of which are to the right of the decimal point or 12345.12345. decimal(10,2) means 10 digits, 2 of which are to the right of the decimal point or 12345678.12....
View ArticleComment by Schwern on Replacing a SQL statement in a text field inside of a...
I have to ask, what is the purpose of storing (and executing?) SQL via a text field in a table? Could it be done better with a stored procedure?
View ArticleAnswer by Schwern for MySQL convert column data type from DECIMAL(10,5) to...
round(11.11499, 2) will produce 11.11000 losing 0.00999 or about 0.01. round(11.11500, 2) will produce 11.12000 gaining 0.01.If your data is truly well-distributed and the extra decimals are truly...
View ArticleAnswer by Schwern for Git cannot handle HTTP URLs with newlines
How could I make it clone properly over HTTPS where the path contains newlines?I don't think you can.There's an explicit check in credentials.c for this. The commit message explains...The credential...
View ArticleAnswer by Schwern for Compilation using GitHub workflow
Why is there no hello executable found in the repo while the workflow clearly includes the compilation step (g++ -std=c++17 hello.cpp -o hello)? Since there was no errors, why isn't the executable file...
View ArticleAnswer by Schwern for Line items disappear when moving from cart to order
class Cart < ApplicationRecord has_many :line_items, dependent: :destroyendYou've told Rails to destroy all the LineItems associated with the cart when the Cart is destroyed. If the Cart is...
View ArticleComment by Schwern on Postgresql SELECTs went from 0.6s to 10+s after killing...
Parallel Index Only Scan using positioner_moves_p7_2025_pos_id_pos_move_index_idx is where it went wrong, but the rows returned look fine indicating to me that it's not a planner problem. I would start...
View ArticleComment by Schwern on Same key to reference multiple possible tables
@GuillaumeOutters I avoided table inheritance for such a simple project because I've found there are too many caveats, table inheritance requires its own answer. The shared sequence idea is clever! It...
View ArticleAnswer by Schwern for Proper way to migrate a postgres database?
What is the proper way to push my data from my dev machine to my production?Edit: I have in the production machine the database with information and I don't want truncate the tables before...
View ArticleWhy don't PHP properties allow functions?
I'm pretty new to PHP, but I've been programming in similar languages for years. I was flummoxed by the following:class Foo { public $path = array( realpath(".") );}It produced a syntax error: Parse...
View ArticleComment by Schwern on How does git detect directory changes so fast?
This would be a better answer if it was more explicit about what diff-index is (and is not) doing and how it's using the index file to optimize. Basically sum up your comments and add them to the answer.
View ArticleComment by Schwern on How does git detect directory changes so fast?
See also What does the git index contain EXACTLY?
View Article