instruction stringlengths 34 36.1k |
|---|
I have a requirement where I need to validate excel file before importing into application. Excel file will have around 15-20 defined columns. And we are having around 200-250 rules to validate the excel file.
Right now, one windows service is there, which is scanning the directories to process this excel files. window... |
Backstory:
I have been working as part of this team for the past three years and in this time we have had three different Scrum Master who have all run things differently.
Because of this change in Scrum Masters and their way of running the show, it has left my team numb to the idea of Scrum because the principles have... |
I am little bit confused about whether I can put all below functions to one class or if I should split into more classes.
I think GetCustomerByID and AddCustomerData got different responsibilites but on the other hand I think it's the same responsibility. Please help me by clearing the concept what is SRP in following ... |
In a project, I have a task scheduling service, which is allowed to execute certain public methods from other services. Each service decides itself, which methods it want to make available for the task scheduling service by annotating them with @Operation. The task scheduling service simply will scan all given services... |
My manager give me the task to implement new ISO procedures of analysis and design (later it will be of the entire software development cycle) because in the team we don't have any kind of methodology to develop the requested software which tend to be a "developer do what they want thing".
My manager wants to implemen... |
Summary
We're a medium sized company that has a development team of five team members. We recently started learning/employing the Scrum method to our R&D department.
Our core team has one project, while each employee has individual task and projects. Some of those individual projects are only big enough for a single de... |
To hone my skills - and for the pleasure of it - I am writing a small game for my kids in modern C++ (C++11, C++14 and the part of C++17 already supported by Visual Studio), which is a nice break from my usual (enterprise) programming tasks.
I need a small interpreter for user input and of course I must handle erroneo... |
I'm struggling with finding the best branching model for my team and would like advice on what branching models will work best.
We have 2 enviroments - Test & Production.
I recently started to work with "nvie gitflow" with my team, without the release branches - so we have a develop branch that is the Test enviroment, ... |
We're using (and loving) the jest test framework. Most of our tests are nice compartmentalized good-code-hygiene style unit tests.
However we've also written some service level tests (setting up servers and issuing requests) and also some longer running deployment tests for testing the automation around deploying our s... |
TL;DR: How should I structure my C++ project to allow for starting, stopping, and pausing my program?
Overview:
I am designing an application that needs to allow users to start, pause, and stop the running of a test. The test functionality itself will be fairly straightforward, but the architecture around it has been a... |
I have to create a service which expose an API (REST). It will use MongoDB as a database and structs as data model. The problem is I really can't find a nice solution for making the basic CRUD non repeatable. For example:
I have 3 struct (ModelA, ModelB, ModelC) Each serves as a model for a db document. I have to expos... |
Most, if not all IT people I know believe that it is beneficial to model software with UML or other types of diagrams before coding. (My question is not about UML specifically, it could be any graphical or textual description of the software design.)
I am not so sure about it. The main reason is: Code doesn't lie. It i... |
In my past experience, the way we enabled blue/green style deployments was to provision some servers for the new release that were copies of that app's production environment servers, deploy the new app version to them, test, then switch over the traffic routing to point to the new servers. When I suggested this in my ... |
Sometimes I just need .h but not .cpp file, eg : interface class or enum class, and when the class list is displayed on file list of IDE (eg:Xcode):
Animal.cpp
Animal.h
Cat.cpp
Cat.h
Dog.cpp
Dog.h
IEnumerable.h
Lizard.cpp
Lizard.h
MyEnum.h
Penguin.cpp
Penguin.h
I felt uncomfortable to see this file list because IEnume... |
Hi I'm working with an API Where an employee can see his Vacation (overview and balance) and Request new Vacation. A manager can Approve or Reject a Request for Vacation. He can also create Vacation on behalf of an employee.
I'm in doubt what would be the best design. Most understandable for a developer (say mobile dev... |
When writing java tests for an application, be they unit tests or testing a broader scope, the java community tends to model fixtures in terms of object factories that produce fixtures of a defined state.
eg:
public class TestFixtureGeneratorA{
static public A modelAState1(){
A a = new A();
a.setFoo... |
Why is LLVM's intermediate representation (LLVM IR) assembly-like rather than tree-like?
Alternatively, why do language implementations target LLVM IR rather than clang's AST?
I'm not trying to ask two different questions at once if it seems that way. To me, it simply seems like both client and library programmers have... |
So I'm having trouble understanding the relationship between threads (software) and processor cores (hardware).
Basically my understanding of a processor core is a unit that deals with commands and is essentially what executes them. A processor with 2 cores operating at 1 kHz can execute 2000 commands per second, right... |
I made a test today, how good WinRAR can compress a folder with several times the same picture in it. For that I just put one picture with 300 kB into a folder and copied it there 11 times, so that I had 12 times the same picture, only with different names. I expacted WinRAR to realise this fact and to get a compressed... |
If got a scenario with accounts in any currency.
The account got multiple lines/items for each transaction which adds or removes an amount of the account. Basically similar to a bank account. The requirement is that a user should be able to see the total amount of account.
My scenario includes multiple clients (eventua... |
I inherited a large code base (iOS / Objective-C) that is used to build multiple mobile apps. The apps have similar, but not identical UI.
The apps share a lot of common features, but there are features only found in one app. Some features can be later added to other apps.
Apps have relatively independent life cycle. ... |
I have a situation where I support what is functionally the same library in multiple languages. There are often constants that need to be shared between these (for example, json field name keys or error codes).
The way I currently do this is by having code defining the constants in each language.
The problem comes in ... |
http://librdf.org/rasqal/docs/api/rasqal-section-query-results.html describes an API for enumerating rows (consisting of several values) of data.
In this API there is retrieval of values from the current row and "jumping" to the next row.
In my opinion, this is a misdesign. It violates the rule of single responsibility... |
So, it might be a very fundamental question, but I'm pretty confusing right now...
It's all about Element and ElementCategory: an element belongs to a category, a categoty can have many elements - a straightforward one to many relationship.
At the database level, I have two tables:
Element(element_id, category_id, ele... |
We got 30 or so enterprise applications, some interacting with each other. And I'd like to create a diagram to see the big picture.
Which diagram should I use? System context diagram?
|
I have created a blog for a friend.
I have heavily designed it around jQuery's $.ajax() function and as a result it is only a single webpage asynchronously gets its data (title, article, relative image paths, etc.) from the database.
To navigate, a visitor can do the following:
Type on a given search <input>, site w... |
For example, assume my app has 3 steps with 3 pages:
Step 1 : MainActivity: choose color
Step 2 : EditTextActivity: input text
Step 3 : GreenActivity: display color and input text
In EditTextActivity, which activity to go after Next pressed depends on previous MainActivity, so I write a switch case to do that:
Ma... |
Is it a property of Huffman code to always be translated in one way? Or there are examples where a single piece of binary code can be interpreted in two different ways?
For instance: let code (1001010) be sent to a computer.
Is it possible that the computer recognizes the code in different ways?
Eg (100,1010) or (100... |
Aesthetically and mathematically a map(f, X) function seems great: in just two arguments it tells what is going to happen: we are going to use function f to transform each element from X to create a new array Y.
However I do not know what is happening under the bonnet of either for or map; and my reasons for liking map... |
We're building a web application for company, which administration existed only in Excel sheets so far. We're almost done by now, but recently I was assigned a task to import all their data from those sheets to our new system. The system is built in Java, but as this import is just one-time thing I decided to write the... |
Say I have a class like this:
public abstract class Product
{
public Guid id {get; set;}
public string description {get; set;}
}
This class is populated from the database. I am writing a unit test to decide if two products are the same. How do I establish if two entities are equal:
1) Guid o... |
I've been watching an presentation from Jonathan Blow on Software Quality. He as a point that adding more and more layers of abstraction gives you not only more difficulty to manage your code, but also we are using too much resources and the software is slow.
On this he also shows an giant call stack of some tomcat ser... |
I asked a question on here earlier and Laiv shared the following link.
In the article; it is stated that Eric Evans avoids .equals methods on Entities.
In this question; the accepted answerer talks about using Custom Assertions for Unit Testing rather than .equals
Therefore I am looking at custom assertions. I have c... |
I'm exploring Cargo DDD sample.
There is BookingService which belongs to application layer.
But looking at the code, it seems that all methods correspondent to Domain Logic (bookNewCargo, assignCargoToRoute, etc).
Why is it in Application Layer then?
What is the difference between application and domain services?
So c... |
This is a design/planning question, not specific to any particular software/deployment. The stuff I'm talking about doesn't exist yet, but I am hoping to avoid mistakes early in the process.
Here's the situation that I'd like advice on:
We have 7 business "verticals" (e.g. Sales, marketing, etc) with each vertical sep... |
I see this sometimes:
class SomeClass {
Object param1, param2, param3, param4;
private SomeClass(){}
static class Builder {
SomeClass someClassInstance = new SomeClass();
// standard builder code
}
}
VS this:
class SomeClass {
Object param1, param2, param3, param4;
private SomeClass(){} ... |
I am convinced that software development is essentially a creative process. I also believe that this is the case for all levels, from architecture to coding.
What makes me think so? To put it very briefly, because a software developer is supposed to create something new, not just copy existing stuff. It is more than ju... |
I'm designing a MVC app and I'm having a hard time figuring how to build my models. For example, I have in my database, Managers, that have a role, are linked to an institution, a program and courses.
I'll have a View for Managers, with their profile information, contact info and the like. I'll also want to link them ... |
Something that bugs me with sprint planning, is where training fits in. Let's say you have a requirement to learn JQuery for a small web application. There would seem to be a number of possible approaches - each with their own potential pitfalls.
Specific task
A task is added to the sprint to learn the technology. The ... |
As the title says what is the difference between watchdog timer and heartbeat signal ? When to use each of them.
|
I hope I've chosen the right community for that (there's no software architecture / design one)!
I'd like to ask you about practical considerations of RESTful APIs (and similar design patterns as for that matter) in context of complex server-side operations / business logic.
Few things to keep in mind:
I know REST is ... |
Our microservices are going to be deployed on AWS, using Pipelines.
A step on this pipeline will execute integration tests using a dedicated database on AWS, a MySQL instance.
My question is: since I want to execute integration tests also locally, while developing, should I need to replicate exactly what's happening on... |
I am trying to build a movie ticketing system. But I am not able to figure out how to solve the below use case:
Let’s say there are 10 seats namely S1,S2,S3,S4… S10.
Now let’s say that User1 had logged into the system and selected seats S1 and S2.
Both these seats must be automatically blocked for a time span of 15mi... |
I sometimes find experienced programmers who will actively avoid using spaces in their filenames, opting to use underscores or camelCase instead.
(i.e. /org map/attach jobs.cpp vs /org_map/attach_jobs.cpp vs /orgMap/attachJobs.cpp)
From what I understand, this was originally done on older systems which had more strict ... |
In a generic sense, my question goes something like this:
if (p) {
if (q) {
a();
} else {
b();
}
} else {
if (q) {
c();
} else {
d();
}
}
There are four outcomes a(), b(), c(), and d() depending on the conditions p and q. Even though p and q will only be evaluate... |
I'm currently writing a SAML Identity provider(Idp) to enable SSO and one of the easy ways to go about it is to use Shibboleth Identity Provider which is a ready deployable web application on it's own.
We also have an in-house authentication system that authenticates users via login screen and also has certain OAuth se... |
This is a bit experimentation from my part because I had written a lot of procedural code back in my school days hence I have trouble in thinking in OOP way i.e. to find proper classes and relationship between them. I know I cannot do this every time but I need to create some kind of correlation which may help me under... |
From my understanding, the form and all of its graphical controls run on the main thread. The form is displayed by the main thread and the inputs from the keyboard and mouse are received via the message pump and are executed on that same main thread. I also believe that the code you write also runs on that same thread,... |
I read in a data science book that there is the concept of a code permanence spectrum. If your code is low on the permanence spectrum the code is ad-hoc/throw away work. I work mostly as a scientist where the code is my tool for doing analysis. However, I've noticed from studying some of my colleague's code that there ... |
While direct Language-Assembly compilers generate the code required to perform specific task for the given platform, how do interpreters do it?
Abstract example
The following pseudo-code...
printf("Hello World");
...would compile to this assembly language code.
org 100h
mov dx,msg
mov ah,9
int 21h
mov ah,4Ch
int 21h
m... |
I'm developing a webapp with users and roles, and I need to keep track of any changes that are made, so that I know when and who has changed a user role.
I have my user table:
CREATE TABLE user(
user_id,
name
);
And my user_role table (one user can have many roles):
CREATE TABLE user_role(
u... |
I'm a long-time Java programmer familiar with the Java Memory Model. I'm starting to learn C#, and based on what I've learned so far, the C# memory model seems to be very similar to the JMM. This validates my previous understanding that the JMM reflects the characteristics of architectures supported by the JVM. The l... |
Implementing operator overloading for e.g. + (plus) isn't terribly difficult if you know it's a binary operator. One can just parse expression + expression
But what if the programmer can choose whether + is binary, unary (prefix/postfix), part of a ternary, or something else? E.g.
.. ? .. : ..
..²
.. | .. | .. | .. |... |
What is the correct way to apply commands to objects deep within the model hierarchy?
Given the following model:
public class Picture : AggregateRoot
{
private string title;
private List<Shape> shapes;
}
public class Shape
{
private ShapeType Type;
private Color color;
}
We can define a CreatePicture ... |
At work, we are discussing about two system models:
First one with a centralized server:
Second one without a centralized server:
The goal of the system is to allow clients access information, by browser, served by some remote raspberry-pis that will be connected with different kinds of sensors.
As the pictures show,... |
In Think Python the author introduces defaultdict. The following is an excerpt from the book regarding defaultdict:
If you are making a dictionary of lists, you can often write simpler
code using defaultdict. In my solution to Exercise 12-2, which you can
get from http://thinkpython2.com/code/anagram_sets.py, I ma... |
RDBMS design often emphasizes data normalization (especially 3 NF) for the sake of efficient transaction processing (OLTP). OLTP is the predominant use case for an RDBMS.
Goals of Normalization in RDBMS:
Free the database from modification anomalies
Minimize re-design when extending
Avoid bias toward any particular ac... |
If I have microservice architecture and one or more microservices have layered architecture that contain service layer, how can I avoid naming confusion between microservices and structural units of an application called services?
|
Imagine you have a Vehicle entity in your domain model. Vehicle entity has Reserve method that put vehicle in "reserved" state and do another stuff. But Reserve method have to do some checking first to ensure that reservation could be done. This checking is done by legacy stored procedure that have to be called as a pa... |
Please see the article here: http://enterprisecraftsmanship.com/2017/02/16/on-automappers/
The writer advises against using Automapper to map DTOs to domain objects as it can cause problems with validation. Why is this? My domain models have a function called Validate(), which is called by the Service Layer i.e. it ha... |
Overview
I'm trying to wrap my head around the best-practice way to link Aggregate Roots together without transferring a lot of the business logic from the Entities/AR's themselves to Services, all while still adhering to the Vaughn Vernon tip to:
Prefer references to external Aggregates only by their globally unique ... |
Elastic search is basically about indexing of data.
In database world,
Multiple indexes can be created on a MongoDB collection
Collection in MongoDB can be schema-less.
In MongoDB, BSON encoding of JSON syntax is used to communicate queries to MongoDB
In Elastic search, indexing is performed on such schema-less docume... |
Currently in my office we have an age old problem, which I feel has been discussed to death by many, yet solved by few. The clients want a monetary amount, project managers want to know how many hours it will take, and developers only want to discuss in terms of effort.
How do you approach appeasing all of the three d... |
All,We need a convention to assign a version number for our product. After I research. I found this post answer my question. And it lead me to the http://semver.org/, The Semantic Versioning Specification.
I think almost everything in the Semantic Versioning make sense to me .But only one thing I didn't understand . In... |
I know synchronous communication between services is an anti-pattern, so I'm searching for a good solution for my use-case.
I have this two services:
Location Service that manages users location
Score Service that manages users score
Now, I have to build another service: Users Feed Service (UFS). It has to return use... |
This question might have been asked before, but I am unable to find it.
So here goes:
I am writing a program which connects to several databases (one at a time). It is using OleDbConnection at the moment, but will be changed to SqlConnection at some point.
Should I create, and open a new connection every time, or simpl... |
How does one conceptually manage date-ranges, specifically the ending-date when there is a time-component involved (as in JavaScripts Date, C# DateTime, MS-SQLs datetime2).
For example, humans saying "from 01-07-2017 to 10-07-2017" would give the mental model of both dates being inclusive (at least in most cases in my... |
I am interested in zcash (https://github.com/zcash/zcash) and the theory behind it. Therefore, I download the source codes of zcash to trace it. The codes comprise C++,python and shell scripts. How to determine the behavior of these codes quickly? I tried UML revere engineering, but doesn't really help.
|
We're currently building a library in C that configures itself from tables in EEPROM.
This leaves the possibility however that some caller requests a field that is out of bounds, and the question then is, what can we do about that?
We've been thinking about an optional here, but since we're implementing our own error ... |
We have a microservices architecture. One of the components is an Authentication & Authorization Service, which implements OAuth2 standard using encrypted JWTs. On each authentication of a user to any component, the component sends a REST to the service to get an access token. On each REST interaction of a user to any ... |
We are using StructureMap in a new software development project. One of the team members has implemented a unit test that basically tests the StructureMap container configuration. It does this by doing the following;
Counts number of instances of assemblies that are configured for classes in our application namespace.... |
As defined in Software Systems Architecture (chapter 3 - Viewpoints and Views) a view describes a particular aspect of architecture, and a viewpoint is a collection of patterns, templates, and conventions for constructing one type of view.
From this I do assume that only one view will be constructed from a viewpoint. B... |
Since the Go lang is getting popular, I started to play with it. I do derive from Java language so when I saw the Go syntax it has been a bit strange to me.
sample code from go lang project site:
func NewField(w, h int) *Field {
s := make([][]bool, h)
for i := range s {
s[i] = make([]bool, w)
}
... |
We have an MVC 5 based web application.
Part of functionality includes displaying hierarchical structure as a tree (I use this JavaScript component: https://www.jstree.com/)
Tree is displayed in the left part of the screen and is several levels deep. Each level represents different object type. When user clicks on the ... |
I am working on a little project (in a very "low Level" language with single-precision 32-bit float that nearly has no functionality apart from basic conditions and loops) and at one point I have to solve a linear system of equations (4x4 or sometimes 5x5). This is not the problem, I use the GAUSSian algorithm with piv... |
Netflix conductor allows you to implement complex business and process flows using a JSON DSL. I do understand the scheduled nature of Conductor, still, in what way, it is different from having a BPEL engine in the good old SOA world? Also, who should own the governance and maintenance of Workflows?
|
This question is more of a general question about how to model simple one-to-many relations using collections: should a change in a list item be reflected in the version of the aggregate containing it?
The domain is about meeting scheduling (like in Outlook). I have a Meeting entity, which can have multiple Participant... |
To some of my tables I want to add "second_primary_key" which will be uuid or some random long key. I need it because for some tables I don't want to expose integers to my web application. That is, on a page "/invoices" I have a list of invoices and a link to "/invoices/:id" where :id is an integer. I don't want a user... |
When testing, sometimes a helper method can be useful for repeated task e.g. in test setup.
Concrete example:
We have certain tests against our rest interface using Spring's RestTemplate. To make it easier, the requests are sent with the help of a helper method (let's call it method A() for now), which returns the ob... |
I'm having doubts about how to implement and keep synchronization between two datasources in a distributed system. In my case, I have a service that checks for expired jobs in a repository. If the job has expired, then it is removed from the repository and enqueued in a distributed queue (the example is in Python but s... |
The dependency rule in Clean Architecture states that:
... that source code dependencies can only point inwards.
I now came across a problem that I cannot figure out myself.
Lets assume I have a module with application business rules abr and 2 modules for services that implement interfaces from abr.
+----... |
I understand there are many questions in this site revolving around the same concept, but I could not get a precise answer for my case.
Problem
I am handling an ERP System, with code base in both:
VB.NET/ASP Forms for the user interface portion of the system
TSQL Stored Procedures on SQL Server, handling business logi... |
Having single (or few) method(s) interface constructor injection should I store in a field a reference to the interface instance passed as is or just necessary "entry point(s)"?
class Client
{
private readonly ITool _tool;
public Client(ITool tool) => _tool = tool;
...
}
or
class Client
{
private reado... |
Quoting from Vaughn Vernon:
When two or more Aggregates have at least some dependencies on updates, use eventual consistency.
He further goes on to suggest that one could make use of Domain Events to publish actions to the other Aggregate Roots that need to be updated.
He further proceeds to explain that Eventual Co... |
Actually in the company that I work there isn't a procedure or any kind of methodology choose to develop software. The software developed is administrative to the own company, clients applications many of them data driven and some outsourcing wherever the occasion arise. My manager give me the task to create a set of p... |
Imagine while using the command pattern, I have a quite a few different commands (> 30), now most of them are very similar but they depend upon an answer after execution (think in a dinner example, as the waiter needing feedback from the guest, whether they received the right meal).
Now basically I could reduce the num... |
What I want to achieve: I need to obtain a run time (unique) id for "any object" (for classes either in java SE, classes I have created or classes provided by other third parties... any instance of a class).
Ideally it should be as easy as:
Map<Object, UUID> objId = new HashMap<>();
MyClassFoo foo = new MyClassFoo();
U... |
I'm getting ready to create an integration with a major external system and was wondering if my understanding of the design pattern for this in domain driven design was solid.
Considerations:
External System serves SOAP, mine's a web api 2 solution.
Full CRUD operations across many SOAP methods
My thoughts:
Create a g... |
The DbContext of my application's Entity Framework setup (which I will refer to as ApplicationContext, the name of our derived type) contains classes for all of the tables in our SQL Server database, rather than having them spread out across multiple DbContext classes. One of the issues we've run into is, because EF us... |
I've set our sprints up to last for 2 weeks, nominally 10 days. Day 1 starts with planning and then moves to start development. Day 10 has S&T and Retro, but also cleans up the release/tidies the Boards/backlog etc.
It's now been suggested to me that a 10 day sprint should have 10 days of development, and then a deli... |
There is some information about how to package HTML5 app to use on Android or iOS, but I couldn't find anything about a normal website.
Let's say I would like to create a website displaying multiple HTML5 interactive animations/apps, and I would like to have clear way of adding more of them. With SWF files the problem ... |
This question about when to use private and when to use protected in classes got me to think. (I'll extend this question also to final classes and methods, since it is related. I'm programming in Java, but I think this is relevant to every OOP language)
The accepted answer sais:
A good rule of thumb is: make everythin... |
This is the ER diagram example from the Wikipedia. Here they have marked the Orders entity as a strong entity.
As I understand a weak entity is an entity which cannot exist without a corresponding strong entity.
In this case, I think the Orders entity is existence-depended on the Customer entity. Because an Order wo... |
I've been developing my scientific-computation software for a few years in C++ and it performs pretty well on CFD and DEM simulations. However, it has about 12k lines of code without the dependencies.
Any time I peek into another project, I'm always surprised how much lines are written even in a 'simple' project on rat... |
I was reading through Groovy in Action, Second Edition and on a footnote, I found the following text
Java pours “syntax vinegar” over such a construct to discourage programmers from using it.
What does the term syntax vinegar means here?
I have never heard of this term before and searched on DuckDuckGo and Google but... |
I have been given the task to create a system in which users can buy intellectual property (broadly categorized, hard to explain what they are really buying) from the system and can transfer funds between each other.
For the purpose I have created a transactions table which holds the sender, receiver and amount. For pe... |
The following procedure: We have Development branch and
Developer create feature branch from Development
Work and commit in this branch
Rebase from Development
Create pull request
Code review
Merge with Development
Problem that we should have 2 level code review, performing by different people. After first review app... |
I'm currently working in an environment where I have the following:
Multiple Inputs (with multiple versions)
Source code to generate output (multiple versions)
Output generated by a combination of input and source code
The top level directory looks like this:
inputs/
outputs/
src/
I'd like to somewhat generalize thi... |
Our company is deciding on a policy regarding the use of type inference in our C# and Visual Basic.NET code. During our discussions of what type inference is, one of our developers raised an objection based on an argument made by Andrew Troelson. I've tracked this argument down, and I'm presenting it here because I wan... |
There a lot's of SO questions asking "how" to get unknown JSON keys from a JSON object, and I've done it plenty of times, but after starting to use JSON schema to start designing API request and responses, I am starting to question if having unknown or even dynamic keys that the JSON consumer has to be smart enough to ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.