instruction stringlengths 34 36.1k |
|---|
I'm doing an essay on this for college and I can't really find sources.
So far I've found these:
https://www.quora.com/Which-is-the-best-programming-language-for-embedded-system
http://www.eetimes.com/author.asp?doc_id=1323907
Why does C dominate in the embedded software market?
I'm meant to evaluate the suitability of... |
In Angular 2's official tutorial, any operation involving getting or saving a class necessitates using a service. For a Hero class, they had to create a HeroService to perform all HTTP calls. This includes getting a single Hero object with heroService.getHero, and creating or updating a single Hero object with heroServ... |
I have a table, let's call it Widgets, a Tags table with about 30 tags, a WidgetsTags table that joins each widget with any number of tags, and a table called LandingPages, the landing pages are for SEO purposes, they offer pre-filtered versions of the widgets table that match popular searches. That way when someone s... |
I read this article from the google testing blog. Basically, the idea expressed in the article is that it's a good practice to avoid writing "change-detector tests". This code is given as an example to avoid
// Production code:
def process(w: Work)
firstPart.process(w)
secondPart.process(w)
// Test code:
part1 = ... |
I am trying to implement a message that contains sub messages. The format would look something like the following.
Message: Field 1, field 2, ..., sub type, buffer
Depending on the sub type there could be one of several ways to interpret the buffer. Some of the sub messages might look something like the following.
Sub ... |
This is going to be a very non-technical, soft question and I am not sure if this is the right platform. But I am a beginning CS student so I hope you guys tolerate it.
In the first semester we were introduced to OOP concepts like encapsulation, data hiding, modularity, inheritance and so on through Java and UML. (Jav... |
I often find myself writing functions that look like this because they
allow me to easily mock data access, and still provide a signature that accepts parameters to determine what data to access.
public static string GetFormattedRate(
Func<string, RateType>> getRate,
string rateKey)
{
var rate = get... |
We have a simple CRUD application. QA has a test script where they are doing the following:
Call Create Customer service
Query the database for the newly created Customer
Verify the Customer in the database matches the expected result
Call the Get Customer service
Verify that the Customer returned from the services m... |
I am using the same final constants in different classes,
like
class A { private static final String NAME = "Name"; }
class B { private static final String NAME = "Name"; }
class C { private static final String NAME = "Name"; }
I am trying to simplify the code here instead of using the same constants in multiple cla... |
I will be developing a mobile app, which will mainly act as a client. There will be an API on the cloud that these mobile clients will interact with, and there will also be a web application for administrative purposes.
I'm thinking if I should use two separate applications for the API and the admin application. My tho... |
I am constructing an enum Flower which contains the fixed set of constants for Flowers as described below. I'm writing it in a separate file and importing it to other classes so that it could be used across my project.
Is it a good practice to write an enum in a separate file in Java. Can someone give me some advice on... |
I am integrating an external library that declares a singleton, like this:
public class External : MonoBehaviour {
public static External Instance { get {/*setup inner stuff*/} }
public void Method1(int arg);
...
public bool MethodN(): // N is large
}
I created a wrapper with an interface, so I can un... |
Studying some in-depth concept of Spring framework, I'm facing this doubt.
Has the Model, as inteded in Spring MVC, the same meaning of the M in MVC?
I mean: I always considered the Model of the MVC pattern a layer where is residing all the data and the logic that is retrieving it from a DB.
But in Spring MVC model is ... |
I keep hearing the term and all google searches lead me to articles on compilers. I just wanna understand what the term compile target means :|
UPDATE: To give some context: I've heard it said that web assembly is a compile target for for other languages such as C, C++, Rust etc.
|
Right now I am working with embedded systems and figuring out ways to implement strings on a microprocessor with no operating system. So far what I am doing is just using the idea of having NULL terminated character pointers and treating them as strings where the NULL signifies the end. I know that this is fairly commo... |
Having one e-commerce system for multiple markets.
Having markets related 1:1 to currencies.
Having one database storing all order information (cost, price, invoicing)
How to manage different currencies?
normalise all saved data to one single currency (and at display time apply conversion rate)?
save everything in the... |
I have a large codebase of Java/JSP files that needs to be compiled and checked for errors. The compilation time is long enough that we only run it once a day. However, I'd like it to be more frequent than that, say every 15 minute interval.
But I'm not able to figure out how to minimize the build time to allow this. R... |
Does code-review typically involve UAT/QA testing? We are trying to establish a meaningful code review process and we have come to a disagreement among our development team. Some of are holding that a reviewer should checkout a development branch from TFS, and actually perform UAT based on the acceptance criteria of th... |
In C, almost everything requires a function. What nags me is that I don't know exactly what's going on. If there was no msvcrt.dll file, my C programs would all break because that's where all the standard library functions are. I would like to know what the equivalents to the standard library functions are, but without... |
In the GUI application I'm working on I have a number of custom (composite) widgets that I've created, with each widget having an update_gui function where I access my SQLite database so I can fill in text areas, set checkbox status, etc
I constantly run into the problem of events being fired when the gui_update code i... |
It sucks being on the critical path as normal developer, especially if you're late. When you're the senior developer, that the team is looking to for leadership, it's even worse.
When work for most of the team is stalled waiting on some critical piece what should the rest of the team do? We have limited access to th... |
I go on challenging the Erlang-promoted practices. I see that they advise to hide the messaging behind API
We love messages, but we keep them secret:
Something annoying with the previous example
5> Pid ! {self(), {store, bacon}}.
{<0.33.0>,{store,bacon}}
6> Pid ! {self(), {take, bacon}}.
{<0.33.0>,{take,bacon}}
7... |
In our company, we have large ear files to which developer groups contribute jars. This is a many-to-many relation, where each ear has 30-50 jars and some of the jars are within 10 or more ear files.
We are thinking about introducing more automatic testing to move in the direction of CI. Integration tests usually happ... |
I need to process a large number of data items, and I need to restrict the speed at which they are processed. For example, not more than 20 items per minute.
I've thought about an algorithm for that, where I'd keep a list with the time when each past item was processed, then I can know how many more I can process at a ... |
Imagine an ORM system, independent of language but let's assume PHP. Data is encapsulated in PHP objects and stored into and loaded from database.
Let us have a theoretical object "Person" with multiple addresses (so mapped to 2 tables in database), which can be added by a function.
Do NOT consider how access on data e... |
I have a service running on AWS exposed via a rest API. The service processes files.
Clients of the service post a file to the api and are returned a Job ID.
Clients can then request the status of the job, if it is complete the job result is returned as JSON.
The API essentially consists of a simple gateway service th... |
I'm currently working on a project that requires using a database. This system may be required to use an SQL database in the future, but for now we are using Google Spreadsheets via API because we need to access the data quickly, easily and for free.
My question is: Should we create a DB API in case we change the data... |
In the context of sports scheduling, a scheduling rule violation (let's call it simply violation from now on) is produced when trying to allocate a match in an illegal timeslot. There is a wide variety of reasons of why this can happen and this is precisely the purpose of the scheduling violation object: a list of them... |
We have a relatively simple version control process: master branch, dev (otherwise known as integration) branch, and our individual branches for every user story.
We check out from dev, branch at the beginning of a new user story to a new branch and once we finish, we merge again to the dev branch.
There is the opinion... |
I'm trying to understand the age old facade vs adapter confusion.
Most languages and frameworks have a data access library designed for RDBMs. In the case of the examples provided above you have a connection interface, and one connection type for each driver type. All of these types besides ODBC have a ODBC connection... |
I'm new to Docker and containers in general, and was wondering if:
this approach is possible, and
are there better/more-proven approaches
I have a "Command Central" web app that's responsible for maintaining the data for multiple teams. The teams will each work with their own containers, which come in pairs; one web... |
I know this question has probably been asked several times before, but my question is specific to my situation.
I am implementing a notification micro service. It has an email table and a queue table. The service is exposed using a REST API. Each email can have multiple to addresses and cc addresses. The queue has an e... |
I've seen this in C#, Hack, and now Kotlin: await or an equivalent operation can only be performed in special "async" contexts. Return values from these are, to borrow Hack's terminology, "awaitable" in turn, so the special async-ness of some low-level async system function call bubbles to the top unless it transformed... |
I have general parallel programming question.
Suppose there is a directed graph with cycles. Let’s assume that each node has fairly small amount of incoming edges ~ from 0 to 20 and potentially pretty big amount of outgoing edges ~ from 0 to 500. Let’s say that each node is a function that getting all incoming edges as... |
I'm an owner of some Product, where I have different clients who use that product, and the attributes of that product alter the experience that my clients have on my page.
For an example, lets say that clients have a key called "product1" and that would yield a "Product" object with values
Product:
{
"id": produ... |
I am trying to come out with high level architecture for product search in big scalable ecommerce application like amazon/best buy etc.
Use case :- Search any item in free text. Say user search product "galaxy white" , it can be mobile phone, air condition, garment brand , beaty product etc. I need to display all pro... |
I know that ReentrantLock use AbstractQueuedSynchronizer(AQS) to implement Lock.
But the detail of the realization, I can not understand.
I know that AQS use volatile, CAS and spin for synchronizing. But, these actions only control the "state" member.
Although, LockSupport.park and LockSupport.unpark can synchronize th... |
I'm a C++ developer and in an attempt to better understand cross-platform development, I'm trying to get a better understanding of some implementation details of compilers and how exactly they create OS specific binaries. In the midst of my study I realized that, at least for a while, most compilers you downloaded for ... |
Let's say that I have a JSON file like at example below.
How would I go about finding all possible values of item combination time sums that exist between let's say 00:03:04 to 00:25:55 without finding every single permutation combination that exists and adding them for that set?
For example item 1 and item 3 would be ... |
It's a language agnostic question. Seems like a common problem, but I can't find answer anywhere.
I need to pick a name for a variable to hold the values of one attribute of a list of objects, and I would like the variable's name contain the attribute name as well as the object's name. My question is how to use the plu... |
Edit: the difference between my question and What are the differences between abstract classes, interfaces, and when to use them, What are abstract classes and abstract methods? is that the chosen answers didn't mention about the compiler-warning part. One even mention the re-use of code by inheritance, which is bad pr... |
I am trying to model a design for a C# project. Trying to follow the SOLID principles, this is what I've got so far:
SDKClient class which has three (for this explanation) important properties (IAuthProvider, IHttpProvider and IFileService). The SDKClient should be decoupled, so I am always free to exchange the auth cl... |
At several times in the past while writing software documentation -- including user manuals, user stories, bug reports, test cases, and emails to users/colleagues -- I've needed to be able to refer to items inside a menu. Sometimes ones nested several submenus deep.
I've seen and/or used several styles in the past:
Pa... |
I have 20 entities and 50 user requests. And i have very complex business-logic (set of rules). How can i make my architecture so I'm not confused when adding new rules.
Now if i add property "InTheBattle" to fleet, i must consider this in 5 requestDispatchers and 3 methods in Verifications classes.
What will happen w... |
My sincere apologies, if this question is too vague but I am really curious in understanding how payment redirection works in web development without exposing data in url parameters.
In detail with example:
I go to Jet blue website(jetblue.com), search for flight, choose flight, fill all the necessary information and ... |
Given the interfaces that major OSes (Windows, macOS/OS X/Mac OS X, Linux) provide to file systems, can file systems be designed and implemented in a way that is largely independent of OS?
I'm not at all an expert on file systems and I've never implemented one but I am an enthusiastic user of file systems. My naive exp... |
Domain object "Contragent"
Let's say I have an hierarchy of classes:
public class BaseContragent
{
public int Id { get; set; }
}
public class PersonContragent : BaseContragent
{
public string FirstName { get; set; }
public string LastName { get; set; }
}
public class CompanyContragent : BaseContragent
{
... |
I have a problem and I want to know what is the best way to solve it.
Problem:
I have a Binary Decision Tree. Each leaf node has an object (called Matrix) that stores some information and performs some calculations. At some point during execution, I want to ask Matrix if I should split the leaf node. If yes, I should c... |
I have a mysql database in server, storing user accounts information (username and password). I'm developing the Android login/ register page for an app.
When the app is first loaded on client mobile, should the Activity takes all the accounts information from the server and store in the local sqllite? and then when u... |
I am a C++ programmer with limited experience.
Supposing I want to use an STL map to store and manipulate some data, I would like to know if there is any meaningful difference (also in performance) between those 2 data structure approaches:
Choice 1:
map<int, pair<string, bool> >
Choice 2:
struct Ente {
... |
I ask this because I am interning as a QA Engineer and one of my bugs got rejected by a remote project manager because I performed an unrealistic test.
Basically, the bug involved a large text field to hold notes of 2000 characters max. I performed a test in which I entered a 2000 character long string to see how it wo... |
As far as I understand, the domain model should not know about the persistence layer. But then... How can I deal with removing element that are dependant of a father object?
For example, in my domain, if I have a ShoppingBasket with Products, and I want to remove a Product. I can remove the Product in my Domain Model.... |
We have a GitHub repository where we distribute our source code. For that, we want to use a really permissive license, like MIT. Of course, some of our projects have GPL or similarly licensed dependencies. However, we do not include their source code there but rather (since we're using maven) list them in our POM files... |
How do you think we should handle 1 external collaborator/developper within scrum method ?
For example : Should we isolate the tasks that he must do ?
|
I've come across two Stack Overflow posts that seem to offer conflicting answers:
https://stackoverflow.com/questions/4831307/is-it-bad-to-store-all-instances-of-a-class-in-a-class-field
https://stackoverflow.com/questions/12101958/keep-track-of-instances-in-python
Can anyone confirm whether or not storing instances ... |
I'm a seasoned programmer but a novice with DDD. I have a project that I'm trying to implement with DDD and my understanding is that there is some ambiguity with regard to the use of domain models and application services. In the purest of DDD implementations, my understanding is that domain models are supposed to co... |
tl;dr Can I have a repository depend on another repository, where they both implement the same interface?
I am working on a website analytics system that involves getting data from different sources. One of these sources is very slow for large datasets and the other is deprecated and we are moving away from it.
interfa... |
I want to make some enhancements in some still-functional code that was written a long time ago, before the programming language it is written in grew in features. In theory, the whole project uses the up-to-date version of the language; however, this particular module (and in fact, many other modules) are still writte... |
On a regular Hard Drive a secure delete of a file is possible by overwriting it, does simply overwriting the registry key is enough to secure delete the key ?
If not how I can proceed to secure delete my registry key ?
|
Introduction
I'm working at a software company building software as a service. Currently we have version x.y in production and x.z on acceptance. Let's say we find a critical bug on production and want to test the fix on an acceptance environment. I don't know how to work with this.
Options
Create a second acc enviro... |
I have this example class:
public class Carrots
{
private string name;
public void SetName(string pName)
{
name = pName;
}
public string GetName()
{
return name;
}
}
I have the member of the class set as private and to set and get this member, I have made get and set metho... |
We have a persistence backed object, and it has a version field
in the database. Assume there's lots of unrelated code in this
class.
#
# We're branching on this "version" field, and we return one
# of 2 policies.
#
class Foo
def policy
if version == 'a'
PolicyA.new
else
PolicyB.new
end
end
... |
This is the code in question, comments point it out:
class Actor extends Entity {
private MutableVector2f position;
private MutableIdentity identity;
public Actor(MutableVector2f initialPosition, MutableIdentity initialIdentity) {
super(initialPosition, initialIdentity); // !! pass to supertype !!
... |
I have 3 Different Classes Which are representing different types of Sensors, for example:
WaterLevelSensor
DoorSensor
TemperatureSensor
Each Class has different functionality.
Following the OOD Principles:
I have decided to make 1 parent class called Sensor.
Make the 3 different types of sensors inherit from the pa... |
Recently i have been looking more into the design part of application programs. The suggestion seems to be very different across different sources. For example the books like code complete suggest to build into language or framework. Other approach like clean will suggest a more business or domain driven approach.
Whic... |
The only real logic is in the query syntax for the external API. I don't want to test whether it queries the api, I want to test that it queries it in such a way that the correct data will be returned. For example, some pseudo-code:
function retrieve_related_data(id)
{
query = "[potentially long, syntactically comple... |
Maybe too basic of a question but wanted to see if there is more to it than I am thinking.
When configuring URLs (baseUrls, like https://my.app or relative URLs like /path/to/resource) either as a static variable, in configuration files or environment variables etc., what should my 'slash strategy' be?
One of my cowo... |
I have a huge time series (about 30 million) of network paths with the following format:
timestamp, path, latency
The path is a sequence of IP address, so it can be represented either as a string or an array of integers. Currently the data are stored in text files which makes it very slow the analysis and querying of p... |
I'm making a console application, and over time I have been developing my own tools and practices for outputting text; a process that keeps evolving.
For example, these days I have 4 main types of messages formatted roughly like the following:
bold( red(" Error: ")) + msg << endl << bold(blue(" Value: ")) + invert(... |
I've searched a lot for a clear explanation for a software architecture but each time I got more confused, so What a software architecture really is and is there a standard way to represent it or it's something generic that describes some software components?
|
I agree with all the fundamental ideas of BDD and try to use it as much as I can. However, one thing that strikes me is that the outside in development and tests that express a scenario need to have control over the client.
The term outside in development refers to the practice of developing software by writing domain... |
The scenario:
I have a GUI with textfields and radio buttons where the user insert information for a 'Person'
Here are the classes of the model and of the view-model:
enum Gender
{
case Male, Female
}
class Person
{
var name: String = ""
var surname: String = ""
var id: String = ""
var gender: Gen... |
I am trying to solve a problem in which I have a list of two-dimensional coordinates, and I want to find the shortest path that connects all of them.
At first I thought this was a case of the Traveling Salesman Problem, however:
You don't need to get back to the starting city, which I believe TSP wants you to.
On this... |
Theoretically, is it possible to write programs without using variables? What will the most complex program look like? Does the answer vary depending on the language?
Would you be able to use functions? Control flow?
|
I know I am reinventing the wheel. But I'm really interested in implementing arbitrary precision numbers (integers, rationals, complex, etc) in C or C++ and their algorithms. Please be patient.
My question: How should I approach the process of implementation (and testing) of arbitrary-precision numerical algorithms in... |
Another question was asked regarding the use of IP addresses to identify individual clients. I think I understand why an IP address is insufficient. But what about the socket, which has more information and, from what I understand, is stateful? Couldn't that be potentially used in lieu of a cookie?
|
I am modelling a system that requires a state-chart before implementation.
Given These Images:
Main Questions:
Can I use the word "Elapsed Time" if I do not know how long it will take to finish the first state?
Can I use event-based time instead of stating how long in seconds or mins? See the second Image for an exa... |
I'm trying to write a program in Python that will take an input of a .wav (sound) file, and determine whether the user is saying "yes" or "no".
The issue is that the sound files are not always the same length.
I'm worried that with a static input dimension (i.e. 5 seconds of audio), I may have a sample that exceeds tha... |
Recently, we have started to migrate a spring application to java 8. The application is divided into 3 layers, rest controllers, service and the repository layer. Our 'architect' proposed that our service layer, always accept a mapper function e.g.
public <T> Optional<T> getCompany(int companyId, Mapper<S,T> mapper)
... |
In my appliaction I am using EF. I have the service that can provide some information and clients who want to ask for that information.
Let's imagine that I have a User, which has Address, the list of equipments, the list of subscriptions, the list of Balances. Each Balance has the list of Operations.
public class ... |
Note: The example in this question is for demonstration. Please focus on the question and not on problems in the example (such as tight coupling, lack of Dependency Injection etc.).
I have a form to create a contact with a button for saving it. Here are the View and Presenter(written in C#).
View:
class View : Form
{
... |
Foreground
We are moving from a monolithic platform to a more Service Oriented Architecture. We are applying very basic DDD principles and splitting our domain across different bounded contexts. Each domain is distributed and exposes a service via a web API (REST).
Due to the nature of our business, we have services su... |
I'm working with Xamarin and we are following the MVVM design pattern. For those who don't know what Xamarin is, it's a technology that allows us to build iOS and Android apps with shared code. Basically, your solution has 3 projects, one "Core" and then one per platform, the platform containing all the platform specif... |
What is the reason to use release version as a release title on GitHub?
It looks like this
And it looks like a common practise. Almost all popular repositories use it.
What is the use case to duplicate release tag to the release title?
UPDATE:
Examples: Facebook React, Atom, Kubernetes, CryEngine
|
Wondering about pros and cons around a facade pattern implementation (or perhaps there is a better pattern I should consider), versus simply exposing a dependent object to a caller.
Consider the following:
public class Model implements Player {
private Player player;
/*
implement Player interface, which simp... |
I have an application with a database that doesn't allow cascading deletes. When a user goes to delete an entity, I would like to display a popup saying something generic like, "This record has dependencies that must be deleted first".
To support this, I was hoping to write some code that could generically take an enti... |
It seems pretty clear that "Single Responsibility Principle" does not mean "only does one thing." That's what methods are for.
public Interface CustomerCRUD
{
public void Create(Customer customer);
public Customer Read(int CustomerID);
public void Update(Customer customer);
public void Delete(int Custo... |
One of the first things I learned about dates and times in c# (and various other languages) is that a date is stored as a DateTime with the time component set to midnight. There is no difference between "Jan 1, 2017" and "January 1, 2017 00:00:00.000". If you need to display just a date, you can use formatting functi... |
In addition to this question Should Git be used for documentation and project management? Should the code be in a separate repository? I want to ask if it is recommended to keep the documentation version (e.g.: for a REST API) the same as project version, assuming the code and documentation are in the same git reposito... |
In my course, I have been taught that, in general, In general, a class B should be responsible for creating instances of class A if one, or preferably more, of the following apply:
Instances of B contain or compositely aggregate instances of A
Instances of B record instances of A
Instances of B closely use instances o... |
In many ways C# supports functional programming, but there is a (shrinking) list of features commonly found in statically-typed functional languages that are missing, such as tail recursion, partial function application, etc. Of these missing features, partial application is "fake-able" using existing language feature... |
Background:
I'm creating my first C++ game project and I plan on calling a InitialThirdPartySystems() function to...well...intialize all third party systems to be used in my code lol. Within it I want to do some checks to make sure all systems are initializing properly. However, I'm not quite sure of the properly way t... |
I'm not sure which design pattern might help me solve this issue.
I have a class, 'Coordinator', which determines which Worker class should be used - without having to know about all the different types of Workers there are - it just calls a WorkerFactory and acts upon the common IWorker interface.
It then sets the app... |
When you need to classify an object; what are the design implications for using a collection vs a member field (say a Boolean flag).
So say I have a Client object, Client is either 'active' or 'archived'.
Should I have two collections one for 'active clients' and the other for 'archived clients' and move objects from... |
Please note: Although this question mentions Java and even a specific Java library, it really has nothing to do with Java and is really more about serial communication and device drivers. As such, I think this can be answered by anybody with experience in those fields.
I've been in "Enterprise Java Land" for a while ... |
I would like to follow up on this question, except that I have no code to show, so I decided to ask it here.
In the linked question, the OP was looking for an algorithm which could generate a plane with only one OpenGL triangle strip. He came up with a solution that works almost perfectly:
The order of the vertices fo... |
In a library in Java 7, I have a class which provides services to other classes. After creating an instance of this service class, one method of it may be called several times (let’s call it the doWork() method). So I do not know when the work of the service class is completed.
The problem is the service class uses he... |
Say you have a big bloat of enterprise software and for every customer a different setup in terms of amount of appservers, search cluster size, webservers, database, loadbalancers and application-related staging functionality (edit -> live systems).
Of course, you want to be as narrow as possible to your production e... |
I have a factory for an interface with different implementations. But one implementation needs an extra method which the others don't need. How do I solve this without implementing "not implemented exception" methods in other implementations?
|
I always use implicit imports like from module import z, y, z but now I got a project, where all imports are done like from module import * and I'm trying to understand, if there any advantages of importing everything from the other module.
Intuitively it looks for me like a very bad and inconsistent pattern, but mayb... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.