instruction stringlengths 34 36.1k |
|---|
I have an open source API server project on Github and I am trying to put it into continous integration. The project uses SQL Alchemy and I use ELAlchemy to manually generate a png database relationship graph (in png format) and put it into my documentation (in .rst format and uploaded to Read the Docs).
Now I am usin... |
As a creator of a software library, how can I verify backward compatibility with earlier versions?
When using a dependency management (here: Maven), multiple versions of my dependency could be (transitively) used:
com.example:some-project:jar:1.0.0
+- com.example:my-library:jar:1.1.0:compile
+- org.example:another-libr... |
I'm building my project with Visual Paradigm and I have some use cases that implements the CRUD pattern.
As specified in the book Use Cases: Patterns and Blueprints, Övergaard and Palmkvist suggest to implement a single use case as one of the best ways to handle this type of use cases. There is a different flow for eac... |
I have no experience with C (only C++ and higher level languages). Right now I have tried and failed to find general guidelines on how to write good C code in a way that allows to separate the programm logic clearly into replacable parts that can be combined with other parts or reused in other projects.
To give some co... |
What the different types of SDLC models and in which systems are they most suitable for?
|
I am working on a problem where I need to extract data from text. I first considered using regular expressions, but some of the data is not in a format I am sure how to handle or even if regex is the best way to handle it. So, some lines are simple [fieldname]: value \newline. Unfortunately, others have nested data, ... |
I am traditionally a desktop app developer, but circumstance has thrust me into the role of doing web client and corresponding REST api logic for a project I am involved in. Unfortunately, I'm a one-man-show, so my opportunities to learn new patterns or techniques from co-workers is somewhat limited. When I was rampi... |
we have a legacy project, on Windows. It goes on from 1990-s.
Until very recently it was not backed by any version control, today it is moved into Git.
The question is all the prior snapshots. As of now, they are spread on network shared folders, with folder names usually suggesting the part of the project, the date or... |
We have an application that has served us and our clients well from some 20 years now. Pretty good track record but it's obviously showing it's age in some areas.
We are looking for advise and suggestions for bringing the product to the next level. The idea is to address some issues without throwing away or rewriting ... |
My question
I built an inverted pendulum on an Arduino using C (ie. everything was done procedurally). I'm trying to self study application design and would like to refactor my code into a more OO approach with SOLID, loose coupling, and testability in mind.
How can I improve this design to achieve a more loosely coupl... |
I am a scala developer new to swift. In scala we can share implementation across a variety of classes by "extending" a trait that has default implementations for the methods. I would like to see how to do that in swift. Here is my shot at it.
Let's consider an Alerting mechanism to be added to many application classe... |
I am working on a web application as a hobby and trying to learn some concepts related to cloud development and distributed applications. I am currently targeting an AWS EC2 instance as a deployment environment, and while I don't currently have plans to deploy the same instance of my API application to many servers, I ... |
Lately, I've been working on a project which basically is a huge rewrite in .NET Core F# + Event Sourcing + PostgreSQL of an old sub-ledger legacy app written in .NET 4.6 C# + SQL Server.
Since the whole rework thing cannot happen overnight and the legacy process needs to run till every single piece is tested replaced,... |
As my first job, I joined a startup with a small number of developers.
I mainly work with this one other person -- let's call him Paul for now. We are the only two devs on our team.
He joined the company a year before I did, pretty much at its inception, and built a considerable part of our company's core and gets a lo... |
I am developing a webservice, which offers different services, but currently under different ports. Existing services like GitHub or GitLab also several services, but I am wondering how they can expose them under a single port. Are they looking at the header of request and decide if it is a git client or web browser re... |
I'm trying to learn about MODBUS as a free-time project. It is a long standing desire to write my own driver in Golang. That being said, I'm now trying to design the concurrency model for device connections.
I'm using the MODBUS specifications from modbus.org as guidance. Specifically, my question arises after reading ... |
I am watching this talk by Sean Parent. He notes that:
Choosing the same syntax for the same semantics enables code reuse and avoids combinatoric interfaces
What does "combinatoric interface" mean?
Could you explain with an example?
P.S. Thinking more about this my guess is that if we have n types and m operations wi... |
Please, consider the below merge sort algorithm. Here we start with a divide portion which splits the array into halves and we do recursive operation on each half separately. I have ignored the merge portion of the algorithm to reduce complexity.
function mergeSort(unsortedArray)
{
let midpoint = Math.floor(unsorted... |
I have an architectural question. I have an application which is subscribed to a log compacted Kafka topic. I have to process each event and store into a persistent datastore. I am planning to run the app in 4 instances with the same group-id so that the partitions are distributed with all the nodes.
During the lifetim... |
I'm working on a PHP web application that depends on a few 3rd-party services. These services are well documented and provided by fairly large organisations.
I feel paranoid when working with responses from these API, which leads me to write validation code that validates that the responses match the structure and dat... |
...to prevent messing up with data updates, such as prices, titles, of the products that are placed in an order.
Namely, a customer buys 3 items: for $5, $10 and $33 and pays for them. All is well. When I as an owner of a shop step in and, before I've delivered those products to a customer, decide to descrease the pric... |
I am writing a paper trading system, and what I have works, but I can't help but feel that there's a better way to partially close a stock position; what I currently have seems a little overboard.
Partially Close Scenario: Customer A buys 100 shares of stock X at $1 then, later the customer sells 80 shares at $2; leav... |
I wrote a small video library app. It renders private Vimeo videos for paid subscribers.
The owners of the app would like to reward users who watch videos. My first implementation was to trigger a watched mutation at 80% of the video playback (this was not ideal but clients demand features). Users have figured this out... |
Oftentimes, "dirty" is used to represent unsaved code, memory, or files. For example, a file can be "dirty", meaning it's unsaved, memory can be "dirty", meaning it's been modified but hasn't been written to RAM, and Git reports its working tree as "clean" when there are no uncommitted changes.
I understand why you wou... |
We will finish a sprint with stories tested and "Done" and thereby closed in Jira. They often sit in a branch somewhere until someone remembers we have code waiting to be pushed live. Or worse, we go to push something live and someone will pipe up with "oh that also includes xyz change...", or even worse we push one ch... |
I am working on a system where I am planning to send a large amount of data in a message to an event queue. About 150 or so small objects. I know the technology should be able to handle this, but is it good practice?
|
How should I set up my project when I want to run the present version of a class against previous versions? I'm interested in issues related to code organization, file naming, and source control.
I have a stable version A of my code, and am working on some accuracy improvements for version B. (It's a forecasting model ... |
Is there a standard on db alter scripts (both data and ddl), should they be re-runnable if so what are the reasons for making them re-runnable.
The only web pages I could find are telling me how to do it, but i want to know why to do it?
|
I have a library (npm package, LIB) which is used by the application code (APP). In a release of APP, multiple features are worked on parallely. Sometimes these features need support from LIB, so the changes need to happen there too and LIB used semvar.
When multiple features like F1 and F2 are being worked on in APP, ... |
I am writing a client facing library and wanted to check if the below approach sounds reasonable? This library is a service that consumes HTML and creates a greeting card.
I feel writing Services and ServicesImpl may not be necessary and I only need ServicesImpl because the content in Services and ServiceImpl will be c... |
I have a block of code that branches into 2 pathways, let's call them the "simple" and "complex" branch, based on user input.
Either the simple or complex logic has 4 steps, let's call them A, B, C and D. A, B and C each have 2 different variations depending on whether we're in the simple or complex branch.
In the comp... |
I've got a project with an HTTP API which returns data from a database. The layers it goes through to get to the API look like this:
DB -> Repository -> Controller
I'm looking to restrict the results which are returned based on the permissions of the requester. Should this be included in the repository layer, or the co... |
I am trying to plant a garden. Certain plants are good for some plants and bad for others, and I am trying to find the best order of plants: most adjacent friends and no adjacent foes, as defined in this table:
Num Vegetable Friends Foes
1 Watermelon 7,4,3 8,6
2 Tomatoes 9,8,6,5,1 7
3 Su... |
We are struggling in deciding scope of end-to-end tests. As per our understanding, we have automated the form exactly the way users interact with it. below are the steps user perform while submitting the form.
Step 1. User fills the form
Step 2. If all the validation passes. We submit the form using an API.
Step 3. We ... |
So I'm currently playing around with web development as a project, and I've been looking at React recently. My current issue is that I'm having trouble distinguishing between front and back end seperation.
From my understanding, the front end is the UI that the client interacts with, and the back end is the server itse... |
i have a problem in my scalable Pub/Sub application that it can not take more than 30 RPS when big amount of sessions are open against it.
first i will explain the application structure.
the application is a spring-boot embedded tomcat with 200 tomcat threads.
it is like i said a Pub/Sub application with multiple inst... |
I've looked through similar questions and tried to Google what I'm trying to do, but I haven't found anything concrete.
What I'm trying to do: where I work, we use an HMI/SCADA system that displays tags, machine states, and other standard SCADA functions. Recently, I figured out how to send HTTP requests from the SCAD... |
so my project is that I'd like to pull data from a bunch of different services/API's and show them in a single dashboard. SSO is a requirement so I want to make sure the user doesn't have to put in their password over and over.
The system already has SAML2.0 set up with ADFS which is configured as the identity provider... |
In my opinion it should not since it violates single responsibility principle, but I am finding myself often calling both.
Edit: here are the 'boring' details:
As you all know, we cannot escape the existence of an Util class. It simply exists. I have a static class Util that has some helper methods, and there dwells ... |
My web app is built around classes that I call widgets. Their goal is to be reusable and modular, to suit different scenarios. For example, I have a widget called BreadcrumbWidget which has two functions:
addHome(): adds the "Home" breadcrumb.
addBreadcrumb($title, $url = null): adds any number of breadcrumbs.
I ha... |
I have been doing problems on LeetCode recently, and keep getting stuck on some graph or tree problems. I understand the underlying concepts of Graphs, Trees, and different methods of traversal just fine. For example, I can code a tree from scratch by creating a class for the Node and then passing the root to a functio... |
I am building an app where you can invite your friends to join the platform and discuss various topics. (almost Reddit).
Functionality: When you create a topic you can enter the email of users you want to add. If some of the users are not registered with the platform, we send them an email, asking to get onboarded and... |
We have some entities in our code:
-"View" and View has some attributes and also contains one or many "SubViews"
-And each "SubView" has some attributes and contains one or more "Tweet" entities.
So far so good. User edits Views/SubViews/Tweet (adding/removing tweets from subviews, adding/removing subviews fro views et... |
The first alternative can result in lines that are too long, and so reduced readability in some web browsing.
The second one can result in a better web readability, but might annoy command line debugger users.
Example:
blah_bleh_blih_bloh = something(arg_a, arg_b, arg_c, arg_d, arg_e);
blah_bleh_blih_bloh =
so... |
I'm currently designing an IoT device that connects to a home network and an app to communicate over said network. I'm trying to find a way to reliably connect to the IoT device/ make the IoT device easily discoverable. I've had a few ideas on how I could do this:
Local DNS. - however, not all routers support this so ... |
Recently I was asked to refactor some code that leverages JavaScript's array.reduce() method because other developers felt the code hard to read. While doing this I decided to play around with some JavaScript array iteration performance benchmarks, to help me validate various approaches. I wanted to know what the faste... |
Assume I have the following two functions:
function storeObject(object) {
// Connect to database
// Prepare query
// Execute query
}
function retrieveObjectWith(id) {
// Connect to database
// Prepare query
// Execute query
// Parse results
return object;
}
And that I want to write te... |
Is it mandatory to implement a REST API even if it doesn't make sense?
I have created an app consuming REST services from other apps. Now that I have the final result, I wonder if it is needed to implement my own REST API, because as I try to implement it seems that the API has the same funcionality as the APIs I'm usi... |
I'm pretty new with C so I have encountered many doubts with pointers.
I've already search a lot about this but there are some things that still are not clear for me, and I also think this will help other beginners:
I'm currently working with something like a binary search tree, more specifically a dictionary.
In both... |
I am planning to do the university project with the Desktop application + web application + mobile application, I have planned to use languages for these 3 as below:
Desktop application: Java SE
Web application: PHP
Mobile application: flutter with Dart
Database: Mysql
Now I have a problem with how to connect these 3... |
Given I have a message bus that can handle commands and events. A command handler can dispatch an event. But should an event handler be able to dispatch another command? Or should event handlers only be able to dispatch further events?
Example:
PostReceivedEventHandler subscribes to PostReceivedEvent, invokes Validate... |
In a couple of my programs, the program needs to know an IP address and a port to which it should connect or send data to.
The solution I have right is to ask for user input via the console - but this just doesn't look like a good solution to me for passing the parameters to the program in the long term. In a later st... |
As I'm spending more time working with SQL, I'm starting to feel like this language promotes logic obfuscation. Here are some examples:
An INNER JOIN in a query can act as an implicit filter that reduces the result set into a subset. However, to understand what is being filtered, you needs to have knowledge of the tabl... |
I am playing with my simple personal project - a simple REST API application and I am currently struggling with a kind of design problem.
The problem:
How to insert an operation ID (request ID, an identifier of each operation) into each "layer"?
Context:
Let's say I have a UserRepository trait (interface) with 2 imple... |
The project I am working on is a SaaS application with multiple payment tiers. Each one has multiple limits for different actions. One example would be that a free user can only create 1 space, a premium user can create 5 spaces, and a pro user can create unlimited spaces.
I am thinking about a system that has the foll... |
We will be streaming data from Phones (<= 5000) to a server. We were previously sending the data using MQTT to AWS IOT. Now we want to run this locally. Estimated size per second to be ingested is 5000 phone * 500 bytes = 2.5 MB to 5 MB. 5 mBps = 5*8 mbps i.e. we are looking at something like 20 to 40 mbps. This is not... |
We have an SSO application that provides authentication for a native mobile application, as well as for a web application. There are some features that the web application has that the mobile application does not, such as account management. We would like to keep the user logged in (without having to sign in again) w... |
In general terms, what's the added value in using the techniques described in the iconic book "Modern C++ Design"? Is it simply the ability to write reusable code that's easily extensible? Or are there particular classes of applications where development can be greatly facilitated through the use of such techniques?
|
In SAP ERP (probably in other SAP systems as well), you have transport orders which you could see as "commits" i guess in git. These transports are send from development to test or production system and then "activated", which means compiled in their terms.
With git you normally solve this with different branches or ta... |
Say we have a boolean variable indicating whether an input array is 2D or 3D (just an example). Is it acceptable to name it is_2d_or_3d instead of is_2d, to make it clearer that if false, it indicates the input is 3D?
I've personally been doing this for quite some time. I don't remember if I picked it up from some guid... |
I have some external SDK library that makes IO calls (either networking or database) in the form of blocks, like so:
SomeClass.doWork(success: {}, failure: {})
Now I need to chain about 60 different calls because we are working on data replication where each operation is distinct enough that it's not the same, but the... |
I'm trying to understand what microservices are and MINIX's microkernel architecture seems to be a good analog. (I'm a systems engineer.) In my understanding:
Microservices are like user space drivers
That applications don't ask the kernel to do all the work. Instead they send requests to various services (drivers) t... |
I'm currently evaluating Event Sourcing and CQRS for an implementation of a new business requirement at my day job. While I can't really speak about the actual business problem, I can give a few reasons for why we think that Event Sourcing might be a good fit:
great auditing capabilities based on the history of events... |
My question is related to designing new software. Let's say I work in a medium-sized company that has a core product. Now we want to start with new software (purpose of the application is different than the core product) with a completely different approach. There is a document with the main features from business poin... |
I am working on a WebAPI application which follows the layered approach like Controller > Service Layer > Repository Layer > Entity Framework Core (SQL / Cosmos) The view is in Angular.
In many of our API, we have some transformation required on the Request object (DTO - request send by UX) to a domain entity that my r... |
How to tell if we have unused require expressions?
For example:
require 'colorize'
require_relative './helpers'
puts 'Hello, world!'
This is a very simple example but there can be larger/complex cases when after some refactoring we forget to remove the requires, is there an easy way to identify those unused requires... |
I'm trying to find the correct flow to manage this kind of development, where A and B are two independent features, and C is a third feature that relies on A and B.
An obvious approach would be to develop the three features in a sequential way, such as:
----A----B----C
But I want to be able to push A and B for review... |
I am looking for a way to automate deployment of configmaps to our dev/qa/prod environments. Right now our applications rely on kubernetes configmap/secrets that we manually apply in the cluster using
kubectl apply -f {name-of-configmap}.yaml
This is fine and all but before I send my code to our dev environment for in... |
Solution as it is right now
I have this solution where I gather information from a proprietary product of a different company in various sites. The solution is based on a single go binary that contains everything needed to run the application (even an embedded sqlite) and is deployed to Windows computers running the pr... |
I'm working on a project that is a API with many controllers and modules. Which of the following is the best architectural practice to organizing my API controllers by dll (.NET 4.7 WebAPI)? Why?
OBS: Each item is inside a module is a dll
One dll for each controller. Each csproj contains only one Controller.cs file:... |
I found this also happened in my team although he may have exaggerated the situation a little bit.
Scrum is a way to take a below average or poor developer and turn them
into an average developer. It's also great at taking great developers
and turning them into average developers.
Everyone just wants to take something... |
I realize this is a subjective question, but after studying F# and functional programming I've seen the benefits of immutability.
Now, I'm thinking of getting rid of mutability entirely in C# unless specifically required. In essence, where before I might have written a function with a signature like -
public static int... |
Java collection streams were introduced in Java 8, which came out in March of 2014.
By that time, we already had well-established mechanisms for manipulating collections in several other languages, at least two that I can speak of:
In C#, Linq provides extension methods such as Select(), Where(), etc. including collec... |
I have a collection /users/{userId}/tools
and I want to GET and POST to that collection. Can I have different representation of that object based on the method?
For example, for POST I want to send only
{"name": "Toolname", "material": "MaterialName"}
so I built a DTO with only that 2 fields.
And forGET I want to retr... |
Assume that there is a library and it provides an interface to its users in order to callback them. Users implement this interface and receive notifications from the library.
Let's say, ICallback is the interface, and Notify1(arg1), ..., Notify5(arg5) are the interface methods.
interface ICallback;
+ Notify1(arg1)
+ ..... |
Is it doable, desirable to organize project classes, dependencies in Tree/DAG structure?
To be more specific. In applications (not libraries) we have always some entry point, am I right? Some main class. Here we keep some core dependencies, which have other dependencies and so on. We treat it as root of dependency tree... |
The following is an example requesting an explanation for one specific file in one specific filesystem, not helper classes generally.
I have configured a LEPP stack on a CentOS server. The server hosts an API which is built using Slim PHP Framework. There is an official skeleton repo on Slim's github.
The repo has a ba... |
In the Model-View-Controller pattern, I do understand the role of each component.
The Model represents our application's domain model. The View presents this information and the controller manipulates business logic.
I do not understand from any diagram that I saw, who knows about whom. Does the View know about the Con... |
Let us say that for a web application, inside the source code of the app you created a function called calculateAmount. Inside the
web app, you need to call that function.
But for some reason, due to the need for 'automation', you want the
app itself to 'think for itself', at which stage of the program, which function... |
On multiple occasions, we've deployed frontend code to production only to find out the backend (REST or GraphQL) hasn't shipped their side yet. Worse yet, we unexpectedly find out a param name changed which may throw an error. Another example: the backend removes an API thinking that clients no longer use the removed A... |
I'm developing a social network with Django (Python) + Postgres SQL. My site will have a chat feature so that users can communicate to each other in real-time, and the communication will be only from user-to-user (so there won't be chatrooms with more than two people).
Let's say that in the future my social network has... |
Background
Simplifying, assume I want to write some tool for code-analysis, which tell me which files - class/module - are/have some kind of network interface(s). No matter if it's REST Controller, DB connection, RPC or simple socket.
Restrictions
I want to achive this automatically. What do I mean by that? I don't wan... |
There are different methods for recognizing classes in UP methodology:
noun/verb analysis
using CRC analysis
using RUP stereotypes
other sources
I have read above methods fully detailed in UML 2 and the Unified Process_ Practical Object-Oriented Analysis and Design (2nd Edition)-Addison-Wesley Professional (2005) boo... |
I am at the stage of implementing a my 1st ever view, after developing a Model and Controller, however there is a problem.
I have been reading this article on MVC, which is what I have been aiming for when implementing, but I kind of went off-script when making the Controller because I didn't remember to look back at i... |
I know that Tensorflow use symbolic model-building APIs where the developers can use them to build static computational graphs.
Whereas Pytorch offer imperative programming paradigm where it performs computations as it goes.
Could anyone help me understand the development paradigms of Scikit-Learn, Keras, Caffe and Th... |
I'd like to try to create an application where 2 players can play chess online. The (possibly) novel feature would be that the process for joining a game would be similar to how Typeracer works. The first player creates a lobby then shares a link. The friend can then click the link to join the session immediately.
Howe... |
We have data in Kafka which we need to export to multiple destinations. Each message key is to be exported to one destination.
A destination can be a REST endpoint, a file, a database etc.
Each exporter can have its own speed or rate limits and one exporter should not slow down the other.
In Kafka, the parallelism is d... |
This is something that has been bothering me for quite some time, I tried different approaches over the past year but I always come back to reflect on this, so I'll throw myself out here !
So, first get some common ground: if we follow the blue book, transaction handling should be done in the application service. We op... |
To reiterate the question - what does it mean to have a weaker or stronger postcondition when overriding a method that only does side effects with another one that only does side effects?
P.S. What about a mix of side effects & return values?
|
I'm developing an application where one of the main components of the app heavily relies on a third-party framework to work. The choice of framework is highly volatile and it is likely that business requirements will change in the foreseeable future, meaning that there's a good chance the framework I currently am using... |
We've got 2 very large platforms for our services & jobs.
Both platforms consists of 20+ servers hosting 1000+ services/jobs.
Each job/service is essentially a java web application.
Both platforms are managed centrally, which allows us to get a holistic overview of the platform, as well as drill down capability to each... |
I'm a firmware developer and I'm interested in applying the SOLID practice in low level programming especially in Hardware Abstraction Layers in ARM microcontrollers.
Every example I come across on the internet is implemented in C++ or C# or Java and it seems a little hard to follow those patterns in C.
Is there any ex... |
I am currently working in a team, which, when I joined them did not do any sort of unit or integration testing.
Over the last 2 years I have bit by bit pushed dotnet unit testing to a point where it is now considered part of day to day workflow. Integration testing have also had a place and are coming up once again as ... |
I am new to UML sequence diagrams. I saw a few YouTube videos and a few tutorials such as this one.
I have a system with multiple inputs, that can interact with the system asynchronously. For example, first the input 4 (out of 5), secondly the input 1 (out of 5), etc. How do I represent them in a UML Sequence diagram?
|
My web application has a UI. Some aspects of the UI can be changed (e.g. the language, the theme, the text size). As a concrete example, let's assume that I have a "theme" dropdown box available on every page.
Now, when a user changes the theme, the current page should reload with the new theme, and the new theme shoul... |
This question may sound strange to you, but I am learning C++ all by myself. I have nobody whom I could ask for mentoring and I would be very glad for some advice.
I have started recently to program in C++ (about 3 - 4 intensive months with about 6 - 8 daily hours). My background is Java and I have done some bigger pro... |
I'm trying create a .NET Core project and followed some guides to create a basic architecture
Jason Taylor - Clean Architecture with ASP.NET Core 3.0
Sample project
Clean Architecture Template
I'm not using an ORM like Entity Framework, I want to use raw SQL for my Maria database so I'm using the official MySQL Conne... |
I have a software product I am going to release soon. It is built with Java/Spring/Tomcat and will be installed on the customer's local network.
I plan to sell this to corporate customers and I want them to buy an annual renewing license to run it.
I am imagining something like the customer provides me with their comp... |
Should Developers conduct Sanity Testing in Dev Public Server, before sending code over to QA team?
We are developing a Property Application. Our company utilizes C# .Net Core with Angular, and Devops process in Azure cloud.
After software engineer codes and tests locally; by getting all latest changes from Azure Git... |
Sometimes when I look at other people's code I see functions that make a bunch of assumptions about the inputs but do not explicitly assert their assumptions. For example, look at the code below:
def func(a: list, b: list, c: int):
total = 0
for i in range(len(a)):
total = a[i] + b[i]
return total/c... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.