instruction stringlengths 34 36.1k |
|---|
So I have a couple of Java RESTful microservices, and since the past few years I have basically been using Docker to build them and deploy them over to a Kubernetes cluster.
Our team is upgrading Kubernetes versions, and it was brought to attention that latest versions of Kubernetes don't support dockerd, and has moved... |
I know there are potential duplicates, but imo this is different because there are around 100 developers actively working on this nightmare.
I have unfortunately gotten into a job where this GUI project exists. Development started around 20 years ago and it has to support different hardware and OSes (Windows, Linux).
T... |
I'm writing a webapp that serves users with different roles and permissions. One of the features of my application requires an API call to a secured endpoint. If the user doesn't have the correct permissions, the endpoint responds with a 403 Forbidden. In my application, the failed API call has no effect on the behavio... |
I have a client/server application that exposes data and commands through REST APIs. This API exposes a GET /recipes/:id endpoint that instructs the client on how to show a recipe. A recipe can be made of diverse activities, each of them carrying specific contextual data. Summing up, the API response would look like th... |
I'm working on a project which needs to always be up-to-date for my users. It's quite simple to make an auto-update feature, but I need to know how ethical this is.
If, when the user installs the software, it tells them it'll automatically install updates silently in the background (when the user opens it intentionally... |
I have an application that can be reduced/simplify to this flow:
user sends request to app A
app A inserts info about the request and user into DB ( marked as "B in progress" and "C in progress")
app A pushes the data into queue and returns to user
app B retrieves data from queue and process it
app B finishes processi... |
In my PHP Laravel application, I want to display special offers to users, depending on the quality of their house(s).
There are 4 Models: User, House, Offer, OfferTargeting.
Each User can have many Houses.
Each House record has details like size, type, city, country etc.
Each Offer records holds the details of the of... |
So, I'm trying to understand how this is done in real life... If I have a website with an API and a UI, and a User Story comes in like... as a user I want to be able to login that requires changes changes to both tiers and different teams work on each tier.
Would you create separate user stories for each team?
Do they... |
I am curious how others tackle the issue of needing small, sometimes trivial changes in a pull-request. The problem crops up a lot where I work. A developer completes a task and makes a pull-request, and after some review and changes it is good to merge except for one last detail. Rather than ask them to once again mak... |
I wanted to understand what are the best industry practices and the pros-cons in the following 2 choices:
A single service that serves internal only API and public API, vs
2 separate services - one for internal only API and another for the public API
I would like to add more context as I understand the answers will d... |
We are currently splitting up our Intranet monolith into multiple (Micro)services. The layout in itself is already finished and we have decided to split them up in a way that there is only ever one service connecting to a different outside service. One of these services, for our news and companywide calendar has to con... |
So, i just start learning in AI field and i want to develop my skill more. So, i just curious is it possible to predict last 3 digits of a closing stock price? which mean the output result will run from "000" to "999" in total 1000 number and to make it more clear lets say the closing price of Dow Jones Industrial Aver... |
I'm developing an API that given a few parameters, reads the given data, transforms it and returns it as JSON.
Eg. (some logic included)
Request:
POST /myApi/exportAsText
Content-Type: application/json
{
section: array,
answers: array,
targetLevel: int
}
Output:
// Goes through data, create big text
{'text... |
I'm trying to design a data updates mechanism in my micro-services architecture.
For the sake of simplicity, let's assume we have two micro-services A and B, B exposes an API for creating some tasks, using simple REST, POST /tasks, which creates a task and returns a unique task identifier to query on - task_id. Then an... |
My question regards to constants in Python. Which is more "convenient" or "acceptable" among software engineers in general:
Putting classes of constants in another file called "consts.py" as such:
consts.py
class Messages:
GREETING = "You are greeted by {greeted_person}"
or in a class of classes of constants as ... |
Intro
Structured concurrency is a relatively recent concept for structuring concurrent programs. It has implementations in for example Python, Java and Swift.
Examples of structured concurrency often describe a server application which has to receive or make multiple requests on the same time.
Like this:
async with tri... |
I'm writing integration tests for an already existing product.
I'm using the Spring Integration Testing suite for this purpose, which allows testing a real DB connection by creating a transaction and rolling it back after the test execution.
This looks safe to be used to test also against a production database, however... |
My team writes a lot of Python code in PyCharm to do quick simulations and calculations for our mechanical engineering work. Often, we'd like to include a little image (a hand drawn sketch, CAD screenshot, or a PowerPoint slide with a diagram made from AutoShapes) to explain how different variables relate to a physical... |
Is there a name for a function that outputs more data than was put into it? For example: let's say I input a one byte value into the function and it returns a three byte value, is there a name for this type of function?
|
I am often confronted to this problem in my scripts and I feel I am lacking some software design culture, I hope this is the right place to ask and sorry if this sounds too simple.
I write many scripts in Python to do various ML related tasks. They start small (e.g. I just want to compute some results) and often end up... |
Situation
I have some existing functions which expect containers which can be iterated and which have certain value_type. The value_type can be a value or some (smart) pointer.
All the value_type have traits implementations for their base types, f.e.
template <>
struct Trait<A> {
static void test(A const& v) {
... |
I am designing an API using .NET core 6 C# which has 2 versions. For v1 I have something like the following for the business logic interface (fictional names and simple fields just to facilitate understanding):
public interface IV1Business
{
Task<MyModel> Create(string configuration, string metadata);
Task<MyM... |
Currently at my company three people take part in the annual performance evaluation of a software developer:
the developer,
product owner from the scrum team of the developer,
head of software development (line manager).
There isn't any 360-degree review system. Additionally, scrum masters usually are asked for writt... |
Let's take a hypothetical system, a state based,
exceptions thrown from persistence layer or other outer layer, should propagate to ui layer through domain layer. Domain need not know about this exception. so no catching(ideal domain?)
the issue is that the outer layer catches the exception, but now the system is in so... |
As suggested by Uncle Bob in his book "Clean Code", I am actively trying to keep my functions small and readable.
However, I often encounter arguments drilling when I try to refractor a big function into smaller ones.
For example,
func bigFunc(input) {
funcState := ...
for {
smallFunc(input, funcState)
anot... |
The question is simple: there is no shortage of opinions that state automated unit tests are to be written only for public methods.
What is the authoritative source and argument behind this best practice?
|
I have two bounded contexts, Store and Inventory. The Store context has the Product aggregate, the Inventory context also have an aggregate called Product. Product is a different concept inside each context.
Now in my Store context I want this behavior in the products: "Please select the items from stock needed to sell... |
I am working on an online exam management system, which have those main actors:-
Super Admin. Can manage questions/answers under all functional areas.
Functional Admin. Can add questions/answers under his/her functional area only
Applicant. Attend the exam
The system itself. with modules including; Exam creation, Addi... |
We're building a PDF service for internal use, to permit common operations like HTML to PDF, merging PDFs, extracting pages, convert to/from other formats, etc. We intend to use a queueing mechanism so everything would be async. The only thing we're trying to decide is whether or not we should front the queue with a RE... |
If I am working on a project, say it has this file structure:
car/
body/
__init__.py
doors.py
bonnet.py
engine/
cyclinderhead/
__init__.py
pistons.py
__init__.py
crankshaft.py
engconstants.py
utilities.py
Now invariabley the pistons.py file wi... |
I am designing an API that some operations may take a while, for example, creating a backup (not the actual case).
I am planning to have an endpoint to query the current job
http GET /api/v1/jobs/{uuid}
{
"code": 1,
"status": "created",
"running": true,
"completed": false
}
To create a new task, the client sh... |
I'm designing a REST API in which users create groups that other users join and leave.
A user creates a group by making a request like this:
POST /groups
Request body:
{
"name": "Avengers",
"description": "Earth's mightiest heroes"
}
A user retrieves a group by making a request like this:
GET /groups/{id}
Respon... |
I have a program that accepts computer names and then will perform CIM session tasks. The computer names are passed in from the user input and separated by "," (ex: program.exe -computers pc1, pc2, pc3). Then after accepting the input the program will multi-thread against the computer names at the same time.
I'm stuck ... |
I need to make an app for employees & employers.
When is it worth writing your own CRUD generator for a project with the aim of process automation?
With such a generator I wouldn’t need to create manually basic CRUD models, for example: job type, countries, cities, male, work experience, education, especially when cons... |
I would think the answer to my question is yes, but I have never really seen it in practice or any OSS project (and links to any OSS sample projects are highly welcome because the typical examples lack a lot of domain logic for me).
So, my specific case:
My application is mostly network-driven, that is, the UI is just... |
I'm helping a software team to embrace a transition to DevOps and I realized that they struggled a lot with testing. The one point that troubles me the most is that they absolutely want to write unit tests in pytest, when the application is developed ... in C#. Part of this excentric idea comes from the fact that they ... |
We are developping an app and I am not really pro at rest API etc.
We decided that a maximum of business logic should be in the backend and started to do "business" route. But sometime I wonder if i don't split too much my api/controller.
For example, let's say we have a "car" object, in my backend. it's stored in "car... |
Let's say you are performing a PUT request on an endpoint for a resource that holds a list of entities. For example, a football team and it's players. It would be fair to say that the list of players is within the bounded context of its team?
Does this mean that the aggregate root should have the ability to change anyt... |
Here, I suggested the following approach to implementation of a simple text adventure game (in Python). I think that this principle could be used to develop an adventure, similar to The Colossal Cave adventure, by storing a following rooms in a deque. Rooms (represented here by tuple of (function, params), but possibly... |
Disclaimer: this is not an attempt at solving P vs NP, but a way for me to better understand the problem.
Let ¥(n) be the Subset sum problem, n being the number of inputs.
Trivially, a brute force algorithm can solve ¥(n) in O(n2^n).
Let's Divide et Impera trying to solve the problem using n P algorithms:
First example... |
I have the following situation in my spring boot application:
I use unidirectional relationship modelling for my database entities, in order to prevent difficulties with a bidirectional approach. (Cascading, Updating both sides etc.) Of course I don't want to expose this structure to the presentation layer, thus my DTO... |
I have a class hierarchy with a base State class, several inheriting classes each named after their relevant state, and an FSM class that contains all the states in a particular state machine as well as the logic for moving from one state to another. A simplified version in Python:
class State:
def __init__(self):
... |
Processors have come a long way in their handling of unaligned data - from crashing at the very notion of it, through suffering severe penalties, all the way to having almost no impact.
I suppose it is still possible to do harm, if for some reason the use case happens to somehow abuse cache line boundaries, but all in ... |
A common problem I run into is when I have a Factory (let's say ThingFactory) which creates multiple different IThing implementations, and each of these concrete implementation classes requires an exclusive set of constructor parameters.
With a naïve implementation of the ThingFactory, it would need to know about the u... |
I have 2 entities with a parent-child relation (like a base product and product variants), basically the two entities have the same properties and at runtime (when instantiating the object) if the the property X have a value in the parent then the same property X should have the same value for the child entity instance... |
For a given, tree-like data structure:
- Alan
- Barbara
- Charlie
- Cecil
- Brian
- Chris
- Candice
- Cohen
- Boromir
- Corcoran
- Arthur
- Bort
- Clive
- Chad
- Berman
- Chud
- Angel
- Barry
- Cri... |
I have three layers. I wish to reduce coupling between them and other modules.
I wish to use the command pattern between all layers. A command should be able to be passed from one layer to another.
For this, all layers must have implementations of the same set of interfaces, for example the command interface.
I'd prefe... |
i'm making a custom form builder app similar to google forms or wufoo and i've completed the basic database design. However there is one thing i can't figure out. I'd like to keep track of version of each built form. Like if there is a change in an existing form i don't want to just update it to lose old form design, i... |
So I've been trying to understand the difference between MongoDB's Query API and its Query Language but I haven't been able to find a definitive answer.
I've been reading the MongoDB Docs and it is written that the MongoDB Query API is "the mechanism that you use to interact with your data".
However, on Devopedia, MQL ... |
I'm dealing with creating a few internal libraries for a project that can offload emails and logs to a queue (Service bus, storage queue).
The issue I'm having is how to configure the the queueing endpoint, without passing it in, which would require the projects using said library to be aware of the queue endpoint as w... |
Let's say there are two layers of an application:
Business logic layer
Data access layer
Assume integration tests need to be written also for the Business logic layer. Alas tests that run against the database.
Let's also say you are implementing features in a branch in the Data access layer and in this branch you com... |
Assume an application developed in a PaaS public cloud environment. The application stores and processes some kind of sensitive data.
Encryption-at-rest seems clearly described already, and the option to manage keys outside the cloud which can help ensure nobody outside your organisation has access to your unencrypted ... |
We have been continually facing this challenge during the last year. Upper IT management wants us to use Agile Methodology internally (development team) while the external client refuses to do so and wants hard commitments with clearly defined requirements, clearly defined deadlines, and clearly defined payments and fi... |
Assume there's a public void process method on a Java class called A that currently takes a single String argument id.
class A {
public void process(final String id) {
// Some implementation
}
}
The existing method's String id argument has a specific format: type#integer where type can be foo or bar (so foo#1 ... |
I am trying to create a use case diagram. In the diagram, I have two actors that have access to the same use case (View Properties) but they have different functions related to the use case. Can anyone please let me know which one of the diagrams below is correct? Should I keep one "View Properties" use case or should ... |
I'm currently playing around with a CQRS implementation and I'm having some trouble understanding the following concept:
Event Bus for publishing update events (required): Whenever the write
database is updated, a change notification is published as an event on
the event bus. Interested parties can subscribe to the ev... |
Right now, I have this enum, called MemberCategory, defined to be:
public enum MemberCategory {
MEMBERSHIP("Membership"),
GOLD_MEMBERSHIP("Gold"),
SILVER_MEMBERSHIP("Silver"),
STANDARD_MEMBERSHIP("Standard"),
PEDIATRIC("Child")
public final String textValue;
public MemberCategory(String te... |
I work in a software company with a single product, a 25 year old monolith application (1.2m lines of code) handling all HR related data (employments, salary, collective agreements etc.).
I've been put on a team that needs to research how we can modernize our application and so I've started reading up on different desi... |
My team owns several services. One is our primary focus: an accounts service. We have a plentiful stream of feature work and tech debt to address there, and everyone (engineers, product, design, management) is aware of its going-ons and going-wheres.
Two other services though, have to do with exporting our data to a th... |
Currently my company is storing the installers (and in some cases the installed directory copy) for some open source third party tools that our build uses. Were storing these files in our github repo which makes it very large and slow. I want to clean this up since the files themselves are not needed directly for the b... |
I only recently started to work with backends. My database is supposed to store information about maven-like artifacts. There are going to be applications and configuration artifacts. Now those artifacts are pretty much alike - they all have group name, artifact name, versions etc. However many times I want my logic to... |
I work at a company where we have your typical sprints filled with engineering stories that need to get done. But then we have "work" that is not allocated within the sprint. This "work" is stuff like 20% time, reading and presenting papers, work related to various guilds within the org, and a bunch of other things. ... |
We currently have a REST API service (let's call it as A) written in Python which triggers various heavy calculation jobs for Worker (W) written in Python as well. Both services are interconnected using a self-written PostgreSQL queue lib.
That's how they communicate at the moment:
1. Call POST request to service A to... |
I'm writing a new microservice app. event driven app.
The app handles crypto currency wallets.
There is a service: "Coin Service", this one holds data that every other service need access to.
I have 10 services, 9 out of 10 services needs to have access to coin service data.
I dont want to sync all of its data 9 times ... |
I'm looking for suggestions on how to modernise my development/release practices by potentially introducing some automation. I'll outline the current process to help explain why I'm currently struggling.
We have 2 long life branches, master and staging. Live servers point to the master branch and our test/staging serve... |
Let us say I have an entity House that I want to store on a database. The House has an attribute yearBuild. If the house was build before 1990 its status should be 'ToBeSelled'. Now I have two ways to model this
a) store the status in the database as attribute(metadata) or
b) extract the status on runtime each time I a... |
I am still an beginner/intermediate programmer at best so apologies if I misuse terminology.
I work with SCADA software for my job, specifically Ignition by Inductive Automation. It's made for rapid application development, and all you really need to know is that it's built upon java, so what I end up using in practic... |
Older iPads used to have a home button:
Newer iPads don't have it. They have a line on the screen you're supposed to swipe up to get to the home screen:
Now if an app has a row of links or buttons at the bottom of the screen, it has to leave extra space for that line on the screen.
How are people handling this? Am I ... |
When updating to a new major version of .NET (in this case from .NET 5 to .NET 6) without needing to make any change other than selecting the new target framework in Visual Studio, does this warrant a new major or minor version or does bumping the patch version suffice, when adhering to SemVer-principles?
When I update... |
I'm new to DDD and I would like to clarify some concepts. I'm thinking about DDD in the client-side.
The first one is regarding transactions:
My understanding is that transactions are a responsibility of the application layer, when the use case has to coordinate different entities with some level of integrity.
However,... |
Since I don't have much knowledge of multi-threaded design and English is not my native language, I don't know how to exactly describe my problem.
Let's say I have a mini-program in school, which has the responsibility to analyze a runtime feed. The feed is a continuous list of messages with the following format:
{"typ... |
Is there an accepted name for what it's called when someone takes are relative small codebase and splits it up into many tiny libraries, containing just a few or even just a single class, or likewise splitting up a single coherent class into multiple smaller classes that depend on each other.
During my travels, I've tw... |
I'm working on an application with a database containing many recipes. The API is written in Django (with Django REST Framework) and frontend in React.Each recipe is assigned a high-quality image. In React application, the user can see all the recipes with their images in a list view. The problem is that they take too ... |
I have a website and mobile applications Android & IOS, all platforms are connected to the same database, what we are trying to do is to enhance the user experience by showing him specific products based on his selections however right now we can do this a cross all platforms only if the user is logged in using his use... |
Summary of my question in a short form: How to propagate changes of domain objects upwards without introducing application logic into them?
Following 'facts' are based on prescriptions from respected software architecture authors.
Fact 1: In layered architecture, a lower layer should never make explicit method calls up... |
I am implementing if/else statement, by using function "inCase" to make it more readable:
const size = 'small'
const equals = str1 => str2 => str2 === str1
const inCase = (obj) => (predicate) => (whenTrueFn) => (whenFalseFn) => {
predicate(obj) ? whenTrueFn() : whenFalseFn()
}
const renderMobileNavBar = () => co... |
Basic question: I am wondering if there are any industry practices or style guides that mention which of these two styles is better:
if x == 0 //or nullptr
or
if !x
(I am thinking of programming languages where for the same variable x both styles are syntactically allowed and semantically equivalent).
I've always pre... |
What is a suitable software design approach for handling user input from hardware buttons, where the function of each button depends on state?
I'm designing a musical instrument which has a lot of hardware buttons (something like a Novation Launchpad or Monome Grid). I'm used to building screen based software, where yo... |
I'm writing a simulation of a car that can receive commands and act on them and I'm trying to implement it using the command pattern.
class Car {
move() {
console.log('move');
}
}
interface Command {
execute():void;
}
// there can be more commands like this. eg: TURN, ACCELERATE
class MoveCommand implements... |
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 data records; each instance, or record, will at some point end up being fed to the model. Each data record has a bunch o... |
Given a class as follows:
class IntList {
public:
IntList(std::vector<int> list) : m_list(list) {}
std::vector<int> list() { return m_list; }
std::string toString() {
std::string repr;
for (const auto integer: m_list) {
repr += "int:" + std::to_string(integer) + ";";
}
... |
Context: we operate in a highly regulated industry (medical), and aim to have automated test cases to cover all of our requirements - allowing us to still release quickly, but safely.
We have a requirement or acceptance criteria that reads something like:
x object should be read-only for users
Editing this object not... |
I have a campaign, which has URL as a child.
If I make a patch request to add a list of 3 URLs out of which first one is invalid URL, second URL already exists in the campaign and we do not want to duplicate the URL and third one is a valid URL which can be added to campaign.
What should server do?
should it return 40... |
I have read through a number of posts on Software Engineering but am unable to find a suitable solution for the problem my team and I are trying to solve.
We are building a system where we have multiple Actors / Personas, for example: an application user, patient, staff member, practitioner etc.
As you can imagine each... |
I have a software application where we have 2 services, say A and B.
A delegates some long running work(tracked by an id) to B which is done asynchronously.
They both talk via HTTP.
Post submitting the job, A periodically does getStatus calls passing the id.
Given that any of A or B can die, I need to handle failure sc... |
Currently I have a monolithic gRPC server that implements several service stubs that are utilized by a large amount of internal client programs (none of this is public internet facing).
As our requirements have gotten more complex and more backends are being accessed by the monolithic gRPC server, I am looking to break... |
I have multiple use cases where I need to call an "entry" function, do a bunch of stuff, and then call an "exit" function. (In my case, "entry" is enabling a chip select line and "exit" is disabling it.)
I'm tempted to do the following, but it seems too obvious. How might this trip me up?
#define WITH_CHIP_SELECTED(.... |
I am developing an algorithmic trading framework using DDD/event-driven principles. I've decided the following components sit within my bounded context:
Data feed -> [Entry Point] -> "HandleData" command -> [Alpha Model] -> Insights -> [Portfolio Model] -> Targets -> [Execution Model] -> Orders -> [BrokerGateway]
Each... |
Im making a website and trying to learn Test Driven Development (TDD)
I'm doing one of CS50 projects, were we need to make a website to trade stocks. I decided to use this oportunity to learn TDD. I learned how to use the unittest module from python. But now, im taking way more time to write the tests than actually wri... |
I want to move my current relational database installation into a docker container or a set of a docker containers.
I have a web server with an associated relational database. I provide a set of 40 web services to my clients. Each service is a derivative of my web application. I use an apache web server. It uses redire... |
I am pretty new to Clean Architecture / Onion Achitecture, I actually not sure if the 2 terms are exchangeable.
So it pretty clear to me, considering is a few days I am reading and study about it.
It get even more clear after have read this one article and Clean Architecture on Frontend.
On that one, actually I use the... |
I have a design question to all the programmers out there.
Until now, I wrote most of my software in vb.NET oder C#, especially if I needed a Frontend.
Now I would like to have a Frontend which is accessible via a Browser, so I would like to use an Apache Server with PHP. That is fine so far, but is it possible to use ... |
I'm writing an app which uses a logger with different logging levels (info, debug, warning, error, etc.); but - I'm used to the custom of writing program output to stdout and error information to stderr.
My question: Suppose my logger uses all of these levels, and that I use the logger to report all errors. How do I co... |
I am implementing a basic ledger system for which I want to calculate costs based on the FIFO system. Is there a more clever method than an O(n) search?
Example
Suppose I have two lists of transactions:
Incoming Inventory:
Date
Batch
Quantity
Price
Jan 1
A
3
5.00
Jan 15
B
5
7.00
Inventory Sold:
Order
... |
I'm developing an application with DDD pattern with three layers:
API
Domain
DB
After adding a new field to the domain object, I realized that many places need to change. Imagine the following model.
type TodoItem struct {
UUId uuid.UUID
Title string
OwnerId string
Project *Projec... |
This is a pretty vague question, but, sometimes, I'm not very good at naming specific tasks, but I know it's very important and I don't want to name it something ungood.
I have the following file structure:
Project/
|-- project/
| |-- Connection.py
| |-- ???.py
|
|-- Tests/
|-- test_connection.py
|-- test... |
In mathematics, adding two functions can be considered an operation in the space of functions. The result is another function.
I can model this by making functions an abstract class and implement all relevant operators for it. An object of that class can be assigned with basic functions (e.g. a constant) and the operat... |
I’m making an inventory for a game using nosql (mongo). I made some ItemType records (contains common data like icon, name, weight) and some ItemInstance records (representing specific items, referring to ItemType).
Now I have problem with mixing static and dynamic data in ItemType table. For example, health potion is ... |
I have a command line application written in C#. Here's some facts about the program that are relevant to my question:
The application has a "data directory" (e.g. ~/.config/myapp) where all user data is stored, including log files.
I use Autofac for dependency injection.
I use Serilog for my application logging (prov... |
I followed the guide here https://quarkus.io/guides/building-native-image to set up a minimal quarkus webservice graalvm native image. Ran command 'time quarkus build --native' to compile the example. The compile time on my laptop was 2 minutes, 12 seconds, the resulting image size was 38Mb.
I then followed the guide h... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.