How can I implement online algorithms using functional programming? [closed] - c++

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 11 hours ago.
Improve this question
I program embedded systems using C++. I am learning functional programming and would love to apply it more in my work. All of my data is collected discretely and is often times required to be analyzed online.
For example, using a moving average to smooth signals. I can make the moving average function pure, but I can't make the state for the function const. Another example, I can make a pure Schmitt trigger function, but I can't make all of its inputs depend only on the current state.
What is the best way, in a functional sense, to store data from previous time steps?
Also, do you have any favorite references for embedded/functional programming?

Related

What piece of hardware or software on a computer/microcontroller determines what code you can write (and not write)? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 11 months ago.
Improve this question
So I am writing code for a microcontroller (using Arduino IDE), which I do not have a ton of experience doing. This question popped into my head when I was wondering which 'parts' of C++ I could use in my code that would flash onto this NRF52840 microcontroller. Basically, I am wondering: What on that board determines the code I must write for it?
I understand saying "what code can I write/not write" is broad, but its because I dont know what to say instead. A few guesses I have for substitutes for this would be: certain libraries? certain coding languages?, certain types of languages (interpreted vs compiled)?
Sorry if this question is too horribly stated to get an answer, but this was legit the best I could do lol.
In the case of using C++, it depends entirely upon what language features the compiler you are using supports. I suppose there might be hardware out there that is so simplistic that certain features are simply beyond the ability to implement, but I cannot tell you either what hardware that is, or what language features would be so effected.

Data compression methods [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
Why are most data compression algorithms created with C++ or Java. Why not use javascript or even ruby? Is it dependent on the file type you are trying to compress such as text,video or even audio files?
If you need to compress data, it is probably because you have a lot of data; as such, the performance of such algorithms is pretty important, and other things being equal, a compiled language typically performs better on the kind of low-level data manipulation such algorithms employ than an interpreted one.

Making a decision tree for AI in C++ [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I know the basics of having a user input their decision as a choice, and having that lead to another decision. My only issue is that when i make these choices, it is almost all hard coded in, leaving no room for other uses of the code. I was wondering what the best way to make a decision tree for AI that would allow them to make smart decisions based on the circumstances. I DO NOT want the pre-written code or a library. I would prefer to write the code myself and learn more about the language. I have a good understanding of the language, but would still like to learn more.
You can embed a scripting language (e.g. Lua) into your application and let your users write their decision trees as scripts.
Or you can think of some data structure (XML-based for example) that describes an arbitrary decision tree that you can parse and build the actual tree during run time.

Runtime add algorithm to a program [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I'm creating a program that make some matrix analysis. Now i want to implement some basic algorithms but I need to allow users implement new algorithms in the future without recompile the code.
I suppose that these algorithms already exist, probably in c/c++ language.
How can I do it if I use qt?
Maybe it's better use an other programming language and why?
I suppose that these algorithms already exist, probably in c/c++ language
If that's so, one way would be to write your program capable of loading DLLs, and then your users can compile their own algorithm DLL plugins for your application.
Or if you don't expect your users to be able to compile the existing c/c++ algorithms, maybe you can do as Joachim Pileborg suggests, and add in a scripting interface.

Is it possible to create the low-level grapics API (similar to OpenGL)? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
Is that possible to create a low level framework similar to OpenGL?
What do you need to building such API?
No, implementing something like OpenGL is not possible. Since the time OpenGL has decended from the heavens complete, writing something like it was forbidden by all common religions.
But really, what you'll actually need is about 21 years of work, a few thousands of developers and broad support from all industry leaders, so yea, piece of cake.
Or actually, all you need is just a notepad and a pencil, writing is easy!