Answer by Schwern for Ruby nested blocks call sequence
I think you're expecting meth(meth_block, attr: 'third') to pass in a reference to meth_block and then meth calls meth_block.Instead, meth_block is called immediately and its return value is passed to...
View ArticleComment by Schwern on Why is there no "update:" conventional commit? Should...
What would be an example of an update that isn't a feature or fix?
View ArticleComment by Schwern on SQLchemy: caught in a loop between constraint...
@Lord_Verulam Yes, constraint names are global, and databases are a shared resource. To avoid this in such a situation like testing where you're making and destroying a lot of things, append a little...
View ArticleComment by Schwern on mktime() call never returns. Library bug?
None of those local times exist, so you should get returned a -1. Seems you've found a bug in their mktime implementation. I'm not surprised.
View ArticleAnswer by Schwern for mktime() call never returns. Library bug?
Congratulations, you've found a bug in time.h!Calendars are a bunch of cycles (solar cycles, lunar cycles, arbitrary cycles) that we try to force into synchronization. Already hard. The arbitrary...
View ArticleComment by Schwern on split to multiple table from rapidly growing mysql table
How would you split the table?
View ArticleComment by Schwern on Git safe restore to old commit and return to latest
It's unclear what you want to do here. Words like "restore" and commands like "revert" imply you want to throw out existing work. But I think you just want to do some new work based off an old commit....
View ArticleComment by Schwern on Query optimization on large PostgreSQL tables
1) Please show us your table definitions with indexes. 2) Please describe what you're trying to query, it will help us come up with alternatives. Sample data and your desired result will help. 3)...
View ArticleAnswer by Schwern for split to multiple table from rapidly growing mysql table
1.unable to alter table, getting temp storage exceed exception 2. unable to restore the deleted data storage via optimise table, since it is live table.You'll have to solve that before you can make any...
View ArticleAnswer by Schwern for Git safe restore to old commit and return to latest
I think you're asking how you do work based off an older version.For example, you have commits like so...* C [master] - added the cool thing|* B - fixed that annoying bug|* A - did that mundane taskYou...
View ArticleComment by Schwern on Query optimization on large PostgreSQL tables
This answer would be better with an explanation of why you chose those indexes, and why the include. Also, do you feel it's worthwhile to retain all 4 columns?
View ArticleComment by Schwern on How to INSERT to a table with AUTO_INCREMENT?
The table structure in the question shows it is auto_increment. And if it were not, INSERT INTO user_profile (user_id, email, user_name, first_foo) VALUES (0, %s, %s, 0); would work.
View ArticleComment by Schwern on How to INSERT to a table with AUTO_INCREMENT?
Are you sure that is the Python code you're running? Try adding something obvious like a print to be 100% sure.
View ArticleComment by Schwern on How to use git submodule when trying to customise it?
You committed your changes, did you push them?
View ArticleComment by Schwern on Data type conversion error in simple SQL SELECT query
Would you show us the view definition?
View ArticleComment by Schwern on How to use git submodule when trying to customise it?
@djmoon13 You should be able to change the url your existing submodule is pointing at. I don't use submodules, a dependency manager is generally a better choice, but I believe git submodule set-url...
View ArticleComment by Schwern on A query to show a list of customers with only 1...
Welcome to Stack Overflow. Thank you for providing sample data, however screenshots make it harder to answer questions. Please provide your sample data as text. You can use table formatting found in...
View ArticleComment by Schwern on CircleCI Parallelism messing up with time-based tests
At a guess, Time.now is always returning the same time. This can happen if it is "frozen" for testing.
View ArticleComment by Schwern on Why am I getting this wrong number or argument column...
Looks like it's picking up a different sortable helper method. Have you searched for module SortHelper? Perhaps it's a gem? Is your sortable part of the ApplicationHelper module?
View ArticleComment by Schwern on A query to show a list of customers with only 1...
@JonasMetzler That's probably better if the database supports it. MySQL does not.
View Article