instruction stringlengths 34 36.1k |
|---|
I'm trying to union many functions so that they will all run in the same small section of ram but be loaded from elsewhere.
I have done this for several sections explicitly with a sections command simmilar to the following:
UNION run = RAM
{
.text:testFunc:testSHA256_Final: {} load = TESTFUNCTIONS
.text:testFun... |
i'm relatively new to web development and i wanted to understand what does it mean when someone say "they used django for backend and javascript frameworks for front end."
please correct me if i'm wrong; my understanding is that they're making all their server side code i.e dealing with database and writing complex bus... |
When writing a library/API for the first time I'll usually start by sketching some ideas on a white-board or loose-leaf while thinking about how different parts of the system interact. This usually results in an interface that I'll adhere to when I go to develop some concrete implementation.
I'll get half-way through w... |
I have a problem with implementing generic user interface interaction.
I have different classes that contain data each for particular interface element. So every UserInterfaceElementComponent has data only useful for him - all data inherit from UserInterfaceElementComponentData. For example,
UserInterfaceElementRightC... |
I am pretty new to angular.js world. I wanted to know best architecture for my solution. I have 4 projects in my solution. First is angular.js app solution which has below structure. Is this correct way?
Second project in solution is my webapi.
Third project in solution is my data project which has logic for entity fr... |
What is the difference between code reuse and software product line engineering?
Why is simple code reuse not successful enough?
|
In a different StackExchange question, I noticed someone using this prototype:
void DoSomething<T>(T arg) where T: SomeSpecificReferenceType
{
//Code....
}
Bearing in mind there is only a single type constraint (SomeSpecificReferenceType), what is the difference and advantage of writing it like that, instead of si... |
So for my company's deployment pipeline (which is evolving towards CI+CD), I'm being asked to deploy a Jenkins server.
As it happens, all the staging and production servers are already being deployed using SaltStack as the orchestration system.
Is it worth it to deploy Jenkins using orchestration, for reason of 'reprod... |
I want to understand one thing in plain english that how do I actually use an standard MVC design pattern in iOS App.
I know about Modal View and Controller and theoretically I know what they do(Controller takes data from Modal and show it to View)
However lets say there is an app, which is simply using an api to logi... |
I am under the impression that interaction testing (verifying mock invocations) in general should be avoided.
When unit testing method postconditions should be asserted instead.
However there are cases that interaction testing cannot be avoided. In these rare cases I think interaction testing is allowable.
Cases where ... |
A recent debate within my team made me wonder. The basic topic is that how much and what shall we cover with functional/integration tests (sure, they are not the same but the example is dummy where it doesn't matter).
Let's say you have a "controller" class something like:
public class SomeController {
@Autowired V... |
I am a computer science sophomore doing a data structures and algorithms course. My professor said that insertion sort requires random access, while merge sort does not.
According to him, the insertion step in insertion sort requires random access. But can't it be implemented using sequential access in a linked list, g... |
The problem I want to solve is the following:
Given a set of users, each with a set of interests they can specify themselves, find all the pairs of users that share same interests with a threshold of similarity (e.g 50% similar interests). Furthermore some interest categories should hold higher weight than others (i.e ... |
For the SaaS infrastructure I'm building, we need to send transactional emails and run other long-running tasks on a separate job server. I can communicate via a queue, such as AWS' SQS or via a database table.
But what exactly should I send from the web server to the worker server via the queue mechanism?
Should I s... |
At the moment I am developing three scientific software projects (computer vision) in parallel in Python and scratching my head about organization, clean code and easy extensible/to maintain code.
One question which I have is whether to keep all three project separate or not? They share similar functions, which I thoug... |
I am building a website application using Laravel that will allow me to run gaming tournaments. The site will consist of two types of user, one being the 'admins' that can add/edit results, and the other will be 'users' who can basically view tournament results.
I could build this two ways..
A) Have one Laravel app wit... |
I'm working on a JEE project, here is the situation:
I have an application that puts the maker/checker financial concept. The maker chooses an operation and can modify its values but the checker should approve these changes so they can be registered the problem is that some operation have certain conditions set that ob... |
Is it possible that given a MethodInfo object, i can somehow figure out what the MVC registered route would be for that method?
I've tried something along the lines of checking if the MethodInfo has a Route attribute, and checking if the class also has a Route attribute, and if they don't have one then just generating ... |
What suggestions would you make to write a cookbook to use a distributed database? Does having a tangible end goal enough to distinguish a cookbook from a reference document? What else should I consider when writing a technical cookbook?
I'm thinking - create a scenario that needs addressing and walk the reader through... |
I am regularly given code with bugs in it and told to fix the bugs without introducing any more. My approach is usually as follows:
Identify the bug's issue, e.g. method is returning an empty list and shouldn't be.
Write a test that verifies that the returned list is of size==1.
Run the test, watching it fail.
Write a... |
The question is asked in the context of Python, but it is also relevant for any languages with named parameters support.
If some entity in my code (e.g. a pubsub implementation) or even a simple function accepts a callback, does it make more sense to call it with positional arguments or with named arguments?
def foo(on... |
Imagine an application that allows you to add line items to a quote. The end result is like a sales person giving you a printed sheet with information such as name of the business, name of the sales person, and various service line items printed on the quote along with pricing, description, and quantity.
To implement ... |
I'm currently creating a programming language for fun where the idea is that every function call/new block (if clauses, loops etc) will work in a separate thread. Instead of creating new Threads the standard should be that it does that automatically, and if you want it to run in the main thread you'll have to specify t... |
A problem I've come across and never really had a good answer for, is: what is the correct design pattern for creating or returning an object from another object, or multiple objects?
Traditionally I've just created a Factory and had the source as a argument:
#!/usr/bin/env groovy
class Foo {
String bar
}
class Fo... |
As an example, if there is a controller that calls a CountryService class and the CountryService class uses a Countries class, should the CountryService return the CountriesClass to the controller? Or should the service have another DTO type that contains information about Countries but is only used by the presentation... |
I am new to OOP and how it works. I am having trouble figuring this out.
I have a page called general.php which displays a members code, name etc
I get the member's code using $_GET['code'] from the url.
I get the member's other details from a database using the member's code through my CRUD class.
I have a members cl... |
Is it true that most of the times source code for Linux programs can be compiled into Mac OS programs and vice versa?
|
My team is working on a web application using Micro Service Architecture and Angular + Spring MVC. We follow Agile development. For each story, we create few implementation and test tasks. Documenting REST API is the first task to be done in the story.
We currently document it in Confluence so that developers and teste... |
I read this answer: https://softwareengineering.stackexchange.com/a/234254/173318 please correct my understanding.
Business rules refers to list of steps of business in real world (no codes).
Business Logic refers to the process of converting the business rules into codes and these bunch/kind of codes addressed as "Bu... |
I have written a code generator for my company, that basically has the following workflow:
entity xml definition
|
v
gets validated and put into java runtime classes by jaxb
|
v
runtime classes are ... |
Suppose the following scenario:
A new design for a specific page is required.
I create a new branch for that design.
I implement the design, and merge back into the master branch.
Time goes by and new features is added, and so on...
Management wants to revert that page to the old design -_-
As per my understanding of... |
sorry if the title is a bit messy but I wasn't sure how to form my question. So I have some classes that I've used for a project that I'm looking to making more general so that I can reuse them for other projects. The idea was to move all code that is unique to the current project to a subclass of the original class. T... |
This is the first mongo-backed-application I am trying to make beyond tutorials, so I lack imagination when it comes to document schemas.
Context:
On a dating application, there is an algorithm that identifies matches between users. Currently trying to identify how these matches should be stored.
Current schema:
Create... |
I am reading the book "design patterns: elements of reusable object oriented software. And I am trying to understand the composite pattern. I need help in understanding this paragraph in the case study part of the book
Glyphs like Row that can have children should use Child internally instead of accessing ... |
I'm new to OOP. Can I say Interface is a set of general behavior that may be have and act uniquely by a set of objects that have in common? And Abstract class has similarity with Interface but it have default method that also can be have and perform by a set of objects? Thanks
|
I recently checked out Memcached for using it as an in-memory transient database.
However, I was wondering why can't we use something like a ConcurrentMap (if I were using Java, for example)or something on the lines of a BST/Java HashSet/C++ std::set. Would there particularly be any disadvantages if I used standard dat... |
How would one implement an actor-based concurrent language in ruby? My thought is that only the correct way of creating programs is using actors, but I'm not entirely sure on how this could be done, and how the syntax/grammar could be, but I'm fond of the idea. I will use Ruby together with rdparser and celluloid (for ... |
Introduction and context
I am refactoring a system that stores energy data (gas/electricity consumption, electricity delivery). Data comes from a sensor that posts the absolute data every 15 minutes in a schema that is subject to change in the future (read: requires document storage).
Current situation
The raw data is ... |
I wrote a small client for a project I'm working on that allows me to connect to various implementations of the application API. The client turned out to be so effortless and versatile that I decided to generalize it and publish it as its own library. I would like some feedback on the design and usefulness of the pat... |
What is the better way to organize exception in a Python project? What is the right way to use exception description?
For example I have a function that parse email and return some data from it's attachment. It should raise an exception that specify and explain an error in a better way.
Options:
Use one general except... |
I'm trying to write a REST API client for practice and I'm having trouble figuring out how lay out the project.
The approach I'm taking right now has Actions, DomainObjects, Requests, and a class that deals with authorization and headers and such (CoreClient) that exposes a generic DoPut<T>(string address,T item) and ... |
Problem Statement :
When I first learned backtracking I made a program to find all the
permutations of the English alphabets in lexicographically increasing.
Filled with elation I showed the program to Rohil. Rohil being someone
who likes to do stuff off the league was not impressed and gave me the
following ... |
Please forgive me if my thought process is incorrect. I'm only a programmer in my spare time, with no formal training.
I'm using VB.net to create a very basic application, but some settings need to be read on startup. So my theory is that in the Form1.Load area, add all the checks for various settings and apply the se... |
I'm going through Apple's Start Developing iOS Apps (Swift) tutorial and I'm confused on how they are using MVC.
They have a custom control (the view, a subclass of UIStackView), it is basically 5 stars that you can touch to rate a meal. Touching the third star would rate it a 3-star meal, etc. Their code that handles ... |
I'm working on a security concept of a bigger project. It will be done with Spring,but that's actually not relevant right now.
The whole system is a hierarchical tree of computer nodes that run a custom platfrom software, whereas layer 1 nodes connect to a node on layer 2, layer 2 nodes connect to a node on layer 3 and... |
I can't for the life of me find any reasonable guides or recommendations on how to properly install or deploy applications made of multiple processes. Some considerations:
Multiple machines
Multiple services
Data and data migration
Different environments (eg dev vs QA vs production)
Configuration
Secret keys
handling ... |
I'm working on a software and hardware system which is completely autonomous in its activities. There is no user involved and one external system which data is sent to. There are a lot of different activities and processes going on inside the system, but they cannot be modelled well with use cases as these are all inte... |
I was watching an OOP lesson with such code:
class UsersConstroller {
protected $userService
protected $logger
public function __construct {
UserService $userService,
Logger $logger
}
}
What this class does is pass other class in the constructor, then it will assign them to variabl... |
My company is recruiting an external agency to do a site redesign/development (agency has not been selected yet).
Regarding the technical design document, should my company produce that document or the agency?
I do not want to be restrictive when it comes to agency's creative process, but at the same time there are st... |
Given three classes:
class A {
B* b_;
A(B* b){
b_ = b;
}
void doThings() {
C* c = new C(b_);
...
// Use c
}
}
class B {}
class C {
B* b_;
C(B* b) {
b_ = b;
...
}
}
The reference to B in class A is useful only for passing it to C when ne... |
I'm working on a sequence diagram for a layered system that has a tree hierarchy. Now I have a process that works itself recursively down the tree. Meaning calling the same function on a child object.
I'm talking about a tree like this:
-layer n
-layer n-1
-layer n-2
-...
-layer n-2
... |
For explaining my problem I'll start off with a code example. Imagine this (very simplified) code:
public void entryPoint() {
Foo foo = new Foo();
foo.doSomething()
method1(foo);
}
private void method1(Foo foo) {
// do a lot of stuff before foo is needed again
foo.doSomethingElse();
method2(foo... |
I've done a search about backwards compatibility and there's not a lot of information about it. The most informative article I've found was one about how Subversion handles backwards compatibility. While it mentions what steps to take to ensure that software stays backwards compatible or what could break it, I'm more i... |
Let's say I have an enumeration of related information types and an enumeration of time periods. Also I have created two operations on a controller for retrieving data of those info types.
Due to third party API constraints InfoA can only be retrieved with a date range and InfoB and InfoC can only retrieved with a tim... |
I'm working on a building what I'm calling a Process Wizard Builder in PHP. I'm interested in using established design patterns where applicable, but my experience architecting a system like this using design patterns is limited.
Here's the gist of the system:
There are many different process wizards that need to be b... |
Picture a simple messaging app written in Django.
Users have the option to delete messages at any time, but the messages need to be retained in the database. There are two options:
A deleted attribute on Message. Then the call user.messages.all() would be replaced with user.messages.filter(deleted=False) everywhere in... |
At present we have 2 PHP applications which share absolutely no code, but share a common database. One app is the timesheet application for administrators, the other is the timesheet applications employees log their time against projects. We are proposing a complete rebuild of the application using Spring Boot, Spring ... |
I was talking with my boss recently about composing services from other services (in a Service-Oriented Architecture, if you haven't already guessed). We disagreed on some architectural principles and I'd like to find some articles to read around the subject to help the discussion.
My thesis is that injecting services... |
We need to get more much more rigorous about managing state in our business application. The heart of our problem is an object, lets call it an "TaxRefundApplication", that has about 20 properties, but there are literally hundreds of interactions between them. Individual properties can be disabled or hidden based on th... |
I am creating a method in an ASP.Net Web App that will be called in a few places of my application and it creates a record in the database. When I started to look at the database model (which I have no control over) I realized there are 50 columns that have I have to insert data into. That means when I build this metho... |
I'm working on a project that has a massive script.js file where all the shared functions, code and more is placed; but it also has code that has some page-specific behavior.
Evidently, this causes issues in certain ways as including the line $('#bank-account').on('change' ... in those files that are not the one it is ... |
I have a method that checks a data structure for the presence of a thing that might be missing but is required. If it is missing, it adds it.
Essentially it is this (although the method is much, much more complicated due to the complexity involved in adding the thing, and the thing comes from a thid party service):
vo... |
For example, the SysInternals tool "FileMon" from the past has a kernel-mode driver whose source code is entirely in one 4,000-line file. The same for the first ever ping program ever written (~2,000 LOC).
|
An experienced software engineer described a database design pattern to me in which there are three kinds of tables: transactional tables, associative tables, and data definition/taxonomy tables.
As he described it, a transactional table might store information about a user, product, etc. For example, the USER table mi... |
I'm trying to understand the database per service pattern in microservices architecture.
Say we have a restaurant reservation application composed of the following microservices:
User
Search
Restaurant
Reservation
Search
Notification
If a user wants to create a reservation, the UI would perform a POST request to... |
For ember acceptance tests is it best practice to mock services? This seems strange to me as I would expect an acceptance test not to have to mock anything as it's testing an entire system. Also, some features may call several different services.
Can someone help me out with the best approach? Trying to test my applica... |
I'm new to actors and just playing around in ruby using Celluloid. I have this code below
module Enumerable
# Simple parallel map using Celluloid::Futures
def pmap(&block)
futures = map { |elem| Celluloid::Future.new(elem, &block) }
futures.map(&:value)
end
end
p Benchmark.measure{
100_000.times.pmap { ... |
My microservice prototype currently has a Spring boot MVC application as its front-end. The application renders the View completely in the backend. It makes rest calls to other microservices like OrderService or ShippingService that are behind an API Gateway. Scaling the micro-services behind the API Gateway is no prob... |
I need a run-only-once method that when all the criteria are met, say A&B&C are true, run the codes once, but only once. So if later on all the criteria are met again (A&B&C are true again but I don't care then), the code won't be run again.
This is not to solve the multithread issue, there is no data synchronization p... |
Consider an ORM that maps tables to classes, and columns to properties. How should it handle a property that maps to an identity column for non-inserted objects?
For example,
[Table("MyTable")]
public class MyMappedType
{
[Column("Id")]
public int Id
{
get
{
// ...
}
... |
Say I have two views (Table View for example) that I'd like them to do different stuff; each loads different data but behaviors are similar for most par except what happens when a cell tapped for instance. One shows a list of entries, another a list of users, another a list of comments, etc. I can write one subclass o... |
Given two classes:
class A {
B* b_;
A(B* b){
b_ = b;
}
}
class B {}
B is a class that should be used only inside A so I would like not to expose its creation to whatever class uses A. Moreover, B should not be created every time an instance of A is needed (it has a slow initialization).
Given that... |
In my project I have a list of items that should be sorted, but instead of re-arranging the positions of the items in the array I want to set a 'Sequence' property defining the item's places in the list.
Currently I use a merge sort to re-arrange the array and then loop over the items to set their sequence property.
Ar... |
All of the examples of bridge pattern show only one level of inheritance, but I would want to apply it to a subclass of the base class too.
The RefinedClass adds functionality to the BaseClass. In the end you want 4 classes functionality (Feature1Foo,Feature2Foo) , (Feature1Foo,Feature2Bar) , (Feature1Bar,Feature2Foo)... |
So I have a project which has BDD tests with Behat/Mink. The scenarios which I have use mink, and so require the testable code to be deployed so that Mink can actually test the pages.
I'm wondering how these tests would fit into a CI/CD pipeline/workflow. Currently our workflow is as simple as push, deploy, manually te... |
Just finished reading this article which claims the Java Fork-Join framework is a bad fit for almost any realistic task. He seems to being up some good points but I don't feel qualified to say if he's right or not. To quote the conclusion:
The F/J framework is lacking as an API
It is deficient in “characteristics of ... |
Due to a number of circumstances leading to a poor deployment last build cycle, I campaigned in our office to perform all future deployments with a dedicated build machine, and my boss accepted this proposal.
However, instead of getting an actual machine in our office to use, we're having to share a single machine wit... |
If I split up the development into a timebox with 3 phases: planning (e.g. with planning meeting), functional progress (software development / implementing user stories) and finalization (e.g. with review meeting). What is the iteration/sprint? Does the iteration also contain planning and finalization or are these part... |
I want to make a randomizer for the items in the game La-Mulana. However, some arrangements of items would mean that the game cannot be completed. Sometimes there's only one group of items required to pass an obstacle, other times, there are multiple groups of items which can pass an obstacle.
For example, to reach th... |
We're performing a delivery from our Developer stream to the Integrated stream that we share - this process allows our build team to construct our application from the Integrated view. This is for a Java application.
There are several activities that were never delivered to the Integrated stream - old changes that we... |
I've been wondering something about how we pass complex ORM objects to background workers — in my case, Django models and Celery, but this could apply to any similar background processing framework.
I usually pass model objects "by reference" using the primary key. In quick Python, this would be how I send an email for... |
I want to be able to have a (pretty) large FSM where I can debug it by jumping to a point and watching the execution.
For example, lets say I'm making a FSM that uses some probability on whether I go left or right at a junction. Maybe I have a bunch of things like "people I've seen go left" and "people I've seen go ri... |
So I want to add our git repo to the server so that we can pull in the latest changes from the master branch and easily update the live sites via SSH.
I don't want changes tracked by Git on the live site though, I want it to only be able to pull in new changes from the master branch as new features will be developed on... |
If we test a function B, by testing a function C which calls that function B, i.e. writing a test program to test the function C which calls that function B, is the test method still called unit test, or something else?
When is it preferred to test indirectly on a function which calls the target function, and when is i... |
Summary: Why is it wrong to design a constructor only for its side effects, and then to use the constructor without ever assigning its return value to a variable?
I'm working on a project that involves modeling card games. The public API for the game uses an odd pattern for instantiating Rank and Suit objects. Both use... |
Consider the following method:
public async Task LoginAsync()
{
if (!CanLoginAsyncExecute()) throw new ValidationException();
try
{
StartLoading();
await _authenticationService.LoginAsync(Email, Password);
}
catch (LoginException e)
{
... |
I have been searching the net for an answer, but I was not able to find a similair question nor answer. So here I am.
I am developing an app where a user can take a picture of a car and they will get back the car brand and possibly a model.
Currently I am using an API as a back-end to recieve the picture, the API will ... |
A year or two ago I saw an excellent article on OOP (Java), which showed the progression of a simple concrete logger of two or three lines of code, and a theoretical excessive thought processes by the inexperienced developer that basically said oh, I should add this in case we ever want that! By the end of the article... |
I'm writing a web app which allows users to upload real-estate listings. Part of what this does is allow them to upload photos of the property they're listing.
I'm using a micro-service type approach so there's a property media service which handles all the uploading of media, querying of what media are available for e... |
I have learned that new Intel processors can do "dynamic execution" (meaning out-of-order execution of instructions). How do programs written in a high level language take advantage of this? Does the compiler modify the code so that they can benefit?
Every year new processor architectures come out but languages like ... |
I'm working on a modular video processing pipeline. It's currently presented as a tree of modules. Each module has a set of "results" and can dynamically request data results from other modules. Each request and result are marked with frame ID. User requests one or more "metrics", i.e. end results, for a set of frames ... |
I am trying to make an effective modf() function that uses floats instead of doubles. An embedded application I am working on only supports the float type.
My modf() function works as expected with the exception of float rounding errors.
Consider the float number 12345.67. The current version of my modf() function si... |
I am looking to develop a piece of software which will probably store hundred of thousands or even millions of datasets with 3 to 5 datasets to look up per ID.
Is there any way to build something like this efficient, fast and scalable in regards of "lookup time" using PHP and MySQL?
I thought about trees for easier loo... |
So I am creating a numerical solver that I want to use for many problems/algorithms. The way that it's written, there is a generic class called "Algorithm_Scheme" (and associated files Algorithm_Scheme.h and Algorithm_Scheme.cpp) that is included as a member of the "Solver" class.
To create an executable for a differe... |
I have a Python client launching a subprocess in C++.
The C++ program runs several threads that need to report results to the Python client.
Knowing that both the Python client and the C++ subprocess are running on the same machine, what is the best way to communicate between them? Using communication through TCP or t... |
Say I have a Car, that owns a SpeedBooster that whenever is active and the car has to move, it will add an extra - configurable - speed to that moving action.
I was thinking about how to design-implement this using OOP, and I ended up doubting between two different solutions:
Solution 1
The Car is the one that checks i... |
Just recently started to grasp on MVC and design patterns.
(back to school at 34 ;) )
I was asked by my teacher to design a two part application. It's a recipe website that as an admin WinForms app.
I started to develop my core domain and then moved on to persistence and then moved to the MVC web app... and then I star... |
Recently read couple of Graph DB tutorials. Most of them tell what is Graph DB/when to use/fetch syntax but no where found high level description
how GraphDB stores the data internally to understand it better.
Coming from java background, I think GraphDB must be storing the data similarly like Java represents the Objec... |
I have three subclasses that inherit from Hero:
Warrior
Magician
Amazon
The three of them hold a Weapon, that is always the same one:
Warrior always holds a Sword (that inherits from Weapon)
Magician always holds a Wand (that inherits from Weapon)
Amazon always holds a Bow (that inherits from Weapon)
I have in mind... |
Specific Background
I'm writing a library to extend the async backbone of a language with cooperative multitasking. (The language is Hack, but C# also implements async-await with Task, if the concept sounds familiar.) I've been able to express what I intend the library to do in code. The problem of the hour is when.
So... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.