instruction stringlengths 34 36.1k |
|---|
I'm trying to figure out how it's possible to robustly code against EF Core in a large, multi-tiered codebase. We have been experiencing several issues, and most of the example project architectures online are very simplistic and don't provide much insight.
The most common questions we come up against are the following... |
Our start-up is currently build this way:
Engineering Team which contains the following resources:
Director of Engineering
Mobile, front-end and back-end developers
Quality Assurance
Infrastructure engineer
Product Owner (PO)
Product Team:
Director of Product
Product designers
Business Analyst
Product Manager
Oth... |
Despite various ways to scrub sensitive data in volatile memory (see Survive DSE or Zeroing buffers), programs tend to perform transparent memory copies (such as a Garbage Collection). The newly generated duplicates are no longer referenced and then they're exposed to memory attacks, thus the above mentioned solutions ... |
I have developed a Windows Service to prevent user from using the camera on group of computers. However, I am trying to find a way to ensure the service is never deleted. I tried CanStop in .NET property but the service was still deletable sc delete , not to mention that registery is another way of doing so.
I know it... |
I have an application (written in Go) with a lot of GPS location information. Each record consists of a latitude and longitude plus somewhere around 50 fields of various pieces of meta data, some of it is small nested data structures.
The full data set is well over 1 billion records and growing steadily. They are kept... |
I'm prototyping out an application here where I'm using domain-driven design to identify the domain(s) of the application and I've ended up with something that - at least so far - feels like a fairly decent architecture where each bounded context in my domain is structured as its own hexagonal application. Data flows b... |
There's a software library / application / framework which currently uses "simple version numbers". So it's currently at (say) version 135 and releases are made in irregular intervals whenever "there's enough for a new release". The next release would be 136 in this scheme.
I want to switch this to use semantic versi... |
I'm designing the Authorization part of the AAA module of a business software suite.
Requirements:
There are Users and Groups, and you can assign Permissions to any of those.
You can Grant or Deny a permission. When there is a conflict, Deny wins. Deny is also the default permission.
Client sends a request with a Op... |
I describe a very very simple scenario. I try to develop a system where many machines can help another one (server). I tried RabbitMQ and Redis, but both don't fulfil all requirements.
I have 1-server and n-clients. The server has several tasks to solve with n-subtasks. A task is called A, B, ... and each has 5 (subtas... |
I am building a Point of sales software with Sql Server 2008-R2. I am now confused about how to handle multiple items with prices change.
Let us say price of Pepsi is $2.0 on 10-09-2019 but today it's price is change to $2.50. and may be in coming days it's price will again change and will come back on $2.00.
So at the... |
The two concepts seem equal to me, but I'm not really sure I understand encoding well enough to confirm that this is the case.
|
I'm building a very security conscious application. (All applications should be security conscious, but this one may contain a lot of red data).
Assuming that I will use a Vue/React JavaScript Single Page App that will authenticate with Google for user sign in:
There will be a Sign In With Google button on the page.
... |
If you go to www.htmlbasictutor.ca/character-encoding.htm you will find the following description of character encoding.
Character encoding tells the browser and validator what set of characters to use when converting the bits to characters.
That's all fine and good - but if we were talking about python instead of htm... |
I am trying to understand principle of Unit testing, Purpose, and Moq. We have
complicated Service Call.
The Service Call encompasses numerous Repositories and Services, with dependencies and parameters. We are mocking each method per below. By the time we are done mocking, it seems like people are faking whole test,... |
I wanted to use some function from javascript module in one of my component. Should I pass it in props when making the component or should I just use Imports in component itself to get the javascript function?
Example of Passing in Svelte component:
Proxy.js
var Proxy = {
test: function() {
.....
}
}
e... |
I try to build a very small object database, not for production only to learn a bit in my spare time.
I've got a data structure that saves my data in blocks of a specific size und combine them when more data is needed.
But now my problem is when I do it this way I would need one file per object type I want to save (the... |
I recently wanted to copy my putty config from one laptop to another.
I figured there would be a directory somewhere which stored the IP addresses etc as some form of text file. I was surprised to learn that that information is stored in the registry and so I had to export a registry key.
I'm curious as to why the de... |
After quite some time thinking about it, and testing both methods, I'm really struggling with choosing the right manner to commit my transactions.
To shape the context, we are in the context of Domain Driven Design combined with CQRS.
As Eric Evan states, a transaction should only change 1 aggregate. This is kind of co... |
I have 7 different .NET Core applications (solutions). All supporting a different workflow such as customer request, request for change and much more. However, they do share a similar goal (that is to automate intern processes).
I expect that in 2 years there would be 20+ applications as we keep automating more process... |
I am developing a CAN-BUS reader (logger) with an ESP32 microcontroller.
This sample uses RTOS and several task to send and receive CAN-BUS messages.
https://github.com/espressif/esp-idf/tree/master/examples/peripherals/can/can_self_test
In my application I mostly only want to receive CAN-BUS messages. There will be po... |
API Gateways are great. They can produce a nice unified view of a sea of micro-services living behind them. However, on large scale projects, what patterns can be adapted to allow a single API Gateway to sit over dozens or hundreds of micro-services?
Example
I have an endpoint on my gateway: https://mysite/api/books... |
We have many clients which, upon start up, request a specific resource on the server using an HTTP API (not RESTful). This resource is - currently, identical for all clients.
Naturally, since the client is requesting data from the server via HTTP, a GET is used.
Incidentally, we wish to log the access of this resource ... |
First of all, I'm aware that in python nothing is really private but let's assume that we can stick to using the leading underscore to indicate that something is private.
I have a module consisting of a bunch of private pure functions (marked with an underscore) and a single public one. We can think in the public one a... |
Suppose I have a message broker that allows consumers to specify a batch size. What are the advantages and disadvantages of consuming events in batches compared to consume them one by one?
The obvious advantage I could think of is increased speed. As a drawback, higher delay, which will be more noticeable the lower the... |
I don't know too terrible much about the CPU, but I know it processes assembly instructions and that Windows can say that it is at anywhere from 1-100% usage. How is it possible for a program to use less than 100% of the CPU? Wouldn't an instruction being executed cause it to be at "100%" usage?
Is it implemented in so... |
I'm new to this community, I'm glad I found this and so I can ask questions like this one (as per https://meta.stackexchange.com/questions/68384/whats-the-difference-between-stack-overflow-and-software-engineering-se-previo).
The problem is simple, how do I fetch the data in an app's home screen if I do offline-first t... |
General design pattern for object error state
Consider a simple class Wallet that models a wallet. A Wallet contains a certain amount of Wallet.Cash and it is possible to take money out / put money in.
public class Wallet
{
/// <summary>
/// Indicates the amount of Cash in the wallet
///... |
How does one write & run queries against a database/warehouse if they have no knowledge of how the data is structured?
By "structure" I mean table names, fields, etc. Unless I have table names, how can I possibly query something?
clearly, I don't know much about databases, but this part especially confuses me.
|
I'm running a program in C++ on a Chromebook Penguin terminal. The program runs perfectly the first time, but on consecutive runs it acquires different results. I suspect that this is because the terminal remembers the variables from before. Is there any way to resolve this issue in my code?
|
I run a quite small website and I'd like to have some analytics about the traffic it gets from regular users. And I'd like to continue allowing bots to scrape it. I don't really care enough to invest in trying to detect bad-acting bots masquerading as real users (nor can I think of a reason my site would be the target ... |
I am a developer working on a new mobile app for Android and iOS with a big backend component. We have been in three sprints of this project, and we use Scrum with all of its ceremonies (refinement, planning, dailies, retrospectives, etc.).
In two of the sprints the team had to work (unpaid) overtime and weekends, beca... |
I'm reading Uncle Bob Martin's Clean Code and now I have a question about the code I wrote. Is using a method as an assertion method a good or bad practice for clean code? Example
// Simple example
public class EmployeeGateway
{
private readonly IWebService _service;
public EmployeeGateway(IWebService service)... |
I am looking for the best way of implementing a Multitenant App in AWS. Imagine I am an eCommerce business that has several eCommerce clients and those clients have other clients that are the ones that buy articles.
The easiest multitenant solution would be to have a single database with shared tables such as Articles... |
I’m looking for advice where the business logic and data layers in a Flask/SQLAlchemy-based app all use essentially the same object class.
As an example, my app includes a task scheduler.
Tasks are received (from an external api) as “candidate tasks”. These are prioritised and timing constraints are added in accordan... |
The more CS I read the more I encounter trees, heaps and graphs. All languages seem to incorporate linear data types like lists and arrays and most have some compound data type like objects or structs but when it comes to hierarchical data structures like trees you've either got to roll your own each time or go hunting... |
I want to design my project in DDD spirit. This is single aplication (not microservices) but with separate BC (as modules). Each BC have separate mongoDB collection. I have problem with communication between bounded contexts inside single application. If two BC want to save some data into different collection. It may ... |
I have a deep object content tree that I transform into a XML using JAXB and a small self written API on top.
But now I want to create a static HTML site that has basically the same content (and structure) as the XML, but with tables, parts that can be collapsed, images and so on.
How can I approach this?
Using XSLT ... |
I am relatively new to database architecture and I have been tasked with designing a database that will store 250 values per entry by my group. This is pushing the upper limit for fields in an Access recordset, so my first instinct is to break up the data into more manageable tables after reading answers like these. No... |
I have an application where I'm using pure DI to construct my object graph. I would like to use a factory so I can create and destroy instances of a certain class at run time. The trouble is that this class has a lot (say >10) of dependencies on shared resources.
For example, to log in to a phone switch, you first ne... |
I'm currently in a situation (i'm a technical lead) where the client has modified on his own the source code, and i'm being told to accept the changes and keep working on that version. Technically he owns the code, but, he decided to make a change, and didn't made me aware of it.
His changes won't follow any convention... |
Example BACnet network:
Some help is needed to solve a problem around architecting an efficient method of polling BACnet devices across multiple networks (i.e. MS/TP networks) where client software at the BACnet/IP level is performing the polling operations. Below are the preferred requirements.
Requirements
The exam... |
In the below example, assume FooA and FooB each have constructors that have a large amount of dependencies being injected into them.
If I have a class that needs to determine which IFoo implementation to use, what is my best method to resolve that? I currently have two possible versions, but I'm not sure either is cor... |
For an NP complete problem, how is computational infeasibility determined?
Are there guidelines that that determine whether an NP Complete problem is computationally infeasible?
|
I am writing a Python framework. In order to ensure a class has some properties, I make base "interface" classes like:
class BananaContainer:
def __init__(self):
self._bananas = []
@property
def bananas(self):
return self._bananas
Then, if an object is supposed to be a container of bananas,... |
Suppose I have a command like below:
public sealed class UpdateExampleCommand
{
public int Field1 { get; set; }
public string Field2 { get; set; }
public bool Field3 { get; set; }
public double Field4 { get; set; }
public DateTime Field5 { get; set; }
}
There is a permission that determines whether... |
how would i organize my project structure, areas or folders to
support logical grouping structure within my project.
www.mysite.com/org/{dynamic}/Importer/{controller}/{action}
Currently i have two areas
Org
Importer
Currently i have designed my site to work like this;
www.mysite.com/Importer{area}/Controller/a... |
This Stack Overflow post lists a fairly comprehensive list of situations where the C/C++ language specification declares as to be 'undefined behaviour'. However, I want to understand why other modern languages, like C# or Java, doesn't have the concept of 'undefined behavior'. Does it mean, the compiler designer can co... |
Let me explain what I'm doing.
I have a grid based on integer coordinates like (5,5), (5,6) etc., and I have an algorithm FindCells that generates a list of (coordinate, interval) tuples. These represent information of what coordinate is occupied with a starting time and an ending time (the interval). FindCells runs mu... |
I am looking for some reference material/architecture/ experience for building timer triggers or reminder systems at scale.
A simpler question would be "how would you build Google reminders backend?"
I understand the notification delivery to clients. I am looking for suggestion on timer management.
How would trigger n... |
This is a thing I'm doing a lot lately.
Example:
setCircle(circle, i, { current }) {
if (i == current) {
circle.src = 'images/25CE.svg'
circle.alt = 'Now picking'
} else if (i < current) {
circle.src = 'images/25C9.svg'
circle.alt = 'Pick failed'
} else if (i > current) {
... |
I'm building an application which monitors uptime of hosts/ip addresses. I'm using Laravel + VueJS.
So the app should check lots of urls every minute and get & store in db http responses. I've never worked with highload so I'm struggling a bit.
The thing is: I'm able to store my application on a VDS, run queues using r... |
I have a Windows PC and a Ubuntu laptop that I use for development. One of my main issues is that I switch between them multiple times a day, but because they are different machines, I am unable to just pick up where I left off on another.
I've thought about several solutions but I am really unsure about which would be... |
I've a method that apparently has quite some duplicate logic, I'd like to generalize it so that their duplicate logic could be shared and reused, also make my code more extensible for future additions.
public class GeneralizeExample {
/**Apparently the logic in specificMethod is duplicated, how can we gene... |
Use Case: I need to join two stream sources(say orders(order_id, order_val) and shipments(shipment_id, shipment_val)) based on an id(order_id = shipment_id) and generate a new event shipment_order(id, order_val, shipment_val)
Note that the gap between events might be huge(1 year - 2 years)
Ex: order(order_id = 1, value... |
I'm facing problems with what I feel is too much abstraction in the code base (or at least dealing with it). Most methods in the code base have been abstracted to take in the highest parent A in the codebase, but the child B of this parent has a new attribute that affects the logic of some of those methods. The problem... |
I'm working on centralized authentication and authorization API system and got stuck in front-end vs back-end dilemma.
Front-end person is telling that should to have only one request to that API to have user authenticated and authorized at the same time with response back containing JWT, user role(s) and user data.
Ba... |
Automated software testing professionals often make a distinction between various kinds of test doubles such as Mocks, Stubs and Shim/Fakes.
In fact, in the article Mocks Aren't Stubs Martin Fowler describes clearly the difference between the types of test doubles.
I am left wondering what is the usefulness of such a d... |
In many OOP programming languages, types can be made co-, contra- or in- variant. Most (if not all of these languages) are able to let variables be mutated in place, i.e. they are not fully immutable languages.
I've seen in this SO answer that, in Scala at least, neither a covariant type can appear in a contravariant p... |
I'm developing an event-sourced/CQRS application and do not understand the best strategy to use when building the read model projections when additional domain data is needed. A partial representation of the write model aggregates and events are as follows ...
WorkOrder
workOrderId
workOrderNumber
warehouseId
WorkOrd... |
What is the difference between a Response Object and DTO in software architecture? Say I want to get a list of Products in a catalog.
If ProductDTO is this, how is a Product Response class different? Is a Product Response typically just a wrapper on DTO with datetime, error log, or guid, or what is the prime difference... |
I have a collection of Shipment objects that I am iterating through to update another system. A property on a Shipment is a Stockroom. The target system has a unique ID defining a Stockroom record. If I have a collection of Shipments and some of them relate to a Stockroom for which I've not yet recorded a key cross ref... |
In a legacy Java project, when adding a new feature - an existing email field can be editable or not editable on base of its parent system, a developer added a new feature by adding a new class, which is added as an instance field to the existing class containing thousands of lines because the logic of deciding the edi... |
I notice the GPU, like latest Nvidia/AMD cards, have an output that goes to your monitor but I want to know if we can also use that GPU output feed into some kind of image recorder HARDWARE? If yes, what kind of hardware would I be looking for specifically?
I'm currently trying to create an AI algorithm based on some r... |
I'm trying to derive the simplified asymptotic running time in Theta() notation for the two nested loops below.
For i <-- 1 to n do
j <-- 1
while j*j <= i
j = j+1
For i <-- 1 to n
j <-- 2
while j <= n
j = j*j
I have been trying to solve this using the summation method but not really g... |
I'm developing a Node.js library that collects data whenever user runs tests. I would like to persist the data on local disk so that after the test run, user can run a command accessing that data. The test data might potentially contain sensitive data depending on what the user is testing, such as API keys (if the user... |
I want to ask about iOS application characteristic/behavior regarding processing location information. My previous wording isn't straightforward and seems to make it look unclear (which is my problem with ESL.) I hope this way I can get
As we know in App Store sometimes an app is tagged with "This app may use your loc... |
Let's imagine a custom network application having 3 protocol layers.
Layer A is the top-level protocol and layer C is the lower level protocol. Each layer has its distinct functionalities. These layers need to communicate among them. To my understanding, we can simply call methods of protocol layer B from A's methods.... |
We have a column in a database table that can hold either an IP address or a DNS name, and we're struggling to name it without leaning one way or another.
Is there a "standard" term that means "IP address or DNS name"? Please include a reference to a reliable source.
|
We have an API function that breaks down a total amount into monthly amounts based on given start and end dates.
// JavaScript
function convertToMonths(timePeriod) {
// ... returns the given time period converted to months
}
function getPaymentBreakdown(total, startDate, endDate) {
const numMonths = convertToMont... |
I am developing a multi-user application where a user interacts with the UI and submits execution requests (ER). Each user can submit multiple ERs one after the other and multiple users may submit ERs at the same time. Each ER will take roughly 3-5 hours to finish and use one or more cores for execution. The user is in... |
I want to create an Express REST API and want to try following the clean architecture ideas. I was reading about it but didn't get the idea of the communication between the abstraction layers.
Let's say I have this structure
routes => controllers (sending the response) => use cases (bundling all the logic) => reposito... |
Here we go again with topic what was asked many times all over internet, but I not found any good enough answer:
What are best practices in making client and server side validations synced?
I was not doing it in web apps I was making (I just had duplicated validations),
but now when I started with React Native and REST... |
I'm a React developer at a large company working on an enterprise application which draws on a large amount of data, but performs a very specialized task and has only a handful of internal users. The entire front end is to be built in React, and I am the only dedicated front end developer on the project.
Our unofficia... |
I'm trying to implement an oauth2 server to protect the endpoints developed in php. I have some confusions of how would be the flow to protect my endpoints.
I understand that my resource server should be my apache server that hosts all my endpoints. And my authorization server validates the credentials, provides an acc... |
In a UML component diagram I want to show two components (among others). One is the core component that loads contents (classes) from the other. It's much like a testframework loading unit tests/test discovery. For this I currently have a simple association relationship (which I guess is wrong).
Also the loaded compone... |
I would like to develop a Patient Queue management system with online booking.
In this case there are options to generate queue tokens for various departments. For example dept A will have tokens from A1,A2,A3 etc. And dept B have tokens from B1,B2,B3 etc.
At the time of calling a token if patient is not available the... |
I am creating a grid using ag-grid. Here I want to create custom dynamic cell editors. Which show different edit fields based on the value inside the cell. I got the idea from here.
This question is a design-oriented question. I want to have multiple editors which all have their own getValue() and isPopup() return val... |
In a recent Pull Request (PR) of mine, a colleague suggested that it was a bad idea to map between a model and its view model via extension methods.
I asked why and he said:
It isn't how extension methods are supposed to be used, it is not in the spirit of extension methods.
CODE
I have a Note.cs model class, and I w... |
How do you plan a sprint for the same product with two releases when the same team will be working on both releases during the sprint cycle?
To give some background, our product gets released out to customers every 6 months and we provide weekly automated releases with bug fixes and small features to those customers. L... |
Consider an application being implemented following Domain Driven Design.
In the same aggregation, there are Car and Computer entities that should have a one to many relationship between them (Car has one Computer and Computer can be embedded in many of Car). They are in the same aggregation because Computer only exist... |
I was wandering if there exists some kind of database that organises data based on some declared type rather than tables or collections.
I'll try to explain better with an example.
Let's say I have the following types:
Named {
name: String!
}
Priced {
price: Number!
}
TimePeriod {
from: Date!
to: Date!
}
Eve... |
Let's say I have a class hierarchy like this:
Now let's suppose I add later a new interface Mechanic, responsible for repairing a vehicle. Of course someone capable of repairing a car won't fix your broken bus. So you would have the BusMechanic and CarMechanic as implementations. My question would be, how do you creat... |
I'm extending an existing application, which has an attempt at a logical tier design, using DTOs, a Services layer (business logic), and a DAL. However, as I'm investigating more about DTOs, my existing system doesn't quite fit what I'm reading about DTOs. For example, my DTOs contain all the properties in the underlyi... |
I work for a brand new start-up who wants to roll out a product. One of the task for me is to integrate the existing user and role details of the client company and integrate it with our company dashboard. Our dashboard is simply designed with java. Now different client companies might have different ways of storing us... |
I recently started trying to use the Lazy class to implement lazy loading.
However, I'm finding that doing so does not seem to have any advantages over simply implementing it myself via a null-coalescing operator.
For example, if I want to have Task lazy-load a Contact, I can do it like so:
public class Task
{
... |
Please note: although I mention Shopify here, and would prefer a solution provided by the Shopify platform, I think this question is applicable to any small retail site and the answer may very well lie in something homegrown.
I am trying to help a buddy out that has an emerging (and surprisingly successful) mom-and-po... |
Consider a simple — and fake — interface:
interface ISuperGetter { Super Get(); }
An implementation would get some Super from RAM.
One would store what it needs on disk.
Yet another could fetch the state needed to initialize the Super from a remote HTTP REST JSON server.
A last one actually commands a robot arm that ... |
I am asking here something that is really haunting for years (for real !).
I guess in a "perfect world", we would have programs made of data models and functions, and those functions manipulate data with a total separation betweend data and code.
But I've got the feeling that in practice it seems impossible to achieve ... |
My application has both offline (SQLite) and online (iCloud) storage. See: Offline First: How Do I Fetch Data?
Now, as stated in my past question above, the application is offline first, and I'm currently following the answer in that question.
How I fetch data: In first run (or rather in every appear of the screen), f... |
Got a largish legacy Java code base at my hands:
~100k LoC
~1100 classes
monolithic and cohesive (no "modules" or so)
many OOP abstraction layers
almost no comments, etc.
The task is to produce time estimations (in the end the viability) of numerous new requested features. Some of these apparently go really deep into... |
I was doing a code review today and noticed that the code would work but could have easily been made more readable.
The example in particular was roughly as follows:
def group(x):
GROUP_ALPHA = ('a', 'b', 'e', 'f', 'i', 'j', 'k', 'l')
GROUP_BETA = ('m', 'n', 'o', 'p', 'q')
GROUP_CHARLIE = ('x', 'y', 'z', 'a... |
AFAIK in Haskell it is heavily recommended to avoid partial functions; and if these seem unavoidable (eg head) then return a Maybe. At least, so the Haskell wiki says 1 2
What's the use of the pattern?
Assume I have a function that seems partial. It wants its arguments to fulfil some requirements that seem difficult to... |
There's a RFID Reader library for Arduino that I wish to adapt to another reader model. But since the original library not only has the same name of the reader it supports, the reader model name is all over the place, therefore my adaptation surely won't be merged. That said, should I still click "Fork" on its GitHub p... |
I have made an application that deals with collections of images. Currently it has a REST api to add/remove images, create/clear/delete collections and a worker that can automatically fetch images from sources.
I want to make a CLI application to execute some tasks. An example of a task would be to clear a collection, ... |
Disclaimer: the following is written without further distinction in the object oriented terminology as C# is implementing it: classes, interfaces and instances, etc.
Let's assume the following scenario: there are different classes Apple, Avocado and Egg with no shared inheritance hierarchy except for Object at the top.... |
I raised an issue at my employer concerning our gigantic heaps of testing logs.
I raised the issue because I was spending well over a minute to find the relevant logs and stack-trace.
I stated we should change the logging level of tests to either warning or error. Not debug or info which they currently are.
Two of my c... |
I am building an application and trying to embrace Domain Driven design principles, CQRS and event sourcing.
We are having two applications one for reading and another for writing. The write application is using a event store data base. And after it completes a transaction on a aggregate, it publishes a domain event to... |
So we've got the following class:
public class BudgetAmounts
{
public readonly int BudgetFk;//Foreign key to Budget
public readonly int ItemSalesGroupFk;//Foreign key to the type of product being budgeted
public readonly decimal DollarAmount;
public readonly int UnitAmount;
...
}
This class represe... |
I have 3 (python) git repositories that I need to work with.
One of them is the top level application (packageA), and the other two (packageB, and packageC) are dependencies of packageA. (Note: none of the 3 are available on PyPI).
I've got a virtualenv setup, and have each of my 3 packages checkout within.
Option A) U... |
Let's suppose I have the following objects in my domain:
class Warehouse
{
int Id;
string Address;
Item[] Inventory;
}
class Item
{
int Id;
string Name;
int Price;
int WarehouseId;
}
I have a collection of all the warehouses and all the items. I am using a web api to provide access to them... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.