instruction
stringlengths
34
36.1k
Context : We have deployed a cloud solution ERP (Acumatica) for one of our client. There is only one dedicated Production server on the cloud hosting the app. We have our own local server to develop and integrate the customizations our client asked us so far in the scope of the project. Now, Our client would like to ...
When I read and watch videos on Oath it talks more about being able to access data from other applications. However, a common usage of what I think is OAuth is simply identifying a user without requiring them to have a id/pw for a site. I don't see that explained very often though. What is the concept behind that proce...
Update: I added some diagrams to help understanding I had a discussion with a colleague about two different approaches in mapping data objects. I'd like to get your opinion on pros and cons between the two approaches. Some background information. We have two external services. One is reached over SOAP, the other over R...
I have a situation whereby I'm using a library that's been generated to provide an XML interface in C# based upon an XSD file run through xsd.exe. The XML is structured as so. -Results -ModelA -ModelB -ModelC -ModelD When I'm actually working with this XML (which is mapped into internal memory objects ...
Should a Software project have a Detailed Design phase, in which the detailed specifications (ie, the code) are spelt out? The reason I ask about this is that finding the right syntax to be used may be difficult, given the myriad language features available. Therefore, it might be best to design the code before actual...
I've got a production server I'm managing right now, but it's becoming incredibly inefficient to either: SSH into the remote server, and develop server-side Develop on my local machine and transfer changes to remote server A possible remedy that came to mind was keeping a git repo that mirrored the filesystem of the ...
I'm seeking advice from people using RabbitMQ to connect services written in different languages. Currently my organization is using RabbitMQ exclusively with C# and it's all working quite well. In order to provide some nice additional functionality over and above what RabbitMQ provides, we've implemented MassTransit...
In Java's documentation, it states: Don't allow subclasses to override methods. The simplest way to do this is to declare the class as final. A more sophisticated approach is to make the constructor private and construct instances in factory methods. From Clean Code(Page 25): When constructors are overloaded, ...
I'm learning DDD and I'm thinking about throwing exceptions in certain situations. I understand that an object can not enter to a bad state so here the exceptions are fine, but in many examples exceptions are throwing also for example if we are trying add new user with exists email in database. public function doIt(Us...
I have a group of 100 clients around the globe, that need to communicate between then self, fast. Each message that each of the clients sends needs to be broadcasted to everyone. The messages will be between 1 to 16 MB. Each client is expected to send one message every half minute. I was thinking of a tree structure an...
I was talking with part of my team about the responsibility for who own the Binding and Queue creation. We are using Spring framework. In async communication they agree that the responsability to create the Binding and Queue is of the Consumer. Until here, we all agree. But they understand that this is not true for syn...
I'm trying to make sense out of a pattern used with a javascript webgl framework. background WebGL uses shader programs to draw or compute stuff. These programs have to be compiled at runtime, so at one point they exist in javascript as strings. The library offers an abstraction layer called "Material". It exposes hi...
C# has events built in with a keyword. So if you want to declare an event, you write: public event MyEventHandler SomethingHappened; It is convenient, as it does allow you to add multiple event handlers, although it also prevents you from customising how events are handled, such as if you want to ensure that certain e...
Consider a database table for user info like: id, name, email now consider I have another table for video something like: id, name, description, length Say a many to many relationship exists between them based on subscription. Obviously, to handle the relationship you'd create a third link table user_video_link: i...
This is closely related to this question which asks about the complexity of the following: while (x > level) x = x – 1; x = 0 Using the graph method it has a Complexity = 2. Fred Swartz indicates a more faster way of computing complexity for Java/C# based on actual instructions from these languages: - Start with a...
Can you all take a look at my package structure to understand how i implemented clean architecture in android: if we take a look at the clean architecture diagram it looks like frameworks is apart of the UI layer: so the UI layer is apart of frameworks and drivers. so one of my questions then is it be more appropriat...
I'm used to write unit tests with assertions which are based on the input, e.g. (hopefully self-explanatory and let's assume that using random test data is fine) int a = random(); int b = random(); Adder instance = new Adder(); int expResult = a+b; int result instance.add(a, b); assertEquals(expResult, result); Let's ...
I am trying to incorporate BDD into the teams working practices to make interactions with Business Analysts more effective. I recently asked this question: Should I pass an ID number from the feature file? Please see the code below: public class Chestnut { private Guid _id; public Customer (Guid id) { ...
I employ a lot of meta-programming to avoid repetitive tasks and build safer-to-use abstractions. I recently moved to a new job where I am working in a larger team and this worries some of my colleagues, because they do not comprehend it. I always try to leverage the full potential of the language, but some (not all) o...
Imagine you have the following scenario. Your organization deploys some app core to its mission. For example if you're Stack Exchange, this might be the customer facing web server. Let's also say you subscribe to something like the 12-Factor App philosophy. Each app mantains its own SCM repo, which acts as the canonica...
Ok please dont downvote because im serious about this question. I hope im asking this in the right place. At programming school they are currently teaching us about project management. Instead of teaching us the classic waterfall model, spiral model, smart or other project management models they have their own which ba...
First example: countryRepository.getCountriesFromAsiaWhereAreTheMostPlanesAndBoats(); countryRepository.getCountriesFromAfricaWhereAreTheMostCars(); Are these names too big? How else do we call these functions? I was thinking about parameters, but according to Martin Fowler, it's better not to use parameters in functi...
I'm creating a popover component for a UI in React. That component contains a button that triggers the popover to display. Because the button needs to be configurable--label, classes, properties--I need to pass down these configuration parameters to the child. There are two main ways I see this happening. Pass down la...
When deciding for a new web project I have two design choices. First, I can go for traditional web application design. In this case, pages are rendered on server side. Second, I can go for an API server over HTTP. In this case, I have to develop a separate front-end client which will consume the API. I think the second...
I have some open source software I'm planning on releasing which invokes grep -nP via the command line. (Yes, this is arguably a terrible decision.) The problem I'm running into is that while this runs great on Linux, my functions fail on Mac OS, because grep -P doesn't work as expect on Mac. I'll receive the following...
I'm working on a JavaScript user script to assist my team in making assembling support tickets on a web interface more efficient. In doing so, I'm finding myself making a lot of calls to DOM API to gather data, e.g., with event listeners and user-triggered calls. In an attempt to make my script more concise, I have mad...
I am developing a newspaper-like MVC webapp with an article content type which has a visits field. The database is mysql. Each time a visitor requests an article, the visits field of the article is incremented by 1. So I can easily query article table by their overall visits. But what I want is to sort out articles ba...
I work as a Business Analyst in a S/W development firm. At a previous company I was a BA in Asset Management, and the BAs there were more Business oriented (i.e. less technically inclined). We are currently building a web application and I'm using JIRA to write the user stories, acceptance criteria etc for the function...
I work as a business analyst in a software development firm. In my previous organisation, the development was done using waterfall and we wrote: "Business Requirement Documents" (BRDs). In my current role, the team is using Agile Scrum and JIRA to write the user stories to capture the functional requirements etc. My qu...
Let's say I have a class SelectableEntity<T extends Entity> which has three methods, select, deselect, isSelected and count. To take a somewhat contrived example, let's say I'm building an emergency messaging application that allows me to message to residents during fires, floods and other natural disaster. I can selec...
I have recently started exploring the field of machine learning (ML). I think I understand the difference between ML and AI at high level, but I wanted to understand more accurately the differences between these commonly used concepts. After some research, I came out with the following boundaries for these domains....
I have a bit of confusion whether a method should create an instance of a class each time it's invoked? It is all possible to move this instance creation part to the constructor and just use the reference to call methods, but what is the best way ?? Code >> Class B{ void readFromS3(){// this method reads from a S3...
The facts This is a very similar question to this one, but here I am talking about a more general case the MISRA-C3 Rule 5.0.2 or the SEI CERT C EXP00-C rule (more permissive). Within MISRA-C3 I shall use parentheses to avoid implicit operator precedence. So the following code is correct, but to my eyes very boilerpla...
Let's say I have a function that returns a dataset. First it tries to read it and if that fails it is requested from an API and then written: def get_dataset(): try: df = pd.read_csv('dataset.csv') except FileNotFoundError: df = pd.DataFrame(api.get_dataset()) df.to_csv('dataset.csv') ...
I am currently writing an application with the following structure: input: the equivalent of an excel workbook, i.e. a few tables with different headers and a few scalar values. They represent properties of hardware, workers, production processes,ecc.. in a factory and a few "global" parameters. processing: compute so...
I need a way to solve double withdrawal attacks in decentralized databases. For example, a banking infrastructure has multiple servers with their own databases, the advantage is that it lets citizens have quick withdrawals and low latency, with redundant data. The disadvantage is that it allows double transaction attac...
I'm making a online game where I need to preserve some things for the players so each will have an account. However, I don't want to get into the business of storing user created passwords since that's dicey these days. So I was thinking what's the point of even asking for the user to create a password for most apps t...
Distributed Blockchain datastores provide inmutability to recorded transactions and only allow to add records accepted by a consensus algorithm in sequence. You could store data on the blockchain or have references to where data might live in other data stores. The blockchain does not seem to me like an ideal data st...
Today I would like to ask you a question about open-source licensing. My idea is to build a server community in a multiplayer game where you are can use scripting languages (like PAWN, Lua, Squirrel, etc.), allow people to contribute to the source code, however prevent people from using the source to open their own ser...
We have a webapp that will rely on large CSVs from external vendors every month. When I say large, we are looking at around 6gb so a few million rows. Probably, 2-5 CSVs. This webapp will also allow users to enter, correct, and flag/delete data. The number of columns and cleanliness of the data is not guaranteed from t...
We have the requirement to implement some fire and forget long running tasks that fit perfectly into windows services (remote data acquisition and processing, etc) but the requirement is to deploy them into hosts without remote administration rights. We are thinking on the possibility of hosting these tasks as backgrou...
A few days ago I found a fun fact, that finding a collision of 256-bit hash using brute-force is physically impossible in solar system. That made me think, what would happen if we used a good (uniform) 256-bit hash in a hash map. I guess, we could consider, that there are never false key hash matches, so we could get r...
I'm working on a personal project and I've found myself switching between doing some refactoring for a day or two and then some feature-adding for a few days. I like it, and I noted it was similar to how an instructor I worked with wanted to rework the class website. First, she froze the features and worked on refactor...
I was having a discussion with a colleague regarding the HTTP method of an API. The purpose of the API which looks like /booking/{bookingId}/receipt is to send the receipt of the booking to the registered email of the customer who completed the booking. I argue that the method should be GET because the API caller is r...
This is a simplified example, the actual problem has more reports and data points that are requested. Also, more reports could be added in the future so I would like to have something "smart" and dynamic. Let's say I have the following methods: public CustomerInfo GetCustomerInfo(int customerId){/* implementation */ } ...
I already have this core class structure that can not be changed: class A { //some basic fields and methods } class B { //some another basic fields and methods } It is core classes and I'm adding some functionality in addition to the existing system. I need to add some common functionality to this classes. It'...
Most people as they surf the web would get a warning by their browser if they approach a website with an SSL certificate issued by an unnknown authority, or even known as malicious place. Now, thousands of developers - over 80% of Java related projects using Maven Central - download software components known to have v...
I have a system which hits a API on daily basis and collects data. This data is divided into logical groups, with a logical group defined as all data belonging to a particular user. A user has 30 subaccounts and for each account I hit the API and insert data into the database. After each hit, I perform an insert so I h...
The Situation I'm developing a JavaFX desktop application that can be described in three parts: The Data The GUI The Process The GUI is a means of seeing and editing the data and the process is a, well, a process that requires the data to perform its job. Think of the GUI as more of a supplementary piece that allows ...
How a HTML5 game can be buyable? I mean, if it is HTML, even though you obfuscate the code or apply encryption, the whole html and javascript is already on your browser means you already have the whole code. then how can it be buyable? I don't understand. I mean even if you make sure that unauthentic person can not pla...
I need to make some get/post requests to a website that I have credential to log in. I plan to do this with Ruby and Net::Http. As I'm new to this kind of experience, I'm struggling with the fact that the log-in page requests robot verification (check-box kind) - that means I'm not able to automate the log-in phase. Be...
What is more important? SOLID or KISS? To be consistent with SOLID I would have to inject Decorator and Footer classes and create interfaces for them. public class HelloService { String name; HelloService(String name){ this.name = name; } public String getHello() { Decorator decorator = new Deco...
I need to open a game save file, read it, maybe modify it and then save it. The structure of the save is quite simple: it is an object with some members, some of which are data, while others are other objects, those objects have some members, some of which are data, while others are other objects, you see where this is...
junior developer here. I am currently working alone on a web application for a big client of my company. I started last month. The client wants at least 25% of comments in each of its software projects. I checked the code of previous applications and here are my observations : each file begin with a comment block (pac...
I might be missing something but I do not get why in the commonly described worklow the Build follows the Code phases. I mean, isn't it the other way around? We code, we integrate the changes, build it, test it.. The picture is for example on the site below: http://www.bmc.com/blogs/continuous-delivery-continuous-deplo...
There is a common argument about multiple variable initialisation in a one liner, that is : Consider for example int i, j = 1; which might lead some people to mistakingly believe both variables are being initialized We could argue that someone should know enough the syntax of his language to not mistaken about that....
I recently gave advice to refactor some code along the lines of class Validator<T> : IValidator { public ValidationResult Validate(Validatable thingToValidate) { if(typeof(T).Name == nameof(FooThing)) { ValidateFoo(thingToValidate); } if(typeof(T).Name == nameof(BarTh...
The Problem I'm looking for a query to help me solve the following: I have a series of events Each event has a start and end date. Many of these events overlap The answer I'm looking for is the maximum number of events that overlap Example Say I have 5 events: 1 Jan -> 9 Jan 7 Jan -> 12 Jan 8 Jan -> 10 Jan 10 Jan ->...
The c# application I'm working with executes many T-SQL SELECT queries that are stored as strings in a database. These queries almost all involve selecting data from and joining with several tables from within the database. Certain combinations should not be permitted, e.g. column 1 from table X should not be returned...
I've got two applications - one application is essentially a REST service, another app has UI that communicates with REST (uses it facilities). The idea is that rule engine is a service that can execute rules against the input - input is not neccessary player data but some other (like level specific, or quest specific ...
I'm in the early stages of building a cryptocurrency tracking app for iOS and looking for a scalable design. My question specifically relates to the element of the app which retrieves data from an API and converts it to objects. Currently, I have a service layer and a networking layer. The service layer handles a lot a...
We have a complex app which built by using multiple microservices. At a runtime, one of the microservices emits an event to initialize some maintenance process in another microservices, it's ok. But lately, we were required to initialize a maintenance process at the same service from which this event was being emitted,...
I asked a question on StackOverflow regarding how to 'best' use the Builder pattern for constructing a Value Object which could be constructed with or without optional parameters. One answer stated that: A builder is not part of the domain driven design paradigm because it cannot be expressed as part of your domain'...
It's widely agreed that Python's properties are not merely a kludge for working around the past mistake of exposing of publicly exposing data members. But then when is it not Pythonic to use a property instead of a method that doesn't take any arguments? For example, if we were writing the Python standard library from ...
I am building a web application that will retrieve results from a remote server and use them to render some charts and maps. The remote server has already been implemented and contains a large amount of APIs, written in Java Spring Framework. The developer that implemented them, has given me access to a set of non-publ...
I'm building a web extension that will be a wrapper for a public API. There aren't any paid tiers for the API currently, but I'm trying to secure the API key so it doesn't get stolen and used outside of my app. I'd like to avoid having my permissions denied. I currently have 2 ideas that would allow me to do such a thi...
I am trying to write a program to help scheduling shifts for the employees of a small business. There are 28 shifts that needs to be assigned to 28 employees (so this means that each person gets a shift per week). Each employee can provide a set of preferred shifts, so my idea was to procede as follows: 1) first assign...
For example, suppose I have a class like that: public class ABC{ private Data data; public ABC(Data data){ this.data=data; } public void ab(A a,B b){ //some codes needs to use data,a,b } public void bc(B c,B c){ //some codes needs to use data,b,c } } which ABC depe...
I am a newbie at data structures. I have read an implementation of a stack using a simple array. The algorithm for this implementation is presented below. Stack implementation in terms of an array Before implementing actual operations, first follow the below steps to create an empty stack. Include all the header files...
Reading "Code Complete 2" in a Quality of Requirements paragraph I found this: Are acceptable trade-offs between competing attributes specified — for example, between robustness and correctness? (this above is a point of a large checkbox list in order to check the quality of the requirements) So, I found a lot of d...
I have a website where I want to have a partial view on the page that contains a Singleton service. I am trying to do this with Razor Pages, and have tried Partial Views and ViewComponents, but haven't gotten the desired experience, probably because I am not implementing correctly. Here is what I would like to accompl...
Let's say I'm building a trivia game where users can create games with exactly 5 questions and 4 options (games, questions & options have their own database tables) for each question and assume I'm using a front-end MVC and a backend API. I've always had this dilemma as to how the API should be designed. Should I: ha...
I was asked by a public organization to give an informal workshop about the 101 of agile development explaining terms and concepts of Scrum, Kanban, and the like. I have worked in agile environments for about five years now, but I don't think of me as a Scrum evangelist. After the workshop they liked the idea. However,...
My team and I are currently maintaining a caching system that is purely based on keys. From what I've read we are striving for a system that's based on the cache-aside strategy. Where we have a website that talks to a rest service using httpclients. These clients make use of a memory cache which works based on a combin...
We are planning to create REST API which has main objects as User and Article. Article object has following fields Title - one line Description - it can expand to few paragraphs Image - one or more images about article List of categories - categories of article ( starting with one but in future can be more) List of...
Hopefully the title is not painfully obscure, but as it indicates, I'm really looking for advice on my architecture proposal, as the current architecture is subject to concurrency issues, performance issues and dictated by third party software. The platform is essentially a naïve Micro-Service pattern followed by being...
Summary: Is the usage of the word "Friday" to refer to released/old software or requirements something widely used and if so: is there a definition and/or reasoning behind this terminology? Longer version: At my current workplace, some formal requirements are written in the form 'High-level description of some function...
I have implemented clean architecture for my app, and I have a few questions. Typically, pure DI is argued for over a Service Locator pattern, because it is very explicit and more testable. However, I like the idea of having an object that contains all of my services or all of my repositories, and I can just inject tha...
I have few state machines which run "concurrently" in a super loop. do { state_one(); state_two(); state_three(); /* The point I want to deal with the error */ } while(1); Each of these state machines might consist of other state machines. I'm trying to figure out a way that I'll be able to catch an unexpect...
Is it okay to implement a virtual method in a base class because I know that the majority of derived classes will use that particular implementation? Suppose I have the following class hierarchy (in C#): public abstract class BaseClass { public virtual void MethodA() { //Implement MethodA as DerivedClassA a...
I'm new to TDD, and relatively new to software development in general (e.g. < 4 years experience), but I am trying to learn. I have been toying with TDD but ran into what I know realize is a common problem. I have been testing both higher level API contracts, sometimes with integration tests when necessary, and lower l...
So I was having a discussion with some co-workers, imagine I'm designing an API. The API takes in a list of IDs, and returns a list of corresponding objects for each ID, each ID corresponds to exactly 1 object, and if any ID is not found the entire call fails. The objects returned do not have the ID used to query for...
Does using touching a database mean a unit test is an integration test even if you are using fixtures? If so, what are the alternatives to write a unit test when you need to use models as a part of a test in a CRUD app (e.g. Ruby on Rails)?
We are developing internal api's for integrating the server side logic (backend) with frontend (web, mobile etc). We have a java stack in our backend and front end is coded in react and react native. Since both of these are developed by our organization, as API providers we have complete control over the API consumers....
I want to document my code such that there is minimum need for reading and browsing the code again months later. I know that there are different types of documentation (in source code and outside, sequence diagrams, and so on). I just want to know what is an efficient way to document my code so that, when a few months...
In my team we have been cleaning a lot of old stuff in a big monolithic project (whole classes, methods, etc.). During that cleaning tasks I was wondering if there is a kind of annotation or library fancier than the usual @Deprecated. This @FancyDeprecated should prevent the build of the project from succeeding if you ...
I have the task to port some code from Visual C++ to gcc. Some calls are gcnew and gcroot to handle managed code inside cpp module. How can these calls be ported to gcc in a fashionable way?
In general, I would my domain objects (customer, contract, etc.) to be always in a consistent state. However there are situations, where they might be in an inconsistent state, and nevertheless I want to work with them: When I load the domain-object from the database and it is in an inconsistent state (maybe someone c...
Community, as our software and development team grows, we ran into multiple problems: Multiple Config files with different paths for each machine "Do I need this tool? And what version, I don't have this yet" - "I use it with version x.x" "Why does this work on my local machine but not on the prod server?" "Which Visu...
I'm writing the service layer for my DAO and I've made it extend the DAO interface. It looks a bit like this: public interface FooDAO { Foo get(long id); boolean update(Foo foo); These two methods will do for now. Now, writing the Service layer over that: public interface FooService extends FooDAO, AutoCloseab...
I am trying to learn Specflow. I have bought a book and it arrives at the weekend. Most of the scenarios I see online are for simple things like calculators. For example, please see the scenario below: Feature: Calculator In order to avoid silly mistakes As a math idiot I want to be told the sum...
I was in a job interview demo-ing a RESTful API in Flask when an argument broke about the API. The interviewer argued that the URL for adding a new user (/users/new) is not proper REST. My API endpoint looked pretty much like below: GET /users # get all users GET /users/1 # get user 1 DELETE /users/1 # delet...
I am currently developing a simple game in Unity. I got a game board composed of hexagons. Let's say, the red dot is the player. Now I want to show the user on which fields he can go, depending on the number he diced. The user should not be allowed to enter one hexagons multiple times in one move. Is there any algorit...
I build an object in vb.net where I store data from JSON file that I get from a RESTApi. The object is nested and looks like this: Public Class FullData Public Property userID As ULong Public Property data As List(Of String) End Class Public Class GeneralInfo Public Property id As Integer Public Proper...
I am faced with taking a mvce's for SQL which happens to be the WideWorldImporters Database from Microsoft and migrating it to a NoSQL on mongodb. The system in question may use certain fractions of the SQLDB lesser than the others, but certainly no clear approach has been formulated except that, we understand, denorm...
I am looking to create a website. There will be a portal, from which the user (and thier associated users) can create/access one or more databases. There will be many different databases in the background (for historical reasons, please just go with that bit). It must obviously be as secure as possible. I thought it pr...
IComparable only works one way Let's say you have a Employee class. In one view, you want to show all Employees sorted by name - in another, by address. How are you going to achieve that? Not with IComparable, at least not in any idiomatic way. IComparable has the logic in the wrong place The interface is used by calli...
User story: I'm developing a new program and try to put as much program logic into different libraries as possible to increase the reusability. For interfaces where only a single library or "module" is needed, it is easy. Simply add the library to the project and work with the interface of the library. Problem: But n...
I have been reading up on UDP connections and understand that UDP transmissions are "Best Effort", maybe your data will be received, maybe it won't, and if it is, it could be out of order. What I'm struggling to find information on is, what happens if the data you are sending via UDP is large enough that it must be sen...
I'm trying to learn DDD/CQRS in a hobby project. And have no prior experience. In this project I use MongoDb as a read db and EventStore as a write db. I'm building a simple 'Sprint board' application. (JIRA / Asana like) Model Sprint Tickets I decided to model this as two separate aggregates. Because I wanted to ke...