instruction stringlengths 34 36.1k |
|---|
Recently I've heard a lot about automating test is taking away manual jobs from the QA sector.
When I look at example of what it is about most of it is just running a sequence of functions over and over to make sure it ends up in same results or other similar kind of tests.
What exactly is groundbreaking there?
Couldn'... |
At the end of a 2 week sprint and a task has a code review, in the review we discover a function that works, is readable, but it's quite long and has a few code smells. Easy refactor job.
Otherwise the task fits the definition of done.
We have two choices.
Fail the code review, so that the ticket doesn't close in this... |
Note: this question is not strictly PHP-oriented, since both Docker and Composer can be easily used outside of the PHP ecosystem (although such cases would be rather rare IMO).
In one of the projects I work for, the production environment is set up in a way that uses an image with Composer only (i.e. https://docs.docke... |
We have a system which generates db records and a ever increasing id named archive_id ( bigint in postgres).
sample table: record_table ------ archive_id bigint,info varchar
Another system continuously polls the first system DB and get records in its system based on archive_id column.
When first system DB is restored t... |
I was trying to find more info on the matter but could only find this:
In C++ why and how are virtual functions slower?
The answer says that the virtual call "Get[s] the right function address from the vtable into a register (the index where the correct function address is stored is decided at compile-time).".
But how ... |
I know -- it depends, right?
What I'm asking is whether the notion that sprints/iterations in agile development should always be back-to-back, with only a review and planning meeting to separate them from each other, is correct and/or good for a team? I've been on plenty of projects for different companies now where we... |
I am making a project using the Laravel framework.
I plan to create unit tests for my project. But I feel I don't really have an idea what to test because I mostly use library or framework functions. Even though I create my own functions, they usually are compose of functions called from Laravel and libraries I use. He... |
I'm currently working on an Android application that broadcasts the location of the device every 5 seconds.
Pseudo showing current app process:
deviceLocation = getLocation()
if (hasChanged(deviceLocation)) {
putRequestWithLocation();
} else {
// Send heartbeat so we at least know device is still connected
... |
Let me illustrate with an example.
Say I want to create a class Returns that generates the returns of a stock for example. Returns can be arithmetic or logarithmic, and I want to be able to choose at instantiation which I want. For the moment, I do the following:
def arithmetic(prices):
daily_ret = []
for i row... |
I am reading "Patterns, Principles, and Practices of Domain-Driven Design" by Scott Millett and Nick Tune and so far it has been a great read (first 2 chapters read) but one term they seem to use a lot and appears to have a fairly abstract meaning is the term "model". They talk about developing a model using domain kno... |
My original design has a domain service that did a lot of work which resulted in an Anemic Domain Model (concepts like BalanceCalculators, AccountServices, etc.). I refactored my design which resulted in Accounts computing the the balance (which is a domain concept).
However, this resulted in me needing to hold a refer... |
I recently watched "All the Little Things" from RailsConf 2014. During this talk, Sandi Metz refactors a function that includes a large nested if-statement:
def tick
if @name != 'Aged Brie' && @name != 'Backstage passes to a TAFKAL80ETC concert'
if @quality > 0
if @name != 'Sulfuras, Hand of Rag... |
In my app server's authentication implementation, an authentication token is generated for every user that has logged in. According to some highly recommended security tips (Implementing Secure User Authentication in PHP Applications with Long-Term Persistence (Login with "Remember Me" Cookies)), this token must be upd... |
We have a team of about 40 engineers who work on a large SaaS platform. As with any organisation, we have an enormous backlog of things we want to deliver from our roadmap. But of course, we also have a backlog of bugs, of all priorities, as well as occasional production incidents to react to.
We're aware of a few mod... |
I'm designing a system that will
Act as proxy calling a service on a back-end in context of user and his session
Manage sessions for users on multiple back-ends
I will expose the system over HTTP.
Most of the requests will need back-end-id, user-id and session-id parameters, now I can model it as path parameters
/:b... |
The UI team deliver the HTML files to the development team.
Developers code PHP on html files to make the website.
But later we face a lot of changes in design. The designing team makes the changes in HTML file and the developers find the committed changes and integrate the same in PHP files. Sometimes the HTML changes... |
I have to sympathetically resolve a debate internally. Take this scenario, it's not perfect but bear with me.
As Arthur
I want to upload multiple lists of appointment data during
the day
So that a SMS message is sent to the patient to check their
emails.
The file is exported from a 3rd party system in .csv, we... |
I have an old branch (old-branch) which I last used approximately four months ago that I used to develop a feature for a specific project. It was never merged back into master because the feature never played out according to plan and was abandoned.
Since then, the project has come a very long way and the codebase now... |
I am trying to understand what exactly an API is.
From my current understanding, an API (Application Programming Interface) is a contract provided by a software instance, that guarantees a defined set of behaviors, which are triggered by a defined set of actions.
An API is a "public" sort of construct, as it defines th... |
I am a sole developer and I recently wrote a new web application in the form of a API with Swagger and front-end. This was customers could use the API on their own, usually forscripting.
It is nearing completion, and my boss who is not a developer brought up that the API looks too difficult for the consumers, and he fe... |
I'm trying to get the Repository/UnitOfWork pattern figured out. We're working on a project with EntityFramework and our DBContext contains 200+ tables.
Right now our approach is to inject whatever repository is required to a service. This way the services can only call a few methods from the passed repository. Service... |
I have been working on a project that integrates spring-cloud-based microservices and MVC applications with SSO. currently, I use spring-session for the session repository service. My current applications login component contains an authentication server to create a session in the backend, and a frontend client calling... |
I want to implement tracking of changes in plain-text documents, in a way similar to how it works in MS Word or Apple Pages. What I am unsure of is the data model and how to store it.
Goal
The expected properties:
disk space frugality
it should be possible to revert all the changes and get the original document
multip... |
For example I need to find a user which its status is 0 and its name is John. So beside usual methods for a Repository pattern (e.g. find, create), I decide to create a method in UsersRepository called findJohnWithStatusZero or to be more generic, a method called findUserWithStatusAndName
UsersRepository.php
<?php
cla... |
I'm a bit new to MVVM, but here's my dilemma:
I have a model (or models, but let's keep it simple)
I want to show that model data on multiple different views.
Ok, so ViewModel for each view gets created
UserControls get created (my views)
each Usercontrol gets a ViewModel
Here's my question: What/where/how do I hand... |
I am developing a service which will expose some APIs through REST end-point.
I have some API which can take a lot of time like say 5 to 10 minutes to complete the requested operation.
I am also writing the client side application which is multi-threaded and it can make multiple requests to server at the same time. If ... |
I have a bunch of PHP 5.6 code that I would like to get up to 7.2. My biggest concern was the change that causes an error when you call a function without enough parameters. Previously, this was a warning. This is the change I know for a fact affects me, but others may as well. So what I did is I put together a small... |
This applies to the Google API for situations where there are many (thousands of) hits in Web text searches.
When searching large text sources, typically books, the default display order of results of well used search terms A and B may list the hits with A and B close together in the text block, first.
But not always.
... |
This is almost getting me crazy. EF bring us a very convenience experience in development.
However, if we need to use the Entity model in the upper layer, we always put a reference from the upper layer to DAL or some layer at the lower which is holding the Entity class. I have visualize the situation.
... |
First of all I am going to give you a brief explanation of what i am after doing. I want to write a program that applies filters to an image using a strategy design pattern. I have read some documentations about the pattern and decided to use it like this.
First I will create an Interface called FilterStrategy which ha... |
I've been scouring information on Entity-Component-System designs for weeks to try to figure out how to implement it in C++, and there are lots of wonderful explanations for different aspects of it, but the one thing everybody seems to overlook in examples is how you actually access whatever the data members are in a s... |
I need to have some common functionality while the derived class needs to have singleton behavior.
For example:
class A
{
//common file functions
}
class B : public A
{
//Needs to be singleton . since there is specific file of this class
}
class C : public A
{
//Needs to be singleton. There is also specific file of t... |
While going through the book 'Head First design patterns ' on Factory Method Pattern chapter , I came across the following question and answer at pp.135 (print publication date of the book : 2004/10/25)
Q: Are the factory method and the Creator always abstract ?
A: No , you can define a default factory method to produc... |
I have some background in Petri nets, and in my last UML training, the trainer explained how activity diagrams are essentially a form of a Petri net with Petri net semantics.
Now read that fork and join symbols are used for modelling concurrency in UML activity diagrams, and I am a bit unsure whether they are actually ... |
If you were streaming JSON to the end user, and every "buffer" of response was in the format of, for instance...
{ "something": "here", "other": 1}
You'd be in a spot where the entire stream together would look like this...
{ "something": "here", "other": 1}{ "something": "else", "other": 2}
So the entire response reco... |
So I'll take the context of Red Hat FUSE as an example because this is what I know. I know that Apache Camel which is the library on which is based FUSE doesn't consider itself an ESB (http://camel.apache.org/is-camel-an-esb.html) but that they consider that Apache ServiceMix can be considered an ESB. But according to ... |
I am designing an Intranet employee reward web app using ASP.NET MVC C#/MS SQL Server. This will only be accessed from within the network.
Employees and managers will be able to give a reward to other employees for a job well done or for specific employee appreciate days. About 1000 employees total.
I'd like to not r... |
Suppose your team writes a software system that is (quite surprisingly) running fine.
One day one of the engineers mistakenly runs some SQL queries that change some of the DB data, then forgets about it.
After some time you discover the corrupted/erroneous data and everyone scratches their heads as to which part of the... |
Hopefully this topic is not opinionated and I could maybe get meaningful answer please. Our problem is, imagine you have two microservices: Car and Driver. DTO of the driver could be let's say as following:
DriverDTO
{
id: 1,
name: "John Smith"
}
and CarDTO:
CarDTO
{
name: "Ford",
driver: {
id: 1,
... |
What I want to know is, how can we still make use of assembly today, in productive manners?
When assembly outperform C, so it would seem practical to write a section of the project in assembly rather than C, even if this will be a section of C/C++ project. I am not talking about pure assembly project here
I also referr... |
I have learned a significant amount of coding, however, it's always been in a scientific environment (not computer science), completely self-taught without anyone to guide me in the right direction. Thus, my coding journey has been ... messy. I've noticed now that whenever I build some type of program, by the end, I re... |
I am making a b2b-webshop system that will have multiple customers. Each customer will have a separate active pricelist which contains the products that they can buy and the prices that applies for that customer.
I am struggling designing this. What is a good practice?
My database looks like below right now, and Im thi... |
Besides the fact that all primitive types of C++ are copy assignable except the reference type, it also doesn't play well with containers or any other parts of the language where copy-assignable semantics are needed. I personally believe this is the reason that std::reference_wrapper had to be introduced to the langu... |
An app generates a PDF based on user entered data in text fields. Copying and pasting users can inadvertently end up pasting "tags" in the field. Eg -
<foo@bar.com>
The PDF generator plugin does not like this and crashes throwing an exception. The App vendor says this "escaping needs to be done on the plugin side"... |
I am just looking into microservices and containerization for learning. I have not really implemented anything yet. In principal I get a lot of the layers of the pattern.
One thing I am not understanding and cannot find a good answer on is a microservice's database. When speaking of a database per service is that per e... |
I am building a internal crm which has contacts which are just people with first name, last name, email, phone etc. Contacts can be one or more types e.t.c. job candidates, hiring managers, customers, workers, sub-contractors etc... and based on the types there are more fields specific fields.
I am building the softwa... |
I want to move a bunch of similar methods to an external class. The class is initialized with the original class instance. From there I can access it either by property (persistent instance) or by method (new instance each time).
Which approach is favorable? In a real system I will have many of these classes holding ma... |
Persistence is an essential requirement for preferences. Developer's preferences are saved in .idea/ folder. It is recommended to add .idea/ to .gitignore to avoid merge conflicts. But then settings are lost whenever
Project is cloned to a new environment
Project settings are messed up and you want to roll back
New de... |
Context: we have a responsive web application developed in React.js, which we have successfully used a few times to run user studies on Amazon Mechanical Turk. Now, we would like to add interactivity tracking to this app. Concretely, we want to track interaction events, which can be either multi-touch gestures (pinch, ... |
Why we do this is for "Planning before we code" and one another point is to "help the newcomers in the team".
We are a team of 5-8 members. We do have API documentation and Readme included with our projects. Writing a solution document once is not a hard task. But problem facing is, It is time-consuming and hard to m... |
The software should be able to:
Draw shapes on a drawing
Save drawings
Load drawings
Adding a new shape should have a limited effect on existing code. There is no user cases, no clues about possible evolution.
I chose a factory pattern for the shape creation. To do so it will use creator classes. It is not clear to ... |
I want to extend class Base which is defined in specific API and the extend the extended again. As you can see below, draw method of intermediate class calculates variable top and I need to use it in second subclass:
abstract class Base{
public abstract void draw();
}
class Sub1 extends Base{
@Override
pub... |
I'm trying to write an application server in python. I have a master process and multiple worker processes created from the master using fork(). I have two approaches in mind about how the workers should handle request data.
Using pipes pass data received by the master using accept() to an idle worker. The worker rece... |
I have a series of points (x,y) and each point has a colour (in the LAB colour space). I need to associate points by similar colour and then spatially. So the end result is each point becomes part of a local cluster or segment.
Is there a specific data structure that is suited to such a scenario? I'm trying to find a d... |
Context
Let's considering a standard web application handling cars. Each car has an owner. So the car structure looks like:
cars(
id INTEGER PRIMARY KEY,
...
owner_id *???*
)
For simplicity reasons, I am using an external Identity Management, in my case Auth0. My question is "how to represent users in a database... |
Description
I'm designing a Node.JS application (more like a full website). The app will send five JavaScript files and will have <script> tags linking them together.
Question
How can I prevent users and attackers peering and editing my code?
An example would be:
Ctrl + Shift + I
In Devtools, goto Sources, select a ... |
Take the wikipedia definition:
Agile software development is an approach to software development under which requirements and solutions evolve through the collaborative effort of self-organizing and cross-functional teams and their customer(s)/end user(s).
so what is this saying? It's saying
groups of developers wor... |
I have some older xsl transformations that I will modify soon. They generated XHTML code from a home-grown XML format. Since I am touching these XSL files anyway, I am wondering how I will deal with HTML 5 not being XML anymore.
I guess it won't be terrible if I still generate HTML (the browsers will still display it),... |
I have a REST API. I want to monitor it -- that it's always up.
That's the canonical way to ping it? Especially when all of its calls require an API key.
Should I create an empty open end point which returns "200 ok" specially for monitoring it?
|
I've been looking through class and friends and similar c++ arrangements to share data, and cannot find how to program levels of share.
No players can know what the other players have in their gold-sack or their arrow quiver, basically.
Only a few players can know such things.
Basically, how do I set up security levels... |
I just started working with a pull and fork model. I keep sync my fork and create a new branch when I have to fix something or for a new feature.
I'd like to know what to do when I have to face the following situation:
Let's suppose that I start creating a new feature
When I finish my new feature and before creating a... |
I have created a login form for my website, but the issue is how to process the data provided in the form by the uses.
You see, I can't just write a basic function like this one -
myfunction(){
if(usename==='xyz' && password==='pqr');
return true;
else{
return false;
}
}
'Cause it will be clearly visible to all in the... |
I am not the first one to ask this but i also did not get anything concrete from other such posts to tell me what is needed so i am posing the question here. Feel free to refer to some other resource.
My organization is constantly trying to implement the agile methodology as its shiny but we know we have not implemente... |
I’m working with legacy web app for managing an animal shelter which need to be rearchitected/redesign, so it can scale and be possible to deploy in a central location.
Currently it's physically deployed on the servers at customers locations (9 and more waiting till centralizing will be possible).
Short description of... |
//This represents my rows in my database
public class PersonModel
{
public int Id{get;set;}
public string FirstName{get;set;}
public string LastName{get;set;}
public DateTime CreatedBy{get;set;}
}
//This is what the client receives
public class PersonDto
{
public int Id{get;set;}
public strin... |
Elements of my team and myself are experiencing some difficulty performing design meetings. The symptoms are:
We get off track easily, a combination of low understanding of the content of the system and want for the solution to be your solution drives the conversation often.
We are unable to come to an acceptable conc... |
I was reading what is a changelog in keepachangelog.com
and says that we shouldn't drop our git logs for the creationg of this file, but I see a lot of projects do it like the Angular framework repository, so I am wondering what is the recommended strategy for doing this, what kind of users are we aiming for or the spe... |
I'm curious on the best way to handle lookup-type codes that can be shared across bounded contexts. For instance, state codes, or business-specific type codes that might be used in more than one bounded context. Does it make sense to have a single database for these, with an api in front to fetch the code lists, or d... |
We have weekly planned release cycle. Following standard semantic versioning system. Like first week V3.0.0, next V3.0.1 patch release, next week V3.1.0 minor release.
Apart from the above planned releases we have N daily bugfixes and hot fixes.
My question is how do I maintain the semantic version pattern?
Should I d... |
I'm interested in all the cases where shunting-yard algorithm can tell if an expression is not correctly written from a syntax point of view.
So the Shunting-yard algorithm takes an expression written in infix notation and transforms it into prefix or postfix notation.
As a simple example, the one taken from wikipedia:... |
In a DDD designed application with CQRS principle how do we handle the case when a command needs to be validated before it is executed on an aggregate and the validation needs to query the existing data?
For instance, in my system I have Customer, Project and Ticket aggregates. A Project belongs to a specific Customer ... |
We develop an application which has now been installed on a few thousand customers sites.
Unfortunately, we have no customer data collection built into the software. This is something we want to implement in the next version. We want to collect a few parameters from the software (what features they are using), as well... |
I am creating a CMD like program where the user manage his "drive" with commands.
I would like to know if there is a way of doing this type of application in a easier/better way.
Actually I'm doing like this:
Listing the commands
I created an enum with all commands to be easy to add and manage commands
Executing the c... |
If I have a page with three cascading dropdownlists, is that an example of controlling the state of a web application (assume it is part of a larger application)?
I want to make sure I understand state management and the need for a system like Vuex and Redux and having the store pattern, one singleton to run it all thr... |
I have REST API for my SPA application.
My domain model has Order entity, it has Commission property which calculated on backend, it is number value
For get Order entity SPA calls this endpoint, this endpoint returns saved order
GET /api/orders/{id}
This endpoint returns basicly filled model for new Order
GET /api/ord... |
I have some values and methods to define in a scala object.
I do not know in which order I should define them. Is there a "good way" to do it? Such as private methods first then public methods? Only alphabetically ordered?
|
I got confused with the role of the Messenger in MVVM. I see contradictory articles about it.
This Article by MSDN by:
Communicating from the View-Model to the View
Observant readers will notice that Figure 1 has one arrow missing: in this figure, there is no way for the View-Model to communicate with the view. ... |
TL;DR: what do I call a section of code that is used to assemble a Graph object?
I have a fairly large section of code that is duplicated in a few areas. I wish to extract it into its own class. What do I call this class is my question.
The section contains code like this:
/*
* First Graph
*/
$flow_... |
An application I'm currently working on in our front end we currently use React, Redux and some singleton services (wrappers around some 3rd party libraries). We started discussing a new feature which we need to develop which involves non-changing data (as far as we can see) as it is set when the app is initialised, va... |
I have a server which is exposing API through REST. I need to implement a simple Heartbeat service to monitor this server status and availability of API. The interval of Heartbeat check will be every few seconds, like every 3 seconds.
Is it good enough to just define a REST end-point (say ping) which will return the st... |
I was going through the traditional quick sort algorithm. I had a look on the partition algorithm in a couple of places and the implementation difference was very subtle. Here are the 2 approaches:
Approach 1: Pivot is last element
partition (arr[], low, high)
{
// pivot (Element to be placed at right position)
... |
Can't figure out how.
1) Resource identification. How do I identify the resource? Something like this? /latest_news/<id> That doesn't seem right.
2) Now suppose you have a URL for the resource latest news. Now each request for the same URL may give you a different representation. Does it violet any constraint of REST... |
I'm implementing the onion architecture with webapi, service layer, repository, unit of work and the domain classes.
I use also DI, using simple injector.
But my issue, is how can I implement a specific use case.
The webapi should have the ability to receive a batch of files from
the ui. After they are received they ... |
This might be a bit of a wide question but I want to understand if it's the correct way to do it.
Assume I have a couple of classes all doing operations on an object. First class takes the object, does some operations on it; after this seconds class takes it and does it's own operations and so on.
Each of these classes... |
Changeability is a quality attribute of requirements that is emphasized in some classic literature. To get changeability of requirements, they must not be redundant.
However, when dealing with requirements in Scrum, some practices will inevitably lead to redundant user stories. For example, if a software shall have a n... |
We have been thinking about comparing product size/effort at least roughly and this is what some suggested:
There are multiple products, each with one scrum team
All the scrum teams estimate their stories relative to a common reference story. Therefore, e.g. in Project A, they look at their story and estimate it as re... |
Based on this question about the correct usage of nUnit's TestCaseAttribute, I was wondering whether to specify the test case directly on the implementation or create test methods (as when using explicit Assert.AreEqual etc.).
In the following, I specified examples for both approaches and also listed potential argument... |
I'm working as a support engineer, having access to the source code, and I'd like to use this opportunity to document the source code, but I stumble on a first question: how do I even start?
For single-threaded applications, this is simple: using a tree structure (main() function calls some subfunctions, calling subsub... |
I have joined a team working on a large and mature responsive website (using a javascript MVC framework), and one thing I frequently see in the codebase is branching code in controllers or components checking whether we are in Desktop mode or mobile mode before doing some action. In some ways it feels like two separate... |
Is there anyone who can explain the relationship between customer, users, and the company ?
As far as I understand, the product is used by the users, and before that product is designed, the users list their requests for that product. This is called user requirements. The customer is responsible for constructing a nego... |
I am working for a company which has an abundance of Word and Excel files festering away in the depths of their file server, probably like most other companies. The problem is that each of these files contains nuggets of information that at the very least would give some valuable insight into past performance. There is... |
I've been developing several front-end web-applications recently that bind against a database using a RESTful CRUD api.
I've noticed a massive amount of boilerplate code going into defining the API. For example, on the back-end I define a db-schema, controller, api endpoint, and view-model. On the front-end, I expose... |
I am trying to understand how I can make the code for this easy to understand and debug too. The reason I'm asking is that it feels like the kind of scenario which has probably been tackled before plenty of times. And if that is the case I would like to use that as a solid starting point which will allow this to be e... |
It is generally understood in software engineering that global state is bad. However, OpenGL has been designed very much embracing the concept of global state. many of the things you modify will affect everything in your program (active shading program, uniforms, active buffer, glDepthTest...)
Because of this, I ended ... |
I'm trying to make an abstract board game. In the game, a player can choose to make multiple actions within one turn such as placing, moving, or rotating a piece. I'm not sure if whether or not my implementation is bad. I was told by my professor that using instanceof and if statements like this is a sign of code smell... |
for example, sometimes I need to define a hardcoded string with some variable parts, I often have trouble to choose the style:
style 1 : reuse every characters when possible
showMessage(num){
let strArr=['Mon','Tues','Wednes','Thurs','Fri','Satur','Sun'];
alert('Today is '+strArr[num]+'day');
}
style 2: Keep the v... |
For example, I have multiple projects which shares some common libraries:
ProjectA
CommonLib1
CommonLib2
ProjectB
CommonLib1
CommonLib2
At the moment, they are all in one big repository:
ProjectA
ProjectB
CommonLib1
CommonLib2
However, I think it is better to have one repository for ProjectA and ProjectB. But... |
I have a situation on the front end where a user clicks on “Download” button and the query behind the scenes is going to take over a day. I have a Spring boot web app running as far as web services are concerned.
What I want:
When the download button is clicked on the front end, I would like to put this process in som... |
When I think of software configuration, I think of a file that is read by runtime - said file would contain things like the port a server might use, whether to use encryption, and paths of various resources.
When I first came across "Software Configuration Management", I thought it meant the management of configuration... |
I'm trying to implement authentication and session management for a microservice. In order to do the process RESTfully, I understand that I'll need to use some kind of token-based authentication to avoid tracking client session data on the server. The following quote from this answer on the Information Security Stack E... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.