instruction
stringlengths
34
36.1k
Intel 8085: I'm having big troubles understanding addition or subtraction with more than 16-bit numbers in Intel 8085: 1.) If I execute ADC M instruction then this should happen: (A)<--(A)+((H)(L))+(CY) , right? How can be 16-bit data (HL) transfered to 8-bit register (A)?
I am experimenting with using a private NuGet repository and jenkins to deal with dependencies. Let's say we have exe A and libraries B,C and D. Exe A depends on library B which depends on C and D. On push of code changes to B,C or D jenkins builds and publishes a separate NuGet package for B,C and D to our private rep...
I have two process ProcessA and ProcessB. I want to run these two process independent of each other. There is no relation between them at all. Each process should have a different Properties object. Each process should have a different thread pool configuration since they can be run in multithreaded way if needed ind...
Polyglot Programs strikes me as pretty confusing and error prone. Right away I don't see any use to it besides "showing-off". Wouldn't that be a bad programming pattern, since it's not modular? Is there something that can be implemented with it that's cleaner than designing software applications as suites of independen...
I am looking to create a "Composite file" in C++, basically a composite file is a file containing files, (examples: .docx, .jar, etc) these files can usually be renamed as .zip and opened with a .zip opening program, but the program using them don't usually unzip them prior to use, nor do they compress them after use, ...
I am having trouble differentiating between Big Data vs Data Science. From what I've understood so far, both are buzzwords for the old statistics job. Where does machine learning fit into this?
I'm currently working on a requirement to implement logging in multiple projects and require to develop a enterprise level logging application that can be using in n number of projects. Present Scenario: What currently is happening is for every solution comprises of 3-4 projects, a logging project was developed and Log...
As I can see in recent releases of akka-http, successor of spray, spray-routing's approach of using shapeless HList was replaced in favor of self-included Tuple What is the motivation for this transformation? Has this done just for self-inclusion or pure Tuples without intermediate generic transformations to HLists a...
Domain objects (aggregates and entities) are only exposing behavior and no dummy getter() or setter() methods. If I don't want to use an ORM in a repository which is capable of extracting internal state by means of reflection, then how a repository is supposed to get internal state of an aggregate?
There are huge benefits to pure functions in functional programming, but can the same benefits be obtained in imperative programming with heavy use of the service pattern? I ask because I want to find a way to map ideas from pure functional programming to imperative programming focusing on using stack space or immortal...
I work on a large software programme - 100 developers in financial services. The common wisdom of Continuous Integration is to get feedback early from your changes. The common wisdom from Continuous Delivery is that by getting good at releasing small chunks, you reduce the risk of failure, because you can roll back e...
I'm not sure what to do with the following: We take data from an external tool within our own tool. This data is written in Dutch. We are writing our Java code in English. Should we then translate this Dutch to English or keep it Dutch? For example, we have 2 departments: Bouw (Construction in English) & Onderhoud (Mai...
One of my NPM modules is, frankly, pretty lame, hasn't been worked on in years, has no watchers, no stars, and only ~50 downloads per month. I'm going to abandon it, and eventually delete it so it doesn't clutter up my github page. Just in case there's one project in the world relying on it, is there a good way to l...
TL;DR - Is it ok to share a POJO library between services? Generally we like to keep the sharing between services strictly limited to none if possible. There has been some debate whether or not the service that is sharing data should provide a client-library for clients to use. The client-lib is generally optional for ...
So at a high level my use case is as follows - I periodically (every 24 hours) get a very large file (size can vary from MBs to 10s of GBs) which I need to process within 24 hours. The processing involves reading a record, apply some Business Logic and updating a database with the record. Current solution is a...
I'm working on a quiz system that will allow users to enter text as an answer. The question could be something simple to start with, looking for a short phrase, or a select few words as the "correct" answer. Having a single correct phrase however could be limiting. It may be that the user misses out a few words, write...
I'm building my own utility functions to master ES6: const contains = (array, value) => { return array.indexOf(value) > -1 } const keys = (object) => { return Object.keys(object) } const find = (array, value) => { return array.filter(item => { return item[keys[0]] === value[keys[0]] })[0] } So far, I've ...
I have a use case where I display variables in a PDF file. But to get there is not simple, but I could do something like this: /* * takes product model number, retrieves, processes, formats values * returns $variables, ready to plug-in to view with no further processing */ $variables = $this->repository->getVariabl...
Let's say I have a factory class that creates some series of concrete types. I've documented all of these classes in a UML static class diagram. How do you communicate the relationship between the factory class and the types it creates? Normally you'd use aggregation or composition, except that the factory doesn't actu...
I'm starting a project with Django, previously I've used Yii and Rails and they have tools that will take a DB structure and build models for you based off the DB structure. From what I've read Django seems to be the other way round in that it builds the DB from what you put in your models. While Django is best suited...
I have several git repositories for a web project that share a library of common code. I don't want to repeat the common code inside for each repo. What are some ways others have solved this problem? Git submodules seem to get a lot of hate because they tend to cause more problems than they solve I could just have a se...
I'm writing a compiler that compiles to C. This means that most of the time I piggyback on top of C for optimisations and generating code for multiple platforms. Right now I can think of a few reasons why it might be beneficial: I can perform specific optimisations for my language It will be easier to translate the si...
When we load a register or memory location with a value (e.g. MVI 3A or MVI 53), what initializes register or memory location with that specific value? It is the CPU who performs the initialization, right? But where are those values drawn from?
I often write database intensive applications and discovered the gateway pattern which seemed to fit my needs. My problem now is that many of my models are compositioned of other models. For example I have an User model and an Order model which each has an own Gateway. Interface for User Gateway: interface IUserGatewa...
I'm developing web application using ASP.NET Core. When I use project template Web Application with Authentification: ApplicationDbContext class generated: public class ApplicationDbContext : IdentityDbContext<ApplicationUser> { public ApplicationDbContext(DbContextOptions<ApplicationDbContext> options) ...
A coworker and I are having a debate. In our app, there are components that behave slightly differently based on how we want it to be presented. Thus far, we have agreed our inheritance should look akin to: Component / \ Fixed Resizeable wherein Fixed would have a size property and Resizeable woul...
I am currently working on a web application page, my boss sees the changes online while i still make the changes, sometimes the page is shown to some clients in order to get feedback while it's still on development.. At this point i have added a self-signed certification and of course the browser throws the warning abo...
Hope your day is going well. I want to make the following composition of two objects with the same inheritance root: There will be 3 basic operations on the Wallet class: add, getCards and getPaymentCards. getCards should return both Cards and PaymentCards. This is a place where I've faced a problem of how to store th...
My plan's to develop a module for easy customer KPI handling across projects. It should consist of a small SDK to put 2-3 lines of code in the project, a "template"/model for a SQL table (code first DB) and a small frontend to see the most crucial things like clicks/item and so on. I thought about storing everything in...
When I review database models for RDBMS, I'm usually surprised to find little to no constraints (aside PK/FK). For instance, percentage is often stored in a column of type int (while tinyint would be more appropriate) and there is no CHECK constraint to restrict the value to 0..100 range. Similarly on SE.SE, answers su...
The author here states that: Share state between processes. Run a long running batch job in one Python interpreter (say loading a few million lines of CSV in to a Redis key/value lookup table) and run another interpreter to play with the data that’s already been collected, even as the first process is streaming data i...
I want to write a library for Mechanical State Estimation of a vehicle. This is, estimate variables as position, velocity an so on, using the information provided by different sensor measurements (GPS, IMU, ... ). These are things to keep in mind: I am not a very skilled programmer. The estimation algorithm will be th...
While learning about Redux, the God-object pattern(or anti-pattern) came to my mind- both have a single big object holding all the app data and methods to manipulate them. But Redux has put some constraints like making the Object immutable and events pure functions maintaining strict signature. So the question came, is...
I'm developing a desktop app (using Node.js and Electron), licensing the code under Apache License v2.0 It's possible to add a module, licensed as Lesser GPL v3, to my app? I know that compiled LGPL libraries can be used on any type of projects (including commercial projects), as long as the linking is dynamic. Does t...
We have a ratings system in our website that allows users to provide feedback to 3 different questions about a user. We currently calculate the rating using averages using the following query on our RDBMS: SELECT AVG(question_1), AVG(question_2), AVG(question_3) FROM ratings WHERE user_id = 1 This query does not scale...
Is it OK to have functions that have single statements? I usually make functions that have single statements. I believe these increases code readability and i am able to write code faster as they make code more like natural language. These functions are often utility functions I call at more than 2 places, at least. Re...
The way many design patterns are described in the classical literature is somewhat different from their implementation in dynamic languages such as Javascript. The presence of some features like first-class functions makes some pattern implementations structurally the same, what sometimes makes it harder to distinguish...
I'm implementing a platform where users can create an account with my system and use it to login. Also I allow them to add any external login (social login) such as Facebook, Google, Twitter and so on. The mechanics is similar to what Stack Overflow offers (Edit Profile & Settings > My Logins). This is what I came up w...
Here is a bit of context: I am practicing TDD for a new application that will target .NET 3.5 CF and .NET 4.5.2 FF. I might have some part of the code that use polymorphisme to decide at run-time a strategy (the design pattern) to use while running on a .NET 3.5 CF machine and an another running on a .NET 4.5.2 FF mach...
The organisation I work for currently uses web deploy to release to different environments. Configuration of web applications (connection strings, service url's, and so on) is managed using solution configurations, with associated app.config transforms. With debug, three test environments and production, there are fi...
I'm currently working on the project with the new team and they are using Repository pattern which is new to me. In this repository, they're currently doing 1.If we are offline, we will load data from file 2.Otherwise, we will make an api call to get data from server. I did some researches and noticed that Repository...
Given a list of transactions like: A -> 10 to B B -> 10 to C The naive way to settle the transaction would be: C owes 10 to B B owes 10 to A But the same transaction could be settled by: C owes 10 to A I am representing each transaction as an object: { amount: Number, account: Object, linkId: Object } So, f...
Given the file path: /some/path/abc.txt The filename is "abc.txt", and extension is "txt". What is the "industry standard", unambiguous name for the "abc" part? For reference, in both java's older java.io and newer java.nio libraries, filename means "abc.txt", and there is no term (ie the library APIs don't support) ...
Outline I have an application that loads data from a database. I'm not talking about client data here though, I'm talking about application configuration. The database will therefore come with some default setup, which I want to remain unchanged so that future updates can just be imported and overwrite that setup. I ...
The book Software Metrics A Rigorous and Practical Approach defines measurement as ...the process by which numbers or symbols are assigned to attributes of entities in the real world in such a way so as to describe them according to clearly defined rules. but what does it mean by "clearly defined rules"? Does th...
Everything discussed here will refer to Intel 8085 (8-bit architecture). When using two's complement number "conversion" : 1.) If we take SBI 0F (subtraction) for example; immediate value 0F(hex) or 15 is subtracted from A register, which is loaded with 3C(hex) or 60. How will the microprocessor know whether e.g. 3C is...
I know it is best practice to split of your "global requirements". Which is something I do when documenting in Confluence. However, when coming to grooming with the development team, I don't really know how to best incorporate these in to our User Stories in Jira. The obvious approach would I guess be to add them as ac...
It is common to provide several image sizes with applications; anything from 16x16 to 256x256 and 512x512 for HiDPI monitors. Is there a reason why we need to provide all of them? Can we not supply say a 256x256 and then downsize it?
Should an error 500 only be thrown by the web server, or is it acceptable for your program to throw one itself? try { some bad code; } catch (Exception) { set_header_code(500); set_content_type('application/json'); set_response_body(json_encode({'is_error': true, 'message': 'An unknown error occurred', 'request...
I'm making a C program that uses GTK3 (best documentation ever) and OpenSSL (worst documentation ever) to simply encrypt/decrypt a file using a password. The encryption and decryption functions are both working, however if I enter the wrong password in the decryption phase, the file becomes corrupt (obviously). So I ne...
For example, the following function loops through an array which contains the name and errors of an input field. It does this by checking the name of the validating field and then pushing the error info to the invalid fields array. Is it better to be brief and write this: addInvalidField (field, message) { const foun...
How to handle cron jobs for multiple timezone? I am working on the PHP project that supports users from multiple timezones. I have used multiple cron jobs for multiple database operations. I am setting cron job to send push notification on the date of user's birthday. For ex., I am from USA and my birthday is 1st Decem...
I am working on a GIS platform that basically handles roads with features. The system uses an EAV model to store all the data in a database. The system has been around for a while and there is nothing I can do to completely change the database model. EAV was chosen because each installation had unique features with uni...
I am working on an embedded system that interfaces with the user with several buttons and a small graphic display. As a side note: Since I am on an embedded system, I would like to prevent dynamic memory allocation as much as possible. Something like std::vector is not even available. I need to implement a configuratio...
Context: I'm creating some applications to help me on my daily tasks, it does not connect anywhere and the only "data" it has to deal with is the parameters that I enter on the input fields. This is how I structured my solution: |- Helpers (Folder + Class Library) |- Core (Folder + Class Library) |- Shared (Folder + Sh...
This year I started using several Third-Party-Libraries (all open source) and I noted that some throw exceptions in a proper way (i.e. declaring exactly which checked Exceptions can be thrown by a method in the method signature), while others just declare throws Exception, which generally makes it more difficult to cat...
I'm developing a library intended for public release. It contains various methods for operating on sets of objects - generating, inspecting, partitioning and projecting the sets into new forms. In case it's relevant, it's a C# class library containing LINQ-style extensions on IEnumerable, to be released as a NuGet pack...
I've heard conflicting philosophies on this issue - or specifically, two conflicting philosophies. One is to check in the code as soon as the change is complete, so that your co-workers can see the change and to minimize any merging that has to be done when putting a build together. The other is to not check in any ...
Why is not it a common practice for languages to have method arguments passed inside method names? For instance, wouldn't something like: shop.Sell(15)Notebooks (although looking pretty unusual) be more readable than shop.SellNotebooks(15)? Also, this could simplify fluent APIs: instead of implementing additional inter...
Here my scenario: I have a client application that needs a dedicated powerful computation system that every seconds process some data in input (few kilobyte) and return a few megabytes of processed data that the client displays in a certain way. The algorithm to process the data has a sort of "precision" parameter so w...
In the W3schools tutorial on CSS3 media queries they recommend to have the standard layout adapted to mobile viewing, and have a media query "scale it up" to desktop format when viewing on a desktop instead of the other way around. This should make the page display faster on mobile devices. What is the reasons that it ...
I'm learning concurrency in Java and went over the tutorials on Oracle website. While I have understood some of it, a greater portion eludes me. I was thinking of a hypothetical problem (though it may or may not be a good case of using multiple threads) where I have 100 text files and I need to search for a particular ...
I am working on setting up a multi-tenant site, where users can select a theme. Each of these themes have different settings, so I would like someone to be able to select a theme and then when they edit their site settings it would bring up a form to allow that. I am sure I could do this through hard coding data, but...
I have developed a CUDA code that is a reimplementation of a (CPU only) C code. I would like to benchmark the performance of these two programs. I am wondering how to do benchmarking well in this case, as the hardware they are run on are different. For example, it would be unfair to run my CUDA C program on a $3000 GPU...
I have some question about the Composite pattern. I have implemented a model like these: Element is an abstract class, RegexElement is the "primitive", a sub class of Element and RegexBlock, the real Composite class, that has like instance variable a List of Element. 1) I would like to access to all the leafs of this ...
Intel 8085: In my textbook it is said: "Carry Flag - this flag is the carry out from the MSB of the A-register. CY is set after an ADD instruction if carry out was generated from the A-register." I get this, but how can be carry out generated from the MSB if the carry flag bit is located in the LSB of flag register-F? ...
So there is an Intel page about what to do about denorms. (BTW, I know exactly what denormals are and am quite familiar with IEEE-754 floating point standard.) I have two questions: What are the names of the system calls (in Visual Studio) to turn on these FTZ and DAZ bits so that denorms don't cause exceptions? What...
Basically what I need in my project is a number of some sort that iterates itself every time I build my project, and that I can output by my program. So for example, when generating audio, I need to add metadata that states that this audio file was generated by build #1551. After I build again, that number should go t...
For example, In NoSQL, technically replication and sharding approach is used for supporting large data. Was reading this article about NoSQL use cases. It mentions that NoSQL can be used for faster key-value access: This is probably the second most cited virtue of NoSQL in the general mind set. When latency is impo...
In Don Reinertsen's book - Principles of Product Development Flow - the tradeoff between release size (number of stories) and release cost (regression test cost and release cost) is described like this: In Ken Rubin's book - Essential Scrum - he talks about the benefits of smaller release sizes - being: Reduced cycle...
I am making an OO design for an app. So far I've come with this, I looks like it could work, but I am not sure of correctness of its design. Old design EDIT Okay so, I used factory pattern, and it looks good to me. Is this good design ? You are building application that will load data from several different advert...
I'm building a Json REST API for my application, and have some doubts about the design itself. My application has organizations and also equipment which belongs to organizations. That would be an example of the organizations API: /organizations: Loads all the organizations from the application /organizations/{id}: L...
This is a very simple function to find if a string is composed of unique characters. I believe that this is a O(n) time complexity as it loops once and has a single if condition. Am I correct? Is there any way it can be optimized further? public class Program { public static void Main(string[] args) { ...
I've been studying architecture lately, and came across the terms Event Sourcing, Event Streaming and Historical Modeling, all of them referring to "append-only" models, but all the concepts I've read so far are a little bit too abstract to me to fully understand the pros and cons of each one. I've gone through several...
I started a project using Slim3 and PHP using limited knowledge of application architecture. The plan was to create the project and separate application concerns. It was all going well, but things got confusing fast as the application grew. The whole idea for doing this was to make development easier. It does in a way,...
We have to write a library. Naturally, it should only have a very small API (as broad as needed as small as possible). The internals of the library are somewhat complex. Therefore, they need structuring. For the structuring I currently see two ways: 1. use packages. pros: the library can be neatly structured. Everythi...
I have an asp.net core project that is divided into the following structure Controller Store Repository The controller receives requests, and calls the correct Stores that are responsible for actions against the database (Create Users, Update Records, etc) The way I see it the controller should be agnostic to t...
I have had a discussion with my team about huddles; they want to do the meeting as a report written on slack rather than a face-to-face meeting. They consider that the meeting takes too long (it's 5 minutes long) and they forget what the others said from one day to another, not to mention that if someone mentions somet...
interface IUser {} interface IConcreteUser : IUser {} abstract class UserBase : IUser {} class ConcreteUser : UserBase, IConcreteUser {} As you can see, ConcreteUser inherits IUser two times - one time by inherting from UserBase and second time by implementing IConcreteUser interface. Is there something wrong with t...
Some languages claim to have "no runtime errors" as a clear advantage over other languages that has them. I am confused on the matter. Runtime error is just a tool, as far as I know, and when used well: you can communicate "dirty" states (throwing at unexpected data) by adding stack you can point to the chain of error...
I have a monolithic application. It is MVC, PHP, all on one server. It does get copied to another server or replicated. There are also older web pages that connect to databases that aren't related to the MVC app at all, adding to the complexity. I don't have a large team. I don't need big teams from various section...
I'm wondering whether measuring conditional code coverage by current tools for Java are not obsolete since Java 8 came up. With Java 8's Optional and Stream we can often avoid code branches/loops, which makes it easy to get very high conditional coverage without testing all possible execution paths. Let's compare old J...
The gist of what I'm trying to do is get an instance of the appropriate user service, then pass it whatever subtype of User we're working with. Models: public class User { public string FirstName { get; set; } public string LastName { get; set; } } public class Student : User { public int Grade { get; set;...
I have a SKU record which keeps track of raw materials used, pricing, cost, etc. An example SKU would be a Hamburger (1 bun, 1 patty, 1 oz ketchup, costs $11 make, priced at $4, etc). I need to add the concept of composite SKU's now, such as Burger and Fries Meal, which would have a Hamburger SKU, and Fries SKU, plus s...
Is there a design pattern or practice I can use to help with services that are either down or go down, while others are stable? What if I have three microservices, and two of them are good, and one dies right in the middle of a POST? Two will get the POST and one will not. I don't think I can do transactions because ...
I'm not sure what the best design is for returning an object that can both return a result for successful REST calls, or failed REST calls. I'm currently thinking of something like this (written in Java): public class ResultDTO<T> { public enum Status { SUCCESS, FAILURE } private Status status; ...
See this link. At the moment an extension is sorting the list through a tag (using a render hook?): <sort2> * C * A * B </sort2> Outputs: A B C However, the result is temporary in that it is kicking in each time the page is loaded and this might have downsides as the list grows. Can you think of another way to achie...
As the title says, can it be done? struct Room{ char *type; //Lecture hall, laboratory, etc. char *name; int *capacity; //How may people it can hold struct Building *building; }; struct Building{ char *name; char *type; //Administrative, school, etc. int *rooms; //How many does it h...
We have set(6-8) of API and it will be invoked in a sequence . there are cases, want to use output of first/second API in the third/fourth API . We have request object which is passed as input to all the APIs . we have defined all the response object in the same request and after each API execution corresponding respo...
I became the scrum master of a newly established team, that is responsible for creating a software AND maintaining other deployed application. So basically each team member has development & operations tasks. I have been observing how they work the past couple of weeks and I noticed that team is having troubles in coor...
This is a bit of a subjective question I guess but I was hoping for opinions on either side of the argument. So take this for example in C#: public interface IFactory<Tin, Tout> : IFactory { Tout Create(Tin param); } Now as you can see we take an input type and an output type, however a lot of frameworks often hav...
I am using SonarLint for Eclipse since recently, and it helped me a lot. However, it raised to me a question about cyclomatic complexity. SonarLint considers as acceptable a C.C of 10, and there are some cases where I am beyond it, about 5 or 6 units. Those parts are related to mappers where the values relies on differ...
Should I set up a shared account in our CI infrastructure to make it easier to use? My team uses CI infrastructure. When a developer first sets up a build he must enter his source control credentials so that the server can access the code. Thus the build is "tied" to a particular developer. I personally like this--I th...
I'm helping to manage an external team who are starting to develop new versions of some existing products. Historically, this team has always used a model of a single project in a single solution for about 30 modules in Visual Studio which go together to produce a deployable build. This is having a detrimental impact o...
While implementing one of my modules, I needed a singleton for one of my classes, say, ModuleManager. Instead of creating a class with singleton criteria, I created an interface ModuleManager to define the API and implemented this interface with an anonymous class so that there cannot be any other implementation or no ...
Let's say I have this function authenticate that returns a promise. The promise then resolves with the result. False and true are expected outcomes, as I see it, and rejections should only occur in an error case. Or, is a failure in authentication considered something you would reject a promise for?
We have a MVC Web API that is called to write transactions for a specific amount, where the amount is debited or credited to a user's balance. This records the balance pre-transaction (PreAmount), the amount, and the balance post-transaction (PostAmount). We noticed from a simple query using SQL Server's LAG and LEAD f...
I was recently debugging a bit of code where the previous implementation looked something like this: # controller for group/customers def index @customers = current_user.available_customers(param[:group_id].to_i) end # user def available_customers(group_id) # some other code, that sometimes returns early # ...
I'm developing a NodeJS API that will be consumed, for now, by an Android app. I need 2 important things here: a News Feed and a Notification system. And I need it to be scalable. I'm using MongoDB with Express for this project. Notification System About the notification system I'm thinking about a document that wou...
I have a manufacturing management application that I'm in the middle of redesigning to make it more universal (we acquired a small company and they will use the tool as well). Where before I had many values hard coded because the application had a single client, now it's more configuration based with various data eleme...