All Questions

Filter by
Sorted by
Tagged with
0 votes
2 answers
36 views

Fail fast is brittle

I am creating a csv consumer (with Java). There is one field / column that should contain one of the values "Rename" or "Move". I implemented this by allowing mixed case of letters,...
0 votes
1 answer
47 views

Why do most package managers not keep a single reusable library with different versions of each package?

When you use a Python virtual environment, you can activate it for different projects. Whatever packages are in it will be used by the project code. When you use npm, there will be a node_modules ...
2 votes
3 answers
2k views

Find k max integers of an array -- Min Heap vs. Selection Algo vs. Selection Sort

I have an array with a large number of elements, and I need to find the k largest elements. For an idea of scale, let us assume an integer array of length 10,000,000, and k is 1,000. I see three ...
9 votes
2 answers
605 views

Name of technique for inferring type arguments of a type parameter?

Setup: Let's assume we have a type called Iterator which has a type parameter Element: interface Iterator<Element> {} Then we have an interface Iterable which has one method which will return ...
0 votes
1 answer
24 views

Optimal way to share data between different classes

I have a C++ code that performs simulation of a physical system which deals with motion of objects. It has the following classes: Class Main, containing all the main calculation methods and the data ...
80 votes
12 answers
141k views

What exactly is the build number in MAJOR.MINOR.BUILDNUMBER.REVISION

What I think about Build Numbers is that whenever a new nightly build is created, a new BUILDNUMBER is generated and assigned to that build. So for my 7.0 version application the nightly builds will ...
1 vote
2 answers
123 views

How to store an encrypted filesystem in a single file on disk on multiple platforms (maybe not portably), or alternatives

I'm in the very conceptual phase of designing an open source password manager that provides distributed Vaults that can be simultaneously accessed and managed from multiple devices with the promise of ...
0 votes
1 answer
13 views

How to rebalance data across nodes?

I am implementing a message queue where messages are distributed across nodes in a cluster. The goal is to design a system to be able to auto-scale without needing to keep a global map of each message ...
-2 votes
1 answer
57 views

Spring/Java multiple shared modules for different databases

I'm implementing a software based on the micro-service architecture using Spring/Java. Each micro-service connects to either a PostgreSQL or a MongoDB database. Is it standard practice to have a ...
-2 votes
3 answers
75 views

Server-side ad insertion and video downloaders

Video streaming sites like YouTube are experimenting with server-side ad insertion Server-side ad insertion differs from normal YouTube ad insertion techniques primarily in how ads are delivered to ...
-3 votes
0 answers
49 views

How to scale Git servers reliably? [closed]

I'm planning to manage a cluster of Git servers. There are a few requirements for the functional requirements: Users should not be concerned with the fact that there are a cluster of Git servers. ...
0 votes
4 answers
2k views

Share Global Variable in DLL, feasible or naive?

So the gist is to have a static global variable that can be modified by different executables. For example I have 2 different source files including the same dll.h: dll.h #include <iostream> ...
2 votes
4 answers
303 views

How would I go about writing my own implementation of Win32 functions?

So I am currently coding a C program for Windows and come across a little bit of a problem. I've been compiling using the mingw-w64 toolchain. In my program, I am attempting to remove as many ...
14 votes
4 answers
3k views

What side-effects, if any, are okay when importing a python module?

Generally, modules should not have side effects. However, in a lot of cases, the side-effects are hard to avoid or may be desirable. There are also popular packages with on-import side-effects. Which ...
0 votes
3 answers
161 views

Adding a CLI to a Windows service

I have a Windows service that I would like to extend and add a CLI to it similar to docker or Elastic Agent, so I have a question about what kind of approach I should use for the *.exe to communicate ...
-1 votes
0 answers
31 views

How to become better at predicting refactoring outcome? [closed]

Seems like even after years programming, one may occasionally fall on seemingly simple code which in reality is tricky code that isn't as easily refactorable as it seems in first instance... Here's an ...
0 votes
2 answers
103 views

Is it still "feature envy" if the state to make decision or the action to take after asking the state involves other classes to participate?

According to https://softwareengineering.stackexchange.com/a/212130/432039, if a class asks another class for the state, and then call methods of that class, it is called "feature envy", eg: ...
16 votes
7 answers
43k views

What is the better way to escape from too many if/else-if from the following code snippet?

I am trying to write a servlet which does task based on the "action" value passed it to as input. Here is the sample of which public class SampleClass extends HttpServlet { public static void ...
0 votes
0 answers
42 views

A Design Pattern for a component which both writes to and reads from an ordered event log

I am searching for a good design for a set of components I am writing for a system. I believe it is very likely there is a Design Pattern, or set of Design Patterns, which could be combined to solve ...
1 vote
1 answer
55 views

Need help on Clean Architecture with Service/Manager/Controller

I am developing an Android application trying to comply with Uncle Bob's clean architecture. User interface has a text and a button. Button triggers a usecase (TextToSpeechUseCase) from viewmodel. ...
6 votes
2 answers
298 views

What time horizon and level of abstraction is the right for the maintainable and evolvable software? [closed]

From time to time I feel exhausted in my software development efforts because I am pressed to think and develop in a very specific and very short-term manner. One client here and now requires one ...
1 vote
1 answer
814 views

Can a class factory also save the object to a database?

How can a factory also save the object in the database? I want to create an object that consists of other objects. Pseudocode: firstObject = db.get....; secondObject = db.get....; expectedObject = ...
6 votes
4 answers
1k views

Why is there both logical operators <> and !=?

The are two operators '<>' and '!=' used in programming languages with the same general meaning. '<>' can be used in PHP, SQL, and Pascal. '!=' seems to be more commonly used. What is the ...
1 vote
2 answers
453 views

Agile development: where to include UI coding?

I've been doing agile planning for a long time, but always I get to the same question: where should I put the basic UI development tasks? I mean, for example, if we are developing a web app, we need ...
1 vote
3 answers
116 views

How to tackle synchronizing large amounts of data across services in an efficient way?

I am working at a retailer with a deep catalog of products and we are taking stock of our architecture. Currently, we use microservices, but all product information goes to a service that is getting ...
5 votes
1 answer
344 views

ReactJS with Elasticsearch App Architecture

I want some advice regarding my architecture and hosting options. I'm attempting to build an e-commerce site for e-books. It will use nestJS for the backend and ReactJS+Typescript for the frontend. ...
4 votes
2 answers
923 views

How to make max-heap stable with counter and account for counter overflow?

Generally I need size-efficient data structure similar to std::priority_queue but stable (preserving order of insertion). By adding just 4 bytes to the object I could have 1 byte serving as priority ...
0 votes
0 answers
34 views

Storing SqlAlchemy models for database with >20 tables

I'm working on a pet project for a web shop that uses SQLAlchemy (SA) and connects to a database with over 25 tables (thus, I have 25+ SA models - one for each table). What would be the best practices ...
-3 votes
0 answers
43 views

How to architect/design an "achievement" system in, for example, a web shop [closed]

Imagine you have a webshop page with its own database, but you also want to add the feature that the user gets achievements for certain actions, e.g. first buy, buy 10 items, buy an item in discount, ...
0 votes
1 answer
323 views

Static data reuse

I'm going to describe the situation first and ask questions in the end. I need to validate a scalar value using the Symfony Validator component. The value is an associative array. Now I have defined ...
-2 votes
0 answers
34 views

React js POST method to two or more tables [closed]

I'm a newbie to react and PHP and have been trying to learn it by a random car project with crud operations. Right now i'm only using CRUD operations on coches (cars) table and it works just fine. ...
0 votes
0 answers
73 views

Best way in C# to share class implementation patterns between abstract base classes [closed]

I could also ask this question for Java, D or C++. I remember, I found this to be an artificial limitation in Java already 10 years ago. I am currently working with C# and appreciate advices here. It'...
1 vote
1 answer
78 views

How to Handle Additional Parameters in State Transition for State Pattern in C++

I'm implementing a state pattern in C++ with a context and several states. Each state implements its transition. Here's a simplified version of what that design could look like: class Context; class ...
179 votes
5 answers
75k views

What's the reason for not using C++17's [[nodiscard]] almost everywhere in new code?

C++17 introduces the [[nodiscard]] attribute, which allows programmers to mark functions in a way that the compiler produces a warning if the returned object is discarded by a caller; the same ...
0 votes
1 answer
135 views

I need to choose records from a database to feed to a model for training, but would like to weigh records beforehand. What's a good strategy for this?

I am currently responsible for feeding data to an STT model. My backend is written in Python/Django and is primarily responsible for managing a Postgress database. The database has a table that saves ...
-4 votes
0 answers
19 views

How chromium Site Isolation and process allocation works for Iframe? [closed]

I was with working with a website it contains 6-10 Iframes, Each Iframe contains a web app so obviously there are high chances of that my website get slowed down. So to fix this I tried to understand ...
9 votes
4 answers
2k views

Is the inability to find code by searching for a class name a reason to avoid using auto in c++ variable declarations?

According to https://softwareengineering.stackexchange.com/a/180616/432039 suggested, I know the answer advised "auto" should be used instead of the actual type when declaring variables. ...
0 votes
3 answers
123 views

.Net 8 XUnit: How to mock MySql in a CQRS API using integration tests?

This is a rewrite of my own .Net 8 XUnit: Should my tests use real data or how to mock MySql with CQRS? in a much more clear way: The reason for rewriting my previous question is because in the ...
-2 votes
2 answers
143 views

How do I build my application with high throughput in mind? (Need guidance)

I am building a Spring boot REST API app that is part of a microservice architecture project. What I am planning: My app listens for events from two other services and after some business logic, ...
5 votes
5 answers
4k views

dev and qa in same sprint

I am not the first one to ask this but i also did not get anything concrete from other such posts to tell me what is needed so i am posing the question here. Feel free to refer to some other resource. ...
0 votes
1 answer
171 views

Is there a good reason not to use a "super class" (an all-encompassing class) [closed]

I write embedded software and I often find myself structuring my code such that there is one large parent class that contains just about everything. For example, consider you want to model a hardware ...
1 vote
0 answers
37 views

BPMN 2.0: Can sub-processes / event sub-processes have a message end event?

boiling it down to the painpoint: I wonder, if sub-processes can end with a message end event. And in addition, does this hold for event sub-processes as well? (I know that event sub-processes are not ...
3 votes
2 answers
338 views

.Net 8 XUnit: Should my tests use real data or how to mock MySql with CQRS?

I'm creating tests for our .Net 8 API. We use MySql for data storage and CQRS pattern for queries. In my personal opinion, I shouldn't use the real database for testing, because you will use an ...
0 votes
0 answers
65 views

How to restructure a schema in order to support conditional (one of two tables) relations

I've been stuck on this for a while now so I decided to ask for some help. My SetTemplate needs to EITHER be connected directly to exerciseTemplate OR connected to exerciseTemplate through a ...
5 votes
2 answers
414 views

When the stack frames become computationally expensive

I've been experimenting with different data structures and algorithms in Python, Java and C to see in what circumstances function/method inlining could bring meaningful gains in terms of the execution ...
1 vote
2 answers
5k views

C# DbContext with nested classes containing the Repository methods

So I have done a lot of reading and it appears that, since DbContext already implements a repository and unit of work pattern combination, creating more abstraction classes would be redundant. However,...
3 votes
1 answer
178 views

Gradual Upgrade of an Inherited .Net Framework Project

I'm seeking advice on the best approach to upgrade a legacy .Net Framework project to a newer version. The project currently consists of over 80 projects, and a complete rewrite would be a time-...
1 vote
3 answers
1k views

How to design an API wrapper with bulky operations on domain object? (Need guidance)

I need some guidance in designing an API wrapper for my backend APIs. I have tried to keep it as specific as possible. Context: We have a project which supports certain file operations like edit, ...
9 votes
4 answers
10k views

What is the most-widely accepted naming convention for date properties? [closed]

What is a widely accepted naming convention for date variables or properties in an Object-based, strongly typed language like C# (and by extension, for date database columns)? Do you use the word &...
1 vote
7 answers
436 views

How do I cleanly keep track of the type of various objects implementing a common interface without reflection?

In my multiplayer game I keep track of each player's inventory. I have a class for each inventory action that extends the abstract class InventoryItem. I then polymorphically call use() on the ...

15 30 50 per page
1
2 3 4 5
1275