All Questions

1
vote
3answers
207 views

How to specify that a number is a random number, or a rounded number, etc

Trying to better understand how to write specifications for automated theorem proving and testing, etc. One seemingly simple example is generating a random number. I would like to know how to specify ...
-2
votes
0answers
35 views

Neural Network Weight Update [closed]

I'm currently reading Artificial Intelligence: A Guide to Intelligent Systems by Michael Negnevitsky (3rd edition) and came across this example of weight updates in a neural network. The equation for ...
1
vote
2answers
82 views

Transforming one collection of objects into a separate unrelated collection?

Say I have a customer class class Customer(name, age) somewhere in my code, I have a list of customers List[Customers] at some point, I need to transform this list of customers into a Map with ...
-1
votes
1answer
26 views

Branching strategy when utilizing open source application

I'm looking for advice on what a good branching strategy looks like when using mostly open source code. Most of my dev experience is with writing and working with custom made code and only using open ...
0
votes
2answers
52 views

backwards compatibility of REST API for update/patch when adding new fields

Context: Suppose the current way to update a person is to use HTTP PATCH, where you can set the firstname and lastname: { "firstname": "john", "lastname": "doe" } And you want to add an extra ...
10
votes
5answers
683 views

Pure functional vs tell, don't ask?

"The ideal number of arguments for a function is zero" is plain wrong. The ideal number of arguments is exactly the number needed to enable your function to be side-effect free. Less than that and you ...
2
votes
0answers
36 views

How to let users specify their own logical conditions (PHP / Laravel)

I am currently trying to create a web application, that saves inbound emails. I have figured out how to save the incoming emails into my database, and I have all the email information available (...
0
votes
1answer
52 views

Objectreference vs Equality [closed]

While coding I stumbled upon something like this (extremely simplified example): public bool Func() { Object[] array = new Object[] {false, false}; return array[0] != array[1]; } I was ...
-4
votes
1answer
73 views

Running python script in a node server? [closed]

My younger brother has made a small rock, scissor and paper python game running in console. I want to host it on my own domain, running on a digitalOcean droplet. I have no more experience with python,...
-2
votes
2answers
105 views

Should I call a callback for an event triggered by a developer?

I'm designing an API for a stream-processing library. The library will process a stream provided by the user and will transition between states based on the data in the stream. The state transitions ...
3
votes
5answers
229 views

Should a Product Owner be responsible for an initial prototype?

Is it typical that a Product Owner (or even a BA) creates a high-level prototype/wireframe of a system based on the requirements document to ensure that the requirements are clear enough to start ...
0
votes
1answer
47 views

Pipeline design pattern with context for chaining REST API calls

Just like the title says, I want to use the pipeline design pattern for chaining related API calls. The context will store the data that will be used to create a payload. For example, I have the ...
1
vote
2answers
71 views

Python method docstring: to use or not to use Args: Returns:

Default docstring from PyCharm automatically creates template with Args: and Returns: sections. However I have observed that this prompts people to say obvious things, frequently just stating the ...
-2
votes
0answers
38 views

SSO authentication & authorization architecture/implemenation

We got a bunch of different services (SPAs + API GW, legacy JavaEE apps, etc.). Each of those is usually ran in multiple instances (customer specific instances). The plan is to federate them under a ...
-3
votes
0answers
85 views

Technically, is it possible to code JavaScript in frontend to manipulate a database like MongoDB? [on hold]

I know it is the job of the backend to manipulate a database; for JavaScript, we could use Node.js to talk to a database like MongoDB. However, I want to write some scripts to use locally by myself. ...
0
votes
1answer
42 views

“Fetch the data if it doesn't exist” selector?

Let's say I have a react component like this: const MyComponent = ({data}) => (<div>{JSON.stringify(data)}</div>); const myReduxSelector = (state, id) => state.someData[id]; ...
0
votes
3answers
103 views

Designing a class whose dependancies require “starting”/initializing step

I have Facade class which requires an Endpoint instance to function (it uses it in most of the functions). Endpoint is attached to Platform that is passed in Endpoint's constructor and has to be ...
3
votes
1answer
135 views

Alternative to a utility class for extension methods in C#?

I understand that in OOP languages like C#, it is generally viewed as bad practice to create utility classes, and it's preferable to put methods in the classes in which they will be used. To that ...
3
votes
3answers
87 views

Open Close Principle is applicable when requirement is to add new operation(s) to existing type?

I understand OCP in SOLID can be applied when we have same set of interfaces defined via abstract type, so that we can have varying implementations of those interfaces via concrete types. For example,...
1
vote
0answers
19 views

Dynamic API Data Validation

I am in the process of building an heavily data-driven web application written in Node.js / Typescript with Mariadb for the database engine. I am trying to put an emphasis on extensibility and DRY ...
-2
votes
0answers
37 views

Pattern for building objects from JSON [duplicate]

Is there a specific pattern that we can follow that allows to build and object graph from reading say JSON or Yaml config? I already have my object defined but now I want to build a bunch of them by ...
0
votes
1answer
100 views

Multiple DLLs vs Multiple EXE's in a project that needs to be modular (web browsing automation)

First of all, C# solutions are needed. So in my team I am responsible for creating a program that will receive a "task" in json format from an API, from this json it needs to figure out what website ...
0
votes
7answers
297 views

Good object oriented practice to use an object to build itself?

Do you think its a good OO practice to use parts of an object to build itself? Here is an example. var car = new Car { Make = BuildMake(), Model = BuildModel(), Vin = ...
-2
votes
1answer
39 views

Ordered vs sequence in association in UML

I am trying to understand UML class diagrams. Imagine two classes that are related with each other by association. What is the difference between {ordered} and {sequence} for the association?
4
votes
3answers
458 views

What exactly is Yak Shaving?

This came up when a developer brought in these planning poker cards, one of which is Yak Shaving. There are various articles on google/wikitionary which basically say: Yak shaving is programming ...
-1
votes
3answers
234 views

Can an object in java have behaviour without having any state

I was just studying the interdependence of state and behavior exhibited by the state of an object and its behavior.was wondering if an object can have behavior without having state. Because i am very ...
1
vote
0answers
40 views

Better approach of testing groups of small services with or without dependency injection

Let's assume, that frameworks I use, provide some kind of dependency injection automatically available in testing environment. Let's also assume, that I have a lot of micro services in my application....
-1
votes
1answer
76 views

What ways is forcing cross-functionality upon individuals detrimental? [closed]

It takes many years for one to become an expert Java developer, or an expert SQL-DBA. What are known detriments to insisting that a JAVA developer "picks-up" UI design in a team or that a SQL-DBA ...
0
votes
2answers
75 views

Integration Testing - Units of measure

A SW-Component "SWC-A" is integrated with a SW-Component "SWC-B". The SWC-A has an output interface which provides "Distance in meters". The SWC-B receives this value and does some calculation. If in ...
1
vote
2answers
291 views

Avoid if-else block in favor of default assignment followed by if

A colleague, and frankly better software engineer that me, is telling me that this pattern let variable = someDefaultVariable(); if (some_boolean) { variable = someOtherValue(); } is better than ...
0
votes
0answers
24 views

Asp.Net Core: creating files in background

I have a web app with SPA client. When user requests a report, that request should create an excel or pdf file in background and notify user via SignalR. I guess I need to save that file somewhere ...
2
votes
2answers
60 views

What does message means in UML sequence diagrams?

In UML sequence diagrams, given two objects A and B, if Object A sends a message to Object B. Does this mean the message is a method in Object B which is invoked from Object A?
0
votes
2answers
101 views

How to handle command line parameters

I am writing a gui that is supposed to replace a fairly large shellscript in order to make the usage easier for not-so-technical people. The script calls a certain program (saga_cmd) multiple times ...
0
votes
3answers
192 views

Responsibility of a Factory

I am trying to refactor a huge chunk of our software, and it requires to set up a factory. However, I am not sure where lies its responsibility. (PS: The code below is shown simply as an illustration ...
107
votes
12answers
14k views

Rationale to prefer local variables over instance variables?

The codebase I'm working on frequently uses instance variables to share data between various trivial methods. The original developer is adamant that this adheres to the best practices stated in the ...
7
votes
1answer
630 views

I accidentally overhauled someone's entire project. Any acceptable way to pull request?

I found a great project on github with a useful central feature but which is rough in the "polishing" of error handling, logging, config, and setup. The project is 5 years untouched, and only a couple ...
0
votes
0answers
54 views

Realizing input & output signals from C++ code

I am dealing with C++ code that I want to model it as component diagram (UML2.0). So, a main step is to realize which parameters are input & output signals. One problem with that is: Not every ...
29
votes
4answers
4k views

When should a commit not be version tagged?

Context: I recently found out about Semantic Versioning, and am trying to determine how to best use it practically for my own projects. Given that semver takes major changes, minor changes, and ...
5
votes
2answers
250 views

Is it bad practice to use a single endpoint to do multiple similar tasks?

So the scenario is that I'm asked to redesign and refactor a REST API by combining multiple endpoints that do similar tasks. For example, now I have 10 different endpoints that are all used to upload ...
1
vote
7answers
654 views

Why don't languages not use the words “and” and “or” instead of “&&” and “||”?

When I was a beginner it took a while to learn the language syntax and the idea that languages couldn't improve after they were invented. But now we're seeing new language features added every year ...
-2
votes
2answers
125 views

How to handle multiple versions of binary file format

I'm writing a reader for the custom binary file format used in one game. The format has multiple versions for example: struct FileHeader { ushort version; uint fieldX; // version 1 uint ...
-1
votes
1answer
174 views

What does it mean for an algorithm to be conservative? [closed]

Example: Minimum loss reduction required to make a further partition on a leaf node of the tree. The larger gamma is, the more conservative the algorithm will be.
0
votes
1answer
65 views

Some Suggestion about Data Modeling

I want to make a social game for Android. I am using NoSQL Based Database (MongoDB) and I am using NodeJs. I am using Android-Volley library to make POST and GET requests. But I am stucked on ...
-2
votes
0answers
17 views

How to share Firebase Analytics for just one App on a project? [on hold]

I'm aware that I can share Firebase Analytics of a whole project to someone, either via an Invitation or by connecting it to Google Analytics, but I'd like to share only one App's info, since two Apps ...
94
votes
6answers
18k views

What is a term for a function that when called repeatedly, has the same effect as calling once?

(Assuming a single-threaded environment) A function that fulfills this criterion is: bool MyClass::is_initialized = false; void MyClass::lazy_initialize() { if (!is_initialized) { ...
1
vote
1answer
61 views

Check if object exists before updating/deleting

In an application that doesn't use an ORM, is it good practice to check whether an object exists before attempting to update/delete it? For example: @Route(method="DELETE", path="/posts/\d+") ...
0
votes
1answer
100 views

Is the complexity of this code quasilinear time?

Algorithm explanation: based on an unsorted list I want to find the indexes of the values in another sorted list. Note that all values are unique and the two lists have the same values, only in ...
-2
votes
1answer
45 views

Given list of sets, find set of elements which belong to at least two different sets [closed]

Given a list of sets S, I'd like to find a set of all elements which belong to at least two differents sets in S. Here are my attempts in Python: import itertools duplicates = set() for u, v in ...
-2
votes
1answer
44 views

Preuso/empty entity or only real entities + nulls?

I have a table "products" and a child one "product_modifications" Some products have "product_modifications": "colour", "size",, .... But not all. When a client orders a product, views pictures and ...
0
votes
2answers
93 views

Can there be too much logging? (Front End & Back End)

In a bit of a dilemma. At work we are having issues with an API service that communicates with the client side through a WebSocket. The problem so far is that the WebSocket seems to be unreliable. We ...

15 30 50 per page