First, I'd like to highlight my personal premise on error handling approaches in C++ (as it might be the source of confusion in the first place). C++ Standards, 2004 (Sutter, Aleksandrescu), item 68 states as follows: Use assert or an equivalent liberally to document assumptions internal to a module (i.e., where the caller and callee are maintained by the same person or team) that must always be true and otherwise represent programming errors (e.g., violations of a function's postconditions d...| Recent Questions - Software Engineering Stack Exchange
Context: Trying to login, the request is working with success login. But for storing refreshToken, the cookie is not being set in Cookies section and not found. Backend sends set-cookie header with values but it doesn't store cookie in browser. Note: - I have mentioned below TECH STACK USED, CODE and REQUEST AND RESPONSE HEADER Backend Code: CORS: ` cors: { origin: 'https://dev.agent.example.in', methods: 'GET,HEAD,PUT,PATCH,POST,DELETE,HEAD,OPTIONS', preflightContinue: false, optionsSuccessS...| Recent Questions - Software Engineering Stack Exchange
We want CI/CD to inject the production connection string into a .NET Framework app.config during deployment. In source control, we only want test/staging DB connection strings. Developers should still be able to debug locally with test/staging DBs. At deployment, the CI/CD pipeline should replace the connection string with the production one (stored in GitHub Secrets). Question: What’s the recommended way to update or override app.config connection strings in a GitHub Actions workflow for a...| Recent Questions - Software Engineering Stack Exchange
Most database wire protocols mandate a specific byte order for multi-byte integers: PostgreSQL: big-endian (network byte order) MySQL: little-endian MongoDB: little-endian (BSON format) OracleDB: Oracledb uses big-endian for vector data (link) However, this seems inefficient. For example, when both client and server run on x86 (little-endian), PostgreSQL still requires: Client converts from little to big-endian Sends over network Server converts from big to little-endian Stores in native form...| Recent Questions - Software Engineering Stack Exchange
I am building an Android password management app, where passwords are locally kept for security reasons. The network endpoints are only for creating an account, email verifications etc. I want to handle a scenario where, if a user accidentally deletes the app and re-installs it, the local data is backed up for that account. Of course I don't want to implement a cloud backup here. What is the best way to locally and securely backup the data of passwords, only so that upon reinstalling the app ...| Recent Questions - Software Engineering Stack Exchange
In my working experience, I am into a situation in which the team has stopped using migration scripts for setting up the db. The team is fast paced focusing on business upon a 1-year old startup. Currently, we are using schema diffs provided from doctrine and db dumps (from deployed dev or staging environment) for local development. But there are situations that beyond only running a schema diff is not enough such as this situation. So what is the most common approach in this problem? Usually...| Recent Questions - Software Engineering Stack Exchange
Lately, I’ve been studying the fundamentals of Software Architecture for web applications, and I’m a bit unsure about how the data and presentation layers should interact. From what I understand, the presentation layer is responsible for operations like validating requests, handling authentication, and so on. Meanwhile, the business logic and query handling should live within services or, in some cases, dedicated queries and commands. My question is about data serialization and transmissi...| Recent Questions - Software Engineering Stack Exchange
I’m integrating with the Ajax Enterprise API which exposes an AWS SQS feed for device events and notifications. The API documentation is here: Ajax Enterprise API Docs. Each SQS message supplies an event code, which is then used to look up the corresponding log message. This is supplied with placeholders, which you then substitute with other data in the SQS message. Example: "M_01_20": "%3$s: open, %1$s in %2$s" -> "MyHub: open, MyDetector in MyRoom" In an ideal world the feed would just su...| Recent Questions - Software Engineering Stack Exchange
I'm testing writing 10 MB of data to a server. The expected result echoed back is 10485760 bytes. 160 writes of 65336 bytes. Approximately 1 of 5 tests I get back 10420224 bytes in the test. 65536 less than the expected 10485760 bytes. Is there a standard software engineering terminology describing a case where the same algorithm produces different results during tests?| Recent Questions - Software Engineering Stack Exchange
For me the hardest part has always been designing data access layer. After trying various strategies I started leaning towards many small focused DAOs like in example below. public class EmployeeService { public Task<EmployeeAnnualReport> GetEmployeeAnnualReportAsync(int id, IGetEmployeeAnnualReportDAO dataAccess) { Employee employee = await dataAccess.GetEmployeeAsync(id); // skipped for brevity } public async Task UpdateEmployeeAsync(int id, EmployeeUpdateInfo info, IUpdateEmployeeDAO dataA...| Recent Questions - Software Engineering Stack Exchange
There is already a prior question dealing with why certain bit-widths were chosen (although I do find it somewhat insufficient, but that's another topic), but what strikes me as unusual is how the bits are distributed rather than anything else. If we are to divide a 32-bit, single-precision floating point number into bytes, we see that the exponent is split across bytes 3 and 4, with one bit in byte 3 and seven in byte 4. There are various "homebrew" floating point libraries around online tar...| Recent Questions - Software Engineering Stack Exchange
I am creating a DB that indexes JSONs on top of a key value storage engine (LMDB or somewhat similar). When a new JSON needs to be indexed, I will create an entry for each field (AKA, JSON key), for example, for the field "firstname=123" I will create a reverse index "123 = jsonid". So this allows me to query all json objects in which firstname equals 123. My question is, how do I structure my indexes, in order to be able to answer a compound query (example firstname = X and lastname = Y) In ...| Recent Questions - Software Engineering Stack Exchange
Conditions: stable legacy prod system no Software Devs of the system are available anymore app is maintained by Engineers, who do not have the same software dev experience like the original Devs and almost none for that specific system there are issues requiring debugging of the code, and the remaining Engineers have to handle both the issues and the technical documentation maintenance not enough documentation usable for debugging and maintenance purposes of is available code repository is th...| Recent Questions - Software Engineering Stack Exchange
I'm trying to a create a "Task Queue" that has the following behaviour. Work is added via a Func such that the task is only started when the item is popped off the queue (no when it is added to the queue) Only a single item in the queue should be executing at any one time. If a new item is added, anything in the queue and the currently executing item (if there is one) should be cancelled, such that the new item can be started ASAP This is what I have come up with, using Channels public class ...| Recent Questions - Software Engineering Stack Exchange
In the python docs, I read this about the ABC (abstract base class) meta class: Use this metaclass to create an ABC. An ABC can be subclassed directly, and then acts as a mix-in class. I don't come from a strong technical background so can someone explain this to me in really simple terms? I have an ABC, which represents a set of methods to ingest, parse, transform and write the data contained in different types of file (e.g. csv, docx, pdf, json, xml etc.) and I have lots of subclasses of th...| Recent Questions - Software Engineering Stack Exchange
I'm a huge believer in the value of Intellisense for showing you what syntax is expected and allowed (and also saving typing, though this is a secondary consideration). When you build a web component (or use JSX or tagged templates or the like), you have code like this: class MyElement extends HTMLElement { constructor() { super(); this.innerHTML = `<span>${this.getAttribute('name')}</span>`; } } and this is nice in terms of getting typescript/javascript Intellisense: But it's terrible in ter...| Recent Questions - Software Engineering Stack Exchange
In microservice architecture, let's say I have 4 services that will need file upload/download feature, I have two options for this: I can create a new 5th service to expose a file upload/download API. But when it comes file download authorization, the download privilege actually depends on the other 4 services' data (if the user can access this customer, then he can download the customer's contract), this will introduce an high coupling with the other 4 services, and when the data types (cust...| Recent Questions - Software Engineering Stack Exchange
I have decided to try to create my own board game implementation. Probably going to use a REST-api to expose the contract. I'll figure out what database, communication, ... tools I'm going to use once I've got my business logic set. Now, to achieve not being dependent on tools/frameworks in my business layer, I need to abstract the, for example, persistence layer. This is where my dilemma comes in to play. I will probably use Spring Boot but I want it to stay away from my business logic. To a...| Recent Questions - Software Engineering Stack Exchange
Not sure how to handle this. Our current app (.Net MVC) is accessed via companyname.appname.com, authentication is handled via forms (cookie) authentication. Within the app there is a global search box that is quite heavily used, we are looking to split this out into it's own microservice so all calls for search will go to something like search.appname.com instead, therefore lightening the load on the main app. The question we have is about how best to authenticate the calls to that url. We c...| Recent Questions - Software Engineering Stack Exchange
The definition of UTM(Universal Turing Machine) is a Turing machine that can simulate other Turing machines, so as far as I can guess operating system is a UTM, since it can run multiple programs on a OS?| Recent Questions - Software Engineering Stack Exchange
So I've developed a website for a client, however he used to use this url with a re-direct to 'another' site of his. I had the re-direct cancelled, but whoever visited their old website before, still has it in their cache that it redirects to the old site. This can be solved by a browser cache clean-up, but I was wondering if there was another way of solving this. Especially because I do not think my users will understand what "clearing the cache" means (target demographic is age 60+).| Recent Questions - Software Engineering Stack Exchange
I was reading through the Hacklang docs on Collections, and came across this curious definition [paraphrased slightly]: interface KeyedIterable<Tk, Tv> ... interface ConstVector<+Tv> implements KeyedIterable<int, Tv> ... Of course, KeyedIterable must be read-only with respect to Tv, and indeed it is since its methods cannot modify its type. It could be specified to be covariant on at least Tv, but isn't. I was wondering what impetus there could be to do this? --- Edit: I read the definition w...| Recent Questions - Software Engineering Stack Exchange
Currently we have one master branch for our PHP application in a shared repository. We have more than 500 clients who are subscribers of our software, most of whom have some customization for different purposes, each in a separate branch. The customization could be a different text field name, a totally new feature or module, or new tables/columns in the database. The challenge we face is that as we maintain these hundreds of customized branches and distribute to clients, from time to time we...| Recent Questions - Software Engineering Stack Exchange
I have spent the past two days investigating which technology I will use to support translations of text strings (as part of an overall internationalization migration) for an archaic (VC6) Windows desktop application (with MFC) that is being migrated to Visual Studio 2013 at the same time that it is being internationalized. I have all but decided to use GetText to implement text (string) translations (given the availability of Poedit, Eazy Po, and perhaps other tools; at least Poedit also inc...| Recent Questions - Software Engineering Stack Exchange
I think I generally know what the Garbage Collector in Java does, but It's praised a lot, so I thought maybe I'm missing something about it's functionality. What I know is, that the GC takes care of erasing from the memory objects that have no reference to them, and thus are unreachable by the programmer. For example, if inside a loop I'm constantly creating a new Object(), the previous ones will eventually get deleted by the GC (correct me if I'm wrong). This is very useful for me as a Java ...| Recent Questions - Software Engineering Stack Exchange
After reading lots of pages on various sites, I came to the conclusion that abstract data-type (ADT) helps to separate the use of a data-structure from its implementation. We can easily map the data into a data-structure by using an already available abstraction. And this abstraction is called ADT. Please tell me if I have understood this correctly. Also if you can give a small example, it will be very helpful. If you prefer to give any code in your example, C or Python would be helpful for m...| Recent Questions - Software Engineering Stack Exchange
Currently at my job, we have a large suite of unit tests for our C++ application. However we don't use a unit test framework. They simply utilize a C macro that basically wraps an assert and a cout. Something like: VERIFY(cond) if (!(cond)) {std::cout << "unit test failed at " << __FILE__ << "," << __LINE__; asserst(false)} Then we simply create functions for each of our tests like void CheckBehaviorYWhenXHappens() { // a bunch of code to run the test // VERIFY(blah != blah2); // more VERIFY'...| Recent Questions - Software Engineering Stack Exchange
Perl and Python are often compared to each other (let's not forget Ruby), and almost always those discussions will come to the conclusion pretty much anything you can do in one or the other. Without going into that, I've noticed that Python however, is often used as an implementation language (uhmm, maybe the term here is incorrect technically - a language you use to, for example, enable some degree of scripting in a large application ... Tecplot, Rhinoceros etc.; these are from the scientifi...| Recent Questions - Software Engineering Stack Exchange
I'm freshly out of college, and starting university somewhere next week. We've seen unit tests, but we kinda not used them much; and everyone talks about them, so I figured maybe I should do some. ...| Software Engineering Stack Exchange
It is said that C's type system is unsound, which means that it has "false negatives", it tells the programmer everything is fine, but then the code fails at runtime. for example, "the program can reach a state where an expression evaluates to a value that doesn't match the expression's static type" I learned it from the lecture notes of the course CSE341 in university of Washington which are available online. It says: with respect to some thing X we wish to prevent. For example, X could be, ...| Recent Questions - Software Engineering Stack Exchange
My team just started using crucible/fisheye for initiating code reviews whenever one of us checks something in. There are only 3 of us, and we're each encouraged to review the code and leave comments| Software Engineering Stack Exchange
I recently tried to implement a ranking algorithm, AllegSkill, to Python 3. Here's what the maths looks like: No, really. This is then what I wrote: t = (µw-µl)/c # those are used in e = ε/c ...| Software Engineering Stack Exchange
I have some SQL script files on Windows 7. When opened with Notepad++, in the "Encoding" menu some of them are reported to have an encoding of "UCS-2 Little Endian" and some of ...| Software Engineering Stack Exchange
In order to ask this question I need to define a couple of terms to ensure everyone reading it is on the same page: Unit testing is the testing of a single class with all dependencies mocked / stub...| Software Engineering Stack Exchange
What were the historical forces at work, the tradeoffs to make, in deciding to use groups of eight bits as the fundamental unit? There were machines, once upon a time, using other word sizes. But t...| Software Engineering Stack Exchange
My team at work is moving to Scrum and other teams are starting to do test-driven development using unit tests and user acceptance tests. I like the UATs, but I'm not sold on unit testing for test-...| Software Engineering Stack Exchange
Our team of 5 members are managing a microservice architecture that currently includes around 200 Java Spring boot microservices, with approximately 50 new services being added each year. We follow| Software Engineering Stack Exchange
Is using time stamps to enforce unique in file names a poor practice? I could get the time from the creation date and serialize the file names (file0001.bak, file0002.bak, etc) but just including the| Software Engineering Stack Exchange