instruction
stringlengths
34
36.1k
By the GPL v2, every modification of the program needs to be licensed by the GPL as well: "... by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or...
Our team is facing an issue adopting Scrum. We are a team with 10 developers a dedicated Scrum Master and a Product Owner. Our Product Owner is having issues with the Business Unit manager. He's a senior manager and he maintains the relationships with all their customers. In creating stories, sometimes there are missin...
I make use of an AngularJS style guide. Within this guide there is a style called folder-by-feature, instead of folder-by-type, and I'm actually curious what's the best approach (in this example for Java) Let's say I have an application where I can retrieve Users & Pets, using services, controllers, repositories and of...
I'm starting to design and develop a WPF application for my company and one of the first choices that I have to make is whether or not to use MVVM. The main points to consider are: The application is basically a VisualStudio-like editor, where designers will create projects and will define UIs by dragging and dropping...
Thanks to some great replies in a previous question, I think I now have a better understanding of GAs, but am still confused on a couple of points. I'll start with one here. I've been reading around about how a GA algorithm works, and have seen what appear to be conflicting opinions as to what you do at each generation...
OK, so please tell me if this is the worst idea ever, or if it might have some merit. Here it goes: I have a customer who uses a legacy application that stores data in an Omnis database file (*.DF1). This application manages reservations and bookings for campgrounds, and is locally hosted on a server that runs at my ...
Across the various different programs, you will most often have a menu item called: Preferences Firefox Chrome Gedit Synaptic (Under a Settings menu column) Hexchat (Under a Settings menu column) Gnome-Terminal Thunderbird Rhythmbox Less often: Options QtCreator and less often: Settings Gvim Chrome Preferenc...
I am very new to the software industry. I was assigned to implement keyup search or real time search for a web page. I need to search employee code. For example, employee code is like TM-00001. If user types T then search box will show all the employee codes with prefix T. This is very basic and I can do this by using...
I am a intern student working on a project. We have the need to use a dynamic layout. Originally all that we needed was to know whether or not a search input should appear in the navbar and what catalog that should search on. Now there is more meta-info needed about the search and other dynamically displayed side bars....
I have a class used to process customer payments. All but one of the methods of this class are the same for every customer, except for one that calculates (for example) how much the customer's user owes. This can vary greatly from customer to customer and there is no easy way to capture the logic of the calculations ...
Our project methodology is recently migrated from Waterfall Model to Agile, and the development and QA team is given proper training on that. Now, one of the Agile Strategies is "Small Feedback cycles". But our product owner is still giving feedback after 2-3 sprints. That in turn results to major functional changes in...
Sometimes I come across the situation that I have some data in a nested dict with rather long key-names (sometimes unavoidable for one reason or another). some_dict = {'not_too_short_key_one': {'second_lvl_key_one': 23, 'one_more_second_lvl_key': 5}, 'not_too_short_ke...
I have an application, that can run on both Windows and macOS. I want to apply a digital signature to its binaries. I have already got a Thawte certificate (with private key) for Windows. Can I use the same certificate to sign my macOS .pkg installer?
For example: if I'm modeling a system that handles the inscription of students in a library and the documents in it, should I create a class for the library even though I have only ONE library?
I want to confirm that my software works on an OS that is not installed on my workstation. So I want to use a virtual environment to test it. I am worrying there are disadvantages about that. Are there disadvantages for testing software in a virtual environment? OS what I mean, operating system.
I've taken a deep dive into the world of parsers recently, wanting to create my own programming language. However, I found out that there exist two somewhat different approaches of writing parsers: Parser Generators and Parser Combinators. Interestingly, I have been unable to find any resource that explained in what ca...
In this article the author claims that Sometimes, it is required to expose an operation in the API that inherently is non RESTful. and that If an API has too many actions, then that’s an indication that either it was designed with an RPC viewpoint rather than using RESTful principles, or that the API in question i...
I'm currently building the front-end of an application using AngularJS. I don't have a whole lot of knowledge about the back-end, but some of the data I'm being served by the back-end developer is becoming difficult to work with, requiring a lot of rejigging on the front-end, and I'm starting to suspect that we could ...
Let's say I have an interface: public interface IAccountStoreManager { bool IsUserMemberOfAny(string username, string[] groups, out string[] containingGroups); } The method signature of IsUserMemberOfAny was affected by my observation that the client class would check a user's membership in multiple groups. For e...
I am working in embedded software domain and my primary work area is development of firmware for various MCUs. I follow the folder structure as mentioned below for any firmware project to release the source code and docs as complete bundle (.zip archive) for customer use. XYZ-project-2.0.zip |-> docs/ ...
We currently have a classic n-tier application: DB / web service / front-end. It has other components, but it's the basic layout. We want to improve the application availability for 3 main reasons: Our host sometimes experiences outages (as they all do), and we want to minimize the impact on our customers, so for inst...
Let us say there is a project A, and i came across a project EA which extends the project. The problem is project A is not available under version control, it is only available as tarball releases. The project EA extends A by creating a new github repository and adding new functionality, most of the changes are concen...
I am currently deciding whether I should implement a new system with a web application as a front-end, or if I should instead produce an executable file using WPF. The pattern that I will use is MVVM, since it suits my project needs quite well. However, I keep being told that MVVM is much better suited to WPF developme...
I have two Actors: User and Admin that will interact with my system. Admin uses generalization to inherent use cases from User. I have a use case named authenticate that should have two different behaviors. The post-condition for this use case is: User authenticated. If User is calling it, it should only ask for usern...
Should I take the time to clean my code once it's working if it isn't clean? Cleaning can take a lot of time. My boss just need it working but I feel unhappy if my code isn't clean.
Most of the literature I've read about GAs suggests using a crossover value of around 0.7, so you take the first 70% of one chromosome's genes, and the last 30% of the other to produce one new chromosome. If you are picking the parent chromosomes by taking the top two (ranked by fitness), then I can see the logic here,...
Note: This question is somewhat related to How exactly is bytecode "parsed"?, but it is not a duplicate of it. In this question, I'm asking about a specific part of how bytecode is generated, not how bytecode is "parsed". As stated in the title, how are literals(such as strings, integers, etc...), encoded into bytecod...
Let's say I have a phone that can process 1 million operations per second and a micro controller that can perform 1000. Is there a way to tell how many operations a performed by a function or block of code is performing? I have a function and I can write it a few different ways, an example doesn't matter because I'm ta...
Everytime I make a http request I must make sure there is internet connection. public class InternetCheck { public static boolean isOnline() { } } class Httphandler { public static String login(String uname,String pass){ if(InternetCkeck.isOnline)//make the request } } What if I add logout,...
Engineering is typically the art of knowing what solution fits best to the problem. If I were asked such as Should I use singleton classes?, Should all database have views and triggers?, What is the greatest PHP framework?, Is C++ or Go better?, or Is RSA or AES more secure? I will most certainly answer "It depeneds......
I have an array with a large number of elements, and I need to find the k largest elements. For an idea of scale, let us assume an integer array of length 10,000,000, and k is 1,000. I see three potential solutions: This answers to this question on Stack Overflow suggest the selection algorithm to find the kth largest...
Sample Java properties file which is read by the properties class appl.component1.property1=value1 appl.component1.property1=value2 Custom class which extends the java.util.Properties class adding behavior to throw an exception when a requested property is not available. public class Configuration extends Properties...
Is it safe to say that a Container is the "program" or mechanism that manages IoC via DI, but it doesn't really change your initial design of DI to accomplish loose coupling? In other words, if I want to achieve loose coupling, say for a Logger, using a Container doesn't change that. It just manages it in case I had a...
So this is all hypothetical and theoretical really. This isn't a real system I'd have to architect, but its a good question. A company stores and reproduces contracts. Contracts can have many documents associated with them. There are up to 200 types of these documents that can be assigned to any single contract. Tha...
This is not an easy one but here goes. I'm working on adapting a JavaScript project (ACE Editor) to support two different targets but maybe more. Any way I look at it, it looks like a large task and no approach feels quite right. I started to create a class that extends a HTML web view. This is basically a web view, a...
Imagine you are in charge of a cargo ship: travelling along a fixed route or loop (A, B, C, D, A...) has a maximum cargo capacity At each stop you can: buy commodities, up to your cargo capacity, or sell cargo that you have already bought each stop has different prices for each commodity for simplicity, you can't ru...
So I'm working on an iOS app and I’m thinking about how to keep user profile data in sync between server and client. The first idea that comes to mind is to create a class called User. It would be a subclass of NSMutableDictionary. Then I would declare a shared-instance within User so all view controllers and other cla...
Imagine the main system with the following use cases : one person may register, and book a room. At the same time there is a mobile app which is derived from the main system which is enabling the same functions (register, book a room) with some added use case options. How to distinct these two systems in a same use-ca...
I came accross this question while designing a multi module application that communicates with events. All modules are loosely coupled and are not dependant on each other. They use common event-types to communicate with each other. The question is, where to put the common event types in this scenario? Let's assume we a...
I have multiple related projects in one Visual Studio C# solution, which in general have similar architecture of WCF business logic services and ASP.NET clients. In order to host these services, I have implemented custom ServiceHosting application, which reads binding and port settings, services list and NInject setti...
We are having problems in testing routes that modify the data in our API. For example the test that deletes a resource will fail if run the second time. Also due to business logic you can't create or delete some resources via the API (as they are created by other triggers, or as a user you can't delete data but only a...
A developer built for me a SaaS for document analysis and one of the library used is GPLv3. The developer has shared source code with me as GPL. Now if i want to launch that SaaS for public consumption do I need to share publicly the source code i paid the developer for? there are two usage scenarios. user uploaded th...
I am starting a startup and myself and my partners are having trouble keeping up to date on each other's code and how to implement their functions. Our code is very well commented, but each of us have over 100 functions written, and we are getting to the point where we are re-writing functions the others have written ...
So, we're all probably familiar with the example provided in most textbooks of the Liskov substitution problem involving a square inheriting from rectangle. The objection to this approach is that while a square “is a” rectangle in a mathematical sense, the parent class, rectangle, cannot easily described in terms of a ...
So in S/W Requirements how to know a correct use case ? for Example : this one here seems wrong but I'm not sure
I am new to design patterns, here is a classic example of basic mediator pattern that has 3 problems with it, first of all take a look at the application image, diagram, code and description: We use a DialogDirector to implement the font dialog box shown in the Motivation. The abstract class DialogDirector defines th...
I'm building a chrome extension that I would like to offer for free for a given trial period and then the users buys a registration key on our website for a forever version . I've built software previously, but I've never made something paid. Using my basic knowledge of cryptography and membership websites, I thought ...
For example, when working with arrays there are methods like indexOf() that works like this: if (array.indexOf("something")!=-1) { // do something or nothing } Why hasn't someone made a contains method? if (array.contains("something")) { // do something or nothing } Or add functions people find useful like: var f...
I want to create a class with static constants which are used whenever a part of an application want to access the database in any way. This way I want to remove all magic numbers and string inside my application code except at one place. So any time later any changes to the database model have to be done, all adjustme...
I would like to know if there are any drawbacks to having descriptive names for database tables and columns. This would be for a Java based web application, and most of the times I have seen database tables or columns, they have had abbreviations for the tables and columns, such as "CD" when referring to "Code". Would ...
I've been tasked with researching and making suggestions about refactoring/cleaning up some existing code in our code base. Presently, many of our projects depend on a Constants class, which contains all of the constants used in the library. While on one hand I get this choice - this object has a clear, defined purpo...
Let's say we deal with a quite naive, simple version of a database, which uses the classic version of redo-undo logs for failure recovery. For a "classic" request transferring an amount from one account to another one, the logs written at each stage of the transaction are the following: 1. TRANSACTION START ---...
I'm learning Ruby on Rails coming from Node.js/express and had a few design questions. I used React.js for the frontend in my Node apps and I'm planning on continuing to do so in my Rails apps. What I was doing in Node.js Have all requests starting with / be handled by a "view router". This essentially serves all the H...
Observation There are many Exception subtypes that don't have any added state or behavior. For example, ClosedByInterruptException code. Question Why is subtyping without adding state or behavior "acceptable" in the case of Exception? From what I know, an interface should be used when defining new behavior, and a class...
I am trying to figure out how to use OpenCV with XCode's Swift. I need to do realtime video processing for the project I am working on, but I can't seem to find any good references on learning OpenCV within Xcode. As far I understand the native video processing in Xcode is not very powerful. The main problem I am facin...
I regularly play a 2v2 game with 12 friends and I want a database to keep track of players, teams, scores and games, with the intent of creating a ranking system. Since we regularly change teams I've come up with tables players, teams and games where the games have two teams (team1 and team2) and the teams consist of t...
I am experimenting with converting an API to GraphQL, and I have a database that has many-to-many relationships that are stored via link tables; something like this: CREATE TABLE accounts ( id int, last_name varchar, first_name varchar ); CREATE TABLE files ( id int, content varchar, name varchar ); CREAT...
Both seem like parallel MPI communicating network of processes. I identify actors with services. Are actors more dynamic (you can create them and kill as breathing whereas service network is more static) or what?
ECMAScript 6 introduced default parameters. The default value can be any expression, so you can use it to make a function throw an error when a parameter is not supplied: const mandatory = (name) => { throw new Error(`The ${name} parameter is mandatory`); }; const foo = (bar = mandatory('bar')) => { // some code }...
On some machines the operation of data path between ALU and registers is controlled by microprogram . On some machines , it is controlled by hardware .On machines with software control of the data path, the microprogram is an interpreter for the instructions at machine level. It fetches, examines, and executes instruct...
I've read that when your program needs to know what class an object is, usually indicates a design flaw so I want to know what is a good practice to handle this. I'm implementing a class Shape with different subclasses inherited from it like Circle, Polygon or Rectangle and I've different algorithms to know if a Circle...
I'm building a custom Notification section, which provides notification or messages to multiple users on any particular object update, I've created a HTML page like Dashboard where I have added a Alert section or notification section, which shows a particular record updates, like there is a Object (table) lets call it ...
I wanted to ask this question that has been bugging my head for a long time. Recently, I have started to develop a distributed system which has continuous and frequent database lookups in a loop. Let me describe it to you. There are entries in a queue, which can be matched mutually among themselves. For example, let's ...
I'm building an OSX app that utilizes a Redis instance. It would be cumbersome to have the user install and boot a Redis server session only for the app to communicate with it. I'd imagine there are design patterns to handle these situations, regardless of the system (OSX, Android, etc) and database being used (MySQL, ...
In the MVC pattern, is it good programming practice to make all instance variables in the view(GUI) public so that the controller has easier access? I started to make setters and getters for everything but then gave up because it was way too many. Why does everything have to always be private anyway?
I've found that a common task for web applications I've built is to react to a change in the state of the database. That is, any user interaction that affects the persistent state may change views that are dependent on that data, possibly views for other clients. The challenge is to update all affected views immediatel...
I'm fairly new to CQRS and Event Sourcing, though I have built one application (ASP.NET MVC) that uses it for a part of its business domain (one "bounded context" if you will). So I know how to implement it, and I've seen the benefits. In the near future, I will need to create a new application that is solely focussed ...
Sorry for the non-descriptive title, I don't know how to explain what I'm trying to achieve succinctly. In most SQL use-cases, we have records in the database that have properties, and we are trying to retrieve records which match some conditions. For example, we may have for instance a table of products, where each pr...
I was working with GTK in one of my projects and I noticed that the library supports inheritance. As you can type-cast a child struct to its parent struct and vice versa. Other than GTK I've never seen this used (so flawlessly): struct parent p = {5}; struct child c; c = (struct child)p; c.b = 1; Does using the parent...
In a MVC application, integration between controller and views are often a matter of: class HelloController { public function sayHello(Request $request) { return new Response($this->templating->render('view', [ 'name' => $request->get('name') ]); } } However, there are many frameworks out there wh...
I have the following global statement calls sprinkled throughout my PHP legacy codebase: $jobnumber = db_quick($sql); db_query($sql); That is, those function calls have been initialized in the global scope and they themselves call upon a previously initialized MySQL global object, i.e: //initializes MySQL connection o...
I am using a JSON map to save objects (e.g. users) whose ids are the keys of the map but the object (user) itself also contains the id. JSON { "john":{ "username":"john", "age":30 }, "bob":{ "username":"bob", "age":40 }, "chris":{ "username":"chris", "age":50 } } C...
I am doing a code review for a commercial software system. I noticed that some user's story and even sub-tasks when are implemented they result in a large code commit and usually end up in changing tens of source code files (java classes, javascript files, HTML, etc) I expect that when someone implements a subtask or ...
I have two elements inside a container. I don't need to give the two inner elements any id or class since they require no CSS or JS references. Is giving them an id just for the purposes of communicating their purpose good practice? Or should I leave an HTML comment instead?
There's shuup django based e-commerce web-framework which is licensed AGPL-3.0 I would like to use it in my commercial project, which ultimately means that I'll want to modify a thing or two in the source files, also add a dozen of extra features to fulfil specific project requirements. After reading an answer to a sim...
I want a feasible way to compare my project with my friend's project. I first thought it was enough to compare based on the number of code lines. But for some reason, people kept saying "LOC is not a good measure". So, is the following method (I cooked up myself and I don't know if there is anything like this) good e...
When programming using (pre-emptive) multithreading model on a single processor, we need to deal with synchronization, deadlocks, etc. Do any additional concerns appear (and correspondingly, new techniques used) when switching to multithreading on multiple processors?
I'm working on a code base that dates back at least 15 and possibly as much as 20 years, where the older code is still functional but includes thousands of JSPs full of Connection, PreparedStatement, and ResultSet objects, as well as hard-coded SQL, to manage data access. Yes, it's about as painful as it sounds ... b...
I have a big list of email addresses and I want to find out which of those are duplicates. How to define "duplicate" is exactly what I'm posting about here. I know from experience that with Gmail, it's possible to remove all the periods and the mail will go to the same destination. However, from what I've gleaned this ...
I have a class that sets up an array of nodes and connects them to each other in a graph-like structure. Is it best to: Keep the functionality to initialize and connect the nodes in one function Have the initialization and connection functionality in two different functions (and have a dependent order on which the fu...
If the supervisor and its child actors are sharing the same messages, which is the right place to keep those case classes? Should it be in both Supervisor and the individual actors or should it be in a separate file? I have read that the best practice is to keep it in the companion object of the actor.
Is it possible to intentionally stress and break part of a computer on a mechanical level using the specificity of C/C++ in targeting addresses? All of this talk of addresses and pointers is not a mere matter of abstract logic, you're actually sending electricity to specific areas of your computer. In my mind I picture...
Let's say we have an application with a DAL, business layer, and presentation layer, we do dependency Inversion, and we place the database repository interfaces at the business layer. At the data layer we use EF for database access. Who owns the entities? The business layer or the DAL? I mean at the business layer we s...
I make very long programs. There are many files. Basically I have too many function. Every code can pretty much call every function. If I want to pull out some function and store it as a library so other function can use it I am in trouble. That's because one file has function that's used by other files that has functi...
A bit of down time at work let my mind wonder a bit. I was designing a single location application on Digital Ocean (load balancer to app servers to DB with DNS). All fine. Then I thought what if the application will have a lot of traffic in America and Japan so I want to have data centers located in strategic geograph...
I am confused about Dependency Inversion in general. Lets's say we have 2 layers: Layer0 the low level layer, and Layer1 the high level layer. Layer1 should define the abstract interface, and Layer0 should implement it. However if Layer1 requires other types then the built in types, then in order to use Dependency Inv...
I'm developing an admin dashboard with different areas, where different users may have different permissions. For example: News John: edit, view, add, remove; Carlos: edit, view; Mario: --; Support John: view; Carlos: edit, view; Mario: edit, view, add, remove; The way I control this permission is via JSON arra...
I'm writing some code for a scientific simulation and I'd really like to use this as an opportunity to get some unit testing practice under my belt. I understand the idea of tests in theory, but I just can't quite see how to apply it to my problem to prove a mathematical result comes out correctly. For example, a big ...
I have a module, say 'M', which has a few clients, say 'C1', 'C2', 'C3'. I want to apportion the module M's namespace, i.e. the declarations of the APIs and data it exposes, into header file(s) in such a way that - for any client only the data and APIs that it requires is visible; rest of the module's namespace is hid...
I have been in arguments with programmers that mixing elements with animations and react is very bad practice, and that all animations should be in a style sheet because that is something presentational that is only concerned with CSS. However, I have also seen a great number of libraries using elements like VelocityCo...
Have you ever seen a significant non-theoretical project where the underlying database engine had to be changed? Was it a major undertaking, taking months of work, or was it conceived and done in a day/week? I have seen a few online posts/messages conveying one to write database-handling code in such a way as to allow...
I'm working on a GUI application using the MVC pattern, but the controller has proven to be much more complicated than I originally thought it would be. The application has options which determine how the operations in the action listeners function, so I started to use the state design pattern. But then I realized tha...
Lets say I have a class Person. class Person{ Person(std::string, int); void walk(); void talk(); void eat(); private: int age; std::string() name; }; Now lets say I want to add personality to this person object. How should add this feature to this person? I was thinking of inheritance clas...
My application is similar to a very simple CAD program. The user can create and modify a database of several thousand, simple 3D objects (e.g. cubes and spheres). Each object has a position, orientation, and size. I anticipate having these objects serialized in the database. I want to render objects in the database in ...
< backstory > I grabbed a book called Code Complete at a used bookstore the other day because I heard it was a great book, and started reading it. After around 10 pages I realized that I've been kind of stupid about a recent project I've been working on. A bit of clarification I should put in at this point: I'm not at ...
We were taught that objects are self contained things with data and behaviour and therefore they should have methods that act on their attributes. But there are several situations when this coupling between entities and their behaviour is not observed: Entity frameworks (like .NET with POCO and Enterprise Java with PO...
I mean, it's a matter of choosing words more than there is any difference between function and constructor call. The thing which is named "constructor of an object" can also be named "function with name object returning type object". One could argue that C++ does not allow one to have the same function and type name; ...
Background: So I'm trying to create my first game engine for learning purposes. After looking up a few articles I was able to design the beginning portions of my engine to at least get me going. My design so far involves have my own "Framework" layer for which all other, higher level subsystems (graphics, input, audio,...
Developing a co-founded idea software product can have sometimes misunderstood information about roles and responsibilities. A Management role is responsible for understand and delegate the operator's role. The next figure will produce a possible and hypothetical project structure from Steering Committee, Management Te...
I have a project which uses 3-4 different open source C/C++ libraries. I built these libraries for several platforms and checked in include files and static libs for different platforms in my project. However, I struggle with a couple of problems. All of these projects are around dependency management. And I am lookin...