Welcome to Software Development on Codidact!
Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.
Activity for Alexei
Type | On... | Excerpt | Status | Date |
---|---|---|---|---|
Edit | Post #279436 | Initial revision | — | almost 4 years ago |
Answer | — |
A: How much memory is allocated for a MySQL VARCHAR variable in a stored procedure? This answers your questions, not what I suspect to be real issue. According to the specifications a VARCHAR(100) will need actual data stored length + 1. So, the actual size would have mattered if you have used CHAR(100) instead: > The compact family of InnoDB row formats optimize storage fo... (more) |
— | almost 4 years ago |
Comment | Post #278978 |
Also, can you provide more information about "run out of memory"? Is it the stack (too much recursion?) or another type of memory? (more) |
— | almost 4 years ago |
Comment | Post #278978 |
Can you please post the relevant parts of your procedure? As written, this looks like an XY problem (i.e. the issue seems to be in the way the procedure is written not the VARCHAR length). (more) |
— | almost 4 years ago |
Edit | Post #279424 | Initial revision | — | about 4 years ago |
Question | — |
Are any downsides of hiding the actual Entity Framework Core DbSets and exposing only some generic methods? I have recently started a project based on the clean architecture principle and noticed that it did not rely on generic repositories since Entity Framework's DbSets are doing the job just fine. In the referenced project the database context class implements an interface that exposes all the DbSets, b... (more) |
— | about 4 years ago |
Edit | Post #279277 |
Post edited: added relevant tags |
— | about 4 years ago |
Edit | Post #279317 | Initial revision | — | about 4 years ago |
Answer | — |
A: How to automatically run Entity Framework Core migrations for an application which uses a user with read/write rights on certain tables? Migrations are applied during the application startup (initialization) only when the application is not accessible yet. One way to go is to leave the existing user as it is and define a designated one for the migrations. Applying the migrations requires powerful roles (create or drop table): - ... (more) |
— | about 4 years ago |
Edit | Post #279316 | Initial revision | — | about 4 years ago |
Question | — |
How to automatically run Entity Framework Core migrations for an application which uses a user with read/write rights on certain tables? I have decided to convert a legacy database-first ASP.NET Core project to code-first. However, I have noticed that the project used the same database as another bigger project and the Entity Framework user had the minimal rights (read and write on some tables). Clearly, this does not allow the app... (more) |
— | about 4 years ago |
Edit | Post #279187 |
Post edited: fixed a typo |
— | about 4 years ago |
Edit | Post #279187 |
Post edited: fixed variable name |
— | about 4 years ago |
Edit | Post #279187 |
Post edited: fixed the link |
— | about 4 years ago |
Edit | Post #279187 | Initial revision | — | about 4 years ago |
Answer | — |
A: Is there a way to automatically fix MySQL tables where the auto_increment has fallen behind the correct value? This is possible in two steps by using a dynamic SQL: SET @nextId = (SELECT MAX(id) + 1 FROM `CustomTable` ); SET @sql = CONCAT('ALTER TABLE `CustomTable` AUTOINCREMENT = ', @nextId[]()); PREPARE st FROM @sql; EXECUTE st; However, if the values fall frequently you should try ... (more) |
— | about 4 years ago |
Edit | Post #279144 |
Post edited: added relevant tag |
— | about 4 years ago |
Edit | Post #279097 |
Post edited: added tag |
— | about 4 years ago |
Edit | Post #279146 | Initial revision | — | about 4 years ago |
Answer | — |
A: In MySQL is there a limit to the number of keys in a IN() clause? According to the documentation for the MySQL IN function: > The number of values in the IN() list is only limited by the maxallowedpacket value. The default value for it is 67108864. So, you should be able to squeeze quite a big number of identifiers, but you should definitely try it out to... (more) |
— | about 4 years ago |
Edit | Post #279059 |
Post edited: added MoreLINQ reference |
— | about 4 years ago |
Comment | Post #278952 |
I have reported the issue on GitHub (thanks Monica for moving it to the right place, now I know that qpixel is the actual project :) ): https://github.com/codidact/qpixel/issues/268 (more) |
— | about 4 years ago |
Edit | Post #279059 | Initial revision | — | about 4 years ago |
Answer | — |
A: How to perform LEFT JOIN using LINQ method call notation? Note: this was tested in a .NET Framework 4.6.2 project. This answer provides an extension method that greatly simplifies (and makes it more intuitive) the written code: public static IQueryable LeftJoin( this IQueryable outer, IQueryable inner, Expression> outerK... (more) |
— | about 4 years ago |
Edit | Post #279058 |
Post edited: simplified the query |
— | about 4 years ago |
Edit | Post #279058 | Initial revision | — | about 4 years ago |
Question | — |
How to perform LEFT JOIN using LINQ method call notation? I am interested in performing a LEFT JOIN using LINQ-2-SQL when working with method call notation. This answer suggests a way that relies on GroupJoin but it is more verbose than expected: var leftJoin = p.Person .GroupJoin(p.PersonInfo, n => n.PersonId, m => m.PersonId, ... (more) |
— | about 4 years ago |
Edit | Post #279034 |
Post edited: added relevant tag |
— | about 4 years ago |
Edit | Post #279051 | Initial revision | — | about 4 years ago |
Answer | — |
A: Is it possible in MySQL to require each row in a table have at least one foreign key record in a join table? `ghost-in-the-zsh` provided a direct answer and I will try to offer a more general complementary one. One possible thing to try is a trigger that checks the integrity, but it cannot work for inserts because the order must be something along the lines: START TRANSACTION INSERT INTO B ... (more) |
— | about 4 years ago |
Edit | Post #278992 |
Post edited: added relevant tag |
— | about 4 years ago |
Edit | Post #279035 |
Post edited: Removed irrelevant information |
— | about 4 years ago |
Comment | Post #279035 |
@Charlie Brumbaugh Yes, that means that the index contains that column + columns in the PK. That would explain the second point which actually seems to be the only point: all indexes will only cover the column in the PK. (more) |
— | about 4 years ago |
Edit | Post #279035 | Initial revision | — | about 4 years ago |
Answer | — |
A: Why would an unique index get moved to the primary key after the underlying column is dropped? I can't say that I fully understood what you did, but I think I got the explanation: - removed 1+ columns that were part of the index. The index will be updated to not include that column. > If columns are dropped from a table, the columns are also removed from any index of which they are apar... (more) |
— | about 4 years ago |
Comment | Post #279002 |
@FractionalRadix Yes, [binding] is very general, but it is what I heard being used for frameworks such a Windows Forms. WPF, Angular and Xamarin. Maybe something like [android-viewbinding] is more appropriate, but I am not sure if this is what you are using (never programmed directly with Java in And... (more) |
— | about 4 years ago |
Comment | Post #279002 |
I have also added [binding] tag as the concept seems to be used (bind view to viewmodel). Very good question btw. (more) |
— | about 4 years ago |
Edit | Post #279002 |
Post edited: added relevant tag |
— | about 4 years ago |
Edit | Post #278695 |
Post edited: removed useless tag |
— | about 4 years ago |
Edit | Post #279014 | Initial revision | — | about 4 years ago |
Question | — |
Do we really need the [tools] tag? During my review of the posts and tags, I have seen the tools tags. It is very generic and I am sure if it is helpful. What do you think? (more) |
— | about 4 years ago |
Edit | Post #279008 | Initial revision | — | about 4 years ago |
Answer | — |
A: How can I add "withCredentials:true" for HTTP requests generated by Swagger UI? One way to solve this without customizing the Swagger UI is to deal with it on the server side. The following assumes that the swagger docs is served at `/swagger` relative path. Middleware /// /// Middleware to protect API Swagger docs /// public class SwaggerAuthorization... (more) |
— | about 4 years ago |
Edit | Post #279007 | Initial revision | — | about 4 years ago |
Question | — |
How can I add "withCredentials:true" for HTTP requests generated by Swagger UI? I have added Swagger UI for an ASP.NET Core 3.1 application and I have realized that all endpoints requiring Windows Authentication fail. This issue is created by the fact that generated HTTP requests do not include withCredentials (what I used in the Angular client consuming the same API). This S... (more) |
— | about 4 years ago |
Edit | Post #279006 | Initial revision | — | about 4 years ago |
Answer | — |
A: Is omitting braces for single statements bad practice? Already good answers, but I can provide a slightly different perspective here: always use braces if there is a risk of getting into a pitfall. Examples (from C#, but the language is less relevant). - omit if the inner instruction fits on a single line and an extra blank line is inserted after:... (more) |
— | about 4 years ago |
Edit | Post #278771 |
Post edited: added relevant tags |
— | about 4 years ago |
Edit | Post #278547 |
Post edited: added relevant tag |
— | about 4 years ago |
Comment | Post #278988 |
@Moshi That would be great and intuitive for anyone using such a feature. (more) |
— | about 4 years ago |