instruction stringlengths 34 36.1k |
|---|
I would like to ask what is the preferred way of passing additional state to projections.
I have UserAggregate that is watching changes of several attributes of user (for instance address, name and state).
I have to read a model or projection that need all user attributes on any change.
Is it better to just write all ... |
I have inherited a distributed application with a lot of legacy configuration management.
Currently the application does not get it's settings updated with an application update. The flow looks something like this:
The application is updated. The only settings that are defined are one's with hard-coded defaults.
A sep... |
Pseudo code and comments to explain:
// first select companies to process from db
foreach (company) {
// select the employees
foreach (employee of company) {
// select items they can access
foreach (item) {
// do some calculation and save
I believe this will be O(n^3) time complexit... |
While refactoring my code using Test Driven Development (TDD), should I keep making new test cases for the new refactored code I am writing?
This question is bases on the following TDD steps:
Write just enough of a test for code to fail
Write just enough code for the test to pass
Refactor
My doubt is in the refactor ... |
Startup Context
A friend of mine recently asked me to be a part time software engineer for her startup which has yet to write any code. She is fairly serious and has already raised a fair bit of money. However, she currently doesn't need someone full time for development.
There are no legal issues with my current empl... |
Im trying to make an activity diagram , but i see that activity and swimlane diagram is almost the same, the only difference i see that swimlane diagram include many actor in it
i wonder about the activity and swimlane diagram, what is the difference , and when to use activity / swimlane diagram
|
Following this post https://stackoverflow.com/questions/21554977/should-services-always-return-dtos-or-can-they-also-return-domain-models and best practices in Software Arch suggestions by Martin Fowler
https://martinfowler.com/eaaCatalog/serviceLayer.html#:~:text=A%20Service%20Layer%20defines%20an,the%20implementation... |
I'm writing documentation for a school java project I'm working on. Basically have chunked most of the methods into the class diagram, but now it seems very unreadable on a pdf as the words are too small. I want to ask for feedback on this issue, as well as other things my class diagram is missing. Thanks.
|
I am building a system that consists of multiple programs on many machines, some cloud services (such as RDS) and so on.
In an ideal world, I would like to supply some configuration (e.g. deployment keys, AWS credentials) and run a single "deploy all" command that will build and deploy everything.
I would also like it... |
I have a process which must do 8 steps, in a particular order. One of the step involves sending an email, another one going on a distant FTP server, another one querying a database, and so on.
Now to be able to unit test these 8 steps, each of them is a method in a distinct class. So far so good.
Now the problem I'm fa... |
I have been using Netbeans to practice JDBC coding. Netbeans projects create multiple sub-directories (/build, /lib, /src...). Should I add and commit all of these directories and files or should I only choose the java code located in /src?
I am new to Git and have been using YouTube to learn syntax but I have not foun... |
In Robert Martin's seminal 1996 article "The Open-Closed Principle" he presents an example in C which does not follow the principle (the DrawAllShapes() method is not closed for modification):
enum ShapeType {circle, square};
struct Shape
{
ShapeType itsType;
};
struct Circle
{
ShapeType itsType;
double itsRadius;
... |
I s it possible to develop a distributed memory pointer in C++ by using operator overload?
The idea would be that you pass ip address and port to the overloaded pointer *, &, and the pointer returns the memory location of remote computer.
|
I want to develop a Windows based application that would interface with external hardware using serial communication. The hardware would in turn relay back the feedback to the application. This entire loop should be ideally completed within a millisecond.
Is it possible to develop such an application on Windows OS? I ... |
I'm currently creating a class in C# that will be utilized to help standardize calls to restful web services in my company's code. While the majority of my code has been written and well tested, I believe I made a mistake by assigning a default value to one of my properties in the default constructor.
The property in q... |
I have code in a (Visual Studio) Shared Project, and a number of end solutions/projects which compile and build the Shared Project to various environments (repo).
When writing unit tests, I will want to unit test for each environment.
Should my test project reference the code in the Shared Project directly? Or should I... |
How can a user story be independent and small (following INVEST acronym)? Most of the time we have big functionalities that depends on each other.
As an example, we made an interface for users where they can define zones on a picture (this zone list of zones is called a "model"). For each zone, user can define a folder... |
The main subject of my question are the user stories, after they have been put in the backlog, discussed, refined and ready to be put into the upcoming Sprint. Do they have to list all the possible detail and all the possible scenario?
Our team of 10 people spent almost 3 hours of the Refinement meeting discussing ever... |
Assume we have a desktop application (probably WinForms) that acts as a client to some API for an app with a messaging function. This API has endpoints that return a JSON of messages, and who sent them and where they sent them. A messaging feature is to be implemented in the application, so that messages can be sent an... |
I'm currently in the planning phase / feasability study of a rather big web application which is meant to be implemented using Laravel.
My own experience on the matter is rather limited but I'd like to take the opportunity to further my skills and, if successful, release the basis of the code under MIT license for anyo... |
A Quick Note
I know the question title is a little odd but I haven't had much caffeine this morning so I'm having trouble thinking clearly right now. If you have any suggestions for a better title, please comment below and I'll update.
The Problem
I've built a custom logging solution that allows us (my organization) t... |
I am developing an application that has some features which are only meant to be available to members of the company while the majority of the application is for public use.
Having two separate repositories is a nightmare, since many bugs, feature requests etc. related to one are relevant to the other. Is there any go... |
What are some ways of documenting pitfalls and gotchas when working with a codebase with a team of developers? I'm working with a team of developers on a big codebase and there's lots of small little things that cause headaches and frustrations in code, configuration, and testing. It doesn't seem appropriate to put the... |
Watching this talk about Symfony Forms and validation, at 23:06, I got stuck with a doubt
I couldn't find a satisfying answer to:
Is it a bad practice to execute a query (or a web request, or a side effect in general) inside a validator?
In my case, I have either Symfony Validation Constraints and some implementation o... |
My question is simple: What steps should you take to protect research from the vast amount of spyware or insecure applications on a given device?
Background:
I do research into developing new models for machine learning applications. Security of this research is of high importance. This is because developing a new mode... |
I'm currently designing a system that, no matter how hard I try to break, slow network, failures, random server deaths, it can recover and it can re-build again. Each action it does is a fragment and it can pick up from where it left off. Each fragment is signed with a "done or not" and, again, it can resume work no ma... |
I'd like to see if there has been any precedent on alternatives to nested-ifs--particularly for error-code returns. My workplace requires one return per function, so I cannot early exit. Here is some sample code, rewritten to protect confidentiality:
static ErrorCode_t FooBar ( Input_t input ) {
ErrorCode_t errorCo... |
Originally https://stackoverflow.com/q/58816567/369489
There are tow separate projects within the same organization: P (product, at version p) which depends on L (library, at version l). p lists l in its dependencies and all is well.
The new feature X requires changes to both P (->p+1) and L (->l+1). The changes are s... |
Question about OO-programming, functional programming, NoSQL, SQL databases, and software architecture
Hi all,
I am a intermediate-level self-taught programmer, and have been dying to get an answer to this general question about how to structure my apps. Having no CS degree and only a few programmer friends, I haven't ... |
I'm very new to databases and have no knowledge of how to design them.
I've been using ASP.net Core to develop my website/API
So what I want to achieve is that remote devices log their temperature value every 10 minutes. I want to do this with potentially 100.000 devices, for multiple years.
Later I want to show the d... |
Context:
I have a case where I need to extend some existing functionality for loading a new version of an xml file into a system (new fields, some mandatory that were not mandatory before, etc). The file contains some heavy information, but to keep things simple I will use a simple case.
The xml file can be something l... |
We have two main branches here, master and development, and feature/bugfix branches come off of development. The issue we're having here is that we can't just merge development into master when doing a production deployment, because it's not guaranteed that those changes are thoroughly tested. What we've been doing is ... |
This question is more theoretical. I am studying to certify in AWS, I am reading for the second time the certified solutions architect study guide of aws and it is not clear to me what is the use that can be given to an ENI, I understand that they are used to connect a VPC with other services. Could someone give me an ... |
My question is about a use of while loops that seems very abstract to me. I understand a while loop like the first one (one which has a clearly defined statement):
num = 1
while num<1:
statement1...
statement2...
but, then there's something like this:
num = 1
while num:
statement...
statement2....
wh... |
I'm the maintainer of an ASP.NET WebForms application and am contemplating a refresh of the application in order to eliminate dependency on some legacy libraries, add some features, fix some areas where application behavior does not adequately match up with real-world business practice, etc. So, I'm looking into curren... |
In Python variables that are created outside of a function are known as global variables. However to create a global variable inside a function (a local variable), you can use the global keyword.
My question is, what are the situations for when a global variable should be inside or outside a function?
|
I am curious about the Difference between direct and indirect function() calls
Could anyone help in the diff analysis ?
The c source code could be found at subroutine_direct.c and subroutine_indirect.c
Note: the diff could be regenerated using command : objdump -drwC -Mintel subroutine_indirect
|
I am working on an embedded software project, whose output is an executable which will run on a linux device, using C++.
The app uses peripherals. Some kernel modules are not loaded when the system is powered on. Hence, I am forced to load them manually by modprobe. Currently, I am using a script to accomplish this an... |
I have a little doubt on about get a class in base of an object passed to a function.
In my case, I can two different types of object: classA, classB that have the same interface.
I have to pass one of that object to a service and get its repository.
I have thought something like this:
classA implements MyInterface {
... |
I am trying to implement DDD along with Hexagonal Architecture. One of the things that I am struggling with is validations. I had explored a lot of articles on where the validation should be but it seems there is no one way. I would like to find the most appropriate way to implement in my scenario. Here is the scenario... |
Although our products often have the same requirements, the solutions are always developed anew. From different people, with different good results and different quality. A code library especially for the needs of our products seems to be a good idea.
I think the main problem would not be to develop this library, but t... |
This is more of a procedure and maybe a philosophical problem.
The development team I am in is divided into Scrum teams or Squads that work on the same product. Occasionally, either one of these squads would have to embark on something 'big' such as a revamp of a core functional or component, database upgrade, etc.
T... |
I have a coding style related question. In my example it is java, but I think this can be a generic question regarding languages that are changing rapidly.
I'm working on a java code base which was mainly written targeting java 8. The code was migrated to java 12. By migration I mean the code can run on jdk12, so the n... |
I have a ecosystem simulation where animals move and collide with each other.
Here is how I handle collisions:
public void HandleCollisionBetween(Animal a, Animal b)
{
if (a.GetType().Name == b.GetType().Name) { // same type collision
bool fishCollision = a.GetType().Name == typeof(Fish).Name;
... |
I am at the beginning of designing a system to be deployed across a job site, your boring, dime-a-dozen, database server backend multi-client system.
One feature that I am very keen to implement in this system is the ability for a development team to making running changes with requiring a client reboot. I'm not so muc... |
I am working on an application with multiple threads (using Qt, C++). One of this threads is designed to execute a batch of operations like reading/writing from/to files as well as creating new ones. Sometimes, while this worker thread is active, I need some sort of confirmation from the user for operations like overwr... |
Array := {"title": "Book Title", "author": "John Doe"}
Some people use the following terminology:
title and author are keys.
Book Title and John Doe are values.
"title": "Book Title" and "author": "John Doe" are elements (= key-value pairs).
But some people - this one:
Book Title and John Doe are elements (= valu... |
I try to figure out how to manage versions in an monorepo where one of the packages is an application that needs to support multiple releases.
Assume we have a monorepo with just two packages: lib and app:
repo:
- lib@2.0
- app@1.0 (depends on lib@2.0)
app@1.0 is released release-app-1.0 tag is created.
We continue to... |
I have a python forecasting application that, for a given Entity, executes a fbprophet model multiple times varying the hyperparameters for each execution while tracking the best fit across the runs. The models need to be run in parallel to minimize run time. The data associated with a given Entity is small (~1mb). The... |
When you encode a code point to code units based on UTF-8, then if the code point fits on 7 bits, the most significant bit is set to zero so that it tells you it is a character which is stored on 1 byte (or more precisely 7 bits).
If the codepoint occupies more than 7 bits, then the number of leading one bits of the fi... |
I'm asked to input 15 to 25 sets of data into a website once daily. It requires logging into the website, clicking a button, then selecting 2-7 checkboxes, clicking button, selecting up to 3 more checkboxes, then inputting numerical values for each of those checkboxes, then clicking a 'save/next' button. This proces... |
A C coder here.
My wish is to find the best way to search words and phrases within the ever-growing English Wikipedia XML dump. As a first layer/step, hashing is the answer, yes?
The problem is that the latest dump is around 72GB in size. Would appreciate more experienced coders sharing their vision on the matter.
As a... |
I've heard that when you designing a microservice, the service should includes everything it needs to make them loose coupling instead of calling each other (services).
Based on this idea, should microservice manage their file logics like this:
UserService:
CreateUser()
UploadAvatar()
VideoService:
CreateVideo()
... |
I have an application that returns projects. A Project has many Tasks each Task has a field called hours. A project returns the total hours for all the Tasks that belong to it.
My application processes hundreds of thousands of tasks updating and synchronizing. In the past, I have done no calculating when a task gets sa... |
I have been using c# and trying to learn FP. In context of FP I often hear that usage of basic assignment or return statements are not considered composable, hence their usage is not advised in FP paradigm.
I already found this older Stackoverflow question "What does composability mean in context of functional programm... |
I am currently using RabbitMQ to aggregate the output of various data sources.
Functionally the process is the following:
The user enters a product name.
The request is sent to the different sources via RabbitMQ.
The results are returned asynchronously.
The responses passe through an entity resolution service to make ... |
Please let me know if this isn't the right SE site (or otherwise) for this kind of question, it's the best match I could find.
I'm working on a humble interpreter written in C for a simple language I'm designing. I ran into a design problem in the interpreter which I'm sure people have already solved, and I would like ... |
I want to be able to analyze a five-years archive of supermarket receipts. The receipts are scanned, and thanks to Google Cloud Vision API, the result of an OCR is available. Google's API, however, gives only the text and its geometrical position on an image, nothing more. Example:
ID: 5620
Content: “TICKET”
Vertices: ... |
I'm trying to figure out if the use of schemas on non-relational schemaless databases like MongoDB is a recommended practice or a bad practice to be avoided.
I am doing research work and am looking for objective arguments in favor or against this practice.
|
This argument has been going on for weeks:
Bot.getGuild().getMembers().stream()
.filter((final Member m) -> m.getRoles().size() == 0)
.filter((final Member m) -> !m.getUser().isBot())
.forEach(JoinListener::assignDefaultRole);
vs.
Bot.getGuild().getMembers().stream()
.filter(m -> m.getR... |
Scaling down for the sake of the example, my project is structured like this:
solution X
project A
project B
Project A is exposed as nuget packages externally, project B need the functionality provided by project A.
Those projects are there because of proper namespace attribution and logic isolation, not bec... |
I was watching the Coursera algorithms lecture series' portion on tries. R-way tries are introduced first, where each node has an array the size of the possible character space (R) with potential children -- for instance, an ASCII R-way trie would need 256-element arrays. It is then explained that for many applicatio... |
I've been reading about this thing called dependent types.
So for example imagine a function firstNPrimes(int n) which returns an array of length n. In other words the type it returned would be int[n]. (In normal programming languages without dependent types all we can say is it returns int[] where the type doesn't sp... |
I have multiple databases (MySQL, all identical except data, can delete arbitrarily from any) across multiple machines which contain large quantities of sentences (~ 1e+11 per database, ~ 4e+12 in the whole system). What I want to do is delete all duplicates across these databases.
The first idea that came to mind was ... |
I have a Raspberry Pi with a ConBee 2 (ZigBee) interface connected. The ConBee provides a websocket I can connect to to get push notifications on sensor changes. And I want to forward those notifications using a HTTP method URL.
The current status is that the ConBee (Phoscon) is operational, and I receive push notifi... |
I am a beginner in computer science and have been asked to write a program to convert a binary tree into a circular linked list (order of the nodes in list are in inorder traversal of the tree).
I would like to understand the purpose of such a conversion. May I know any real time or real life applications of such a pro... |
In an order management system for example, what's the best way to plot the states of different objects that overlap and interconnect at different states?
Example:
Order object will have states like Draft, Confirmed, Placed, Picked, Delivered...etc.
Invoice object will have states like Opened, Paid, Closed...etc.
Know... |
Suppose that I have a class that is returned only as a byproduct of another "main" class. I am using a Test Driven Development (TDD) workflow.
Should this byproduct class be unit tested independently or should I be considered as an implementation detail of the "main" class I am testing?
Example:
Suppose I have the fol... |
I have an application which records the company man hours of employees and other related details. Because it gets updated everyday or when a new employee is added, it tends to lead to a very large data set. To analyze this data, I'm planning on using Power BI.
The issue that I'm running into is that the REST API is on... |
I'm implementing an event-driven game in WPF and have the following Blackjack class:
public class Blackjack
{
public Dealer Dealer { get; } = new Dealer();
public Player Player { get; } = new Player();
public IList<Player> AiPlayers { get; } = new List<Player>();
public event EventHandler<EventArgs>? ... |
Imagine a backend service modeled by a hexagonal architecture, where the domain has a class modeling, let us say, a Step of a creative flow that a mobile app will use:
class Step(
val stepId: String,
val description: String
)
The description should come to the client translated according to the User preference... |
I am newbie to angular and Ionic world and trying to figure out the right stack to get started with my requirement to develop a hybrid mobile app.
I understand that Ionic is a wrapper around other JSframeworks as well as Angular. My requirement is to build a hybrid app that runs on web as well as Android and iOS. I che... |
Suppose I have two classes that implement the same interface, as in the example in C# below:
public interface ICommonInterface
{
string Text { get; }
int Count { get; }
}
public class ImplementationA: ICommonInterface
{
// Implementation A
}
public class ImplementationB: ICommonInterface
{
// Implemen... |
Sometimes when writing a unit test using Test Driven Development (TDD) one may find that checking if the result is the correct one is "more complicated than one line of code", probably deserving its own function.
In that case, writing an auxiliary method or even helper/ extension class could be something that comes to ... |
So I have made a pull request to change this code:
//Controller:
...
[HttpPost]
public ActionResult Unauthorize(int userID, int permissionID)
{
_permissionService.UnauthorizeInternalUserPermission(userID, permissionID);
return Json(new Result());
}
... |
I want to use rabbitmq to share domains events between microservices. Due to the fact that queues are round-robin, I need to define one queue per event source and event consumer.
For example, cars-ms emits the CarRepairedEvent and should be consumed by notifications-ms and trace-ms. I though about using a fanout exchan... |
My first programming language is C++. C++ is a multi-paradigm programming language. One of the paradigms C++ supports is Object Oriented Programming. I want to say I get the general idea and benefits of OOP as is exemplified in C++.
I have recently started creating a project in Android Studio. One of the languages Andr... |
When you are done with programming, you may have used many libraries that you maybe had to buy, different software and tools and then when your run your programm, your programm compiles and calls constructs from different libraries and everything works fine, but when we are done and want to sell our software we are sel... |
in my system users register with their email address and receive a temporary link to log in.
hostname/login/OYkwIJt6be1V5kMg10G
The token must be generated from the email adress of user and valid for 2 hours.
I don't want to store a session or token in a given database
In my mind I imagine creating the link like thi... |
Is there a way or design pattern to add supporting information to the existing java object?
Example I have a model class Parent and it has child models. Its nothing but hibernate entities with parent-child hierarchy. The parent class object is being pass through multiple Java business rules class. I would like to add s... |
Updating the libraries in my Angular 8/Electron app produced compilations errors eg, in Electron's menu.ts file, Also, a few of the project external libraries contain @ts-ignore lines, suppressing compilation errors. Some of these have comments "safe to ignore because..." while others don't.
As I couldn't solve the ... |
I manage a library that is made of multiple components, there is some dependencies between some of these components, for example I have a core library for common code base that is referenced by other components. All of these components (including the core one mentioned in the example) are then packaged and pushed separ... |
I have an class named FileCreator which is used to write many strings to a stream. Basically, to achieve its job, the FileCreator needs two objects: a StreamWriter and the actual strings that will be written to the stream. So far so good.
Now, on a architectural level, I'm wondering what would be the proper way to pass... |
I am creating a text generation algorithm for my master's research. I have a dialogue between two people and I would like to simulate one part of the conversation with naturally generated text (not templated text). For the training, I'm simply using a softmax to increase the likelihood of getting the correct word. Howe... |
Let's say I want to use COCOMO to estimate the effort to produce a 100 KLoC embedded project. Not including the Effort Adjustment Factor, the effort would be 2.8 * 100^1.2 = 703. However, the project has two distinct components. I claim that on paper each component is its own project of 50 KLoC, which brings the estima... |
I've created a .NET Core MVC product with Entity Framework, and am being tasked with creating "Add-on" products, which give CRUD operations to more tables, but use the same library functions and UI.
From a software engineering perspective, I found this a good opportunity to break my one huge project into multiple proj... |
I'm using GitLab (which calls them merge requests rather than pull requests). From a couple of the comments below it seems like GitLab behaviour may be different from GitHub's.
I'm trying to get my head around how using pull requests for code reviews would work where you're developing on feature branches with a shared... |
As in topic.
If i want to access RAM from 2 different threads, completly different cells in memory, do they queue and are sent asynchronously or queue?
Lets say accessing memory from one thread (roundtrip till i retrieve data to CPU) is 100ns
How long will it take to process 2 of these queries from 2 threads in same ti... |
It the exceptions thrown in case of error are represented in the UML sequence diagram, would it make the UML sequence diagram too heavy?
If they are not represented, how to tell about them?
|
I've got a program for analyzing specific folders / websites.
The program always does the same steps for each folder and website.
Therefore I've used JSON files to store configuration (domain name, folder name, some rules for the program etc.). In total, I've got 650 JSON config files and the number is growing.
Now, I'... |
Should a bug be added in backlog?
Probably with special rules like
a business value of 0
no complexity evaluation
can be urgent or not
can be added in current sprint
|
This is a problem related to a typical e-commerce requirement.
I am using ElasticSearch for all the below use cases.
I am confused about whether or not to use MongoDB for the sorting part.
I have the data in the following format:
Product JSON:
{
"name": "String",
"description": "String",
"characteristics": [
... |
Sorry if I'm not clear, I didn't touch the program for almost two weeks.
I have a program that reads XML files:
A product list
Each product's default settings (if custom is not available)
Each product's custom settings
Then it constructs a ProductBase object and ProductSettings from either default or custom XML. Afte... |
I've been writing some code comments, and I've been trying to refer to the index integer of a enum type, but I'm not sure what it's called. I'm tempted to call it the identifier, however there is likely a word that already exists.
It's hopefully easier to see what I mean with a example.
enum Weekday
{
... |
I'm developing a microservice with CQRS and Event Sourcing. When an event is saved to the event store, the service currently also saves the updated aggregate root as a JSON object in a separate table. So far I have separated the write model from the read model (though not in separate data stores).
I want to take this a... |
There is a school of thought that describes code reviews as the number one priority activity for all developers in a sprint since they are either:
a) A source of unrealised value
b) A source of bugs
While I'm not sure I subscribe to such as black and white view, I do agree with the sentiment.
But enough of the backgrou... |
Taking into consideration that I'm making an attempt at Domain-Driven Design and overall good separation of concerns when it comes to business logic, data access logic, etc...
Question: How do you validate a child object, when validation depends on one or more fields of a parent object? What about when the parent obje... |
I know the title is confusing, I didn't how to word it.
I'm studying the Domain Driven Design (DDD) and I'm reading the book "NET Microservices Architecture for Containerized NET Applications" from microsoft and I can't understand well how to identify the aggregate roots.
In the book they use an example with an Order b... |
We're configuring the build and release pipeline for our frontend code which is built with React. The final output is just some static HTML/Javascript code. The differences between environments are extremely small - for example, our dev environment will produce code that makes API calls to dev.oursite.com and likewise ... |
I'm trying to wrap my head around event sourced architectures.
It seems like common advice is to have small events with as little info in them as possible (opposed to large events with everything in them to allow other services to store their own data).
Obviously reducing coupling between services is encouraged. So m... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.