Integrate Python's Django into a C++ application [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 9 years ago.
Improve this question
I would like to integrate Python, and specifically Django, to a C++ application. This is for many reasons which include, but not limited to:
Ease of data handling and feature development in python
Django's amazing ORM
Django's instant admin interface
etc...
My specific application is a real-time event intensive application. The Python\Django aspects should mainly come in the initial data loading part, batch data dumps and semi-real time web access for tracking and configuration.
How would you go about integrating these very different programing languages and design concepts?

I would strongly recommend considering to integrate the other way around: your C++ application into Python. A good article on the tradeoffs of extending vs. embedding.
Also, re the Django/web server part, it's not always recommended to have a monolithic application that's too large. Consider breaking the web-serving part into a separate application, purely Django on Python, that will communicate with your main application via either OS files or sockets, or some other IPC. You're still welcome to add Python to your main application (by extending or embedding) for the other needs.

Related

Is it a good idea to develop a server application using QT?(QT5) [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 5 years ago.
Improve this question
I am a QT/C++ GUI developer, and I am familiar with QT event system, meta-object system, concurrency. And I know that QT has separated QtCore which makes it possible to develop server applications using Qt without linking in any unnecessary GUI-related code.
I am confused about whether it is a idea to develop a server application using QT?It is my first time to develop a server application, so any ideas and suggestions about server application with QT is grateful and welcome.
1.My server application will be running on windows(OS),and act as an agent: network request forwarding and buffering, packaging device operations(to provide a unified interface).
2.Need to support 2000 clients concurrent access, so I am worried about whether the event system or signals and qthread are good enough?
The biggest problem in your scenario is not Qt, I would say it is C/C++.
Server-side services usually need a very high fault tolerance.
With languages like PHP, many Java libraries, etc. that kind of comes built-in.
With C++, it does not. One call resulting in an error that you did not remember to catch correctly can easily mess up the whole process. Which then requires you to have multiple processes running at once (to remain responsive even if one process failed) plus a cronjob (or similar) to restart those that died. That's not optimal.
Typically, small parts of an online service are done in C++ (especially if they are performance critical and PHP/Java/Python/Node/etc. wouldn't suffice for the task at hand), and those you could easily do with Qt as well.
But I would advise against coding the part that handles actual user/API requests in C++.

Redux: Is it necessary? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 23 days ago.
Improve this question
Is a reducer like Redux really necessary when developing with ReactJS?
Is it just a way to design cleaner code?
If so, when?
No, reducers or Redux are not necessary. Vanilla React works fine, or other options, e.g. MobX.
Check out the Redux FAQ:
Dan Abramov, one of the creators of Redux, says:
...don’t use Redux until you have problems with vanilla React.
When to use Redux is an architectural opinion and the FAQ provides this guideline:
In general, use Redux when you have reasonable amounts of data changing over time, you need a single source of truth, and you find that approaches like keeping everything in a top-level React component’s state are no longer sufficient.
React is just a library to build UI. Not an entire framework. Using redux let you handle all the logic of your application in a clean way. There are other library similar to redux, but redux seems to be the way to go when starting a new project with react.
Short answer you do not have to use Redux but it is considerably easier on you if you do chose to use it, there is a lot of examples online which i can point you at where you can learn how Redux and React work. Note that React is only V(view layer) in MVC that being said react does one job and it does it really good that is displaying user interface.

A typical tech stack using vowpal wabbit? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 2 years ago.
Improve this question
Hi I want to see an example tech stack where vowpal wabbit is used.
This can be actual application which people are using or an imaginary one which illustrates how VW fits.
We are currently facing a common legacy code problem. Our back end is a collection of web services implemented in C++ using relational DB and Front end is Javascript based web app build on top of those webservices.
Now We want to extend our backend to provide some analytics services which uses machine learning functionality. Having seen around, I quite liked Apache Spark + ML + GraphX as graph already heavily features in our server logic. But the problem is they are not C++. Though they can be made to integrate with it, but as we will be writing lot of our own stuff, We will have to write non-C++/Javascript code, which is currently not under consideration.
Vowpal Wabbit is another candidate that meets our criteria but I am not sure how it would fit over-all right from raw-data storage to application logic. Hence the question.
As I recall VW could be built as static library (check examples in its ./library folder). And perhaps as dynamic library too. Thus it could be just incorporated in your legacy c++ app.
Vowpal can be used as a library and the source code include examples of using the API in C++. We are using it in an iOS application with no problems. The only slight oddity is the need to use boost::program_options to initialize the library and various methods. If you were motivated, you could further develop the API to accept arguments. The maintainers seem to actively encourage the development of patches and features.

Integrating a program written in C with another one written 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'm working on a project where I need to integrate 2 simulation software packages; as in the output from one is to be used as input for the other one, and vice versa. The exchange of information happens at every time-step of the simulation, so it occurs very frequently. Both simulation packages have support for plugins: one of them supports plugins written in C, and the other supports plugins written in C++. Is there an elegant way to integrate these two plugins to make the software packages talk to each other? I thought about reading/writing files to hard drive, but I'm hoping that there is a better way to do this.
Thanks all!
Is SOAP or RESTful service an option? That would work in both C and C++
You definitely can use files to do that, but I wouldn't recommend writing them to the disk, but to use a Memory-mapped file. There are several libraries that implement this functionality, such as Boost C++. Java has the FileChannel class that handles it

Interact with a C++ application throught CakePHP [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 years ago.
Improve this question
I'm wondering Which solution could be the best to interact with a C++ application and its data through CakePHP over a Windows environment.
I was thinking about creating an API, with Delphi or Java for example, which could work with JSON requests and which at the same time would be linked to the C++ application.
This is a very generic question but I would like to have any feedback about this or know if anyone have tried something similar before and what solution was implemented for it.
Thanks.
First, you need to define "best": Most performant, easiest to implement, best scalable, most portable...?
If you can modify the C++ application, I would not create a component in the middle (what you suggest to write in Delphi or Java) but instead add an interface which PHP can access directly. If you cannot do this then you need to create such a component, of course. In this case, roughly the same options exist as for embedding the interface in the C++ app:
A simple approach is to use sockets (see Interprocess communication within PHP with a continuous process?). A more heavyweight approach is http://activemq.apache.org/.
And of course you can expose a webservice (SOAP, REST, XML or JSON...). This is certainly a very portable interface but probably not the fastest (more layers in between).