instruction stringlengths 34 36.1k |
|---|
I've been having the hardest time understanding the difference between AWS Kinesis and Logstash.
From the description of Logstash it says
Logstash is a light-weight, open-source, server-side data processing pipeline that allows you to collect data from a variety of sources, transform it on the fly, and send it to your... |
As far as I know, each webpage is created in a two stage process, initiated by a webserver request and ended in a webserver response:
Parsing: markup (Say HTML) is executed as is, or created by executing a "server-side" or "backend" programming language such as PHP.
Rendering: Styles (say CSS), are added upon the pars... |
I'm learning angular and have been reading about various backend solutions like direct db access, REST, and graphql. One thing I haven't seen addressed anywhere yet is how do you protect privileged information from being leaked to an unprivileged user.
Say I have a list of users with the properties id, displayname, log... |
I want to develop a GUI in python for my company in order to sell it to the customer.
Being fresh from the university where I used pyQt, I promptly started programming using that library, just to discover the fact that it is under GNU GPL, making it unusable for my purpose.
Searching in the web for an alternative, I en... |
I have the following if statement and I feel it could be made simpler to read by breaking the terms up into their own named variables.
if os.path.isfile(os.path.join(dirname, 'file.json')) \
or (os.path.isdir(os.path.join(dirname, 'folder'))
and os.listdir(os.path.join(dirname, 'folder')) != []):
So it would look some... |
I work on refactoring an Java application based on a CAST audit. One of the criterion says that
To respect OO encapsulation concepts, private fields should always be
accessed through accessors
So far, so good. However, the audit highlights all private fields in the class that have no mutators, regardless how they a... |
Usability requirements are focused on User interfaces, how easy they are to learn, how quick access to some frequent menu options are provided, etc. Suppose we have the following requirement:
The system should show menu options after user login within 1 second.
What type of Non Functional Requirements is this? A perf... |
I'm defining a class structure for persisting to our cassandra database, and I'm unsure about using a combination of an abstract class and an interface. I have two concrete classes, one for persisting reports and the other for persisting configurations. They both have separate entity classes defined else where that the... |
At the risk of having this question closed as too broad, would like to know if a microservices-based application/architecture could be delivered with a traditional waterfall development methodology/teams where development team builds, test and hands over the code to operations?
Vice versa, a devops setup/team could als... |
We have been using Scrum as our project management platform for a while, now we are moving toward Lean UX and hypothesis driven development practices. We are using Poker planning to determine the effort needed to deliver the outcome.
We have decided to use Barry O'reily's proposition of including both user stories and ... |
My team are looking to push our shared code to a private NuGet feed in Azure Artifacts. At present the plan is to set the package version in our csproj files and set up CI on the master branch of each library's repo.
For production this flow is fine, but we'd also like to be able to iterate on new library versions and ... |
I have trouble with some of this jargon so I apologize if I misuse some of it.
In my past experiences Story Estimation (planning poker estimating how difficult/complex certain tasks will be with fibonacci numbers) happens before Task Breakdown (figuring out the implementation details of how the team thinks we should im... |
Say I have the following class, which maps to a database table:
public class Person
{
public Guid Id {get; set; }
public string Name {get; set; }
public DateTime DateOfBirth {get; set; }
public string ImageURL {get; set; }
public string ImageBytes {get; set; }
//Methods go here
}
Not... |
I get it for feature branches:
A feature branch is created from develop.
One single PR is then created, going to develop.
If there are conflicts, fix them in the feature branch.
Quite straightforward.
Concerning "multi-destination branches" though, like release or hotfix branches, how are conflicts supposed to be res... |
I'm writing some web socket (wamp) connectivity tests. basically one end pings, and the other end records it.
let's say I have the latency for each ping. So I'm tracking the min and the max latency figures.
the test however can run for a long duration of time, so a single min/max value won't tell me much about the na... |
I have a class that looks like this:
class MyClass
# takes an array of actions
def initialize(actions)
@actions = actions
end
def act
@actions.each {|a| a.do}
end
end
class Action
attr_reader :type
def initialize(func, type)
@type = type
@func = func
end
def do
@func.call
... |
When you have an endpoint that can take a set of valid parameters, how do you do validation on a non-empty set of elements?
Say you have a request /api/endpoint?my_list=1,2,3 where 1, 2, 3 are the only valid values for my_list. What do you do when the following request is made: /api/endpoint?my_list=1,3,7?
Should you f... |
I am currently implementing the transformer architecture for sequence to sequence problems. Key part of the model is the attention mechanism, which is basically a matrix multiplication, followed by a masking operation and a softmax function. My initial thought was to wrap this 3 steps in a function, that looks like thi... |
I am considering what it takes to implement an email server. Google Cloud basically doesn't allow you to send emails at scale (they block the email ports pretty much), though it sounds like you could receive email. AWS on the other hand allows you to send emails for about $1 per 10k. This sums up some other SMTP servic... |
We have 2 to 3 dozen microservices that serve our customers.
These services are deployed in a Kubernetes cluster, and they're only accessible to the outside world through 3 or 4 API gateways.
We found that sometimes the same data is needed by two or more microservices, so we evaluated a couple of strategies to solve th... |
We are starting to integrate our SQL Server workflow with Git, by which I mean generating scripts for all objects and storing them in a Git repository so you can pull, edit, commit, push and apply, rather than just modify objects directly.
One problem we have is that certain objects (in this case, stored procedures) ar... |
I am building a service responsible for sending email/sms communications. The service receives a request that contains information necessary to build an email/sms template and the recipient information of where to send it.
Example CURL request:
curl -X POST \
http://service.local/api/finance/payment-reminder \
... |
I'm trying to apply Clean Architecture to a simple ASP.NET MVC Core app by following Microsoft's ASP.NET architecture guidelines and their eShopOnWeb sample project.
In the standard Clean Architecture approach, business logic is put into "Use Case" classes in the core project. In the Microsoft's example, there are no U... |
I'm designing an app which use a Knowledge Base filled with rules.
Depending on the context some rules will be applicable and others will not.
I need to get first the list of the applicable rules and optionally later the list of non applicable rules.
The system doesn't need both at the same time and I want to avoid ke... |
As part of my bachelors thesis, I'm trying to develop something akin to a painting program. That means, I have a toolset, be it selection, drawing, highlighting, etc.
I'll have a canvas that displays my current model, based on a set of rectangles/spheres/polygons I have already drawn and created.
Some tools require th... |
I am planning to start a new asp.net core MVC web application. One of the features we are having is that anonymous users can register inside our web application by entering their email addresses. then our system will send them a confirmation email, to activate their accounts.
Now by default the system will show error ... |
I frequently encounter situation where I have very basic tests, and if those fail, it doesn't make sense to run many other tests.
Therefore I want to declare a tree of dependencies between my tests, where tests are only run if all pre-conditions tests are passing.
two big advantages I can think of are:
During debuggi... |
I've heard that companies store their private keys offline "in a safe that will never be opened" and stuff like that (the context for this is a console developer like Microsoft keeping the Xbox private keys offline in a safe).
How would they still sign code with their private keys if they're fully locked away? Does som... |
I have an application where the requirements are to show a list of (just for example) car manufacturers. When you click on one of the manufacturers, a list of car models show up. You can then click on the car model to show other data related to the model.
My problem is that one of the manufacturers is to be treated as ... |
I've got a requirement to create a data structure that allows for users to view revision history. Not just the history of a table, but the history of the entire structure at a given point in time.
A pure database solution would involve massive recreation of records. For example - say I'm building a check sheet. Sheets ... |
The backstory is long but the general idea is that I'm beginning an iterative refactoring process to replace a poorly designed data access layer with a new one under constraints from above. We can't fix everything at once but need to slowly phase in the new changes.
The old DAL contains several classes each containing ... |
I am self-learning robotics, C++ and good object oriented design. I have asked various questions over the past couple of weeks: 1 and 2 that have lead to the following design.
The design goal is for portability. It is a Go-To-Goal Differential Drive Robot with PID to regulate the behavior.
I am hoping my design is ro... |
I wonder how should we manage the commits we make AFTER a version is released, according to SEMVER.
For example, I just released 1.0.1, now I have 2 choices:
Immediately change version to 1.0.2 and start working on this version. Once the work is finished, I'll just tag the last commit to be officially the version 1.0.... |
I'm designing an Event Store on AWS and I chose DynamoDB because it seemed the best option. My design seems to be quite good, but I'm facing some issues that I can't solve.
The Design
Events
Events are uniquely identified by the pair (StreamId, EventId):
StreamId: it's the same of the aggregateId, which means one Even... |
I have a question about using databases in my application. I have the User table which stores passwords for my users. I know how to handle user authentication, but how to handle the password for the database itself? I searched online, and all articles mention only storing user passwords, not the database password itsel... |
I'm building a simple app that is a client web application and an API behind it. I'm combining two third-party APIs, one needs to be called from my client application (for ease of authentication) and one needs to be called by the server.
The data I receive from my first API is a list of strings - it will be between 0 a... |
My team is debating how to transition a portion of our Rails application to allow "drafts". For simplicities sake, we can imagine a Post object where we want to allow a kind of draft mode.
Our real model contains, say, roughly 20 fields and 5 has_many relationships. There are some reasonably complex business rules (i.... |
I am doing research for developing a software platform and I have created some class diagrams for the platform. My supervisor adviced me to use UML profiles as well to describe the platform in a more detailed way. However, after googling i still do not really get the difference between the Class diagrams and UML profil... |
I need to determine the average miles per hour for a trip and an object containing a list of trips. I'm thinking of two approaches. First approach, have a MphCalculator class that I would inject into each class such as
public class MphCalculator {
public BigDecimal calculateMph(int durationSeconds, BigDecimal mile... |
I am currently a Junior back-end developer, I write Java and Scala and I love it.
I really want to get into web development, but it seems like every time I look up some guide, it is really just a guide for a specific framework. I totally understand that the way the web has evolved over the years has forced developers i... |
Imagine an application that consumes an external data stream and creates objects of this type:
@Entity
public class Event {
@OneToOne(cascade = CascadeType.ALL)
private EventInfo info;
@OneToOne(cascade = CascadeType.ALL)
private EventSource source;
...
}
Later in the DAO:
session.save(event);
In the da... |
When using Terraform instead of Cloudformation on AWS, I usually get immediate feedback on the terminal, which makes the work very productive.
With CloudFormation, however, I tend to edit the file in my computer, upload it to Cloudformation console on AWS, and keep watching until I get an error/success. Even using CI/C... |
I'm a student, and I don't have much expirience with the building process.
In the last few days i've read something about CMake and others build system generators, but other than that I don't know anything about this world.
I realized that i should learn something about this topic because I wanted to use a third party ... |
I'm working on an asp.net core application, using Identity as authentication/authorization management. Depending on the role the user can do "some thing", this is the normal way of authorization. But when the user is an entity related to other entity the business logic get ambiguous. This is a pseudo code example:
... |
I have a project to build, which has the following requirements:
topup a wallet by paying money in exchange for credit; this has also
the constraint of needing an approval from the finance team, if the
payment used is bank transfer. The finance team will then (in the
future) issue invoices.
transfer credit from one wa... |
I'm designing a game engine that is supposed to be overridden. I have, for example, a class called Character. Should I prefix this with BaseCharacter or should I expect that whoever uses the framework prefixes their classes with GameNameCharacter or CharacterGameName?
What would be most convenient to you?
|
What are the benefits of aggregating a structure and functions associated with it in one object? What are the benefits of explicitly decalring a class. If i write procedural code i already know that some functions are working with specific structures. I just work with it and that's all.
For me the only benefit of OOP s... |
Assume you have a library in which every function is public. Sooner or later developers who use your library will come up with a stable pattern of usage. In that terms external information of how developers are using you library already defines the public interface.
If your function is dealing with only inner context ... |
I'm playing around with DDD in a node.js project and struggling with updates to child entities from the aggregate root.
For the sake of example, let's say I have two domain objects where Event is my aggregate root:
class Event {
_id
_date
_comments = []
}
class Comment {
_id
_name
_content
}
I understand ... |
Right now we have a set of micro services with a client-facing gateway responsible for authentication and routing. MySQL database and RabbitMQ for the message queue. Internal services may queue up requests as necessary but the gateway never does. What I’m finding is that the time for the gateway to respond is too long.... |
I am wondering where does the fxml controller belong in the Entity-Control-Boundary model?
When designing a JavaFX application with the help of Scene Builder, Scene Builder generates an fxml file which represents the GUI. In addition, a controller is needed to make user interaction possible. An example would be: LoginS... |
The product is water purifier, and we are selling packages included support for changing filters.
Serial is a unique number identifying a single produced item and it's only for water purifiers not packages.
My current solution is like this:
order_product table:
id | order_id | product_id | quantity
1 11 2 ... |
My organization is developing a Web API server. We will also develop the only clients authorized to access the API. We will follow the usual technique of returning Bad Request (400) errors for data sent from a client to the server when the data doesn't pass validation at the server. There will be a number of valida... |
As the title says , Why are the instance variables are declared as private in immutable pattern ? I think that the keyword final is enough to avoid any changes that can be done to the value of the instance variable. So why do we also use private keyword with it ?
|
I understand that directly instantiating dependencies inside a class is considered bad practise. This makes sense as doing so tightly couples everything which in turn makes testing very hard.
Almost all the frameworks I've come across seem to favour dependency injection with a container over using service locators. Bot... |
Assume you are tasked with implementing a "cronjob as a service" where you are supposed to be able to run potentially millions of periodical tasks (to simplify, making HTTP requests to URLs) with different schedules.
For example, these tasks could be:
every minute (* * * * *), query http://url1
on Mondays 2:30am (30 ... |
I've been working on the architecture of my Apps for a while.
In the past I've used a SQLite database which I opened in the AppDelegate (Oh dear), and then created a global variable (really!) to store the questions.
I'm going to re-write this.
My thinking around the structure of this is to create separate modules for... |
I am making a microservice based architecture and I'm actively seeking antipatterns and trying to avoid them. In multiple scenarios, I have a database commit followed by a message that is produced to Kafka (but it could be any message broker, really).
If the db commit fails, an error is returned as one would expect. If... |
I am writing a class FileFoodReader (in java if that matters) that reads input from a file containing information about foods and their nutritional values. The file has to fulfill some requirements about how it is formatted. For example there must be a column containing food names and a column for each nutritional valu... |
We develop two projects (and more in future) with JS, Vue.js, using npm, and we store each project in its own git-repository.
We want to place common components (buttons, page-parts and page templates) in a separate git-repo.
How to use the files from this repository in our projects? Create a subdirectory and download ... |
I'm involved in a microservices based application. I'm trying to apply the BDD process for this. I need a recommendation how to apply this process correctly given this type of architecture. It is recommended to avoid or keep at minimal level the end-to-end tests that span across many microservices. I agree with that.
F... |
I have data structure queue with 2 operations:
typedef struct queue queue
void enqueue(queue *q, void *elem);
void *dequeue(queue *q);
queue *read_from_file(const char *path);
I want to write assert for the queue like:
bool assert_queue_equals(queue *q, ...){
//dequeue and compare till the end of varargs
}
The... |
I'm actually working on the web application which was made using technologies such as asp.net core, c#, angular, ef core. For the version control and CD we use Azure DevOps. As a team we try to follow Agile rules. When the developer starts the ticket, he creates a new branch forked from master and when he finishes he m... |
I have studied complexity of algorithms that how long an algorithm will take to execute completely, then why it is said that certain programming languages are faster than others such as C++ is faster than python.
|
I'm struggling a bit to grasp all DDD concepts and apply them to a real project.
Let's say I have the following domain concepts:
Car: a vehicle moving inside an area
Path: a journey made by a car, from A to B. Each car can have many recorded paths, but only an active one at a given moment
Position: the GPS position of... |
My team has a problem with making code review.
Everyone is constantly busy with their tasks and only few of developers do review on a daily basis. As every merge request needs 2 approvals, some of them stay in review for days if not for weeks (!), which slows down the project.
Everyone understands the importance of ... |
This is a question about SSIS package design.
We have an SSIS package built in VS 2008 that loads ~ 22 tables from as many fixed width files into a data warehouse. Each file has its own data flow task. All of the data flow tasks are inside a single control flow.
Would it be better to create a separate package for eac... |
We have a piece of code that looks something like that:
std::vector<int> computeGlobalResult()
{
auto globalResult = std::vector<int>{};
while (myCollection.size() < 100)
{
auto localResult = computeLocalResult();
globalResult.emplace(globalResult.end(), localResult.begin(), localResult.end()... |
I run into a quite common case of handling Video files with different quality of a video, when the app (on android in this case) should save and use one or another video file depending on a user choice (global app's setting). I can’t find some best practices and I think that I'm just googling it wrong. Anyway, both par... |
I have joined a team in company and this team owns few services, which are used widely by many other user facing internal/external UI apps and other internal apis.
My manager gave me rough idea that these services are responsible for, let's assume, around $1B worth of traffic, or something like, so idea was, it's supe... |
I'm currently developing an application using the Dear ImGui library: https://github.com/ocornut/imgui/. And I'm trying to figure out how exactly to access state vs domain data. I'm trying to write it in a purely functional way, using something like:
function View1(DomainModel & model) {
ImGui::Begin("View window")... |
in C#, suppose I have written this function
public void TryToTurnOn( Device d )
{
// some common logic
// some more common logic
}
I then have a class that inherit Device that is DeviceWithAButton, I can write something like this
public void TryToTurnOn( Device d )
{
// some common logic
if( d is Dev... |
I am in the process of creating an android app for our clients that would replace the paper-trail in their facilities with electronic inspections.
Although I have coding experience, I have little knowledge on how I would structure the data received through these electronic inspections.
We will set up electronic inspect... |
Note: This question might sound like a duplicate, but all other similar questions did not take into account (mobile apps, iot's, web, 3rd party usage). Specifically, in dealing with the clients together with cookies.
I'm building a REST API (laravel based) that is to be consumed by multiple clients like web, mobile app... |
I have a project where I work with generated classes for some web interfaces. Some of these classes are (almost) identical and most of the functionality I need them for only use the identical parts. Currently that functionality is implemented for each class separately. I want to refactor it in a way that I only have to... |
I currently have an AWS Codepipeline that is setup to automatically pull an Express, NodeJS API and deploy it with Lambda and API Gateway. It pulls the code from my GitHub repo production branch and deploys it. The project was created with Codestar, which creates a cloudformation stack and all the resources necessary t... |
As I fool around in Swift I have come to absolutely hate variable declarations. int c = 0 seems easier to read than var c:Int = 0 and more informative than var c = 0, and int some() is radically better than func some() -> Int.
As has been pointed out in other threads, the reason for the type at the end is that the type... |
I'm learning the MVVM pattern and something that comes up often is a duplication of data-types.
Say I have a Person datatype. Intuitively I want it to look like this:
public class Person
{
public string FirstName { get; set; }
public string LastName { get; set; }
public uint Age { get; set; }
}
But instead... |
My understanding is that trunk based development should rely on direct commits to master or short-lived feature branches that are merged with master. Incomplete work can be placed inside functions that are then toggled off with feature flags.
For short-lived feature code review: developers can work together in person ... |
Background
I'm designing a round-based game where one of the core design goals is to have a highly exchangable UI. For this, I've defined an interface which allows implementers to only focus on drawing the UI and processing user input - Everything else happens behind the interface.
The general idea is to have a control... |
What are the distinctions between physical threads and logical threads?
The clearest definition of a physical thread that I understand so far is the one here:
https://stackoverflow.com/questions/18857107/logical-thread-vs-physical-thread
"A physical thread is a thread that a processor context switches to and processes... |
My question is similar to this one, but a bit more specific to one case.
Let's say I have a payments model, and this is used by my reporting service, as well as my accounting service.
Is it inescapable that these two services are now coupled by their mutual dependency on the model?
|
I have the following setup for my application:
A User logs in and is granted a Session Token.
When making API requests to Service A the User provides the Session Token.
All requests go through an API Gateway which internally re-directs the request to an Authorization Service which authenticates the Session Token and g... |
I am practicing socket programming in C language.
I have two codes - server and client (based on TCP) on two different laptops.
The server forks a new process for every new request.
For simulating multiple simultaneous clients, I have used pthreads library in my client program.
I have a lots of files at the server, ea... |
I'm working on a project and trying to understand the differences and trade-offs between variations of trunk based development and feature branching like git flow so I can help implement an appropriate solution for the team.
Would the first diagram of GitFlow below also be a representation of Trunk Based Development? N... |
I understand there are three flavours of CQRS:
1) Separate models only i.e. a domain model and a read model.
2) separate models and repositories.
3) Separate models; repositories and physical database.
Is there ever a scenario where the controllers are separated into read controllers and write controllers? I have neve... |
I have a question about best practice and Azure Pipeline. I have a web site (ASP.NET API old version) I need to publish on 2 environments
staging
production
I think this schema is classic. At the beginning I decided to create one build in release mode and deploy it on staging first then manually on production after v... |
Suppose I have an algorithm that has N blocks of data, and an operation needs to be performed on all blocks such that it requires 2 blocks to be in memory at any given time to be done for all possible pairings of the N blocks.
When N is large such that not all the data will fit in the memory of the machine running it:
... |
Say I want to be able to create objects for a range of template parameter
template<int a> class Myclass : public MyclassSuper{...};
And I want to create objects like
Myclass<runtime_dependent_int> a(b);
Now this is not allowed because runtime_dependent_int is not known at compile time.
How can I circumvent this limit... |
Imagine that you are using a tool that automatically applies a set of refactorings of your choice. If the refactorings breaks the existing API for whatever reason (e.g. change method name, parameterise method or a refactoring that makes some structural changes) do you expect the tool to also automatically change your u... |
I'm following the code from Vue.js in Action, Chapter 3.
(much deleted for brevity...)
var webstore = new Vue({
el: '#app',
data: {
sitename: "Vue.js Pet Depot",
showProduct: true,
product: {
id: 1001,
title: "Cat Food, 25lb bag",
... deleted for brevity
},
cart: []
}
m... |
I'm working on an app that will have messages exchange and which have a database with several tables to all users data and preferences but I got thoughtful about the table of messages. I will have about 10k users that will exchange about 500k messages per month.
I have saw some questions in concern of this but are abo... |
I can't find anywhere else where I can show an OO system design and get feedback on it.
Could you identify any major issues with my design and how to fix them?
The description of the problem is as follows:
Create a class diagram of a restaurant system. There are employees and they can perform many roles, depending on... |
Say you have a Users and Orders service and they have their own database.
Since microservices need to stand on their own even if another service is unavailable, does the Orders DB need to have all the complete details of the user who ordered instead of the usual foreign key reference (e.g., user_id) ?
Example:
Users D... |
Suppose I have a house-lending service, like Airbnb. I have a House entity, which can have a name. There's also the Reservation entity, which has a start date, an end date, and a name (which isn't needed but it's to ask the question).
The business rule would be then that no two reservations can overlap. So my aggregate... |
Say I have a Student who has a ID number, a name, a profile picture, some contact details, and is enrolled in several courses.
From the perspective of a Single Page Application there are different scenarios where I might want to see different views of this student object.
For example:
An admin page might want to se... |
I am working in an event-sourcing architecture and while creating the aggregates I came to an interesting challenge, disclaimer I'm new to this.
I have a UserAggregate encapsulating the logic for commands, the user has a relationship with campaigns but not really owned by user.
Campaigns are created by an admin system,... |
I am developing a chat application as my the first project. I have never had experience of establishing a connection to the remote database server before so I don't really understand who should have access to that DB.
I have a user part (with GUI), server part deployed at the remote machine (to send messages from one u... |
I am writing my first R package, converting my existing scripts into a bona fide package. I frequently use the magrittr pipe operator %>% in my code because I find it makes code more intuitively readable and saves typing. However, in order to use this pipe in the code of an R package, I would need to force all users of... |
I 've a pair of private and public ssh keys, which I'm using in encrypting and decrypting my JWT.
So I'm creating and signing my JWT with my private key and shared the public key with the client who then use it to decode the JWT.
Now, I'll be frequently using the private key to do this, so, how/where do I store my priv... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.