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 Message consumption with priorities and consumer error handling using EasyNetQ library
Context I was tasked with developing a way to consume RabbitMQ messages that have various priorities (actually different levels of QoS). My restrictions are: - high priority messages should have precedence over lower priority messages (must be processed more quickly) - low priority messages sh...
(more)
about 15 hours ago
Question Time measurement in an ASP.NET Core application
My team introduces lots of time measurements for various code sections that might take longer than expected in a real-life flow. These rely on initializing a `StopWatch`, getting the elapsed time and sometimes ensuring that measurement is done even if an exception is raised. The following trie...
(more)
17 days ago
Question Azure Service Bus queue message consumption in an ASP.Net Core 6 application
My team is introducing Azure Service Bus consumption into the solution and we have developed an implementation that we want to act as a model for other services in the future. It is split in two parts: - a generic part that is supposed to be pushed into a core layer (a NuGet used by all the ser...
(more)
about 2 months ago
Answer A: Does Socket.AcceptAsync throw SocketException for any transient reason?
The source code for the Socket.AcceptAsync class seems to be this one. The relevant code (the one related to exceptions being raised) is the following: ```c# private bool AcceptAsync(SocketAsyncEventArgs e, CancellationToken cancellationToken) { ThrowIfDisposed(); ArgumentNullException....
(more)
3 months ago
Question Best practices for company internal Swagger Docs in production
The current project I am working on consists of a bunch of microservices (Web APIs) accessible only internally using Entra ID (formerly Azure ID). To simplify the development, all services expose Swagger Docs, but our SRE told us that Swagger Docs should be disabled in production. I understand ...
(more)
3 months ago
Answer A: How to speed up MySQL query?
The main issue with your approach is that, in some cases, you execute a lot of queries to fetch the data. When working with SQL (regardless of relational flavor), you must aim from a set-based approach, that is, you do not execute multiple queries in a loop, but a bigger query. In your case, that ...
(more)
4 months ago
Answer A: How to automatically add package reference into project file after installing .NET package?
Manually editing the `.fsproj` file followed by `dotnet build` worked because some `dotnet` commands have an implicit restore. I think this is the fastest way to add a dependency when you know its version. I have always used NuGet through its Visual Studio package manager, but I guess this is just...
(more)
5 months ago
Answer A: What software architecture are available for developing an application with multiple business domains that only share some common aspects?
Important note: this is primarily based on personal fairly long experience with monolithic architectures and limited microservice-based architecture combined with others' experience with microservice-based architecture Based on your rather vague requirements and the data volume indicated in the co...
(more)
6 months ago
Answer A: Alternatives to `EXPLAIN ANALYZE` for queries that won't complete
Note: I have limited experience with PostgreSQL, but extensive experience working with SQL Server, so not everything below might apply to PostgreSQL. > I have a large and complex PostgreSQL query that I would like to make faster. (..) When run, it does not complete in any reasonable amount of t...
(more)
6 months ago
Answer A: Tag creation/deletion criteria for Software Development?
Yes, but with some notes I think this a good idea, but we will need to provide more details and agree on some details. > 1. A tag must be named appropriately, considering Tag naming guidelines. I have mixed feelings about using uppercase in the tag names. I am inclined to switch to using th...
(more)
7 months ago
Answer A: Why is git merge from rather than to?
Another reason could be to allow to perform the merge without auto commit and no fast-forward: ```bash git merge thebranch --no-commit --no-ff ``` This allows reviewing the merged changes before they are committed.
(more)
8 months ago
Answer A: On self-answered questions, is it inappropriate to mark my own answer "Works for me" immediately?
I don't think it is inappropriate for someone to mark their own answer "Works for me" on self-answered questions, but it feels a little bit redundant since the answer is expected to work for the poster.
(more)
8 months ago
Question Should we disallow ChatGPT-User crawler (and others) from scraping Software Codidact?
Stack Overflow has recently announced OverflowAI and I think this video summarises pretty well this. The main drawback is that the users are less incentivized to put effort into answering questions and have this effort being fed into SO's LLM. I am wondering if it makes sense to start blocking kno...
(more)
8 months ago
Answer A: Self answered questions about an unclear quickstart
Yes Quick starting with an API is definitely ontopic and especially helpful for newbies who struggle to understand the "spirit" of that API. Even if nobody else from the community is into Google Apps Script API right now, I am pretty sure it will help future readers. If you have the time, pl...
(more)
9 months ago
Question Possible drawbacks for having duplicate local sources of the project tracking the same Git remote
Context I have started working on an Angular upgrade for a medium-sized project (from v. 10 to v. 15) and this is a rather long activity that is interrupted by other changes that need to be performed on the same project. I have created another branch for the upgrade, but switching back to anoth...
(more)
9 months ago
Answer A: How to move Rancher Desktop virtual disk file to another location?
It seems that the file can be moved if rancher data is exported unregistered from WSL and reimported in a new location. The process is very similar to the one used for Docker Desktop. Example for my case: - `wsl -l -v` to get the distro name: WSL distro list - `wsl --shutdown` - `wsl --e...
(more)
9 months ago
Question How to move Rancher Desktop virtual disk file to another location?
I am using Rancher Desktop as an alternative to Docker Desktop. After using docker for a while I have noticed that `C:\Users\user\AppData\Local\Docker\wsl\data\ext4.vhdx` has grown quite a bit (20GB+) and it's taking a lot of space from the system drive space. I know that can I can "prune" it (rem...
(more)
9 months ago
Answer A: Should I delete my trivial, lack-of-research question?
I agree with Dirk Herrmann‭'s answer about this: > What if a question is beginner level? I would say: Someone should answer it. > Some of the beginner level questions on stackoverflow have received answers that explain things in wonderful ways. While your question seems trivial for a seaso...
(more)
10 months ago
Question When is it OK for duplication of information between message header and payload in a distributed software application?
A friend is involved in rewriting a distributed software application and while discussing the architecture, we noticed that in many cases the messages had duplication between headers and payload. The headers mostly include metadata such as a correlation id, a phone number identifier, client ident...
(more)
10 months ago
Answer A: Updating the database reverses previous changes
I did not find the exact cause of your issue, but inserts should not be treated as updates. One way to do this is the following: ```c# static void InsertPost(Post post) { using var context = new BloggingContext(); context.Posts.Add(post); context.SaveChanges(); } var newPost =...
(more)
12 months ago
Question Should we allow SEO related questions?
We have recently received a search engine optimization (SEO) question. Our scope currently does not explicitly include or exclude such questions, so I thought we should clarify this. Possible options: - allow only programming-related SEO questions (e.g., ensuring website compatibility with d...
(more)
about 1 year ago
Question Health checks with caching in ASP.NET Core
Context I noticed that an application was flooding the database with simple SELECTs. The investigation revealed some bugs in the health check which theoretically implemented caching (to avoid querying external sources too often), but it was not working properly. The application health check in...
(more)
about 1 year ago
Answer A: EF-core Find method doesn't include other entities
What you want would be called `DbSet<>.Find()` combined with eager loading of the related entities. According to the docs, eager loading is not mentioned and its sole purpose is to easily get an entity based on its type and keys: > Finds an entity with the given primary key values. If an entity w...
(more)
about 1 year ago
Question Deciding if a concept can be materialized to a tag
Note: this is inspired by the comments on this post and especially this one which mentions: > We have tags for languages because people have interest or expertise in languages; likewise frameworks, design patterns, etc. Who is an ‘interface’ enthusiast? This discussion made me question the way...
(more)
about 1 year ago
Answer A: How to inject environment configuration values when deploying an Angular application in Kubernetes or similar infrastructure?
Note: this is mainly based on Build your Angular App Once, Deploy Anywhere article. Read this article, especially the drawbacks section. The basic idea is to create and read a configuration file that is kept as is when the Angular application is built (transpiled). I have made the following steps:...
(more)
over 1 year ago
Question How to inject environment configuration values when deploying an Angular application in Kubernetes or similar infrastructure?
Context I am currently migrating a Web application from on-prem infrastructure to K8s. The legacy infrastructure relies on defining some tokens in the configuration files and these are replaced during the deployment as follows: - ASP.NET Core: appsettings.json tokens are replaced - Angular...
(more)
over 1 year ago
Question Dealing with code maintenance when saving a large and complex entity in a single business transaction
Context I am currently working on migrating a legacy application to an ASP.NET Core + Angular application. The Web API's main project is based on Jason Taylor's template (clean architecture) and among others relies on MediatR library. The UI/UX experience for already migrated business flows rel...
(more)
over 1 year ago
Answer A: interface and interface-type tags
Yes, I have added that tag. I tried to create a tag to match the "interface when working with objects" concept. I am not happy with interface-type because it suggests `typeof(ISomeInterface)`, but I think it is less ambiguous than interface. What about interface-object-type? I am open to su...
(more)
over 1 year ago
Answer A: Closed Question Too Generic, Reason Unhelpful
I will provide an answer to this question in the context of this, now deleted question which included this relevant text before being edited and removed: > How to implement a variable trust-based privileges system, so that there []() always the same number of users with the top trust level and an...
(more)
over 1 year ago
Question Should we allow answers generated by ChatGPT?
We got our first (mostly) ChatGPT answer in our community. Also, a question includes an adapted ChatGPT code that does not seem to do the job. StackOverflow has already banned ChatGPT answers and I am wondering how we should proceed in this case. From my perspective, we should also ban ChatGPT...
(more)
over 1 year ago
Question Implement translatable UI in a Single Page Application when working with ngRx
I am currently working on an Angular SPA that supports multiple languages and relies on ngRx for state management. Although the application state is handled by ngRx, the current language is stored in the database. The translated resources come from outside the store (resource files read using the...
(more)
over 1 year ago
Answer A: How can I provide additional information when raising an exception?
Python documentation suggests that you can simply add other parameters when raising the Exception and retrieve them using args: Code ```python try: raise Exception('spam', 'eggs') except Exception as inst: print(inst.args) # arguments stored in .args x, y = inst.args # unpack ar...
(more)
over 1 year ago
Answer A: Datagrid in MVVM saves edits but not inserts
Entity Framework is able to save the changes by using a tracking mechanism (i.e. what is added, deleted, removed). I guess `repository.GetAllGoals()` implementation is something like `context.Goals` or `context.Set()`, so when you are constructing the `ObservableCollection` you actually get a lis...
(more)
over 1 year ago
Answer A: How to define Polly policies when working with Refit library in ASP.NET Core?
Refit allows such configuration out of the box bt using `AddRefitClient` (which resembles the well-known AddHttpClient). This indeed requires explicit configuration for the HttpClient, but the configuration and usage will be simpler: Refit and resilience configuration ```c# private static ISer...
(more)
over 1 year ago
Question How to define Polly policies when working with Refit library in ASP.NET Core?
Note: this is based on my question on SO and subsequent activity there I am trying to add resilience using Polly to HTTP calls that are performed using Refit library. I am using the Refit factory method `RestService.For<>` and I have a working code, but I feel it is way more complex than it sho...
(more)
over 1 year ago
Answer A: How to refer to the same class twice from one Entity Framework entity?
I tried to replicate your case and the only workable solution I could find is to use OnModelCreating configuration (fluent style) instead of attributes: ```c# public class Contestant { public int Id { get; set; } public int AvatarID { get; set; } public virtual Picture? Avatar { get; ...
(more)
over 1 year ago
Question Should asking about book recommendations directly connected to software development be on-topic?
Context We have recently received a suggestion to allow questions about recommending books directly connected to software development. The way I see this now (pros and cons) Pros: - allow more questions that help software developers Cons: - tend to be open-ended, unless there is not a...
(more)
over 1 year ago
Question Renaming GNU/Linux tag to gnu
I have noticed that we have several questions tagged with GNU/Linux. I would like to rename this tag to gnu to reflect what seems to be the canonical name and also be consistent with tag naming (all letters are lowercase, avoid slashes). Based on provided answers, I know consider the following ...
(more)
over 1 year ago
Question Dealing with table tag
This question which is tagged with table tag. I am trying to find a better replacement for it since there are multiple types of tables such as HTML tables or data tables. The question seems to refer to a table displayed within a graph (a rendered table), but I am not sure how to tag such a tabl...
(more)
over 1 year ago
Question Working with a generic class that uses a type that should be of generic type
I have followed Nick Chapsas' tutorial to avoid throwing a ValidationException to treat validation errors and instead rely on `LanguageExt.Common.Result<>` from LanguageExt library. I have managed to develop a working solution that relies on MediatR (which uses queries, commands and validators fo...
(more)
over 1 year ago
Answer A: How to migrate NLog configuration from XML file(s) to application settings (JSON)?
FreeFormatter resource mentioned in the question is useful and I could use the output as a base for getting to a working configuration. All the changes were manually performed. []()- enable throw configuration exceptions and allow for internal log messages to be output in a file for understanding ...
(more)
over 1 year ago
Question How to migrate NLog configuration from XML file(s) to application settings (JSON)?
I have just created an ASP.NET Core 6 application and added NLog support for logging: ```c# NLogBuilder.ConfigureNLog("nlog.config").GetCurrentClassLogger() ``` However, this API is almost deprecated as the remarks says: > It is now recommended to use NLog.LogManager.Setup().LoadConfigura...
(more)
over 1 year ago
Answer A: How to generate lots of hyperlinks rather fast using ClosedXML library?
One faster alternative is to use a formula to create the hyperlink. An example is provided below: ```c# public static IXLCell SetHyperLink(this IXLCell cell, string url, string text = "link") { if (string.IsNullOrWhiteSpace(url)) return cell; // ensure a valid hyperlink text string a...
(more)
over 1 year ago
Question How to generate lots of hyperlinks rather fast using ClosedXML library?
I am using ClosedXML library to generate an Excel containing thousands of hyperlinks using cell's `Hyperlink` property: ```c# cell.SetValue(text).Hyperlink = new XLHyperlink(url); ``` Such a call takes about 3ms which seems very fast, but this leads to exports taking up to one minute for larg...
(more)
over 1 year ago
Answer A: Order a subcollection from linq
If you are using .NET Core 5.0 or more you should be able to write something like the following (not tested): ```c# var data = context.TblOrder .OrderBy(o => o.OrderDate) .Select(o => new { Order = o, OrderLines = o.TblOrderLine.OrderBy(ol => ol.ProductName) ...
(more)
almost 2 years ago
Question Measuring the impact of using exceptions instead of return values in an ASP.NET Core application
Context This Q&A from SO suggests that throwing exceptions is incredibly expensive when compared to returning values (return codes): > that with return codes instead of exceptions the same program runs less than one millisecond, which means exceptions are at least 30,000 times slower than retu...
(more)
almost 2 years ago
Question What version of runtime environment does a .NET 5 application actually needs?
Our team deals with a legacy application that relies on a rather old deployment process and infrastructure: - we deploy the application on an environment very similar to the production called Clone. Clone is a Windows Server that has (among other versions) a version of .NET 5.0.x (e.g. .NET 5.0.16...
(more)
almost 2 years ago
Answer A: WPF MVVM ListBox not updating
I haven't worked in WPF for a long time, but you might try setting a new list (clone the old one and add the new element) instead of adding the element to the existing list: ```c# demo.Value++; var newList = new List(demo.AllValues); newList.Add(demo.Value); demo.AllValues = newList; OnProper...
(more)
about 2 years ago
Answer A: How to get rid of HTML tags and convert entities in SQL Server?
One way is to create a scalar function that takes an NVARCHAR(MAX) input and performs the following operations: - replaces frequent tags with they plain text equivalent (e.g. `` with chars 13 + 10) - replaces spacial entities with their correspondent UTF character (e.g. `&copy;` with `©`) - comp...
(more)
about 2 years ago
Question How to get rid of HTML tags and convert entities in SQL Server?
I have to migrate a bunch of text from an old application into a new one. Some of these texts contain HTML tags and entities (HTML editor was used) and now they do not want to support this in the new application. How to get rid of the tags and transform the HTML entities?
(more)
about 2 years ago