instruction stringlengths 34 36.1k |
|---|
So I keep track of all my finances using an Excel document (and have been doing this for many years) and it's become quite a pain. So for a fun side-project I want to implement something to handle it for me.
Initially I set out using Entity Framework with a LocalDB to handle the backend for me. But as I continually r... |
If I have three entities like this:
WorkingGroup
WorkingTime
Shift
The WorkingGroup has one or more workingTime
public class WorkingGroup
{
public WorkingGroup()
{
IsActive = true;
IsDefault = false;
WorkingTimes = new List<WorkingTime>();
}
priv... |
There's a 1st software module (s1) that generates data and then there's one or more software modules (s2, s3) that will receive that data (objects), based on pre configured actions that define the type of data to transmit.
A middleware (api) needs to get the data from s1 and convert it to s2 or s3 structure depending o... |
According to Wikipedia, Functional programming languages, that are Declarative, they disallow side effects. Declarative programming in general, attempts to minimize or eliminate side effects.
Also, according to Wikipedia, a side effect is related to state changes. So, Functional programming languages, in that sense, t... |
So, from my understanding, Html Helpers are supposed to be for single elements or small snippets of html. However, I'm not really sure why I think this, or how I came to abide by the practice. I couldn't find anything from Microsoft that covers this topic either.
The reason I ask is that recently I've been asked to bui... |
I am developing the UI of an e-commerce. Actually it is the checkout page only.
The entrance URL looks like this:
myEcomerce.com/{orderGuid}
On load The ui takes the orderGuid as parameter to call the API and get the details. In other words, UI call getOrderDetails passing the orderGuid.
My main concern is in relation... |
Using .Net web api
I have a web page that renders a collection of items depending on filter values applied via an ajax call to an api endpoint.
The items are paged so that if the user scrolls to the bottom of a page then another ajax call to the api with the required page number of the next set of items is made.
I have... |
I've been researching microservice architectures trying to get a high level overview of all the pros and cons, whens and whys, etc. A lot of the information I'm reading/watching is coming from ThoughtWorks (Martin Fowler, Neal Ford, et al).
Most of Martin Fowler's work on the subject is a few years old, when Microserv... |
I have been reading Alistair Cockburn's article on Hexagonal Architecture. One question that occurs to me, is how to handle situations where there are database concurrency issues.
An obvious example is a situation where an entity is retrieved from the repository, has an integer attribute incremented, and then is saved ... |
As far as I got it correctly, as a result of Rice's theorem, the equivalence of two programs is generally not decidable.
Nevertheless, there exists a wide variety of testing and debugging techniques, which do change the program for their purpose - actually, I can barely think of a technique that does not. So in fact, y... |
I believe the concept of DevOps is the single person handling all the activities of a given requirement.
1) Understanding the requirement/problem
2) Come up with logic to solve the problem
3) Write code for the logic
4) Test the developed feature
5) Deploy it
6) Maintain it
Does this mean "Division of Labour" is ... |
I am writing my first state diagram for an approvals matrix and I am stuck. An Order in our system will go through a number of states and transitions for approval:
States
Start (state)
(submit() transition)
Awaiting Approval (state)
(approve() transition)
Awaiting Approval (state)
(approve() transition)
...
Live (stat... |
Take the following algorithm with two separate sections, and the sections do not influence each other whatsoever (the function is not recursive, as well).
void algorithm(int x)
{
// This section of the algorithm has linear growth... O(x)
// This section of the algorithm has x * logarithmic growth... O(xlogx)
}
... |
A colleague of mine is against using DTOs and rather feels we should just return Entity / Domain objects serialized for a REST api. He feels DTO is an anti pattern and sited this article Data Transfer Object is a Shame. Although the article sited has a different approach to solving the "DTO Problem" as my colleague is ... |
I cannot go into the specific details of my project since it is in a very nascent research stage.
However, there is a fair bit of information that I can disclose. My project architecture consists of various Github projects that preprocess the data in a certain way. After a few parallel pipelines of different preproce... |
Let's say I have a Widget object that I serialize and send back to the browser at a regular interval. This Widget object includes lots of different members (variables) and other objects along with their members. For example, in PHP, my widget may look like this:
class Widget implements \JsonSerializable{
private $_va... |
I'm pondering a project in which one component needs to make a large number of http requests at accurate times. It should, let's say, release a set of 'dozens to hundreds' of requests at 1 second intervals. It is important that the requests are received by the other parties as close to the target time as possible.
Not... |
I am currently designing and developing a programming language from scratch. Mostly as a learning experience. Although it's not entirely related to the question, it's important that you know a little bit of the backstory.
I have a fairly good idea as to how I'll turn the code from my language into the target assembly c... |
Background
We have a ton of GPS devices in vehicles. These devices need to communicate with our system. To achieve this, we need to parse the device's messages before proceeding.
The following describes my scalable and fail resistant architecture idea.
Architecture
The devices are black boxes that send us buffers of da... |
Is naming a regular method init only confusing or is it an error?
class A:
def __init__(self, x):
self.x = x
def init(self, y):
self.y = y**2
def reset(self):
self.y = 0
I have encountered such a construction during review. Should I mark is as an issue?
|
I'm developing a Windows WPF app that needs to edit a certain type of document and I need a highly customized editor to do so:
The text is a transcription of an audio feed, and I need to sync the the text with a time code of the corresponding word in the audio stream (red numbers on left). This may involve breaking te... |
I'm looking for some advice about which line of code is more appropriate, readable, and maintainable.
1:
var result = mediator.Send(query).Result;
2:
var accountDetails = mediator.Send(accountFilter).Result;
The above code was taken from a Web API controller. The pros for each:
1:
If the query needs to change and re... |
I already have a solid back-end permissions authorization (ie. admin can perform an action, a normal user cannot perform an action).
However, I'm wondering if there is a better way to do a frontend authorization for my single page JavaScript application then fetching a permission from the API every view.
Seems like I c... |
I have a set of data:
id | name | parentid
------------------------
1 | parent | 0
2 | child | 1
3 | child | 1
4 | parent | 0
5 | child | 4
6 | subchild | 5
7 | child | 4
Which I can map to a hierarchy that looks like:
1 parent
2 |-- child
3 |-- child
4 parent
5 |-- c... |
Im going to be rewriting a library from .net to something that can be used on different platforms (Mac, Linux, Windows, Android). But i am also hoping that it can be used accross languages (c#, python, java). My initial thought was that c++ would be the best option. But ive never done something like this so im not sure... |
Along the lines of How v8 JIT compiler manages dynamically changing variables, wondering how you would go about creating dynamically generated variables in assembly. Not necessarily looking for example assembly code. More looking for a general high-level description of how you would define and then update a variable a ... |
In UML class diagram in MVC software design pattern there are model view controller classes and in ASP.NET MVC all views are cshtml not classes my question is how to put views in class diagram ?
|
I'm a software developer, and the kind of developer we call "front end developer". I'm working on stuff like Angular JS, Angular 2 and others.
I wanted to know how we can organize our front end code so that we can fit a modular based microservices like architecture.
Basically I am thinking of Platform as a Service like... |
I now find myself in a scenario, mentoring no more than 8 beginner-level developers and tasked with the development of a reasonably complex SPA website. It is to be developed using React (which the developers know to some degree - as in, they can put together code that works on a small scale, but is far from perfect an... |
We've got a Web App where we have a lot (>50) of little WebComponents that interact with each other.
To keep everything decoupled, we have as a rule that no component can directly reference another. Instead, components fire events which are then (in the "main" app) wired to call another component's methods.
As time wen... |
i want to call more than one process from the main program which is written in C++.
how to call them with the most efficient way given that one process may open and close more than one time.
the program also can call processes that are written in different languages other than C++
|
We need to send 1000s (under 10,000) per day for a few years. The data is in a SQL Server database - we have many asp.net MVC 5 and .net CORE 2 MVC sites on a Windows 2012 R2 server on IIS.
The emails are sent to customers who are expiring, so some calculations are required to work out who to send what to but nothing s... |
Let's say I have something like this:
switch(i)
{
case 1: new Class1();break;
case 2: new Class2();break;
}
So what's the best practices of doing this if in class where I placed it actively uses DI constructor injection. Is it reasonable to inject all Class1 and Class2 if it ends up with only one i... |
Context
I'm developing a Spring Boot java application. Currently it is a monolith with the rest API and the front end (vaadin driven) in the same big project.
Although this is very easy to develop and deploy, it is getting harder and harder to add features. There are too many concerns in the same application.
Also, I d... |
I read a lot that you can't restrict your Public REST API to only your mobile application, but I have an idea and I want opinions on it:
Variable App Key Method
Mobile App
Get IP address of current connection
Use a secret algorithm to generate a hashed AppKey from IP address.
Send the AppKey with each API request
Ser... |
Do the words to, as and get have any special meaning when used in method names?
Examples
to
new Integer(4).toString()
get
Integer.getInteger("system.unknown.property",4)
as
Arrays.asList(myPrimitiveArray)
|
I have seen a few papers on parallel/GPU processing of trees, but after briefly looking through them I wasn't able to grasp what they did. The closest to a helpful explanation was found in Parallelization: Binary Tree Traversal in this diagram:
But having a difficult time following the paper.
Wondering if one could ou... |
I have a JS function that takes JSON data and creates an HTML table. As my project developed, I needed one specific table to be created with a button - so I added an option to the function and an appropriate if statement. Then I decided I wanted to add a table colour option - another option; another if statement.
Fina... |
Trying to imagine how you would go about implementing summation (or reduction?) on a parallel architecture and am having a difficult time.
Specifically thinking in terms of WebGL arrays of vectors such as this:
[integer1, integer2, integer3, ...]
Wondering if there is a way to do this in parallel
var array = [ 1, 2, 3... |
Consider this simple example:
Tables (in a restaurant) can be booked for a period.
Business constraint: No two table bookings for the same table may overlap in time.
How might one prevent business constraint violations using Read Committed isolation level for the business constraint validation and optimistic locking?
|
I am looking for opinions about how bulletproof could his captcha system be to avoid spam in a contact form.
The form submit goes through ajax.
So I generate 2 random numbers with javascript.
The sum of those numbers must be correct.
On form submit, I validate the inputs and the sum.
If all is correct, I send the form... |
I am thinking, if I do proper testing for all methods in all my classes, then - disrgegarding UI - do I still need system testing? I mean, what would a simple example be, showing a case where unit testing is not necessary to reveal some errors? I tried to come up with something but failed, it always could have been cau... |
I'm working on ASP.NET MVC project where controller calling static class that run R scripts from external R project
Controller
public ActionResult Index()
{
Rscript.Run("WordCloud");// name of script file for example WordCloud
return View();
}
Rscript
public static class Rs... |
My question is
public interface IFoo
{
void HandleRequest(int i);
}
public class Class1 : IFoo
{
public void HandleRequest(int i)
{
if(i == 1) // just for example
{
//In this case i forced to call for async method
// await DoSomething();
}
//but in al... |
I have come across the word "warp" in a few places but haven't seen a thorough definition (there's no Wikipedia page on it either).
A brief definition is found here:
In the SIMT paradigm, threads are automatically grouped into 32-wide bundles called warps. Warps are the base unit used to schedule both computation on A... |
According to Are there guidelines on how many parameters a function should accept?, it is ok for a method to have few parameters.
According to https://stackoverflow.com/questions/11240178/what-is-the-gain-from-declaring-a-method-as-static/11240227#11240227, if a non-static method doesn't rely on any non-static members... |
Given the following constraints:
No multithreading.
No care about hardware cache utilization.
Wondering what a reasonably optimal memory allocation scheme would look like.
From my limited knowledge, one implementation is Free Lists, but it says they have some issues. Then there is buddy management and dynamic allocat... |
Overview
For company abc, teams are separated in terms of mission-critical applications and their extended applications. For example, customer xyz uses mission-critical data, but there are business constraints/flows that cannot be achieved with the mission-critical system alone. To maintain data integrity (mission-crit... |
I'm not that experienced in sql modeling, but i´m thinking of an intricate problem (or/and a silly one).
I have a project table(table 1) with many projectassignments(table 2), which is a join table. This join table have one person(table 3) with many projectassignments. I also have two tables(table 4 and 5) representing... |
Let's say we have a bidding system (written in Java 8), that according to some algorithm (bidding strategy) and certain conditions, we would increase or decrease the amount of the bid at a certain moment. We have different defined algorithms, but now we would like our users to define their own algorithm.
The user can c... |
In our application we have a page were we list our entities with many options to filter and to search. Over time this page got slower and slower especially for large datasets, so we thought about how to improve the performance. I have two ideas:
Use a service like Elasticsearch which is built for problems like these (... |
Our team wants to design a Web-Based retail pharmacy management system. A web based solution is good because no user installations are needed.
Some of the data fetched from central database are read-only and are shared between clients (5000 pharmacy users) and Clients maybe store their billing or anything else to a c... |
What would be an O(n) algorithm to maximize picks from a list when you can only choose 2 items from every 7 items. I've been thinking about this problem for a few days and I can't figure out an answer. I know it has to be a dynamic programming solution but I can't see how to relate any subproblems. I.e. if you have 2, ... |
Wondering what the general structure is for storing a tree in memory most efficiently (for access operation, and space).
For the access operation, it should take advantage of contiguous memory (memory locality) somehow which I am having a hard time determining how that should work for a tree. This way it can take advan... |
I am starting a new project and trying to decide if I should use a Javascript framework (like vue.js or react) and create a Ruby on Rails API, or use Ruby on Rails to server-side render pages and sprinkle javascript on to the pages (potentially leveraging Stimulus.js).
I am currently very comfortable using RoR to gener... |
Should I use HTTP status + message body for an error, or my own set of error codes?
For example, this is a request:
{
"number": 8
}
And these are two possible responses:
HTTP status: 400 Bad Request
Body:
{
"error": "expecting an odd number"
}
or:
HTTP status: 200 OK
Body:
{
"success": false,
"error":... |
I develop/maintain an in-house library in a growing company with about 12 other developers that write code. This library is mostly used for scripting game behavior and we have many different projects that make use of it.
This library implements simple, typed, event-aggregation in a static class EventBus.
It has the ex... |
I searched extensively and can't figure out what the infinity sign is meant in this pseudocode.
The code is taken from here, which has a detailed explanation of dynamic programming for the coin change problem.
|
I recently came across this license agreement on software:
Personal Use License
The content owner grants the buyer a non-exclusive, perpetual, personal use
license to view, download, display, and copy the content, subject to the
following restrictions:
The content is licensed for personal use only, not commercial ... |
Let's say I want to add a row to a table.
I send the query from the client (the website, not the user) to the database which is on another physical server. The query is sent over the network.
The query is executed successfully. The database then sends a message back to the client saying that the query succeeded. At thi... |
From what I understand, no-SQL databases differ from SQL databases because they allow the developpers to designe the tables to fit the usage, rather than fitting the model. Which means most of the time that if I have an API which uses Cassandra or Neo4J, Cassandra or Neo4J will have one view per API service.
If this is... |
I’m new to the whole programming society and the languages I’m learning right now are C++ and Lua. But as I’m learning it I can’t help but wonder how simple syntax such as print and if statements and such are used to program websites, games and more. I understand that they are the backbone of the entire project; it’s w... |
Scenario
A web application defines a user backend interface IUserBackend with the methods
getUser(uid)
createUser(uid)
deleteUser(uid)
setPassword(uid, password)
...
Different user backends (e.g. LDAP, SQL,...) implement this interface but not every backend can do everything. For example a concrete LDAP server does n... |
We as a team are writing an C# SDK which communicates with a Server endpoint. All our API's till now have been Task based. Like
Task DoOperationAsync()
Recently we across a need for API which gets an intermediate update (file location) before the final one if the user opts for it.
DoSomething(bool interestedInIntermedi... |
I created a small Desktop application (approx 15000 lines of code, so not that large) written in C++/Qt. This is non-commerical, just a hobby project and I am coding on my free time.
The larger the application gets, I find it more and more tedious to write C++, and adding new features takes a lot of time.
I find it e... |
In a book Doron A. Peled, he states that "
path coverage does not subsume multiple condition coverage because you
can execute all the paths without exercising all the conditions.
But I believe this is not right (it implies path is only "visible" branches), because even cyclomatic complexity is increased by one for ... |
I recently started reading Evan's book about DDD, and I decided to try and apply some of the principles from that book on a bounded context of a project I've been working on.
The context of interest deals with appointment and appointment scheduling.
I will present some of the business requirements, as well as the curr... |
TL;DR There are no methods in VIPER which are returning any value so how to test them?
Reasoning:
In VIPER, each layer is communicating with other layer by holding an abstract reference to it (Protocols/Interfaces).
For e.g, View has reference of a Presenter. If view calls presenter.getSomething() presenter will not re... |
In Clean Code by Uncle Bob, page 124-125 he states
Procedural code (code using data structures) makes it easy to add new functions without changing the existing data structures. OO code, on the other hand, makes it easy to add new classes without changing existing functions.
I'm reading about Multiple Dispatches like... |
Preface: I am not arguing against convention but rather want to have a greater understanding why convention is something I should follow and what are the benefits/drawbacks of doing so.
I have found in my development that convention is something that I feel I should strive for for whatever technology or platform that I... |
(I asked a similar question which answers focused on compile time instead of runtime. Instead of adding the runtime requirements to the other question and invalidating the good answers, I decided to ask a new question that focuses on runtime communication)
Scenario
A web application defines a user backend interface IUs... |
I have a lot of code that is needed for several projects - units, include files, resources and more. These files are writen by myself, downloaded or cloned with git and have their own place in the directory structure.
These (source)files have to be accessible during compilation. Now I'm struggling with two different po... |
We have all kinds of Lookups in our application, stored in a separate table, LOOKUP_T.
Should the application load them all on startup, and keep them in a global lifecycle variable -- or is it OK to keep making small trips to the DB to fetch these lookups depending on user action? In many cases these will be duplicated... |
I'm in a funny situation. We have a development model that works for an in-house software suite which is focused on responsiveness to the customer. To give you a sense of the environment, when we were using SCRUM, we would often intentionally commit to only 50% of our maximum workload, with a full expectation that th... |
When using factories, although more work is required up front, you know that you will be setting the correct pre-conditions for your test (up to what you have written.) However, when you use fixtures, although no work is required to setup the database state, someone (including the developer of the test) could easily ch... |
I used to think that the BOM is optional for UTF-8, but mandatory for UTF-16 and UTF-32.
But then I have read the following (in this article):
Let's look just at the ones that Notepad supports.
8-bit ANSI (of which 7-bit ASCII is a subset). These have no BOM; they
just dive right in with bytes of text. They are also... |
I am a consultant for a large organization. I work with CI/CD. Now sometimes the organization actually interrupts its services for upgrading the systems - I never do that with my own apps (where I use travis-ci and google appengine). I have ten years uninterrupted service with my own app. Is it alright to name our func... |
Currently I am working on an open source server control panel similar to cPanel, Plesk but I am not sure what would be the best approach to make system changes which require root permissions.
I was thinking to create scripts (with root permissions) which validate and execute commands sent by the app modules (which don'... |
I've really been focusing on making my tests maintainable by focusing on BDD-style tests and only focusing on interfaces. I do not want my tests to be brittle and prevent refactoring.
Is it worth it to test the presence of client-side web application DOM elements? For example, links on a nav-bar such as log in for when... |
Over many years, I always find myself reconsidering this design, so I wanted to get some feedback on my solution to it.
Problem:
I need a limited amount of objects = instances from a class, and I don't want to expose the option to create more. I also want easy access to them from everywhere, and operators like equal / ... |
I'm trying to get a better understanding of Git workflows and read this blog post. What happens after a merge to master if another feature is waiting to deploy?
The deployment from master is delayed and the feature is deployed first.
The feature has to wait for a deployment from master before being allowed to lock... |
If you have a linked-list, where the items are not necessarily close to each other in memory, wondering if it is (in general) better/worse/no difference to do the following.
Say you want to iterate through the items 2 or 3 times. One solution is to just iterate through them each time, finding the pointers one at a time... |
I'm working on a realtime multiplayer game project.
There are entities like Player, Game, Flag etc.
And bunch of it's behaviours like
PlayerRespawnBehaviour, PlayerWalkBehaviour, PlayerLifeBehaviour, GameGoalBehaviour
Over 60 behaviours...
However it's get to level that very hard to break new features into part and let... |
I am designing and documenting a product with agile process. When I write user stories to add them to the product backlog, I found myself in a complex and huge features.
Should I write these features on a product backlog and order them according to their priorities or they will confuse my plan so they may deviate my pr... |
I am a recent grad student aiming to start my Master's in Computer Science. I have come across multiple open source projects that really intrigue me and encourage me to contribute to them (CloudStack, OpenStack, moby, and Kubernetes to name a few). One thing I've found that the majority of them have in common is the us... |
What is the best way to capture dependency between microservices.
I want to create a diagram which show the interfaces and the microservices using the interfaces.
The aim is to easily do a impact analysis when any of the interfaces change.
Any tool or examples of such a diagram would be really helpful.
|
we work within a cluster of 1 gb/s of bandwidth, we use java sockets to perform some data transfer between the cluster's nodes like broadcast and shuffle (nodes of the cluster exchange data) in the cluster, in the instant t we may have multiple simultaneous transfers.
we want to get the maximum number of simultaneous ... |
I am writing a small game library. I capsule the logic in my model named Block. My model Block communicates only via events to it's clients (Is this a good thing to do!?).
I wrote a simple unit test that tests some of that logic. It looks like this:
[Test]
public void CrossMissThrow()
{
UpdateEventA... |
I am currently facing a problem with an application that has deposit/withdraw functionality.
The underlying database (Cassandra) offers no read/write locks.
Now suppose user A has deposited 100$ in his account, He can use this credit to send 100 emails.
Imagine the following scenario:
User A opens two different ... |
I understand Control-Flow Graph (CFG) optimizations and that they typically operate on SSA Intermediate Representations (IR). I am wondering though if the compiler optimizes the AST in any way before the IR, or does any optimizations before the IR/CFG phase.
|
Wondering at a high level how you are supposed to go about navigating a Control-Flow Graph (CFG) to perform operations such as dead code elimination. This diagram shows a dead-code elimination problem, how to figure out these variables are related to each other.
Wondering how you go about iterating through the CFG to ... |
Trying to apply Uncle Bob's clean architecture to an application I'm maintaining and I'm having difficulties with use cases and duplication/reuse. It's my understanding that usecases should be self contained and that duplication is to be expected but this does not seem to make sense with what I'm dealing with.
I feel ... |
Let's take the following Javascript, but the language is not really relevant:
module.exports = (user) => {
return {
createPrimaryConfig: () => {
return new Config('a', 'b', user.getName());
},
createAlternativeConfig: () => {
return new Config('a', 'b', user.getName());
}
... |
Google Maps' frontend is almost completely dependent on canvas.
Given that it was initially developed a long time ago, is it still the best approach to take to build such a UI? If not, what is and why?
|
I can see the benefits of mutable vs immutable objects like immutable objects take away lot of hard to troubleshoot issues in multi threaded programming due to shared and writeable state. On the contrary, mutable objects help to deal with identity of object rather than creating new copy every time and thus also improve... |
Overview
I'm trying to learn about domain-driven design, and I'm about 80% of the way through Eric Evan's book on the subject (and about the same on the Pluralsight course). I've been attempting to apply what I've learnt in redesigning an old LabVIEW/TestStand project but I'm concerned about whether it's okay to have w... |
All the sites I go to look for informations on FAT16 just declaratively state that it can not allocate more than 2 GB. OK. Great. I believe you. But how do you come to that conclusion (other than just testing it)?
Is there some sort of formula one can use to determine how much a FAT16 system can hold?
|
I am developing a large software project using DDD (Domain-Driven Design). I have an entity that acts as an aggregate root, let's call it Root. This entity refers to a collection of child entities of the type Child.
Because the use of this Child entity is an implementation detail that does not matter to clients of my ... |
This question is most easy to describe as a modification of that my question.
Suppose that question is solved as the following Python class:
class Traversal(object):
# ...
def next(self): # next node of the graph
# ...
Now I want to modify the algorithm: Sometimes I want to traverse to the next non-pr... |
GHC's Core data type represents recursion with recursive binders in the Let constructor; as I understand it, all let expressions in Haskell are effectively let rec expressions. Why does GHC use this method of representing recursion instead of an atomic fixpoint operator?
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.