instruction stringlengths 34 36.1k |
|---|
We use the git flow described here. In this way, we have 3 main branches: develop, master, release, and feature branches.
Develop is development. After development starts and features are deployed to develop, QAs merge to release from develop to test on the QA env.
Then fixes go to release, not develop. Release is the ... |
I am working on an App (VB.NET) for my company that retrieves data from a DB about our products (sensors) to make measurements and calibrations.
The DB is part of a software we use, so I have only read access and can't modify in any way it.
At the moment the solution is organized as follows:
BusinessLogic (DLL)
Entity... |
As per wiki,
A dependency is an object that can be used (as a service).
here is the OOP paradigm using C syntax that address 4 roles, shown below.
1) interface (handlers.h)
typedef struct {
int (*canHandle) (char *);
int (*drawImage)(char *);
int (*savefile)(char *);
}imageHandler;
2) Take one Depen... |
Most of the literature on agile seems to be biased towards CRUD type business applications where the user is pretty much aware of what is going on behind the scenes. (That's fine because most of the code being written probably belongs to this class.)
For this type of application the relationship between user stories (r... |
So I would like to model the class diagram for the following scenario:
the client has to manage three types of accounts(Pocket, Postbank, DKB). More types of accounts may be added later.
the client registers movements(expenses and incomes). These movements are what define the state of each account
While income are pre... |
I'm designing a infrastructure to monitor websites and applications. The idea is to build an application which checks the user website/application with a certain interval (30 sec, 1 min, 5 min, etc.). It's important that the website check is close to the given interval. The goal of the infrastructure is to have a scala... |
I use the Entity Framework. Let's say I have a realy complex linq query, that I need in multiple parts of my application, some services, some controllers.
Is there any design pattern I should follow?
First I thought, the Repository Pattern would perfectly be valid:
MyDto myRepository.GetDataFromComplexQuery();
But we ... |
So I tried to access certain website using its server IP address and usually it does not go through. Let's assume IP masquerade technique is not being used such as NAT or reverse proxy.
This makes me wonder:
Does the DNS reply to the client more information than just the IP address? such as the paths to the correct fo... |
It's a C#, ASP.NET MVC Project and here is the problem:
User can enter their email address in the reset password text field and click on the Reset Password button. Each time the user clicks on the Reset Password button a new email will be sent to that email address.
I am trying to limit the user reset password email to... |
I have a web app with an ASP.NET API back-end and React front-end. It also has a mobile app built in React Native.
Question is about date/time values. I have two options in handling time zone conversions and wanted to get some opinions on which is a better approach.
I can store user's time zone in the database and sen... |
When reading about API Gateway, one of things that come up every single time is that API Gateway is a place where you should aggregate results from multiple endpoints. That sounds really nice. However, many popular API Gateway solutions such as AWS API Gateway, Kongo, and Netflix Zuul do not support such feature. You n... |
We've stuck with designing two services. In fact, these two services have been splitted since traffic issues, so they were one before.
I mean, our platform is consumed by two sort of clients: other services and UI clients (web, desktop and mobile).
So services:
Services are using a very short number of exposed endpoin... |
I am looking at a problem where a method can fail in a predictable way. For now I think that exceptions might not be a good way to represent some of the failures (I may be wrong on that). In any case I was thinking of returning a Result type similar to the ones in ASP.NET Identity and the ones discussed in this questio... |
I have a Location Service with an endpoint that returns people near from a given user:
GET /users/near?user=7455
[
{
"userId": 1214,
"location" : [2134983, 89384]
},
//more users
]
On the other hand, I have a Visits Service that manages the visits between users:
[
{
"userVisitor" : ... |
Let's say I have a complex class, perhaps a House so I separate out its creation logic into a factory class, HouseFactory.Build()
However, these classes are for a API DLL, and we've found that many of our consumers are confused and unable to discern that they need to use the HouseFactory, so we add the following static... |
Let's assume that we want to implement a small security subsystem for a financial application that warns the users via email if a strange pattern is detected. For this example, the pattern will consist in three transactions as the ones depicted. The security subsystem can read events from the main system from a queue. ... |
I want to make a dictionary that stores some values I want to use within my code. Would it be better to use an instance variable to hold the dictionary, or an XML file to hold the dictionary, or perhaps another way of storing the dictionary? The dictionary currently has 15 elements and I am constantly extending it.
|
We are a team responsible for 3 products:
2 products are in active development of new functionality and are moving fast therefore work there could be classified as project
3rd product is alive and kicking and here work involves BAU 1 and maintenance
One of the products is new and with great promise to the business, s... |
In general, I like to favour immutability where possible and not allow objects to be created in an invalid state or get into an invalid state. Sometimes though it feels like it might go too far.
Example: I have a User domain object (JPA/Hibernate entity). I only allow the object to be constructed in a valid state, all ... |
I'm developing a web-app which I want to block ip addresses not registered in my database. This web-app should not be accessible for all users, but the users (let's say) I register manually.
The use case is like this:
I create username and password for my client.
They login(first login for the client)
I get the clien... |
I'm going to encrypt the following data (server side):
email, IP, username
{
*IP*: {
email: *email at this IP*
username: *username of email IP*
}
*IP2*: {
email: *email at this IP*
username: *username of email IP*
}
}
I want to keep user name in cookie so I don't have ... |
All the examples I've read and seen on training videos have simplistic examples. But what I don't see if how I do the "real" code after I get green. Is this the "Refactor" part?
If I have a fairly complex object with a complex method, and I write my test and the bare minimum to make it pass (after it first fails, Red... |
I am creating a class which has an instance variable that has many different implementations, but the problem is that all of the implementations have a slightly different interface.
Example:
class GameObject {
virtual Transform * getTransform() = 0;
};
class Transform {
virtual void setPosition() = 0;
virt... |
I'm currently looking into setting up a publish subscribe messaging infra structure for our microservice based platform. The new setup is meant to replace our current kafka based one, with something that's a little easier to maintain. One reason that we initially went with kafka, was the ability to have consumer groups... |
A co-worker submitted code for a PR the other day, which effectively follows this flow:
if (a)
do something_a
else if (b)
do something_b
else if (c)
do something_a
where a, b, and c are mutually exclusive conditions (in reality, they are all checking if a variable is equal to different values).
In my experience ... |
Context
I'm working on refactoring a program that saves data in a DB. This program has a Graphic Interface.
The programmer who did this program ( the one i'm working for) would like me to make this project consistent with MVP.
One of the constraints of my job is to try not change the original business code so even if t... |
Alright, let me shine some light on the ambiguous question. We have an analytics application written in Angular 2 and Scala that's used by quite a number of businesses. Some time last year there was an idea to use the apps' charts and features to display different type of data for a very limited number of customers for... |
I created am ETL that parse various files, transform file's data and then push the lines into a DB, until now I did a manual tests and check that all the values parsed correctly and all the lines (that needed) are insert into DB, of course it's become frustrating and error prone and I want to automate those tests.
I th... |
Imagine I have a class representing a percentage. This class provides self validation through exceptions by not allowing values less than 0 or greater than 100 respectively.
When following TDD the functionality of a method/class should be apparent from the test that are testing the part of the code. Should a test in th... |
So I've been programming for a few years now and recently have started using ReSharper more. One thing that ReSharper always suggests to me is to "invert 'if' statement to reduce nesting".
Let's say I have this code:
foreach (someObject in someObjectList)
{
if(someObject != null)
{
someOtherObject = ... |
I'm refactoring the directory structure of a large Python repo that has a few dozen C and C++ files littered throughout. Is there a suggested architecture for a Python package that contains C/C++ code within it? What I have at the moment for my repo foo is:
foo/
├── LICENSE
├── Makefile
├── README.md
├── docs/
├── exam... |
If usage examples are provided in XML documentation, should those examples be explicitly tested?
/// <summary>
/// Gets a collection of Foo objects.
/// </summary>
/// <param name="bar">The model database connection.</param>
/// <example>Example code for using this method.
/// <codelang = "vb">
/// Dim bar As New Ba... |
A rule of thumb with git is, don't make commits where the project doesn't compile or the tests don't pass. All the commits should build. Then, when you discover a problem that wasn't previously caught by the tests, you can use git bisect to discover where it was introduced quickly. If you are git bisecting for some par... |
For example right now we are finished with the development of our sprint 10 and want to start testing sprint testing in Stage environment.
I was told that we should first test 'Sprint 10 frontend from Stage' against 'Sprint 10 backend from stage'. (I know why we need to do this)
And then also test 'Sprint 9 frontend f... |
The title pretty much says it all.
I have a website hosted with ubuntu with mysql on it. Now I'm trying to figure out how can I use that same mysql with c# app.
I have understood that mysql blocks connections from other IP. The problem is that with c# app the connection can come from any IP Address.
In another ques... |
I am currently reading Why Functional Programming Matters by John Hughes.
In the "Gluing Functions Together" section, after having explained that (foldr f a) is a function that replaces all occurrences of Cons in a list by f, and all occurrences of Nil by a (which I understand), the author writes: "Now it’s obvious tha... |
When building software, we usually go through the requirements phase to design and all the stuff but when we start writing the actual code, how do we decide on which parts of the software will be build first . What is the first line of code to be written? I think we should start by writing tests for the functionalities... |
I'm doing an Android project for an online course. I would like to use DI in that project, so I started to use dagger2, but now I started to have typical newbie problems that are holding me back.
As the project deadline is coming, I decide to abandon dagger2 for this project, but I still like to use some sort of DI.
So... |
Problem Description: We have a big monolith app containing UI components A,B,C,D. You can think of a component as a page for now. Component A & B share a sub-component called SHARED. Now both A & B are planing to move out of the big monolith app. The challenge here is to have same look and feel for sub-component SHARED... |
You can do a lot with Excel. Even without Visual Basic Script. But the data and the logic is in one file, whereas normal programming languages usually have another file (or a database) for the data.
This feels wrong to me, but it might only be that I'm not used to it.
Is this mixture of data and logic a problem? If so,... |
I work with an older framework (15 years+) at work which is fully built on Perl. Its main tasks are calling external programs via command-line calls, parsing their output and presenting some of the parsed information alongside the general output.
Now if I would create a structure like this in something like Java, I was... |
My question is: How can I maximize encapsulation for wrapper-classes that interface with hardware.
The hardware is connected to a PC through COM-Ports or USB ports and I am either reading/writing to it directly or through an API. Either of which I want to wrap in a class.
I have been reading about software development ... |
I have a pretty badly designed system on my hands right now written in ASP.NET MVC.
It does have a lot of logic implemented inside controllers without any outside models with business logic. I would like to change it a little and write a class that would be able to export some tables from views to Excel. Most of the vi... |
I'm developing a google maps application with 50 locations/markers and expecting it to reach about 1000 in a month, each location has a separate database record with properties:
Name, Description, Latitude, Longitude, Address (Country, City, Street,..).
To avoid problems when scaling the application I have 2 concern... |
When we create a Java class for example B that inherits from another class e.g. A, we say that our subclass (B) extends the super class (A). What is this act called in programming. Simply put, for example, when a teacher wants to show this to their student, how should they say this? For example, can they say "Well, now... |
I want to get your clarifications about some points:
Should data modeling (e.g ERD) be ignored at the beginning of a project and then be done later after the project is complete, especially if the project developers don't have all the details about the database at the beginning of the project?
In Agile methodology, wh... |
I have a domain interface ITransformation with several implementing classes such as RemoveRowsTransformation and AddColumnTransformation. The inheritance tree models the command pattern. The ITransformation interface defines an Execute(table). Each implementing class contains different properties it needs to implement ... |
I have a directory which has approx. 100k JSON files.
I want to retrieve a list of file names, where the file satisfies a set of conditions, with a filter condition in same format as we can pass the filter object in a MongoDB find query.
Does the native file system itself have some sort of logic to maintain indexing as... |
I've come across something that I find decently frustrating while adding new functionality to our large existing code base.
Preface
We have a variety of classes (ItemA, ItemB, ItemC...) that inherit from a base class (TheBaseClass). We'll say there are around 10 Item classes. We hold a collection of mixed Item insta... |
My system is importing data from a number of external sources on a nightly basis into staging tables in my local DB. The process backs up the relevant table (by copying all data to a replica table with a special name to indicate it's a backup table), clears the table, then imports data from the sources. If the import j... |
I have an array of records for bids (sample below in JSON). I would like to store this data in a relational database (Postegresql), however, the supplier data is not given with IDs, and there will be some entries that need to be deduplicated. For instance, in the example below the "John Smith and Associates" is liste... |
We have a working proof of concept that implements the sunny day scenarios, but we need to start handling the exception paths. We are contractors and need to put together detailed estimates to discuss this next phase with the client before they renew the contract.
Details
We have spent 10-20 developer months implement... |
I'm looking at designing a multi-tenant application (well I believe it is multi-tenant). We have a single page application, an API and common database.
We have groups of users, each with their own slightly different requirements. A user cannot be in more than one group at the moment.
The key features we have are:
Sear... |
I have a control system and I'm doing a triplet cascaded controllers, I have designed an interface like that
IController
{
void Run();
IController *pFirstController;
IController *pSecondController;
}
My question is for design of triplet cascaded controller, what's the best way in terms of storing a pointer to a third ... |
I'm getting my head around DDD and how to build up an C# Project structure for an .Net Core WebApp.
I searched quite a bit around the web, for example How to structure a Domain Driven Design in an Onion Architecture?, https://github.com/zkavtaskin/Domain-Driven-Design-Example and several Pluralsight courses.
What bogs... |
OK .. after all the discussion I'm changing my question slightly to better reflect a concrete example that I am dealing with.
I have two classes ModelOne and ModelTwo, These classes perform similar type of functionality but are unrelated to each other. However I have a third class CommonFunc that contains some pub... |
Just confirming: The person that acts as a Software Architect should think in non-functional requirements (performance, scalability) in the first days of the project too. Doesn't it? I think that Software Architecture is like building architecture: we can't change the building structure in the middle or in the end of t... |
I'm having trouble figuring how I would test a library that intended to be used for communicating with another web service. For example, I have a Messenger class that initializes a connection and requires a configuration and a remote address to run. How would I go about testing something like this?
import { MessengerCo... |
I often read that each unit tests should test one logical 'thing'.
What do I do when the return value of a function is a dictionary?
Usually I equality check the entire dictionary against an expected result, but this leads to testing for results that perhaps aren't related to one specific test.
Should I be testing ea... |
This question is important for me in growing in my technical abilities. I find I swing from end-to-end, like a pendulum, in writing code that is simultaneously DRY yet readable & efficient. And I'm constantly doing this... which leads to too many re-factors and never a good, satisfied resolution.
The real example is an... |
I have millions of documents(close to 100 million), each document has fields such as skills, hobbies, certification and education. I want to find similarity between each document along with a score.
Below is an example of data.
skills hobbies certification education
Java fishing PMP MS... |
Currently working on a project and facing a structure problem.
The app I'm developing communicate with hardware my company is building. We want to provide access to third party developer to our hardware but we want to keep data usage by our own (how many time the hardware is turn off/on, how many times the hardware is ... |
I've an entity class that the user will construct the object using the setters. This object when passed to another layer, that layer will call the constructChangeDataMap() method to identify the variables that must be updated in another framework.
Class Test {
private int a;
private int b;
public int getA() {... |
I've recently come across an EF6 application where the logic is driven heavily by the use of IDs, something I hadn't seen before.
Once an entity is loaded by EF at the DAL, it is mapped to another near-identical POCO object which sits in the Business Logic layer.
Whenever entities are worked with in the Business Logic,... |
I am working on a component for an enterprise message queue that consumes a message from a queue and sends it as a text message. The message is picked up by my consumer in JSON format (I do not have the ability to modify how the message is received).
{
"id":"19ADFASDFGG456SDGE",
"body":"Hello World!",
"to":... |
I spend most of my time analysing data and developing machine learning algorithms with data. As a result, I spend most of my time coding but I never have fixed specifications. Rather, I start with a question I want to answer which leads me to the next question, and so on.
For code that won't change, I generally start ... |
I have a statement. I know the ups and downs of both Composition and Inheritance, but I am unable to realize that what would be the best option the given scenario.
SCENARIO:
A Software company is developing a website for a university using a multiple inheritance between classes. The classes include Person, Teacher, Stu... |
So I came across an old blog post from Robert Martin (Uncle Bob) that talks about how the Structured Programming discipline convinced programmers to take the GOTO statement out of their code, even when its only implicit like in this example that he gave:
if (a>10)
b++;
else
b--;
He said that was bad practice becau... |
I am writing some user documentation where I need to depict a Microsoft Server Express installed on a computer. (Note: in my user documentation, the idea is that Microsoft Server Express is installed on a computer that is used for typical end-user activities, such as word processing; it is not installed on a computer t... |
I'm interested in developing single-paged application and there are few question I need to get clarified before moving on. One of them is customizable theming implementations. As for traditional web applications, we could easily customize a page but since SPA is a bit more complex than that, what would be the best appr... |
This is specifically about when to develop and implement code for authentication and authorization. I do not mean things the developer should be aware of such as exploits or using Prepared Statements for SQL Injection, and so on. These should be axiomatic for the developer.
What I mean is when in your development cyc... |
I am writing an API, in that API I sometimes need to make a call to another, remote API. This remote API needs an authorization token, which it gives if you call an appropriate method (for example, /api/GetAuthToken?user=user&pass=pass, where user and pass are hardcoded or passed to my API via settings file). Then you ... |
When applying DDD principles in Ruby, I feel that Active Record pattern ends up polluting the domain model, while I'm not sure how to implement JSON deserialization without breaking encapsulation.
The Data Mapper pattern could be an alternative, but I haven't found any satisfactory Ruby implementation that fulfills my... |
The intuition of an optional type like Maybe Int is that either there is no Int (thus, there's Nothing there) or that there is some Int; there is something there.
It makes sense to me that we call the type constructor for the "negative" case Nothing, since it means exactly that -- that there's no Int there. But why use... |
I'm reading the DDD blue book and there is one thing that's pretty unclear to me as of yet and that is how to efficiently perform simple operations on Aggregates that have a lot of child Entities in them.
An example
Considering I have an Order, (Aggregate Root) that has Line Items.
Each Order can only have 1000 Line I... |
I'm somewhat new to Java, as I've only been coding in it for almost two years, so every couple months I try to grasp onto a new concept to improve my understanding and coding practices.
This is just a question to provide clarification, and get the opinions/best practices from engineers on software architecture.
Say I'm... |
We needed a persistent storage for API keys and I came up with reading and writing json in plain text and the user thinks it works but is it very ineffecient compared to a relational dbms?
I just save the data as json and then edit it manually for this use case.
[
{
"241103000000056": {
"Value"... |
I was watching this video to learn about how to use Docker and Jenkins.
This guy immediately started talking about concepts I never heard before (well, I'm still in college), which really caught my attention.
I found that a Build Server is basically a CI server, which I know about. I couldn't find much about build farm... |
Last year I decided to create a web-based SAP Business One extension system consisting of a JavaScript SPA written with Aurelia that communicates with two REST backends written in Go and Java (Dropwizard).
However, from October 2016 to the beginning of this months I only worked eight hours a week, as I am studying soft... |
In my application I often have the case where the same data needs to be in different format in different places. For example a number has to be sent to a web service in decimal form, but has to be formatted in a specific way for the user to see.
public class Prize {
float prizeAmount;
}
A webservice expects the amo... |
We have a lot of frontend developers leaving the company because they want to work with react, angular, npm and what not.
We use some corporate cms platforms and these javascript platforms don't provide much benefit to us. For frontend we need just css and javascript/jquery.
In the last years it has been extremely har... |
Lets say I have a resource representing a list of items for a user. Something like this:
/users/:userid/item-list
[{
id: 1,
name: "list item 1",
hidden: false,
},{
id: 2,
name: "list item 2",
hidden: true,
}]
I can hide or show individual items by issuing a PUT or a PATCH request.
I can filter ... |
I have 2 DTO which have equivalent fields so
what I did is I make them implement one interface to treat them same way as a type of interface (avoid duplication)
so I put in the interface some Getters and Setters that I need to do the business logic.
However, as the fields have differents names but their content is the... |
How should I perform updates on nested children of an Aggregate Root?
Should I find the child object by traversal of associations and perform the update on it directly, or should I add a method on the Aggregate Root that takes care of it?
An example
I'm modelling an old project at our company which is a system we use ... |
I'm looking to do the following for 1000s of items:
1) get time series data for an item from file
2) calculate mean and standard deviation
3) calculate final calculation using mean and standard deviation
4) add value to list
Currently the file is one huge CSV of all items and all dates so there isn't much use multithr... |
I was thinking about creating a simple game/simulation where cars drive around in a city as part of a pet project.
That made me think how I would simulate these individual cars in a simulated world. How would you cope with the following:
The simulated environment has the concept of time. So I guess you need some kind o... |
Say I have the concept of a User; a very basic structure in reality. If the business requires that an aspect of the software needs to display all related 'Posts' for example, how should that be modelled?
Should there be posts as an attribute on the User entity, meaning that every time a User is required simply to veri... |
I have a database table named order. It contains eCommerce orders. Problem is, that's a reserved word in MySQL, and while I can use back-ticks to prevent issues, it's probably a good idea not to use a reserved word.
I could name it orders. Problem is, that's a plural. The rest of my tables using the singular naming sch... |
Let's say I have an app to manage sporting teams. Potential users have a role of 'coach', 'player', and 'fan'. In many cases they will have to make similar api calls to retrieve info like this:
/api/v1/players (retrieve all players on their current team)
/api/v1/events (retrieve all events for their current team... |
I would like to get an advice on how to tackle such a problem.
Currently we're using SQL Server as our database and the whole application is a fat, juicy monolith which we'd like to break down. There's one task that I cannot find a right solution for.
Users in our application can purchase certain data sets and based on... |
The C# language has two "AND" operators when dealing with Boolean values, & and &&. (Leaving aside the bit-wise operators.)
When the left-hand value is False, the difference between these two operators regards the evaluation of the right operand.
Consider (false && x) vs (false & x)
&& means the right hand side must no... |
I have a class that I usually end up calling XManager. This class usually acts a dispatcher. Where it will read a config and do what the config says.
Assuming that I have the following class structure:
-Manger
| - Phases
| - PhaseX implements Phase { void run(); }
| - PhaseY implements Phase { void run(); }
... |
It may be inexperience, but in the small projects I've worked on, I've often found it super useful to completely start over. Is this unique to novices or is it a real thing?
It obviously doesn't make sense for all projects. If you have a well defined goal, organized documentation and a strong product owner, hopefully... |
I am on a team building a SAAS application. Part of the application will send out scheduled reminders to our customer's clients. The project description is asking for the ability for our app to send out those reminder emails using an email address of the customer's choice, preferably their own domain, essentially spoof... |
I was reading some questions about TDD here and came up with my own.
I understand TDD to be a way of developing or capturing the detailed, internal specification/requirements for code in the course of writing that code.
We proceed step by step and add falsifiable propositions to the specification body in the form of te... |
Our company have a been embarking on modernizing our IT Systems. There is good deal of progress so far however there are practices i just don't think are not using modern approach. One example is we have an application where their is a rule engine and from time to time the rule changes.
The rule engine works by process... |
Backstory
I am building a daemon that is to be run in the background on systems based on X11. As of right now, the settings are hardcoded, and that obviously needs to change. As such, I plan to create a /home/user/.mydaemonrc
Issue
Different run configuration files tend to have different syntaxes.
.vimrc for example ... |
Background:
I'm building a desktop app where user ability to develop mods is critical. At its bare bones it is a content generator where the content has many layers, and users can develop their own code to insert/generate content at any/every layer. All these user developed modules would be available to the user on the... |
Suppose you have a code base that you have been compiling with warning suppressed, and you have decided to enable compiler warnings and refactor the code so the code compiles cleanly.
Many of the code changes will not have any impact on the end functionality of the resulting program.
For instance, code like this:
int ... |
I currently manage a team of 1 backend developers and 2 frontend developers. We usually split tasks into backend and frontend subtasks.
Before committing to a scope for an iteration, we assign and estimate the subtasks. Then we make sure that every developer's sum of estimates is less than the length of iteration (20 d... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.