instruction stringlengths 34 36.1k |
|---|
To give a bit of context first, I have been tasked to mentor an internship on creating a UI for a certain business need:
Already 4 months were spend on analyzing, creating the business use cases and some context diagrams, and BPMN diagrams, but the analysis is not complete yet.
It was foreseen that the API would be... |
I've seen this pattern pop up in a couple of different teams. They have a server with a REST API and a frontend web project.
What commonly happens is the frontend developer finds their requests are being blocked by CORS, and they create a REST API for the frontend that just passes requests through to the main backend.... |
Although many people understand that even if we have the same setup for TEST and UAT environments as we have for PROD, there're still a lot of reasons why it makes sense to run smoke tests in production:
Ensure stability of the core functionality
Identify potential bugs and fix them right after deployment
We'd like ... |
I have an application which is currently used by clients. So based on the feedback from the client, normally we are fixing bugs in a live application.Parallel I am adding new modules to demo projects.My plan is to migrate the new modules into live after testing.
But the issue is we have fixed many bugs in live version ... |
In GitLab, an issue is usually closed once a Merge Request is approved and merged into master.
However, what should happen with issues that are closed because of other reasons?
There could be various reasons for this:
It turns out the issue is not needed.
The issue turns out to be not feasible, would break too much ... |
The frames are sent in multiplexed fashion and have a stream id. The receiver re arranges frames with the same stream id but what happens if an older frame arrives first?
Is there a concept of sequence number in http2.0 stream frames?
|
Our website needs to send transactional emails to customers each time an event happens on the site such as:
User registration
Email verification
Password resets
Order confirmations
Despatch confirmations
Comment notifications
And so on.
At the moment I am storing the email templates within an application page (e... |
We have git installed on our webserver (via cpanel), but unfortunately no CI- / Deployment-Tools.
Would it be good practice just initialise our repository in /public_html/ and push our local Dev-branches into the Master-Branch there instead of having an extra repository-directory on the server and 'deploy' the project... |
I have the following "software reality in working code" (also no access to it):
There is a class Class1 with different attributes
AttributeA - sums up all "ordinary attributes"
EnumType
DataType
AttributeValue
It is realized that there are some objects John... of type Class1, so they all have these 4 attributes. T... |
The cover of the book The Practice of Programming lists programming principles:
Simplicity
Clarity
Generality
Intuitively I understand generality as preferring to solve the general problem rather than the specific form in which the problem presents itself. For example a sort function should be able to sort anything t... |
I know redis is a very robust caching solution and scales great, but when it comes to simpler non-enterprise websites I feel as if it's a bit too expensive (Azure Standard/C1: $100/m).
I'm considering just creating a simple API that utilizes the Dotnet Core In-Memory Caching.
One benefit of this would be cost, as I co... |
I have a web application that has some specific differences between production and test environments.
I.e. test email config, test payment config, the word Test written on the home page (useful to be sure you're in test!!)
My previous developers taught me the basics of git and I can use github desktop pro to branch and... |
I’ve got me a design and implementation problem extracting and formulating the results I need.
What I’m trying to do is build some reporting on forecasted stock commitments in an inventory system to help drive JIT stock procurement and manufacturing. I’m really sorry, there is a fair bit to this so if you stick with m... |
I have a list of functions which need to be tested against a list of inputs to measure their relative performance.
I have already create a test function like below:
public static String testFunction(Function<int[], int[]> function , int[] input) {}
I have also generated a list of inputs to feed to each function. The c... |
I'm reading the book "The Go Programming Language" and this sentence in the preface section "The Origins of Go" has me puzzled:
One major stream of influence comes from languages by Niklaus Wirth, beginning with Pascal. Modula-2 inspired the package concept. Oberon eliminated the distinction between module interface f... |
I believe the consensus on unit tests is that each individual test should interact with the smallest surface possible (?).
I have a function I want to test, but it depends on some setup performed by other function.
Should I call these other function in my test, or manually setup the state as the tested function expects... |
I have a wcf service to create that will have to pilot a desktop process for the remote client.
My limitations are :
- the wcf service could not handle more 100 simultaneous desktop process concurrently.
- the wcf service have to be protected so that a problem with one desktop process does not stop the server to ... |
I am trying to make a user story for a basic Sudoku game, using the agile software development approach.
I get the concept behind user stories, but I was just wondering if it was possible to get an example to further my understanding?
Would saying
As an avid Sudoku player, I want to have multiple levels at different ... |
I'm trying to implement an Interface for a Message Queue. This interface should allow different implementations of queues to be implemented etc AWS SQS, Azure Queue Service.
So lets say that I have an interface for the Message Queue:
type Queue interface {
AddMessageToQueue(msg QueueMessage)
}
I also have an interf... |
I need help with a problem which I have been working for the last month.
I have a group of documents, each document has a set of unique words (if the word appears more than once in the document, I count it only once). I want to find for a particular amount of documents the optimum group which contains the least amount ... |
I'm designing an API, and I need to authenticate each request with a user. The simplest way to do that is to provide an API key to each user on their "My account" page, that they could regenerate at any time.
Then, our users can either include it when they design their consumer apps, or the apps they use can ask the us... |
Our team is starting to refine a set of stories that cover components and UI as part of an upgrade to a newer version of Angular. These components will then be used to recreate screens in an existing application. We are considering this work technical debt.
Is there a recommended format for writing technical debt stori... |
Imagine the following situation:
I'm working on a python project, and I install the library antigravity with pip.
I add the function fly() which uses the library, and I commit and push the changes.
Some time after, my partner(s) run git pull.
How do they know that they should install the new library? By failing to ru... |
I'm always having the problem on how to properly design having static entity instances and it being attached to Entity Framework's Dbcontext. For example, we have the following:
using Microsoft.EntityFrameworkCore;
using System;
using System.Linq;
using Xunit;
namespace ClassLibrary1
{
public class PersonType
... |
I currently have a small list (< 20) of constants that can be segmented into the following three parts:
- main script (tokens, log file location)
- database setup (username, passwords)
- API (API key, various external IDs)
I felt that it cluttered the top of the files during declaration, so I transferred them into a c... |
First of all, I hope im in the right stack exchange.
So I'm trying to build a facial recognition system, e.g. one that recognizes a face and compares it to a database of known faces. For the first part, there are a ton of resources available, thats not the problem.
The problem I have is designing the database. How do y... |
We are starting to have a few projects that have a design where a web server needs access to services/devices (think database connections and specialized hardware) that are on a local network. Instead of having users open up ports to the public internet, we are using a small program that establishes a connection from i... |
I have just started a new job in which I will be overhauling and updating a web-application written in Django. I have a loose familiarity with Django (and have been reading up on the documentation for Django and external libraries like Django REST Framework). But I am hoping someone with lots of experience in quickly u... |
A typical implementation of a DDD repository doesn't look very OO, for example a save() method:
package com.example.domain;
public class Product { /* public attributes for brevity */
public String name;
public Double price;
}
public interface ProductRepo {
void save(Product product);
}
Infrastructure p... |
Whlist browsing on github I came across the following project: https://github.com/infection/infection and according to the project's website https://infection.github.io/guide/#What-is-Mutation-Testing .
As far as I understood what a mutation testing mean is that automatically the code is slightly being changed and som... |
So for DDD folks there, Aggregate Roots are supposed to contain business logics only and exposed what is needed only.
In DDD Red Book by Vaugh Vernon, he used LevelDB and Hibernate as examples. LevelDB is key-value storage and Hibernate I think uses reflection.
However, if I don't want to use any of those, how am I goi... |
This may be a broad question but I have not been able to find an answer.
In my program I am communicating to a device over serial communication. The data coming through is binary, and formatted with some header/length/checksum bytes. I can decode the data fine, the part I am stuck on is what is a good practice on distr... |
I am trying to figure what could be the flow since I am using JMS for the first time. Locally, I have ApacheMQ installed on my Windows Machine. And using this simple Spring JMS example mentioned here, I was able to see how to send and receive message thing works in Spring JMS and my ApacheMQ looks like the following af... |
I'm developing a single page application where the first page contains the subjects and the next one contains items of the chosen subjects. The items are stored in a JSON object fetched from the server and have only two properties - name and id.
My questions is - generally speaking - should I divide my fetch from the s... |
I'm currently developing an SaaS application in PHP, with Laravel, using its own DB class.
Let's pretend we've got 2 classes under 2 namespaces, plus Laravel's own DB - so
Illuminate\Support\Facades\DB;
Developer\App\Core\Queries;
Developer\App\Section;
They're our 3 classes.
With our custom classes, we've got
File 1:... |
I am designing some software for transportation companies (air, ground, water, etc). In these industries, you have rest rules where you need to get a certain amount of rest in between activities.
So lets say trucker/pilot/sailor has an activity to go from A to B that takes 4 hours, then has a 30 min break than wants t... |
Let's take this unit test. Unit testing guidelines state that I should only have 1 assert per test, unless I'm testing the state of an object. In this case, Muxer.Muxe is a wrapper around FFMPEG that generates the right command line and executes it. Having the function return "Success" really tells me nothing about whe... |
I'm trying to develop a way to represent something that has an URI inside of it, let's say:
{someVariable}{separator}{URI}{separator}{anotherVariable}
where someVariable is alphanumeric.
I just can't figure out what the separator should be, having in mind that it should:
Unambiguously represent a separator
Be small (... |
I am designing a Job scheduling software. Users of the software will define the job definition in XML like format https://github.com/etingof/apacheconfig/:
e.g.
<job>
job_name myjob
<command>
command_name command1
command_exec_string 'echo from command1
</command>
<command>
comm... |
I have just started reading the book Applying UML and Patterns by Craig Larman. I find it very interesting because it challenges many of what I have been told at work. I read that requirements aren't fully collected in one go in agile and it takes many iterations to complete requirements gathering. If that is the case,... |
I am learning HSMs and I can see a problem that I don’t know how to address. The problem is shown in the image bellow.
Inside S1, substates S11 and S12 are continuously changing in reaction to TIMERTICK event. At the same time the superstate S1 needs also to keep track of TIMERTICK event in order to change to S2 after... |
At the moment I have a frontend client calling several backend REST APIs. For example a call may be to get information about a certain vehicle. Then the client will call REST API A to get some performance data for the vehicle and REST API B to get some model or other static data.
This is becoming tedious to handle in t... |
I approached our architect with a solution in which all of our microservices verify the auth of the user invoking the call. Basically, what I've been doing for years, on different projects. He basically said that I'm digging my own grave and proposed an infrastructural layer, a proxy, which will authorize the requests ... |
I want to create the following distributed system: Spring back-end microservices containing the domain logic, a UAA (authentication) service, a Eureka service registry/discovery, a Spring Cloud Config service, and a Zuul API gateway.
I am wondering what is the proper way of serving an Angular front-end application. At... |
I'm writing the back-end for a chat application. The database being used is MongoDB, which uses objects that have their own unique IDs.
I've run into a problem; I have two document types, channels and users, and said types need to reference each other.
The user object needs a list of channels it can participate in, a... |
Suppose I have a server and a client. When I send a message to the client, would I be sending a ServerMessage, or a ClientMessage? The other way to think about it - when I receive a message, it is a ClientMessage or a ServerMessage? Or is it ClientMessage in both cases?!
|
I am making a program that tracks whether an employee has checked in on a software app that day. The employee can check in at any time, so long as they check in before their shift ends. If they don't check in, then a notification gets sent to their supervisor (where they might get in some trouble :) ). My question is h... |
I'm working on a plugin for some drafting software. The plugin takes the form of a dynamically loaded mach-o bundle.
The software vendor provides a template plugin in the form of an XCode project.
The whole thing is written in C++, but XCode doesn't seem to support C++ in it's testing bundle targets.
Tests could be wri... |
This question is related but doesn't directly answer my question.
I can imagine that understanding category theory helps someone who is designing a programming language, apparently in particular functional programming languages.
But what I find hard to understand is, how would a software engineer benefit from a knowled... |
I would like to write a program in C that forks then execs three different processes.
Afterwards, two of the programs will be suspended and only one of the three will be outputting to stdout. Is is possible to later on suspend the process currently running on stdout, resume one of the other suspended processes and have... |
Use case:
We have a product which ties a set of resources to a concrete user.
Now we would like to provide the customers with an API so that an automated client application can have access to a subset of a concrete user's resources. A single user's resources can be accessed by multiple client applications (potentially ... |
I have a backend that does not support emoji characters in all of its fields, so I want to block them directly in the frontend application. I'm in the register section, and I want to limit the possible characters for the email field.
I know that RFC 5322 specifies that many particularities can be found in those address... |
So, I'm having some value objects in my domain, and when I'm using them in one of my builders it looks like this:
.withSomething(Id.of(123), Specifiers.of(MySpecifier.of("233"), MySpecifier.of("23423")));
and in method I have:
withSomething(Id id, Specifiers specifiers){
//id.value()...
}
This seems too wordy for m... |
Recently I stood up a Redis server and tested the idea of storing application 'states' that only existed in our application and were never stored in our database. Don't know if we will ultimately do this but for the first time this information was available external to the application. What I did notice above all else ... |
I am developing a RESTful API designed primarily (but not exclusively) for consumption by a web application. For the purposes of this question, the API is a set of GET endpoints. The main endpoint is /people/ and understands a large amount of query parameters to refine the result set.
The web application's splash page ... |
Suppose I have a REST end point. UI sends some parameters to this REST end point which are
required for a stored procedure to run properly. Since this stored procedure is going to take
a long time to run, I am planning to use JMS and put this step to JMS Queue.
Now, I am not very clear about what to put in the JMS Q... |
I am currently attempting to create a gravitational n-body simulation using a modified Barnes-Hut algorithm, to be more amicable to GPU computation. This is primarily as a learning project. My goal is to simulate a number of stars comparable to that in real galaxies, meaning on the order of hundreds of billions to tens... |
I'm all on board with functional programming in Javascript - particularly within the context of using React and Redux.
Something that I've been running into again and again, is how easy it is to accidentally mutate objects and create odd bugs.
That is, where the const keyword prevents the variable from being reassign... |
I am a backend developer and was having this argument yesterday with a frontend dev in my team about whether or not should I let him fetch the displayable text message about the result of an operation from the backend.
My argument was that since it is a presentation layer decision, it should remain with the UI. They sh... |
I am looking for an approach / algorithm for using OCR (like Tesseract) to extract only bold text from an image. The Python code I wrote can already identify small letters and numbers, but it cannot distinguish between bold and non-bold text.
Does someone have an idea, for example, for some preprocessing or postprocess... |
Consider a token issuer/validator. Every token is PKI signed.
Is it more secure to use a new key-pair (performance could be ignored for now) per request or is it no difference to have only one key-pair for all?
It's a theoretical question, an implementation could be for example to generate a key-pair with expiration u... |
I'm just learning about clean architecture and I'm trying to design a proof of concept for an application I want to build soon.
In the Clean Architecture the Presentation layer and the Domain Model layer are separated by the Application layer. I understand how this make sense for stateless applications, like a Web base... |
What I'm looking for is a pattern for the client triggering a server process, then the server process signalling the client when its finished.
preferably with examples available in .NET or dotnetcore
My application is accessed through a REST api. I have a full-featured windows client (WPF) and a smaller web client.
So... |
Lets say there exist some service at some organization that exposes information on a company's assets, from employees, company-issued devices (laptops and issues) to the the large xerox printers on each floor and the large servers in the many different server rooms. Each of these objects (laptops, enterprise printers, ... |
I want to to follow a clean architecture rules (with domain and architecture layers). I have a problem with properties that an entity should or should not have.
Let's say that I have a User domain. It has all the business related properties (like first name, last name, email, mobile phone number, etc.). But there are ... |
I have a Controller in ASP Core MVC. I'm trying to trim down the dependency injected services in the constructor so I can start building unit tests more easily. However, I have some services being injected that are only used in one or two controller actions. For example, I inject ILocationService because in a couple of... |
A few months back, I was working on designing a client API (FooManager) for adding/removing/fetching a list of objects (Bar).
The requirements were simple-
1. Fetch operation is CPU-intensive and should be asynchronous.
2. API should be clear about when what data is available.
The options I thought of were-
Option #1 (... |
One of the architectural challenges we are facing on a project is ensuring data consistency over our microservice domains. We have two rules that we are trying hard to enforce: 1. Services cannot directly communicate with one another (primarily to reduce latency and prevent deadlocks) and 2. Each service only has dire... |
I currently capture well structured forecast data in a SQL Server. An example of this data is below:
What this tells me is that each day, I receive a forecast for the next three days. Note that in the real world, I may receive a forecast each hour (DateOfForecast) for the next 48 hours ('DateInQuestion') at 15 minute... |
I'm creating a survey app and I don't know how to design database. I need surveys with multiple questions and multiple types of questions. There are 3 ways that I could think of:
a) Create a database table for surveys and every type of question and connect them with Survey_id column.
b) Create a database table for que... |
As far as I have seen then async/await, callbacks and promises are and can only be used to achieve asynchronous programming. Correct?
So my questions are:
1) Is it correct that the former three is used for asynchronous programming only?
2) If yes, then which of them is the best and why?
3) If no, then how they differ?
... |
I've been doing some research on multi-tenant systems and micro-services and I'm a bit confused by this.
If each micro-service has it's own database, and implements the support of multi-tenancy in it's api - what service is responsible for telling the micro-service what account Ids map to which customers?
Is there a si... |
Say you have a bunch of microservices each accessing dedicated databases. Due to business logic reasons, data from some DBs need to be replicated to other DBs (e.g. to serve as local cache).
One way to handle replication is to stream changes done to DB 1 (e.g. using my Debezium) into a queue (e.g. Kafka). Queue consume... |
Often in my own personal Python libraries, I do something like this:
class MyClass:
# ...
def plot(self):
import someGraphicsLibrary as graphicslib
graphicslib.plot(self.data)
The reason is that initialising someGraphicsLibrary takes some time, up to a few seconds for one of the libraries I u... |
I am using bool flag to call base class function when needed to imitate virtual constructor. I am using this way for inheritance purpose. I have a Base class constructor with int and bool. The bool part is there to check whether to call fun() or not. By default I make base class flag true.
Then for Derived class I make... |
Umbrella activities are defined as "the non SDLC activities that span across the entire software development life cycle".
Considering this definition, can we say that project planning is an umbrella activity, as the plan continuously changes throughout the process? Are there any umbrella activities in software project ... |
I have to represent a certain data structure, in which I have nodes that are related between them. Each node has its numeric id, and a list containing the next directly related nodes and another list containing the previous directly related.
So my code now would be:
class Node {
int id;
ArrayList<Node> previous... |
I design and works on lot of projects involves REST APIs. But one question is always occur to me if it is acceptable way to do REST.
So according to REST manuals online, REST is build upon two major HTTP concepts. HTTP Verbs and HTTP Codes ( their are other thing but I am focusing on these two concepts ).
So If I nee... |
Is it considered to be a good practice to convert all types of exceptions (exceptions from internal logic of application + exceptions from application's external dependencies - for example: File System) to application specific exceptions?
For example,
I am developing a Job Scheduling Software in Python (using layered ... |
I'm looking for perspectives from other web/ui developers.
I'm a UI developer and my company requires that I use components built by another team within the company. That team has developed some patterns over time that I would consider bad practice, but I thought I'd see what others think before I raise any awareness... |
So I am asking this after reading the following: Why shouldn't I use the repository pattern with Entity Framework?.
It seems there is a large split of people who say yay and those that say nay. What seems to be missing from some of the answers are concrete examples, whether that be code or good reasoning or whatever.
T... |
I have recently come across the terms migration pattern and refactoring on the topic of migrating monoliths to microservices. Is there any real difference between the two terms, or can they be used interchangeably?
|
I'm designing a database for name statistics (how many people where given that name). The data consists of names, and numbers for how many men and women were given that name within a time period (primarily 15 year time periods, but this varies). The data is rather simple, but I still keep getting stuck with the schema.... |
I am somewhat new to writing tests and I want to build that habit into my workflow. So for example I might write a test that a user can create a blog post however I'm not sure on how to do that effectively.
Should I have a test case to verify that every field is validated?
By that I mean I could either only write one t... |
I know that triggers can be used to validate stored data to keep database consistent. However, why not perform validation of data on the application side before storing them into the database?
For example, we store clients, and we want to perform some validation that cannot be easily done on DDL level.
https://several... |
Generally, we are looking to create a logging framework that can target human readable output as well as various structured data formats. So, a goal is minimizing code duplication in packaging the format functions. We created a library of functions that can be used to format log entries.
The client can then iterate a... |
In my C# solution, I have a Tests project containing unit tests (xUnit) that can run on every build. So far so good.
I also want to add integration tests, which won't run on every build but can run on request. Where do you put those, and how do you separate unit tests from integration tests? If it's in the same solutio... |
We are trying to move from a monolithic architecture to a microservice architecture. We thought of what would be the best way to segregate our services and started doing so one by one. Now we have a question as to how we should make dependent calls. Let me explain in detail.
Lets say we have different microservices. On... |
I have been reading into possible design patterns and have found the use of singletons always referred to as an anti-pattern.
I am currently using a singleton for the sole purpose of gathering configuration details based on my current build environment from a .ini file.
My singleton only has one public static endpoint ... |
I see some services which takes a requestId from client as the mandatory attribute while some services doesn't. I feel it is a good idea to have a request Id from the clients because it helps in debugging through logs, that is, what happened with this request.
Can someone provide the good reasoning or the best practic... |
For example, suppose my input data and UI is not in 1 to 1 relationship:
html:
<script>
aChanged=function(){
};
bChanged=function(){
};
cChanged=function(){
};
</script>
a:<input id="a" onchange="aChanged()"/>,b:<input id="b" onchange="bChanged()"/>,c:<input id="c" onchange="cChanged()"/><br/>
a+b=<span id="a+b"></s... |
I'm using mongodb for our web application.
Recently I'm think of adding redis for caching objects which usually is the setting/configuration. But the mongodb already cached the frequently accessed items.
So, do I need a redis for this use-case and why?
|
I am working on a project which requires me to execute standard HTTP calls with session tokens. I am building a custom HTTP client, with a custom authenticator, something like this:
Client client = Client.Builder().withConfig().withAuthenticator(Authenticator);
and my authenticator is an interface
public interface Aut... |
Considering a Python Project structure such as the following, where there are "empty" packages with __init__ files simply pulling code from the lib folder:
.
├── foo
│ ├── fred
│ │ └── __init__.py
│ ├── henk
│ │ └── __init__.py
│ ├── _lib
│ │ ├── classes
│ │ │ ├── corge.py
│ │ │ ├── _stuff... |
I have created an application to import CSV files, each CSV file that the application imports can contain different data, with new formats of the CSV files being added in the future. Rather than hard code each import I have created a definition in JSON that details each file. I have written a basic import class that im... |
This is an object-oriented design question that is specific to Spring Boot. I'm extending a Spring Boot application that has an interface that is being extended and used inside another service. The interface uses dependency injection to choose the implementation. I don't want to change that. I think the inheritance ... |
I'm working on a project that involves online purchases. I have my web api in C# and my client in REACT (javascript).
Server and client are connected with SignalR. I want that when an ORDER is changed all the clients that are watching the details of the order receive the warn to refresh the page.
My question is: which... |
Payload:
{
"selection": {
"ids": [1,2,3,4,5]
},
"image": {
"backgroundColor": "#FFFFFF",
"headlineColor": "#000000",
"format": "PNG"
},
"processors": [
{
"repository": "org.my.world.app.repositories.RepoX", // fetch data from this Repository
... |
Currently I have something like the following
def writeThis(fileHandle, name):
fileHandle.write('Hello ' + name)
writeThis(fh, 'Alice')
Something about this doesn't feel right however, it feels like I should try to minimize side effects and have something like the following
def foo(name):
return 'Hello ' +... |
I’m trying to make a AMQP integration layer for my app. This layer would only consume messages from my customer’s queues and the result would be a specific action in my application.
My application is a type of CRM. It manages recipients and it can send emails to these recipients.
What I would like my customers to be ab... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.