It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
Is it possible, for instance, to use functions of a C++ library in another language like Java or Ruby? Can a single application be programmed using separated languages? How?
Yes, it is quite possible to create a program that uses multiple languages. Here is a post for using C++ from Ruby. As for Java, you'll want to look at the Java Native Interface.
A program can be coded using different languages either by inline code (e.g., Assembly language in a C/C++ program, or MATLAB code inside of LabVIEW blocks). Or, by calling external library code (e.g., C# interoperability with C/C++ libraries).
Hope that's helpful!
Yes, it is possible to embed C/C++ code in another language. For example, take a look at SWIG:
SWIG is a software development tool that connects programs written in C and C++ with a variety of high-level programming languages. SWIG is used with different types of target languages including common scripting languages such as Perl, PHP, Python, Tcl and Ruby.
Related
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 9 years ago.
I am working on a math project.I need a programming language that allows me to evaluate users input.
Like Multiplying 2 complex numbers: I can't use a regular expression since there are many possibilities( I want to include all the steps of calculation.)
You could use Scheme, it's a nice Lisp-like language that has built-in support for complex numbers. Also, since in Scheme data is code, it is really easy to turn user input into executable code.
Chicken Scheme is a popular variant.
Other popular languages with built-in complex number support are:
R: use i as suffix for imaginary numbers. (1+2i)^2 returns -3+4j.
Python: use j as a suffix for imaginary numbers. (1+2j)**2 returns (-3+4j).
Ruby: use the Complex class.
C: include complex.h and use I as the imaginary unit. See also How to work with complex numbers in C?
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
My question is how to run a multi-threaded program in C by pthread across multiple computers?
Is it possible?
Running program across multiple computers might not be possible with multi-threading try using multiple processes as #goldenmean has suggested.
PS:You can find my tutorials online this type of application can be easily done using MPI.
Using pthreads library alone would not help you to execute a distributed version of your code/application on different physical CPUs/machines. For that you might need to see how the below libraries/frameworks for distributed computing work
-- Message Passing Interface (MPI)
-- Hadoop and MapReduce
-- Write your own distributed parallel programming framework using the basic building blocks
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
When working in Objective-C, when is it appropriate to use preprocessor directives like
#ifdef, #if, #ifndef, and #define instead of statements like if() and switch()?
Preprocessor directives like #ifdef, etc. are only valid at compile time. They are not able to make decisions or loops at runtime. They simply regulate what gets compiled and what not.
They are totally useless at runtime. They serve a totally different purpose.
These are all part of the C language, there's nothing specific to Objective-C here.
Most of the time in your program logic you're going to be using switches, if-elses, fors, whiles, etc. This applies to C, C++, Objective-C and other C-style languages.
Preprocessor directives are evaluated at compile-time, and so only the preprocessor/compiler is interested in that logic. Your actual program doesn't deal with any of this. You're not going to use directives much except for stuff like architecture differences, compile-time constants, macros and so on.
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
I'm making a program and I need to use another program's API.
Which then let me pick between their activeX or Delphi.
Wondering which one I should utilize or focus more on.
Not sure if I'm being too broad here.
Edit: I'm more familiar with visual studio if that is of any concern.
Delphi is a programming language. If they're offering ActiveX or Delphi, they're offering you a COM object you can use from any language capable of using it (including Delphi) or a Delphi-specific implementation or interface to the library. Your question is pretty meaningless - "Which shall I take, the apple or the orange?".
If you're programming in Delphi, take the Delphi API; if not, or if you just prefer working with the ActiveX instead, choose it.
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 9 years ago.
How can I draw flow chart using LaTeX?
Tikz is a good graphics library to do this (directly in Latex), here is an example of a flowchart made with it.
I know it's not strictly using LaTeX, but the Graphviz suite of tools is pretty neat.
From the description:
The Graphviz layout programs take descriptions of graphs in a simple text language, and make diagrams in several useful formats such as images and SVG for web pages, Postscript for inclusion in PDF or other documents; or display in an interactive graph browser. (Graphviz also supports GXL, an XML dialect.)
Because the tools are command-line driven, there are ways to include Graphviz graphs in-line in LaTeX files, such as dot2texi.
On CTAN exists a package nassflow. The documentation contains an example on page 5.
The package is from 1997, but I was able to use it without problems with TeXLive 2012. It is not part of the TeXLive distribution (wrong license), so you must install it manual. For a quick test, just download everything in a directory and try it.