RSS Amplifier

Blog

Recent Questions - Software Engineering Stack Exchange

most recent 30 from softwareengineering.stackexchange.com

softwareengineering.stackexchange.comSource feed ↗30 posts

Live Last read · last published · next check

Latest posts

What is the best way to walk a file tree while skipping certain directories?

Long story short, I am building a search tool that searches for text inside of files, and returns all files that it matches lines in. Not returning line numbers for now, maybe later. The search tool recursively searches a single directory. There are many levels of directories in the one folder. Total number of files across all levels is 100-200 thousand. Each file ranges from 1-50 kilobytes. My…

Using Laravel to create a new frontend for a liferay project

There is a relatively old liferay project, which is not containing too much buisness logic, its a university website that mostly uses liferay as a CMS, but it has many design flaws and is also very large (but with not much views monthly) Is using another web framework, like laravel or next to develop a frontend fetching data from liferay and show it automatically while the content managers and…

Why use Docker for Data Science Projects?

I am a beginner in Docker and just learning to integrate it into data science projects. From the information online, I see that Docker is advertised as a way to capture the libraries and dependencies of a project so as to solve the "it works in my machine problem". What confuses me is that for most data science projects you are using Python + a limited number of libraries (tensorflow, sklearn,…

How should I structure a workflow that combines an LLM with multiple APIs?

I'm working on an application where users interact with the system using natural language, and the application needs to perform multi-step operations through several APIs. For example, a user might say: "I'd like to schedule an appointment next week." The system needs to understand the request, collect any missing information, check available time slots through an API, apply some business rules,…

In a chat application how would you safely define timestamps of a message?

How would you safely define the timestamps of a message? This Chat Application will be in the browser, off of some React frontend or something similar. If we were to take the approach that we just get the current time from the browser and have that as the field of the message, this could easily be manipulated one way or another to give an incorrect time of a message since they define the…

How is AI changing the skills software developers need to remain employable? [closed]

Recent advances in AI coding tools have made it possible to generate code, debug applications, write tests, and automate some development tasks. At the same time, there are reports of software companies reducing development teams or changing the responsibilities of developers. I am trying to understand how this affects software development as a long-term career rather than whether AI will…

What are reasons for prefixing branch names with descriptors like 'feature' or 'fix'?

Some developers have a practice is to prefix the names of version-control branches with descriptors such as 'feature', 'issue', 'fix', etc - either as a part of the name - e.g. fix-FE-regression - or a folder-type structure - e.g. issue/cannot-log-in-on-tuesday . I've not yet seen an argument for the value of such practices. Why have people adopted them? For context; I've always worked in…

What are best practices for adding meaningful descriptions to branches?

Suppose your Git repository contains numerous branches. The names for branches are supposed to indicate their role, topic and context, but that can become rather unhandy in a large project: main , develop , rewrite_logging , rewrite_logging_again , that_new_feature_we_had_a_coffee_chat_about , urgent111 , ... What are best practices to manage meaningful descriptions of different branches? That…

Circuit breakers for resource-intensive operations

I am preparing for system design interviews and ran into circuit breakers on hellointerview's Networking Essentials section . After some research, I get them. I understand the examples mentioned below with the exception of the one in bold regarding resource-intensive operations. I can't think of examples that are uniquely different and are not 1 of the other 4 as a database call could be…

How to ensure that an Idempotency Key is the same in subsequent requests?

I am going over methods of handling failures in distributed systems for interview preparation. I have never implemented an idempotency key. I have gone over the explanation in this hellointerview article and this ByteMonk video . The explanations lead me to think that it is the client that has to store the idempotency key. However, I don't see how this is done in the Javascript code provided in…

Best practice for serving private S3-compatible bucket files to browsers when presigned URLs contain internal Docker hostnames?

We have a NestJS backend generating presigned GET/POST URLs for a private bucket on MinIO (S3-compatible). The S3 client is configured with the internal Docker service name as endpoint (e.g., http://minio:9000 ), so presigned URLs contain that internal hostname, the browser can't resolve it. Currently we work around this with a server-side proxy: the frontend (Nuxt) fetches presigned URLs from the…

Where should orchestration logic (retries, idempotency, routing) live relative to a clean single-action primitive?

I'm building a system that automates operations against an external service. There are two kinds of code fighting for the same space, and I can't find the clean boundary between them. On one side I have a clean primitive interface — a set of dumb, direct verbs. "Do this one action against the service and tell me what happened." I like these clean and minimal. One of these verbs is, say, "register…

enforce that operations performed in different platforms always take place together

I do business analysis for a license manager application that is about to be developped; it will manage all software licenses that we allocate to users in our institution. Of course, the actual allocation takes place in the Administration Panel of that specific vendor - be it Adobe, Microsoft, Cisco, you name it. The app that we design will just aggregate data from the admin dashboards of all…

Clarification on consistent hashing with virtual nodes with database failure example

I was confused about the explanation of the example provided in this article on Hellointerview based on the labelling of the virtual nodes (dotted circles). The explanation provided for Database 2 (DB2): Now when Database 2 fails: The events that were mapped to "DB2-vn1" will be redistributed to Database 1 The events that were mapped to "DB2-vn2" will go to Database 3 The events that were mapped…

Is the Options pattern used in .Net Core considered as a Design Pattern?

In .Net Core I use the Options pattern to access configuration values in a strongly typed way. I am wondering if the Options pattern is considered as a design pattern or not ? Since it is not one of the patterns mentioned by the GoF . So, does it fall under other pattern category ?

How can I reduce the carbon footprint of using an AI coding agent?

What techniques can I use to reduce the carbon footprint of my AI coding agent usage? Token usage is a good proxy for carbon, so techniques to reduce token usage welcome, as well as carbon-specific ones. I’m not asking about writing greener code with AI, about creating greener AI tools or about programmatically interacting with AI (although all of these are important), just about the day-to-day…

Invalidate session for user in authentication

when user login in my web application (Article Website) I'm using Redis to cache the refresh token. So when user login I will generate refresh token and send it to him. While caching in my Redis the user id as key with same id as value something like this redis.set( `refresh:${user.dataValues.id}`, user.dataValues.id, "EX", +process.env.REFRESH_TOKEN_LIFE_TIME ); but for future when may I need to…

Hexagonal Architecture: What is the purpose of the input ports?

Pretty simple question, but googling brought me nowhere: What is the purpose of input ports in the hexagonal architecture? We are doing Java and seem to have some misunderstandings regarding the input part of this pattern. We presume: Domain Core / Business Logic: This part of the architecture describes our business and should be free of any framework specific / technical knowledge. It should be…

What is the right way of using event aggregator/message bus?

Recently I had a conversation with a colleague, who proposed that a whole app could rely on an event aggregator (or message bus). I think this is a really good pattern if someone wants to decouple publisher and subscriber, especially in cases where we have multiple publishers/subscribers. If there is just one, I think it is perfectly fine to request a service from DI and call a method on it, there…

Git Flow w/ VSTS Build Pipelines

I am trying to marry the git flow approach (w/ dev, test, uat, staging, prod env) & automated build and releases in Visual Studio Team System (VSTS). Slightly struggling due to VSTS needing a persistent branch to 'anchor' builds on - I am curious what other people do. Our Approach branch newFeature from develop branch. do work, & raise PR for newFeature . Once approved & automated build runs,…

Easy Licensing enforcement techniques for C++ Program in Windows

I am developing software in Window 10 and Visual Studio in C++. I would like to restrict the use of the software to a set of computers, by implementing a license control. My thought is to query a few key parameters from the system such CPU Type, Harddrive Serial Number, MAC address, and create a hash. I would then take the hash on my own computer and encrypt it using a private key and then when…

Readme.txt vs. README.txt

I have just forked a project in Github, made my changes etc. This got me wondering: I see mostly README.txt in opensource projects and the file I edited was Readme.txt. Is this some sort of standartisation or should I have left it as is?

Why can we not insert into files without the additional writes? (I neither mean append, nor over-write)

This occurs as a programming language independent problem to me. I have a file with the content aaabddd When I want to insert C behind b then my code needs to rewrite ddd to get aaabCddd Why can I not just insert C at this position? I can not do this in Java, Python, ... . I can not do this in Linux, Windows, ... . Am I right? I do not understand why C can't simply be inserted without the…

Rails engine testing - use dummy app or real parent app?

I'm using Rails engines to break up a big app into smaller pieces. The parent app mostly handles users and authentication. In one of my engine tests I want to log in a user before each test. How should I access this user log in functionality, which exists in the parent app, from the engine? It seems there are two options: 1) Build user authentication into the dummy app. When you run rails plugin…

Is there a limit on the number of threads that can be spawned simultaneously?

Yesterday I came across this question: How can i call robocopy within a python script to bulk copy multiple folders? , and I though it might be a good exercise for multithreading. I though of spawning as many threads as files needed to be copied, each routine having an exception handling system to prevent the whole copying process from crashing (and log -using mutex on the log file - if there was…

Getting users to write decent and useful bug reports

Does anyone know a good way to get users to write a semi-decent (read: useful ) bug report ? We wanted to put up something that would make sense to most users (be easy to read and understand), yet give useful information to developers as well. It does not work when I click the blue button! Ahhh, I just lost a week's work… make it work. …isn't very useful, as it is. I started to fix about a list,…

xpath vs DOM API

I just came up on xpath recently while writing a greasemonkey script and immediately fell in love. I haven't done any benchmarking yet (coming soon), but according to a couple sources that I read, xpath is faster than using the DOM API. After checking out the internals of a couple of libraries (Swizzle and jQuery), I noticed that neither use xpath, but use the DOM API. My question is: Is there…

Is it possible to combine XPath and CSS selectors?

Just came through XPath . I got curious about this. Why is there a different way to select tags in XPath and CSS(selectors). Why cant there be a common way in both XPath and CSS?

How does Python's handling of line-breaks differ from JavaScript's automatic semicolons?

Javascript has a feature called Automatic Semicolon Insertion where basically if the parser encounters an invalid token, and the last token before that was a line break, then the parser will insert a semicolon where the linebreak is. This enables you to basically write all your javascript code without semicolons, but you have to be aware of some edge cases, mostly if you have a return keyword and…

How to educate on reporting bugs to developers?

I'm hoping to get some tips and advice on how to educate the rest of the company on how to submit proper bug reports. Currently we get tickets like: When I click this link I get a 404. (They include the page that 404s and not the page that caused it) Sometimes the right column flows into the button column. (no screenshot or additional information) Changes to xxx does seem to be working right.…