instruction stringlengths 34 36.1k |
|---|
Im building a project that stores time series data on a per user basis. On the dashboard of the user it'll show some simple statistical analysis like averages but more importantly, it'll create charts based on the data. These charts could be line charts plotting values from one date to another, or a pie chart showing t... |
I work in a DevOps role and mainly write glue code and OS-level automation. I've rarely needed to deviate from existing language implementations or "reinvent the wheel" in the small programs I've written.
What is the advantage of creating a "manual" implementation of an algorithm, i.e. merge sort, than using a language... |
Consider the follow entities:
Bob, Sally, Apples, Oranges, SupermarketA, SupermarketB.
The relationship between this is as follows:
Bob can buy Apples from SupermarketA and SupermarketB
Bob can buy Oranges from SupermarketA
Sally can buy Apples from SupermarketA and SupermarketB
Sally can buy Oranges from SupermarketA... |
If I have a GET restful api use for query user info by user name. I don't want to return all column.
My response column is decide to client.
Example.
My user have many column.(userName, sex, phone, address, age)
When my client only want to query the user phone and age by user name.
My restful api is like: /rest/user?us... |
I'm struggling to find an elegant and idiomatic way of coding the following scenario using the MVVM paradigm in WPF and was wondering how other people would approach it.
I have a UserControl in my WPF application which I want to reuse in a number of places. The control is a filtered ComboBox setup allowing users to ref... |
I have several classes like Button, Textbox and so on but at instantiation of those object they all need one object reference. The button represents a physical button on the screen but it is not an UI element. Instead it should be used it Selenium to interact with the physical buttons.
public class Button : Element... |
In short: are email end-to-end tests a thing?
As part of my CI I would like to run email integration/end-to-end tests: the app would send it to some SMTP server and then hits maybe an endpoint where it would check if SMTP server got the email. I have hard time finding anything similar on the net though... Did you hear... |
If I have a repository, like a Dropbox server or a File sharing server, and if a client uses this repository for storing its data, from a design perspective, whose responsibility it is to calculate how much resource has been used / occupied by the client, assuming that there are no limits set on this, and no security c... |
Say I have a class to model my customers
class Customer
{
public static customerType = 'customer';
}
And a subclass class CorporateCustomer extends Customer to model my corporate customers. Presently I have three subclasses
class AlphaCustomer extends CorporateCustomer {...}
class BetaCustomer extends Corporat... |
Two possibilities. Which is better, with respect to readability, maintenance and clean code:
SQL injection can be disregarded.
Constructing complex parameterized sql queries using python string concatenation. Up to 7 parameters each adding an additional where condition, order by logic or wrapping a subquery into a new... |
I have a web application that depends upon a set of R analytics. These R analytics read data from a database and perform machine learning, so have high CPU use.
The R analytics are accessed through HTTP using endpoints set up by the R-plumber REST library, all hosted in a docker container on an Azure Linux App Service.... |
I've to implement some Backend Webservices, which provide a given, final JSON structure, which is allready in use on the FrontEnd side.
This structure doesn't match the database structure, so I have to convert the database entities to the needed serialization format.
It's a service on demand, that means the backend ser... |
I have a range of different animals in my zoo such as turtles, birds etc. As they all share a common trait such as either swimming, flying etc., I thought a strategy pattern would be appropriate to model them. The thing is though that I want to call a method in the composition from the compositor. See this MWE:
Animal.... |
I'm using flatbuffers for the first time. I've generated my java classes and have tested out serializing / deserializaing a message. Now I'm thinking about how to integrate these in to my JavaFx and Android applications.
Is it valid to pass a DataMessage or a MessageA directly in to bussiness logic classes or my UI? It... |
Sorry if this is a silly question, but I am not a native english speaker and a lot of times it is difficult for me to come up with meaningful variable names.
I have a table of users in our app. All of the following columns in the table are unique:
userid (numeric)
username (must contain at least one letter)
email
I w... |
We've recently started working on an API, and I'm running into a philosophy issue. This is only my second API I've worked on, but the standard I've seen for retrieving a single model is always a GET, and the endpoint is something like api/model/1, with 1 being the ID. However, my coworker is REALLY adamant about not pa... |
I'm currently writing a paper on my react frontend and I'm struggeling to find the right verb for the interaction between child-components and components in react.
For example:
"I have a table component which ?inherits? from the child components tableHeader and tableBody."
Is the use of inheritance correct here or how... |
Speaking about DDD, in which layer should a hypothetical MailerInterface be?
I know the implementation (or adapters) for each specific mail sender package should be in the infrastructure, but these implementations will implement an Interface.
This interface should be inside the domain or application layer?
|
I am working on a project to save external credit bureau reports in database. These reports are typically big and could go from 0.5MB to 5.0 MB. Number of files will grow exponentially over the time based on incoming traffic. Estimated file size would be 1TB in 3 months. Files will be read immediately and multiple time... |
Wanting to expand my programming horizons I recently started building a website.
I have started to build up my website and it is heavily focused around an external api.
The reason for using this api is that I could not get all the information it provides by huge huge margin.
I am making a video games site where users c... |
I have a bunch of small utility PHP functions that I made to solve different scripting problems. Functions like UUID() and trackUserActivity() etc. There are tons of these functions and increasing every day.
Say I have around 50 different small functions and around 100 different scripts for my application. Sometimes th... |
I am facing a dilemma with designing an api gateway. Currently, I am using the pipeline pattern, with different stages being the requests made to various services, (http, sockets, amqp, ...).
I have a base class, RequestStage, with some subclasses, HttpStage, SocketStage, AmqpStage. These classes extend RequestStage be... |
Firstly I am new to Software Engineering and my last question was closed. I am doing my best to ask relevant questions and improve. If you are going to down vote my question I'd really appreciate if you explain why you are downvoting me so I can learn.
Background:
I am developing a new Python API that deals with vehic... |
This may seem like an odd question but it's something I've yet to find a "proper" answer for. I've tried googling but I don't get anything useful (maybe I'm looking for the wrong terms).
I'm attending a couple of classes where I'm building Web APIs, one using Spring Boot and the other using NodeJS (with Express), and w... |
It seems that I need to have a MergeNode with incoming ControlFlow and ObjectFlow while according to paragraph 15.3.3.5 Merge Nodes of OMG® Unified Modeling Language® (OMG UML®) Version 2.5.1
If the outgoing edge of a MergeNode is
a ControlFlow, then all incoming edges must be ControlFlows, and, if the outgoing edg... |
I have 2 microservices.
Users Service - REST API which provides user detail
Statistics Service - REST API to provide different stats
My goal is to provide a single interface to a Mobile App which will be used by our users to see the stats. The stats should be shown to user according to his roles.
I think API Gateway ... |
I'm doing a Fruit Ninja clone in java (language not really relevant). It's not completed yet, but here is the point I'm in now:
Currently I've:
Difficulty interface, where several classes will implement it to decide the fruit moving speed based on the game time, and also determine how many bombs will be created compar... |
I am currently adding functionalities to Order Entity and have a column storing the state of the current order in Status.
Order goes through the following workflow with minor deviations I have not captured for keeping this simple:
Placed -> Payment -> Inventory procurement -> Shipped -> Delivered OR Cancelled
So my ord... |
Since Neo4J is implemented in Java and therefore uses the JVM, wouldn't an equivalent graph database that is written in C++ / Rust or GoLang be more performant?
Why would one decide to build a DBMS in a medium "high level" language like Java?
|
In C#/.NET, I have a class that I want to provide extension points for. I can do this either using inheritance:
public class Animal {
public virtual void Speak() { }
}
public class Dog : Animal {
public overrides void Speak() => Console.WriteLine("Woof");
}
var dog = new Dog();
dog.Speak();
Or using passed-in ... |
I have million of objects, each with an array smaller than 10 elements, which are the names of other objects in the dataset.
Basically
{
a:[b,c,d,],
b:[c,d,e],
c:[a,e,f],
...
e:[a,b,c]
}
will result in
(a,c),(b,e),(c,e)
As for each of this tuples element A points to element B and vice-versa,
e.g b has e in his l... |
Looking at the web development landscape I see that there is two approach to making websites.
If the site is simple you're better of using HTML, CSS and JS.
If the site is complexe it's worth it to use a frontend framework.
I have trouble understanding what a simple website means in this context. Is an e-commerce web... |
I have a problem placing and shaping the flowing method in my program:
private void PrintWarning(params string[] messages)
{
if (!_suppressWarnings)
{
if (_warningsAsErrors)
{
foreach (string message in messages)
{
Console.WriteLine($"Error: {message}");
... |
My client has a business which work mostly in remote areas where internet felicity is limited, We have a central database and the branches in remote areas need to connect to the central database.
We are developing a web-application(django, postgres) for the same, but it should work even if the client is offline.
We p... |
In a microservice architecture I have a BREAD (CRUD) service that has methods for interacting with database that holds some number of different entities that reference each-other. I also use a Message Broker to publish messages when a change occurs to the entities (Add, Edit, Delete methods) after the query returns suc... |
I am struggling to find some methods / concepts or even implementations of partially automated processes to split a monolith into microservices. Of cause I do not expect any solution that will make poof and the migration is done but any kind of concept or software that assists in the process would be nice.
I searched ... |
I'm working on Flutter a project. We've test cases on the server-side.
On the client-side, We have an idea to only test every acceptance criteria on the E2E level?
The question is
What're the problems we will encounter after it's getting bigger?
|
The docs explicitly state this:
Avoid using refs for anything that can be done declaratively.
For example, instead of exposing open() and close() methods on a Dialog component, pass an isOpen prop to it.
I get the idea and largely agree for reusable components - not having state (which would need to be manipulated im... |
I often see the terms "early binding" and "static dispatch" used interchangeably, and I also often see the terms "late binding" and "dynamic dispatch" used interchangeably.
Do these terms mean the same thing?
|
I've been researching Event Sourcing, and it seems there are two philosophies hidden within what I've read. The core difference is whether actors in the system are proactive, making changes first and publishing events based on what they have done, or reactive, consuming events and updating data based on those events.
H... |
I have this question for a long time that is it possible for someone with no prior embedded systems programming experience to write unit tests? I have good knowledge of other languages like JAVA, Python, C# and a few others. I can write unit tests in the mentioned languages. But I have never done any project in C or C+... |
Let's suppose that I have 5 microservices, let's also name them ServiceA, ServiceB, ServiceC, ServiceD, ServiceE.
To perform an operation X communication needs to happen between these services.
And I have an API in ServiceD which is a pretty expensive API (in terms of execution time and response size) and this API gets... |
I'd like to implement a fast, smooth search. Searched items are not that many: ~100 max. Each item holds the amount of data a facebook event would hold. They will all show up on initial load (maybe an infite scroll). Data won't change frequently. No more than 100 concurrent users.
What's the best caching strategy for s... |
I am writing a program in Kotlin which parses some input data and writes it to a MySQL database (through JDBC).
The database includes tables such as users and each table has a corresponding data class representing the entity:
data class User(val id: Int, val surname: String, val forename: String, ...)
The users table ... |
I am creating a database that will keep track of my company's clients, and an app that will allow users inside the company to read/update/etc. the database. I'm using code-first EF Core to manage the database. The app is a C# .NET Blazor Server website, and the database is MySQL.
I initially decided to use a RESTful we... |
Background
I'm building a Private Chef booking service where you can book a Chef to cook you a custom Menu. I'm having trouble creating a SQL db schema that accurately represents the domain while maintaining data integrity.
Requirements
Customers create a Booking by selecting a Chef and a Menu and choose the MenuItem... |
Many resources regarding the UI always mention that the evaluation of user interface is highly subjective process. So my question is what is the exact meaning of "subjective process" in the context of UI and why the evaluation process is subjective process ?
|
I'm writing a basic password cracker in C as an introduction to multithreaded programming. I've implemented this already using a 'parallelization' approach that spins up a set number of threads and divides the given wordlist among them, and every thread is more or less self contained to each other. Once one finds a pas... |
I'm learning about the Layered Architecture Pattern for Software Development but I'm confused on how objects are sent 'up' the layers. In general, I know that there are about 4 main layers: ui layer, use case layer, domain layer, data access layer.
So now, let's say I am developing a use case to display all todo items... |
I'm trying implement in JavaScript/Node.js a data upload functionality. I want to be able to switch between different storage providers, e.g. AWS, GCP, Azure, with no code change, for instance, via config-file and at the same time to avoid chains of if-else/switch-case to be able to choose an optimal API/service provid... |
I know how Polymorphism works, but I am trying to understand in what cases is Polymorphism useful.
Now All the examples that I have found about Polymorphism are one of the following (the below code is in C++):
Either we have an array of type Base* that holds pointers to objects derived from the Base class, and then we... |
The main reason, to my understanding, that Flash is being phased out is that it is fundamentally insecure (i.e. it isn't just tons of individual issues; it's insecure on a 'core' level). I severely doubt that anyone would knowingly build something so insecure (so they wouldn't just accept massive security issues even i... |
Example scenario,
API endpoint for a Product with Product information as JSON data and there can be 0 to n number of binary Images.
Currently we upload as Binary file, with both Image and JSON data through /v1/products POST method.
Is this right way? or what are other approaches I can try out, to make a more simple Res... |
I am reading the ISO 25023, and I am not sure if I understand the concept of Functional Completeness correctly, but I think it is useless in comparison to Functional Correctness.
Functional Completeness measures what proportion of the specified functions has been implemented. A missing function is detected when the sy... |
So I have a website which does a bunch of different stuff, more importantly, it allows the user to upload videos.
Now unfortunately videos are a bit annoying as they need a poster img to display correctly on mobile (I'm looking at you Safari...), so anyways, I made a nice function that uses Moviepy to extract the firs... |
Lets say you have 2 docker stacks: stack-A.yml defines serviceA and stack-B.yml defines serviceB; you also have an archive of common data that will be mounted by services.
How could I verify that APIs exposed by a given version of serviceA is compliant with what a given version of serviceB needs?
How could I verify tha... |
The automated tests of an API should be stable and simple.
When writing automated tests for an API, we often have to check that the data created with a program implementing this API is persistent. If the persistence layer is checked directly (for example: a database), then the test is tied to the usage of this persiste... |
I could not find a good book for learning JavaScript. I Googled but most books seem to assume that you have some programming experience and don’t teach from the ground up. They assume you should know how this does this and how to make certain things happen right off the bat. I have no programming experience except know... |
I work for the in-house IT department of one of the largest companies in my country.
The infrastructure and software systems are heavily based on Oracle Database.
Most core business processes and business logic is built using SQL and PL/SQL batch jobs, importing data into the database, transforming, consolidating, comm... |
I have a process that I have been able to drawn somehow with a flowchart.
This process involves several classes, loops and several threads of execution.
However I am unsure which (if any) UML diagram could be adequate to represent it.
I thought first Sequence Diagrams since it includes loops and can represent-I thin... |
I come across the need to do a lot of one time scripts (related to API evaluations, data extraction, experiments etc.) that have the potential only to be used very rarely in the future. These could be one function python scripts, jupyter notebooks etc. Although they are rarely used, they are useful if the need to use t... |
Let's assume that you are trying to refactor a legacy code to make it easier to understand and more testable, how can you do that?
In the book "Working with Legacy Code", a characterization/regression test was recommended. First, you start with a test that invokes the part of the code you want to refactor (e.g. a big m... |
From what I have read about the domain driven design, an aspect of it is that there is a clear separation between domain objects and DTOs.
So the application level components deal with domain objects and are completely unaffected by any changes in the DTOs.
That seems clear win to me but I am wondering if it really sca... |
I have code in the following form:
public void drawObject(MyObject myObject) {
RootElement root = new RootElement();
if (myObject.hasA()) {
root.addElement(new XElement());
} else {
root.addElement(new YElement());
}
if (myObject.hasB()) {
root.addElement(new ZElement("A"));
}
if (myObject... |
When making a website for a client, how do you deal with payments (hosting, theme, plugins, software, ect) when you are setting everything up for them, though the client will be paying for the systems/software?
In the past its just been friends and family who give me a CC, though not sure my client would be ok with th... |
In Software Engineering book by Ian Sommerville 8 edition , more specifically in chapter 16 , the author has proposed the following usability attributes to evaluate UI :
I can't understand what is the meaning of Speed of operation and adaptability according to their given definitions. In more details , I can't unders... |
I am pretty much new to programming, but recently I began to learn C# intensively for Visual C# and for Unity. I have noticed that I use many scripts that have absolutely the same content in different applications.
An example of this script would be the script I use in most of my games in Unity, ObjectPooler. It has go... |
The more I read about the Single Responsibility Principle the less I see a class as an object type, but rather as a servant that does something.
For example, let us suppose we have a new requirement that we need to generate a Pdf file where we write data we get from a Bill class. I would create a class for this. Do I n... |
Suppose Person has a Car. Car is a separate resource with its own URI. For the sake of this example, assume a person can only have one car.
We want to include the Person's Car in the response when requesting a person via /person/{id}, but we don't want to include the entire Car resource with all of its properties which... |
The application user has a lot of standard functionality we see in most applications. At a high-level, this includes some form of authentication, authorization, and session management. At a low-level, we have functions like:
Checking the password strength;
Hashing the password, perhaps with a bit of salt;
Manipulating... |
In our production environment we have a large database (SQL Managed Instance), roughly around 400-500 GB. We create a copy of this database and use it to restore in our development environment to create a database (SQL Server 2019) our developers can use. We create a backup of out production database every day, however... |
My webapp is periodically collecting data samples (say of type A and B) from some web services. Its database has therefore columns for A and B. So we have values A1/B1, A2/B2 etc.
Requirements have changed and now we want to also collect C. More code and more DB columns are added, so now we collect A3/B3/C3 etc. . But ... |
In search engine indexing, a body of text is often processed before it is indexed. A common example is stemming, were words are reduced to their root form (plurals are dropped, tense is normalized). Other examples are lemmatization, soundex transformation, casing, etc.
So, this sentence...
My name is Bond, James Bond
... |
I am a senior software developer, once also worked for a big consulting house. I have been using various cloud services for many years and DevOps is already in my blood.
Recently I moved into another organization. This organization is very lovely in many ways (that's why I moved), but the IT, its tools and processes,... |
The context of this question is the early stage of introducing a VCS into an academic setting consisting of non-SW-engineers, largely unaware of modern best practices related to coding as a team. At the time of introducing the VCS, many projects already had non-negligible amounts of code (serving as the initial commits... |
I am creating a MEAN stack application.
I have noticed by chance that whenever I send the credentials of the user to the backend, I can "fish" it from the network option on the browser (F12). See image?
What is the fastest and simplest way to handle this?
What is the more well-elaborated approach?
|
If I were building an online food ordering app but I wanted to print a receipt to the kitchen, how would I do that?
There are many SaaS solutions available like Uber Eats and other apps that allow the customers to order food online but all the orders just show up on the tablet they give. What if the kitchen was huge o... |
I am creating a service to get the total yearly expenditure of a customer. The service input is the customer ID. If a customer that does not exist is received at the service, should a 404 (Not found) be thrown back to the consumer or should it be a 400 (Bad Request)?
|
A library of audio algorithms is modeled, tested and verified in Simulink (graphical block diagramming tool). It needs to go from this existing Simulink models down to a multiple embedded platforms (floating and fixed-point DSP processors: Qualcomm, Tensilica, ARM, etc).
Several workflows are considered:
1) Simulink d... |
Let me explain my thoughts about architecture of the project I'm working on.
The project code repository consist of:
Scrapy component - of course it serves to scrape data, process it and calculate relations between data. It populates MySQL database.
Django visualization component - it simply displays data stored in da... |
I am working on learning native iOS development in Swift, and I am trying to find something that is similar to what I've learned in Android development with Kotlin.
In particular I am referring to the concept of having the db as the "single source of truth", that is advertised by the Android team as one of the main poi... |
I have a tree-like structure as shown in below picture (as one small example). The tree consists of two different node types, that are:
Data Nodes: These nodes that are colored in yellow contain about ten attributes. They always appear in the leaves of the tree.
Collection Nodes: That are shown in blue. They are shari... |
I am writing an application for different geometrical types of fuel tanks.
I have a design problem that only at runtime I will receive the exact type of tank from the end user; and I don't know how to create/handle a dynamic object on the server side.
For example, a tank can have 3 geometrical types of head: conical, d... |
Given a software component diagram, a sprint could be represented as a delta of that diagram. That delta would reflect how the sprint affect the components. Each component could for example have a colour reflecting the change in state:
New component, or progress on a partially complete component: green
Component to ch... |
I'm starting a brand new project implementing microservices with domain driven design. We will have microservices written in different languages like C#, Python, and Node. I'm thinking about hosting these microservices as AWS lambda functions and using SNS and/or SQS for event pub/sub. My first attempt at hosting C#... |
There is a number of questions about the differences between UML Association, Aggregation and Composition out there and many many answers, some practical and some phylosofical. Here I'm asking we talk about practical differences!
In some answers I found:
Reference languages like Java can't really implement Composition... |
I've recently started reading about CQRS, DDD and EventSourcing. From what I've read one of the best ways to do ES is to have an event store and then a regular DB or cache for easier querying. However, something that confuses me is that in some examples I've seen both of these scenarios:
Store in event log first and t... |
That is, let's say I have a model that's used in several views. Should I create a single view model to represent it across all those views, or should I create a separate view model for each view that uses the model?
|
I've got to build some somewhat complicated WHERE clauses in SQL for a project I'm working on, and the clauses feel very hierarchical with their combination of ANDs and ORs. Instead of:
WHERE ([userId] NOT IN @excludeUsers) AND ((([firstname] LIKE @nameFilter) OR ([surname] LIKE @nameFilter)) AND (([jobTitle] LIKE @in... |
I have an Acconeer XB112 breakout board and an XM112 radar module. It all works just fine per the Acconeer documentation and tutorials.
Now I want to modify some of the code to output to a GPIO. My problem is that there are six different header options: two micro USB (J1 & J2), two 2x5 headers (J5 & J6), a 2x30 boar... |
Suppose that I have a Value Object representing an Image URL of a Cake.
To check that it really is a cake, I make an asynchronous API call to a server that checks whether the image really represents a cake.
Would it be ok to put this kind of validation inside the constructor of the Value Object? After all, I can't iden... |
This is for C#.
Ok so I'm coding a very basic money-managing program. You have an account with money in it and you deposit funds into it or you withdraw funds from it.
Obviously you don't want to accidentally perform the same transaction twice, so I'm trying to throw an InvalidOperationException when a transaction has ... |
I am trying to understand processes and their use in software engineering.
Not processes in general but rather creating a process from within a program.
It seems a really powerfull tool and i have a feeling that it is used in some very important areas of software engineering.
Why would someone create a child process?
W... |
I'm currently writing unit tests for ASP.NET Core Controllers. Some controllers inject UserManager<T> which seems to be a really hard type to mock. After some attempts to mock or even fake it, I eventually had the idea to create a facade to wrap the UserManager<T> and inject the facade interface into the controllers in... |
I have implemented pagination using SQL and stored that result of search into temporary table.
Temporary table is named after unique tab id.
So that other tab can have seperate result sets.
That table can be deleted using unload event of browser.
Now issue I am getting is, sometimes browser crash or system restart, unl... |
I have a class which has one method that is called from another class. This method internally calls several other methods to do its work. Those other methods are all public and can be called by the other class but I don't use them that way because I'm trying to follow the "Tell-Don't-Ask" principle. All these methods r... |
I have this class diagram exercise in UML. The main problem was the permissions are the works, which I did not know very well how to model it. The specification says:
Users can publish their work on a website for external users. In this
process the work will be equipped with a Web service interface.
The environment ... |
The question/title might be ambiguous, so please feel free to improve (or even migrate if necessary) it.
My primary concern is what are the innovations of relational model/theory/databases? (In particular, so groundbreaking that it deserves a Turing Award?)
It feels to me that regardless of the mathematically notation ... |
Suppose I'm in some function of class A, in this function I define an object of class B, say b, and call some function using b.func() which updates some values and arrays, say x and A. Then, I create an object of another class C, say c, and call one of its function using c.func(). This function is supposed to use x and... |
There is a number of books written about OOAD (object-oriented analysis and design). A few of them can probably be considered good books, written by people with a lot of experience in the field.
One could say there is reasonable agreement on what OOAD is, to the point he/she could read a few books and not find (very) d... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.