instruction stringlengths 34 36.1k |
|---|
My model objects are generated by the library using hard-wired new operators, which makes dependencies injection using the constructor impossible. However, they also have methods, which are called by the library (i.e. adding service objects as parameter is not an option), using external service objects for the logic.
I... |
I'm planning to add a feature to my application where you can switch to the "Translation" locale and then see the names of the translation placeholders in the application instead of the actual translations. Another nice thing are "context descriptions" where you see explanations in plain english what the placeholder ac... |
Due to some issues with other shorteners like goo.gl (disabling my links for example) I want to create my own URL shortener.
I am looking to have a single table that will contain the following columns :-
links_id - autoincrement id
url - the actual full URL
abbreviation - the shortened version
In a nutshell, when a n... |
I've heard both about use cases (I'm talking about the description, not the diagram) and user stories being used to gather requirements and organize them better.
I work alone, so I'm just trying to find the best way to organize requirements, to understand what has to be done in the development. I don't have, nor need, ... |
I recently asked a question about design and got suggestion about how to structure my code. I'm still working on design so I only have pseudo code, but this is what I had in mind.
class TableManager()
{
int init(DBManager manager, String name)
{
this.name = name
this.manager = manager
}
... |
I have a situation where I need to make a decision between choosing multiple environments or sticking to one. The Business wants to use multiple, but it is simple glossary (list of terms and definitions) which we link to our development tools. Considering the fact that it is simple glossary and not code development, I ... |
Given a system with static permissions (1 permission for every action that can be made: create a resource, update a resource, etc), and dynamic roles (can be created and assign permissions to it dynamically).
The system have a preconfigured set of roles with the purpose of initial setup and/or testing. These can be de... |
Both classes below implement the same interface and are in fact intended to be interchangeable one for the other. Why is the second one not referred to as a "client" in the literature?
There are many references to service layers, repositories, etc.:
How essential is it to make a service layer?
https://www.asp.net/mv... |
For an example,
In a testing phase if i got a defect which is due to some delayed job restarting,can I raise it as a bug?
In our project,devteam merges and deploy their codes into test site.
usually there occurs some issues which is due to not restarting a delayed job.
We used to log it as a bug.
but development team p... |
As I understand in the 3-tier architecture, the presentation layer talks to business logic layer, which talks to data access layer. And, ideally, business layer knows nothing about presentation, and data access layer knows nothing about business layer. I want to write classes to do CRUD database work that are separate ... |
I'm currently writing an application and I'm struggling with the decision of how to correctly design a class to connect to a database. I came up with something like this:
public class DatabaseConnector {
private Connection databaseConnection = null;
public DatabaseConnector(String url, String user, String pass... |
How do we compile analytics from millions of rows in a PostgreSQL table?
We pull order data from multiple CRM's and need to compile the data for reporting and each CRM has it's own orders table. We compile these tables into a compiled_orders table in 24 hour increments.
Our current implementation uses SQL Views to agg... |
I was reading through a Java book by author Herbert Schildt and he writes how the advantage of Java over C++ in portabilaty is that while C++ can be run anywhere, it still requires each program to be compiled with a compiler that was created for that CPU, and creating compilers is difficult, while Java doesn't need to ... |
I have 2 JVMs on the same machine that I want to pass about 1Mb of (serializable) data between ideally in under 5 ms.
Under load, using HTTP to localhost takes about 70ms average.
I tried hazelcast, passing the data via a distributed queue - about 50ms average.
Is there a faster way?
I'm using spring boot.
|
I am planning to write some financial modeling software targeting enterprises. It will be based on an existing open-source project that already has a BSD-3 license. I do not own the copyright to the original project but will be using it to create my derivative work. I would like to keep my project open-source as well b... |
When people talk about MapReduce you think about Google and Hadoop. But what is MapReduce itself? How does it work? I came across this blog post that tries to explain just MapReduce without Hadoop, but I still have some questions.
Does MapReduce really have an intermediate phase called grouping as the article describe... |
I'd like to follow the RAII(resource acquisition is initialization) idiom throughout my code but I'm also doing the template pattern where I'm developing generic versions of my classes and using them to build a common codebase for certain things. Sometimes I need to enforce an initialization sequence where I would need... |
Below is the working List abstraction design,
List is a generic abstraction holding any type.
Below is the code directory structure. Currently symbol table(ST) and file api fileIO is using List abstraction.
./Code$
.:
fileIO list ST tinyTale type.h frequencyCounter.c frequencyCounter.exe
./fileIO:
file.h fileRead... |
After 50 years of software engineering, why are computer systems still insecure? I don't get it.
Two questions: (i) What's so hard about just denying or restricting networked access to bad actors who lack passwords? It's not like these bad actors arrive with crowbars and dynamite; they only have bits and bytes, right? ... |
Let's say I have a complex software product about which the information or knowledge is scattered all over the organization that built it. There are requirements and features about which even the Quality Assurance/Testing department is not very sure.
There are also many facets of the same generic software product and t... |
In Domain-Driven Design much is said about the domain experts. They are the ones who knows about the domain, and which should be in contact with the developer in order to build the ubiquitous language and hence the domain model.
The only problem I have is that from a practical point of view I don't know who the domain ... |
Scenario: An open-source PHP project that has existed for several years has too many classes in the main namespace that we want to refactor some of them into another namespace, but we have a widely used and diverged plugin API, and refactoring may cause a major backwards incompatibility. This plugin API is basically lo... |
Garbage collection happens during runtime, real time, while managed code is running. In C++ however, we need to write destruct statements into the code. So we could say that GC is built into the code (by us). So why can't managed languages behave like this? The compiler would analyse the code and insert the destruct me... |
The point of redux is to decouple "what happened" from "how the state changes" according to Dan, anyway, but I'm having trouble figuring out how to handle side effects without having getters and setters.
Here's where I am now:
User enters email + password and taps "log in"
App fires off { type: "USER/LOGIN", payload: ... |
I'm developing a Ruby on Rails app. The app contains a service wrapping an external REST API, called from a controller, with several possible error states. The current implementation returns the response body on success and raises a service specific catch-all exception otherwise.
I want to refactor this to be able to d... |
As many other questions and answers already stated, there is no syntax in C++ which allows you to declare and fill a dynamic-sized array with non-default constructible objects.
Obj* array = new Obj[size];
Here, if Obj has a default constructor, it will be used to fill array with size default-constructed instances of... |
I'm trying to learn proper object-oriented design, with class relations and avoiding anemic domain models[1]. I'm creating an application to store and retrieve information about "cyberattacks". There are five relevant classes to this question:
Directory: the class representing the collection of the data indicated belo... |
I would like to modelize some nucleotid chains : ADN & ARN.
ADN is a list of nucleotids : A,T,G,C.
ARN is a list of nucleotids : A,U,G,C.
ideally, I would like to define e.g. ADN as a list of data types A,T,G,C.
I have this code, which works but doesn't suffice:
data NtADN = Td | Ad | Cd | Gd deriving (Eq)
data NtA... |
I was wondering if a value that is defined by the user at the start of a program, and not modified by the program, is considered a constant or a variable. I know that a constant is a word/letter that holds a value that is not changed during the execution of a program (EG: pi or e), and a variable is also a word/letter ... |
I have a data model based around users. User owns records on several derived entities, e.g. A user have tasks and each task have documents. Documents don't have the User ID in their properties, only the task ID.
I want to allow users to read and update only their own documents via the /documents endpoints.
What is the ... |
When encoding our chromosome's characteristics (for want of a better word), binary seems to be the favoured method. I understand that this gives the maximum possibilities for crossover and mutation, but it also seems to have a serious limitation.
For example, suppose I am trying to solve the problem described here, giv... |
I create Application for my client. I use some libraries released on GitHub under MIT, BSD and Apache license. I create also documentation (PDF file) where I would like to point what libraries and components I've used.
What details about libraries should I place beside the name/source of library to satisfy MIT, BSD and... |
I was hoping you could give some feedback on an idea I had for designing functions.
I am trying to think of a unifying principle for choosing what functions should return. The specific project is mostly data access classes.
So the principle is this: "When deciding what value to return as a status code, either True or F... |
The Scrum Team
3 x Developers
2 x Testers
1 x Automation Test Analyst
We are not a multi-functional team in that the developers don't test and the testers don't develop. I believe this is the root cause of the issue.
We currently do two-week sprints.
At the start of the sprint everyone is busy, the developers are m... |
I'm in a bit of a tricky situation where I need to use the Observer pattern but I don't really know the best way to go about it.
Here's a quick briefing on my application:
I'm implementing a GUI application that allows users to create flowcharts and mindmaps by dropping shapes onto a canvas and then manipulating the sh... |
In Test Driven Development (TDD) you start with a suboptimal solution and then iteratively produce better ones by adding test cases and by refactoring. The steps are supposed to be small, meaning that each new solution will somehow be in the neighborhood of the previous one.
This resembles mathematical local optimizati... |
Below is the design, that is implemented similar to design used in Linux/net/socket.c.
Below design provide List abstraction,
where, list.h provides List interface, show here
Background:
Reason to implement List abstraction in this approach is to consider as a prototype inspired from Linux/net/socket.c design, wher... |
In JS you can return a Boolean having custom properties. Eg. when Modernizr tests for video support it returns true or false but the returned Boolean (Bool is first class object in JS) has properties specifying what formats are supported. At first it surprised me a bit but then I began to like the idea and started to ... |
I have been a developer for past 3 years and I have been seeing interface in most of the places as a contract for the developers to write their own implementation or a marker (eg. Serializable). But I quite dont understand how this concept is named as INTERFACE in literal meaning. Am I missing something pretty basic?
|
I have a general question and unfortunately no background in programming apps, so I'm sorry if this is a stupid question:
If my app has to process difficult calculations for which the power of the phone or tablet would not be enough, would it be possible to outsource these calculations to an external server?
And if th... |
I'll try word this as succinctly as possible.
I currently have an object called a StoresAdaptor which inherits from a base class ERPAdaptor, that takes a Stores object and pushes it into a 3rd party ERP system via an adaptor design pattern.
Now, there are multiple types of these Stores movements. Each has their own imp... |
I'm looking at implementing a new RESTFul call where a User can follow/unfollow a generic 'thing' item, but I need to know the best or common approach below, 1 or 2?
1) A GET or POST on the following URL's:
user/{thing_to_follow_id)/follow
user/{thing_to_follow_id)/unfollow
Or
2) A POST containing thing_to_follow_id... |
I am wondering if it is a good idea to do the following:
I have a Django model (which is related to a migration, therefore it has a database entry) with a bunch of properties. Accessing these are obviously hitting the database every time.
I also have many methods using these properties, like:
def is_good(self):
retur... |
I am facing problems structuring projects and libraries.
In the company I am working for I often see, that things would be more maintainable and less error prone, if we could extract common code and build libraries with that code.
A simple example may be the usage of a custom logging library instead of copying code fro... |
For developing a C++ dynamically-linked library (i.e. shared object) which may interface with C programs, what is the best practice to save program state across exported function calls?
I as a not-experienced C++ programmer can think of the following methods:
Compilation unit level static variables.
Instantiate a stru... |
After looking at a lot of session/state debates with regard to REST and finding nothing concrete, I'm just going to cut to the chase and ask myself.
Developing a RESTful API as a backend for a mobile app, I (think I) want to keep track of all users (even unregistered ones) with guest sessions. This allows me to customi... |
I am a budding software engineer (now a sophomore, major in CS) and I really struggle to understand other people's programs. I want to know if this skill (or lack of it) can be a handicap for me, and if yes, then how can I develop it?
|
When using bpmn to specify a process model. And using UML to specify a use case diagram. Don't they both describe processes? What's the difference between the two?
I'm reading a course which states:
A process model makes the processes in which the system is used
readily understandable, but does not hold enough detai... |
How do you collaboratively develop software in a team of 4-5 developers without acceptance criteria, without knowing what the testers will be testing for and with multiple(2-3) people acting as product owner.
All we have is a sketchy 'spec' with some screen shots and a few bullet points.
We've been told that it will be... |
I have a number of web services that form a web application. Clients can access these services through REST APIs calls.
Should these services be able to talk directly to each other? If so wouldn't that make them couple which goes against the concept on microservices?
Should the client call them directly one after anoth... |
I am going to build raspberry pi based device which reads data from sensor bus (serial port), analyzes it and present it on touch screen.
Touch screen will be also used for configuration.
Device needs to have web interface with equal functionality.
What I am planing to do is to split application for 2 or 3 separate ... |
I am currently perusing through Jdk 8 and I came across the feature where you have multiple interfaces that overlap with the same method signature for a default method, the compiler will throw an error if you try to have one class implement both interfaces, to prevent the problem of ambigious methods with multiple inhe... |
I want to keep a dependency decoupled, but at the same time, once it's passed to the constructor, I want to allow changes only through Whatever (in the following example) because changing the dependency from the outside would invalidate the state of the Whatever object that depends on it. So I keep a copy instead:
clas... |
Is every object in C++ mutable if not stated otherwise?
In Python and Javascript I can't change strings, tuple, unicodes. I was wondering if there is something in C++ that is immutable or every object is mutable and I have to use const type qualifier to make it immutable.
|
A Tech Lead in my team said:
We're going to use sonar on our (500KLoc) codebase so that everytime you do a commit, it will check the classes you've touched against the coverage goals. If you don't meet the coverage goals for your commit, the build will break.
Another developer responded:
No that has no value. The c... |
I one failed at an algorithmic test with Codility because I tried to find a better solution, and in the end I had nothing.
So it made me think if I could use an approach similar to TDD?
I.e. If I can usually develop a solution gradually in similar fashion?
If I were writing a sorting algorithm I could move from a stand... |
Having built a RESTful API (using Laravel) for a project at work, I followed what seemed (from lots of reading) to be a the majority in terms of my approach to nested resources - by defining them in the path:
https://myapi.com/clients/{clientId}/tasks
rather than:
https://myapi.com/tasks?client={clientId}
Filtering r... |
I'm working on my CS Masters thesis at a company which does user interfaces in the field of embedded devices. As part of that I am developing a library for integrating a certain device. My C++ library wraps the device drivers and integrates the device's features in the Qt framework so that it can be used with a variety... |
I'm comparing two technologies in order to reach a recommendation for which one should be used by a company. Technology A's code is interpreted while technology B's code is compiled to machine code. In my comparison I state that tech B in general would have better performance since it doesn't have the additional overhe... |
Suppose you were asked to design a scalable chat server with the following requirements:
The main use case is: player A sees B online, A sends a message to B, B receives it.
The secondary use case is: player A sees B offline, A sends a message to B. When B comes back online, B receives the message. (No push notificati... |
When creating time estimates for tickets should the time taken for testers (QAs) be included in a tickets estimate? We have previously always estimated without the testers time but we are talking about always including it. It makes sense for our current sprint, the last before a release, as we need to know the total ti... |
I am designing an application file format which will store chunks of user data, ranging from a few bytes to a few gigabytes - median size probably in the 10MB - 30MB range.
I have the option of storing this data in a sequence of fixed-size blocks, each block having some lightweight structure to it. This structure would... |
High-level languages often expose stream-based I/O abstraction to the programmer, where blocking or non-blocking streams offer select/read/write operations. (AFAIK, message-based I/O seems is usually an even higher-level abstraction built on top of streams.)
But at the low level, the communication between the CPU and t... |
In some MVC frameworks I've used the Model has the method and SQL in the Model so that if you call the controller, it invokes a method on the model class (say Products), and it returns the data. In ASP.NET MVC Core, from what I have seen so far, there is a separate file besides the model to do the logic. Do I use two... |
I know you can configure NServiceBus to automatically retry to send messages (FLR: First Level Retries) and wait before retrying again (SLR: Second Level Retries), but, using the default configuration (5 FLR + 5 SLR) it'll take about one minute before seeing a message into the <error> queue.
I understand the value of ... |
I implemented some CSV reading functionality to my Java program, for which I required adding a Maven dependency.
Should changes to pom.xml be part of the commit for the CSV reading functionality, or should it be a separate commit?
I'm leaning towards the dependency being part of a logical unit of code, and thus should ... |
It is very, very common to see code like this:
for (int i = 0; i < array.Length; i++)
{
DoSomething(array[i]);
}
The above code makes certain assumptions about arrays (which apparently hold true most of the time, but not all the time). Wouldn't it be more explicit and more forward-compatible to use something like... |
This question has an excellent answer by Eric Lippert describing what the stack is used for. For year's I've known - generally speaking - what the stack is and how it's used, but parts of his answers make me wonder if this stack structure is less-used today where async programming is the norm.
From his answer:
the st... |
I am creating an object oriented design for a cab-calling app like Uber. I have some of the classes listed. I am having trouble in designing behavior between the classes. For example, I have these two classes -
Customer and Driver
A customer can call drivers and a driver can accept a ride request from customers.
So my ... |
This is the title of a user story:
As APPLICATION I require a new SOAP element for OTHER_APPLICATION
Lately I read a lot of entries like this in our tool of choice. Here is a write-down of the description. Obviously I had to remove a couple details, but I hope it is still understandable.
A new SOAP element XXX must ... |
We know some of this syntax won't compile, specifically the line where I'm explicitly referring to the class name for a variable.
class Main {
static String Main.s1 ="output"; //won't compile
static String s2 = "output";
public static void main(String... s1) {
System.out.println("output");
}
}... |
I'm learning Composite and Observer design patterns and I have created a FileSystem class where I define Node, Folder and File as a composite relationship. Now I want to implement Observer pattern so when there is a FileBrowser/Finder/File Explorer Observers they can get updated when I add a File to a Folder.
This is m... |
my company currently develops software without ever having releases. This makes all our customers live on the bleeding edge, and they know that.
Now we want to do releases, and intend to regulary fork from the branch, let that branch be testing and after some weeks of testing that branch becomes the new stable.
But ho... |
Assuming I'm using a class from third party library that does not implement an interface, for example:
class ThirdPartyLibClass {
void DoThis() { ... }
void DoThat() { ... }
}
I want to create a very thin wrapper around it, directly reflecting class' interface and delegating to the ThirdPartyLibClass. The purp... |
Assume I have the following code.
class D { static Integer i1 = 42; }
Is it true that D has an Integer? Or is it only for instance variable that we can have a has-a relation?
I also wonder about very similar, if a primitive variable also can make a has-a relation or is it strictly for classes? e.g.
class D { int i1 = ... |
I always see the discussion when there's an API version in the URL where to point the versionless one.
I mean look at these three URLs.
http://host/api/customers/1
http://host/v1/api/customers/1
http://host/v2/api/customers/1
In every blog post I read, they are talking about where to point the first URL. I would first ... |
I have a question similar to this other question
Why aren't design patterns added to the languages constructs?
Why isn't there java.util.Singleton and then we inherit it? The boilerplate code seems to be always the same.
class Singleton {
private static final Singleton s = new Singleton();
public static Singl... |
I find it difficult allying CQRS/ES with the "Out of tar pit" paper architecture.
This architecture implies 4 layers:
State (state of the application)
Business Domain (purely functional)
I/O
Control ( all the dirty stuff for making the layers work together)
In my case, the state depends heavily on a database.
With t... |
How does one even approach testing an abstract data type?
I mean, besides the normal (supposed) way of doing unit tests, where you mock the collaborators, feed them in the class to test, together with sample data, and call the public methods, verifying that the output is the expected one, how do you ensure that the int... |
I want to implement a backup solution in Python where a Backup-Server initiates backups on a number of virtual and physical servers (one server = one backup task). Disregarding the details of the actual backups tasks I am concerned with the scheduling/multiprocessing part for now.
The constraints I have are:
Only bac... |
I'm currently working on an online app that includes many fairly new (for the company) features and they fall outside my expertise area by far, which means the edges may not be really well rounded yet. My boss wants it to be released in a somehow continuous manner, publishing features one at a time. All of these featur... |
I'm using swagger to prototype a RESTful API and I got to a situation where one property is part of a resource but not always should be filled.
Let's say my resource is stores.
Basic endpoints would be:
GET: /stores - returns a list of store
GET: /stores/{storeId} - returns a single store
Say store is defined along the... |
Having read others posts, it already seems to me that the concept "repository" and "database" do not go well hand in hand, as they are meant to be completely separate concepts.... but I'll ask the question anyway.
I currently have to import different types of data (one type of data may consist of several thousand recor... |
I'm working on a Entity Component System for learning purpose. I made major changes with my design so I was wondering if I could pick a better design for my event system.
The purpose of the event system (if you don't know ECS), is to allow
communication between process. For example, in a video game (that's
always ... |
I am working on an application that is essentially a calculator, not the handheld calculator but more of a spreadsheet. It will take many inputs across different views and show the outputs all over the place.
The application will be running many calculations. These calculations depend mostly on user given inputs but i... |
In my web application I need to get data from Wikidata, for example to show item's details. I thought about using ajax for this, but was't sure from where I should to call it, so I asked this question.
But after some thinking, why should I use ajax? I can make http request from my server side code (C#). I can put it in... |
I'm currently part of a team developing a solution intended for small business. One of it's components is kind of a "dynamic business rules engine" (note the quotes) and because of it's nature we would like it to be highly configurable.
My idea was to implement/use an external DSL to write the rules with a simple confi... |
I am a student worker currently close to the finish line of a project I have been working on. Right now I'm implementing the .net Auto generated Api help pages. The nuget package WebApiTestClient does most of this for me. In the test calls however my manager wants certain fields to have options to choose from. So I wan... |
Question
When training and using an OCR algorithm for handwriting recognition, is it helpful to indicate the author of the handwriting?
Use Case
Have a warehouse full of documents that need to be transcribed into digital format.
We'd like to feed the documents into an OCR algorithm first. If the OCR algorithm reports a... |
I'm a developer that works alone, and recently, searching for what kinds of documents I still could benefit, even though I don't require anything formal, I've read that one document that still is highly recomended to write is the project vision document.
I found it described as a short document (a page and a half or tw... |
JavaScript maps (the data type, not the array method) seem set up to accept data (key/value pairs) but not necessarily methods. At least they're not advertised that way. However, we can put methods onto a map instance. Intriguingly, the keyword this works in such methods, and returns the map itself. For example:
const ... |
Do prototypical languages provide a remedy from Liskov's problem?
So the way I see this is: a subclass is very tightly coupled with it's superclass and this creates subtle side effects when polymorphic types are used.
So can this be remedied by prototypical languages in the sense that classes inherits from a copy of th... |
I'm working on an application in the browser and I would like to make sure that my code does not conflict with code from other libraries or with possible calls added by browser manufacturers in the future.
In my environment I would avoid collisions by using a unique application name and placing all my classes and code... |
http://www.cs.unc.edu/~stotts/GOF/hires/pat3cfso.htm
CreateMaze is the function which instantiates the objects. IMO, according to factory pattern we are not supposed to overload or modify or re-write the function which instantiates objects.
But in the example, the CreateMaze function returns a Maze*. So, now if we have... |
I recently started working with GitFlow model as implemented by bitbucket. And there is one thing that is not completely clear to me.
We try to regularly address our technical debt by backlogging, planning, and implementing the refactoring tasks. Such refactoring branches end with pull-requests that are merged in deve... |
It often makes sense to "fetch only what you need" for example if I should display only 10 rows of data then I should not fetch the entire data set because it would waste resources for a large data set.
A practical example is the SQL Limit keyword. select * from users order by added limit 10
I wonder if we can connect... |
I have a software for small delivery stores (pizzeria, Japanese, etc) here in Brazil running on a few dozen customers and have the possibility to expand it to many more customers after evolving it to a full POS (Point of sale) software.
However, there is a critical feature we've been struggling to develop: an offlin... |
I'm trying to decide who is right in the following argument:
How to effectively process data in MSSQL? Which one is faster?
Opinion 1: Data requests (this is especially true for complex ones) should be handled by SQL queries and the result be returned to the requesting C# code.
Opinion 2: First, raw data should be requ... |
We have a mobile app that accepts input into some fields, formalises them as a JSON document and then sends it to the back-end for processing.
We want to agree on a schema for this document that can be validated and referenced indirectly in both the back-end and the front-end.
One of the motivations is that the input c... |
We have a system that is largely configurable, that can be organized in different architectures, and I'm struggling to write its requirement specification. I'll give an example
Module 1 does A
Module 2 does B
Module 3 does C
The system can be configured to have any combination or all of the three modules. How do I wr... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.