Quantcast
Channel: User Schwern - Stack Overflow
Browsing latest articles
Browse All 581 View Live

Answer by Schwern for How to run a function without storing it postgresql

There is were i have a problem as i want to use variables and multiple selects.SQL is a declarative language where you ask questions (queries) and get answers (results). Some SQL implementations...

View Article


Comment by Schwern on how do I display \n as new line in text file?

@echo Yes, because print "These\nare\nturned\ninto\nnewlines\n" will replace the \n with actual newline characters (the number 10). What is actually written to the file are the numbers 84 104 101 115...

View Article


Answer by Schwern for How to Keep a Forked GitHub Repository in Sync Without...

For example, how does a project like Neovim stay in sync with Vim without losing its own release history?A quick glance at the neovim history and the vim history suggests neovim is cherry-picking vim...

View Article

Answer by Schwern for How to keep a PR up to date in a project with...

It should not be necessary to create any intermediate branches.Fetch the latest upstream changes from upstream to your local repository.Update your local PR branch.Push your updated PR branch to your...

View Article

Answer by Schwern for Is there a way to configure a secondary .gitignore file...

To better illustrate the problem, consider I had a git repository R and I cloned R to a directory in my local machine, L, and to a directory on a cluster, C.This is deployment. While you can use Git as...

View Article


Comment by Schwern on Ruby wait for exclusive file lock

@HolgerJust How about narrowing the focus to just the lock?

View Article

Answer 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 Article

Comment 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 Article


Comment 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 Article


Answer 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 Article

Answer 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 Article

Answer 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 Article

Answer 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 Article


Answer 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 Article

Comment 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 Article


Answer 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 Article

Why 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 Article


Answer by Schwern for PostgreSQL authentication method 10 not supported - Rails

As discussed in other answers, scram-sha-256 was introduced in PostgreSQL 10 so you need at least libpq v10. v17 would be best so you can take advantage of all of PostgreSQL v17's features.And if...

View Article

Answer by Schwern for In Github Actions, how can I make all steps run, but...

Make each check its own job, then write one job which needs all the check jobs. All the jobs will execute in parallel (bonus, this will be faster), but the top level job will only succeed if they all...

View Article

Answer by Schwern for Validate has_many with length in Rspec?

But is not working, it's actually creating the Order.No Order is being created.FactoryGirl.build builds an order. It is the equivalent of Order.new. Because of on: :create your validation does not fire...

View Article

Comment by Schwern on Type hint return type of abstract method to be any...

@user2357112 Technically correct, but missing the point.

View Article


Answer by Schwern for How does the multi-pass compiler handle local variables...

T-SQL, and most languages, effectively read the code twice. First they read the code and compile it, "compile time"; this includes making sure all the code is syntactically correct and all variables...

View Article


Answer by Schwern for How to reference user password in Rails testing fixture?

In the test create a new user, with a known password, and then log in as that user. No fixture necessary. No messing with password hashing. No duplication of data.class SomethingTest <...

View Article

Answer by Schwern for How to prove github commit backdating

Yes, check the author and author date fields of the commit. Use git log --format=fuller to see them.A Git commit stores four fields related to the authoring of the commit.Author - who wrote the...

View Article

Comment by Schwern on Rails Active Admin Create action fails to create my...

@SegernJoseMonterola Glad that was it! And I was wrong, validation errors don't show up in the logs.

View Article


Comment by Schwern on How do I query on BigQuery and not get an error message?

@DaniLimia 1) That is not the query in your question. 2) Please edit that information into your question so others can easily find it. 3) Be sure you've copied it correctly, you have a typo ("sytax")...

View Article

Answer by Schwern for git ignore whole directory apart from files with a...

I'll use this layout as an example.$ tree outputs/outputs/├── foo.csv├── foo.pdf└── subdir├── bar.csv├── bar.pdf└── subdir2├── baz.csv├── baz.pdf└── subdir3├── woof.csv└── woof.pdfWe can see exactly...

View Article

Answer by Schwern for How do I query on BigQuery and not get an error message?

Identifiers are quoted with backticks like so:FROM `velvety-accord-452822-a0.employee_data.employees`But you are using a mix of backticks and single quotes.FROM...

View Article

Comment by Schwern on Python - How to check for missing values not...

This is a good solution, fix the data and it will make queries easier.

View Article



Answer by Schwern for How to retrieve all files from all commits in a PR and...

You need to diff between the branch the PR was branched from (the "base branch") and the PR branch. You can get these in a workflow triggered from a pull request with github.base_ref and...

View Article

Comment by Schwern on git lfs not working with github / ssh issue

Errors (large file must be on LFS etc) We need to see the actual error message to help.

View Article

Comment by Schwern on Vapor Fluent - Composite primary key?

1) If it's a join table it doesn't need a primary key, just a unique constraint. If it's an entity that you want to refer to in other tables, consider giving it its own serial primary key; it's...

View Article

Comment by Schwern on Use PostgreSQL syntax with Apache Drill

From the Postgres docs, "DISTINCT ON ( ... ) is an extension of the SQL standard" so it's unlikely to work in other databases unless they explicitly support it. You can emulate it with the technique...

View Article


Comment by Schwern on MySQL Stored Procedure Creation Fails When Declaring a...

Allen is correct, call the variable something other than delimiter. Not exactly sure why you're not getting an error. What mysql client are you using?

View Article

Answer by Schwern for github: how to reference an issue in a commit from a...

#1 refers to issue 1 in this repo.username/repoA#1 refers to issue 1 in username's repoA.org/repoA#1 refers to issue 1 in org's repoA.You would use either of the last two optionsSee Autolinked...

View Article

Comment by Schwern on How do I exclude certain files/folders from being...

Git doesn't "sync between branches" so it's unclear what you're asking. Could you give an example of what you mean using Git commands and terms like git merge? And are you trying to do configuration...

View Article


Answer by Schwern for Rewrite entire Git history

Yes, it's possible to rewrite the entire history... but for your case you don't have to. You just need to rewrite the bits you worked on. This is, probably, just the changes to your master branch. For...

View Article


Comment by Schwern on How to prove github commit backdating

Could you give us a link to the repository and the commits in question?

View Article
Browsing latest articles
Browse All 581 View Live


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