Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »

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
Question Is it necessary for a build server to remove node_modules before an AOT build?
I am currently dealing with an Angular application that is being deployed using an CI orchestrator and Jenkins. Jenkins job is configured to do the following (relevant steps only): - fetch sources from Git - remove nodemodules - `npm install` - perform AOT build (`--prod` + other optimizati...
(more)
over 3 years ago
Question What are the cons of directly mocking Entity Framework DbSets instead of working with an in-memory database when unit testing the application?
I have recently contributed to a Clean Code project and had a discussion about how to implement unit tests. The project author argues for using an in-memory database (which easily replaces the real one) instead of mocking the DbSets and now I am doubting my own approach. The in-memory database...
(more)
over 3 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)
over 3 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)
over 3 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)
over 3 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)
over 3 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)
over 3 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)
over 3 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)
over 3 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)
over 3 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)
over 3 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)
over 3 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)
over 3 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)
over 3 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)
over 3 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)
over 3 years ago
Answer A: What is the point of tagging a question with both a parent and a child tag?
I can provide an answer based on Stack Overflow experience. SO offered watches by tags. By using a general tag along with a more specific tag, users interested in [sql] will also get the question in their feed. While I could find this feature on Codidact, it makes sense to implement it in the futu...
(more)
over 3 years ago
Answer A: How can I can I reduce the size of a SQL Server database after being restored and massive embedded files stripped?
One way to solve this is to shrink the database and reindex all tables to fix the indexes fragmentation: DBCC SHRINKDATABASE (TheDatabase); GO -- reindexing all tables to optimize performance after the DB shrink declare @TableSchema varchar(255) DECLARE @TableName varchar(255)   D...
(more)
over 3 years ago
Question How can I can I reduce the size of a SQL Server database after being restored and massive embedded files stripped?
My project has the following set up for the production and preproduction ("clone") environment. - Production is not accessible at all for the development team, only the preproduction database. - Preproduction database is restored each day, but a post-restore script is run to strip away sensitive ...
(more)
over 3 years ago
Answer A: How to create a delayed loading indicator when working with ngrx/store?
This heavily relies on this question which deals with another matter. In order to delay the loader, there must be a clear difference between the start of loaded from the caller's perspective and when the loader is actually displayed (i.e. `isLoading = true`). The following code does the trick: ...
(more)
over 3 years ago
Question How to create a delayed loading indicator when working with ngrx/store?
I am working on an Angular application using ngrx and I have a loader state + reducer that is used to display a loader. However, very short AJAX calls cause a flicker and I need to delay showing the loaded to avoid being shown for very fast responses (e.g. < 300ms). My state is very simple: ...
(more)
over 3 years ago
Question Is there a way to add expiration for questions tags?
Comments from this question reveal that there is some aggressive caching related to question tags (what tags are used for a question). Unfortunately, after changing tags for several questions I have realized that glitches are quite often. Example for [formula] tag: - search indicates 6 usages ...
(more)
over 3 years ago
Answer A: What is our policy on tags?
Thanks for raising this question. My answers to your questions: What type of tags will we allow? (Should specific tags like [UrlRewrite] be allowed?) I am not sure what is the best way to deal with this and I am waiting for community feedback. How many tags will we allow? (Should we delete a...
(more)
over 3 years ago
Question Phantom answer in my notification list
My notification list includes the following entry: New answer to your question 'How many votes are required for special actions...' However, there is no answer for that question. I imagine that the author posted an answer and remove it, but as far as I know I am able to see delete posts.
(more)
over 3 years ago
Question Should we get rid of [formula] tag and use more meaningful tags like [excel-formula] or [google-sheets-formula]?
We currently have quite a few questions tagged with formula. However, [formula] seems so general that I am inclined to replace it to a more specific formula based on the context. Examples: - [excel-formula] - [google-sheets-formula] - [lotus-formula] Is it OK to perform this tag split?
(more)
over 3 years ago
Answer A: Which abstraction should I choose for background services and why?
I will provide an answer from a pragmatic perspective, rather than a direct answer to your question. This is particularly important when working on a real project (as opposed to homework). Short answer Try to use a third-party library instead of reinventing the wheel. Defining and managing back...
(more)
over 3 years ago
Question Schrödinger's tag - appears in view mode, but not in edit
After removing two tags and adding another one for this question I have noticed that the tag list is not the same between view mode and edit: - View mode: stack-memory + heap-memory + ram + memory-management - Edit mode: stack + heap + memory-management Before editing the question, I have rena...
(more)
over 3 years ago
Answer A: How to use LazyCache library with Unity Container?
For LazyCache version 2.1.2 (maybe even earlier) UnityContainer must be instructed to call the default LazyCache constructor which probably relies on MemoryCache (default). container.RegisterType(new InjectionConstructor()); This worked with .NET Framework 4.6.1, Unity Abstractions 3.1.0.
(more)
over 3 years ago
Question How to use LazyCache library with Unity Container?
I want to use LazyCache and UnityContainer together in an ASP.NET classic application (.NET framework 4.6.1+). Namely, to be able to inject IAppCache in various services. For ASP.NET Core and its default DI container it is as easy as: services.AddLazyCache(); How can this be done with Un...
(more)
over 3 years ago
Question Renaming sheets to the more specific google-sheets?
sheets tag sounds a little bit too generic and I feel that it should be replaced with the more specific [google-sheets]. I know that we should avoid using company names as much as possible, but in this case, I think it will prevent confusion for anyone not familiar with the Google sheets (e.g. we ...
(more)
over 3 years ago
Question Should we rename urlrewrite tag to url-rewriting?
How do I get IIS UrlRewrite to handle CSS-delivered woff files appropriately? is the only question currently using urlrewrite tag. However, for future questions I would like to have a more general tag related to URL rewriting rather than the specific case of IIS URL rewriting. Is it OK to rena...
(more)
over 3 years ago
Question Setting the authentication token in an Angular application for generated API clients
This is a post of mine from Code Review Stack Exchange which did not get an answer yet. I am developing an Angular application that consumes an external REST API. I am using OpenAPI generator (TypeScript template) to generate the API clients. The happy flow is the following: - call a method ...
(more)
over 3 years ago
Question Cache data using Redis Cache in an ASP.NET Core 3.1 project
This is an unanswered code review request of mine from Code Review Stack Exchange. Overview I have developed a small ASP.NET Core 3.1 Web API that provides information that is rarely changed (several times a day) but often read ( 10 K / day). For me, it is a good opportunity to toy with Redi...
(more)
over 3 years ago
Question Measure ASP.NET Core 3.1 Web API action execution times
This is basically an unanswered code review request of mine from CodeReview Stack Exchange. I want to be able to log as accurately as possible, the time spent by a certain Web API action in an ASP.NET Core 3.1 Web API. I found out this very old question dealing with a similar issue in ASP.NET. ...
(more)
over 3 years ago
Answer A: How to calculate how much data is stored in a MySQL column?
The reference indicated by ‭jcsahnwaldt‭ indeed specifies the space required by VARCHAR columns, namely (L = string length): > L + 1 bytes if column values require 0 − 255 bytes, L + 2 bytes if values may require more than 255 bytes However, I think this is true only for non-Unicode characters...
(more)
over 3 years ago
Answer A: Site scope - draft proposal
Based on this proposal, I have created a designated section within the Help section: What type of questions can I ask here? This can evolve over time based on feedback provided by the community.
(more)
over 3 years ago
Answer A: How will you balance demanding high quality questions with maximising the number of users?
One aspect that helps with having a good balance is to have an enough number of users that help newbies ask good (or at least decent) questions. This is something reachable within rather small communities. I have seen this being put in practice by Politics.SE where there is a more effort put into ...
(more)
over 3 years ago
Answer A: What is the rationale of having Cascade as a DeleteAction in EntityFramework.Core?
After toying a little more with Delete actions for referentials, I think the rational of having the CASCADE DELETE as default is the following: - having to DELETE the children before the parent is not actually trivial (clearing the navigation properties collections first leads to a save error, rem...
(more)
over 3 years ago
Question What is the rationale of having Cascade as a DeleteAction in EntityFramework.Core?
I have noticed some time ago that Entity Framework assumes a CASCADE behaviour (implicit value, if not specified) for referential constraints (FKs) when deleting items. This means that by default, if a parent record is removed, all descendants are removed. I remember that back in the days, whe...
(more)
over 3 years ago
Answer A: Should we have a Code Review Section / category?
I would definitely allow code review questions (requests) as they are an important part of any professional software developer. A special category might make sense, although a designated special tag (code-review) might be enough if it also results in a special highlight for at least for the tag.
(more)
over 3 years ago
Question Implementing impersonation in an ASP.NET Core Web application
I am working at a proof-of-concept for porting an ASP.NET MVC application to an ASP.NET Core API + Angular SPA. One of the features of the existing application is the ability of an admin (typically tech support) to impersonate any other user. This is done through ASP.NET impersonation, but one sid...
(more)
over 3 years ago
Question Are questions about web browsers on topic on Software Applications?
I have recently posted this question on Web Application SE and I am wondering if such a question would be on-topic here. The questions deals with understanding a feature of Google Chrome Developer Console: GRPR / GTM flag.
(more)
over 3 years ago
Answer A: In MySQL, is it possible to disable triggers for only certain queries or users?
First of all, it seems that Mysql does not allow to disable triggers. One way would be to set a session variable which can be checked in each trigger. This still incurs some overhead (trigger is still fired for each record), but the actual trigger functionality is very small.
(more)
over 3 years ago
Question Adding a parent to a tag crashes on the server side (500)
Cross posted to Meta: https://meta.codidact.com/questions/278198 If I try to provide a parent to a tag, it crashes with 500. - Error Id = 6bd06f30-539d-4b88-8743-eca32a8465cd - Tag to edit = https://software.codidact.com/categories/38/tags/3338/edit - Added parent = office It seems tha...
(more)
over 3 years ago
Answer A: In a stored procedure, is it possible to get the total number or rows updated by different statements?
One rather complicated way to get what you want (may be extended to multiple calls of statements and/or procedures) is through usage of MySQL Row-Based Binary Logs as explained here. This allows for MYSQL to generate logs with affected rows that will be output like: [Transaction total : 10 ...
(more)
over 3 years ago
Answer A: How to perform LINQ joins with multiple fields in a single join?
The quickest way is to make an equal join on two anonymous objects: var result = from x in entity join y in entity2 on new { x.field1, x.field2 } equals new { y.field1, y.field2 } Another way is combine the styles of writing the LINQ statements for more flexibility: ...
(more)
over 3 years ago
Question How to perform LINQ joins with multiple fields in a single join?
Note: this is an aggregate of the answer provided for this question. I want to get the LINQ equivalent of the following from SQL: SELECT .. FROM entity1 e1 JOIN entity2 e2 ON e1.field1 = e2.field1 AND e1.field2 = e2.field2 What is the best way to write the LINQ query?
(more)
over 3 years ago
Answer A: How can I reduce the size of .svn folder?
`svn cleanup --vacuum-pristines` can be used to clean up the pristine copies that might take a lot of space (version 1.10+). In Windows, TortoiseSVN client has the option Vacuum pristine copies to get the same effect.
(more)
over 3 years ago
Question How can I reduce the size of .svn folder?
Note: This question and its answer are an aggregate of the most up to date information about this topic from here. I have noticed that .svn folder has grown a lot and I want to reduce it. How can I achieve that?
(more)
over 3 years ago
Question How can I fill in tag information?
I have noticed that most tags lack any usage information and moreover a more detailed wiki: Tag with no usage information or detailed wiki I woul[]()d like to add the information for some of these tags, but I do not see how. I assume there is some kind of privilege for this or the function is n...
(more)
over 3 years ago