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 9 years ago.
Improve this question
I have a MATLAB code (including Simulink models) which I would like to make platform-independent, i.e., allowing them to run on web browsers and smartphone apps. Would coding it in Java be the best solution? And are there programs which can convert MATLAB code and Simulink models into another programming language easily so that I won't have to re-code everything out again? Thanks for your suggestions!
Short answer: You'll have to recode
Would coding it in Java be the best solution?
Probably not. I've found that java is hardly ever the best solution. It may be the easiest, but I doubt it's the best. But for web-browsers, AFAIK, you must render some part down to javascript (even if it's just a shim to fetch data running on a server), flash, silverlight*, or java*. For iphone, you need to do it in C, Objective-C, or C++. I think Android uses some kind of java-like/based language, but I don't know. I doubt Win Mobile 8 even has a JVM, but don't really know there.
* Few people like to leave these plugins open. Too easy to exploit and few sites use them.
And are there programs which can convert MATLAB code and Simulink models into another programming language easily so that I won't have to re-code everything out again?
Mathworks makes an m-code compiler, but you still need a lot of their libraries. It compiles for x86 under Windows and Linux. I think it supports a few other OS's, but all x86 unless they changed it around again. I guess you could try to get MCR working on a phone, but not in a web browser. Realtime Workshop renders simulink models to C, but not if they contain matlab function blocks (or some other blocks, I forget the full list). I hope you have a crap ton of cash, 'cause both those are expensive toolsets.
Related
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I have a question for you concerning Java. I am basically a Java user and did most of my work with it. However, in the machine learning classes I took in college, we used mostly python with the scikit-learn and numpy packages.
Now I want to do a project where I crawl data from the web, store it in SQL databases, and then do machine learning on this data. Maybe some of you have experience with those things and share some of it? I mean, of course it is possible to do these things with java, but maybe you have had some particular experiences on why I should use something else or what to consider?
I am happy for all your thoughts :-)
Have a great weekend!
It turns out that programming language and database implementation are secondary problems. Think first about the machine learning you want to do. Review the existing packages (in any language) and pick one according to how well it fits the needs of the business problem you are trying to solve. Then work with whatever language is most convenient for that package. You will probably find that no single language is suitable for all parts of the problem; you will end up gluing together Java, Python, R, shell scripts, etc, to make a complete solution, and there's nothing wrong with that. Consider that your job is problem solving instead of programming in a specific language and go from there.
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 9 years ago.
Improve this question
I have a legacy ISO prolog application of medium size that I would like to move to a JVM based language. The application is a command line tool that parses text files, does some evaluation/transformations and then export a text based file.
My team develops mainly in Java so we have a lot of existing java competence and reusable components. Prolog competence is however very low.
I don't expect there to be a tool that takes prolog source code and transform it to some other language. But I'm trying to understand what would be the easiest solution. Starting from scratch in Java or using a more functional language like Clojure?
But I'm trying to understand what would be the easiest solution.
Some implementations of Prolog run on the JVM platform. Wikipedia lists 5 of them here: http://en.wikipedia.org/wiki/Comparison_of_Prolog_implementations. So maybe the easiest solution is train someone in your team in Prolog, and just port the application to a JVM Prolog implementation. (Which might be a simple thing ...)
Someone on your team is likely to need Prolog skills anyway to successfully translate Prolog to some other language.
However, I recognize that there could be other reasons to translate; e.g. if the existing Prolog code needs a major overhaul anyway.
That is mainly depending on your team's skill. You mentioned that your team has a pretty good Java skills; why not starting with that?
If they don't know LISP, they will spent a lot of time learning it from the scratch. Learning LISP is quite an investment but it is definitely pays in the end.
Although Clojure is going to help you a lot in your case (because of data flow and data transformation), I would say that Java is a better bet since your team is competent with it.
You could consider using Clojure together with core.logic (tutorial) which is a miniKanren implementation. You would need some logic/functional programming skills but you could stay on the JVM.
Prolog is so different from java and other Object Oriented Language. I studied this language to see an other way of programming.
But I dont think there is a magic solution to convert prolog app to a java app. The logic is not the same and no other language is like Prolog. I think you will have to analyse what your prolog app does exactly and go from scractch with a new java app.
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
Is there any active Java remote desktop application including sourcecode or a library for integrating into Java applictions?
The problem is that ultravnc, realvnc and tightvnc are not available (opensource) for Java, just sometimes a viewer.
It should be in plain Java code so it runs on all platforms.
edit: It might not be possible to make it just with Java, but in times of better GPUs and CPUs it might be better to use some libraries which add support for multithreading, like CUDA, OpenCL and Rootbeer (https://github.com/pcpratts/rootbeer1)
Nobody ever tried to implement a VNC server in Java because Java has no (fast) API to examine the desktop for changes. If you can live with 1 fps or less, you can use the Robot API :-)
So all you can get is a VNC client/viewer. I experimented a bit with TightVNC because it's free and the sources are available.
I remember on a Java-Applet connectable to RealVNC, but it wasnt opensource, the compiled sources are obfuscated so i cant uncompile.
You may be able to ask for the Source.
Take a look at http://www.realvnc.com/products/vnc/documentation/4.0/win/java
Java is an high level programming language, VNC is programmed in Low-Level Programming language. You may be able to find a Solution with jni-combination of Java and any other low-level Programm!
But not in plain java.
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
Could you please help me understanding under what scenario JNI (or Java Native Interface) could be useful from web application development perspective?
I did read some articles that promises that JNI can give you access to native application like menu bar/scroll bar etc, so the user interface can be more catchy... however these things can be done in other technologies rather than Java.
I'm still not able to find practical uses of JNI. Have you used the JNI in your projects/apps ever? and for what?
JNI is useful if you need to call some lower level language (C, C++, assembler) function from within Java. Many projects use JNI, for example:
JOGL (Java library for making calls to OpenGL, a C library)
SWT (Java UI library that uses JNI to call a native windowing library, for example GTK on Linux)
There are utilities to automatically generate JNI code, like SWIG, which can dramatically ease the pain of generating JNI wrapper code (which involves writing a bit of Java and some of the underlying language).
It shouldn't be necessary for web development since just about anything you need is already written in Java--and it would also be a terrible idea because it will make your app platform dependent.
It is sometimes used to access a system API an old DLL that you must use without rewriting for some awful management-related reason.
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 have quite a lot of C++ legacy code modules from my colleagues, unfortunately poorly written. Each is doing a different job, but they are all GNU C++ code running under Linux.
I want to write a controller program, to make a singular C++ module for a workflow, for a very urgent demo. Also I need to write a front-end web-app allowing clients submitting jobs to the controller.
My main criteria are:
development speed (very urgent demo)
good binding with C++ (I have legacy code I do not want to rewrite in another language)
smooth introduction of new programming language to team (has some python, java and perl knowledge)
What programming language fits my needs best, and why?
Details:
I lean towards python for its perfect binding with C++, as writing JNI is too much work, and kind of obsolete nowadays. However, no one in my team is Python programmer; I do know some Python (no experience in server side programming at all). I have been developing Java EE apps last year, but I do not think JNI is a good solution. Only one team member knows some Perl, others are pure C++ programmers.
Noting the "very urgent demo" part, assuming that that would take about a month, depending on the complexity, I'd stick to the familiar.
True, maintaining python would be easier in the end, and learning python should be a breeze, if you deem it viable.
I'd say, have the team learn python and do the basic stuff, as you learn the deeper parts, you could build classes for them to extend/implement. That way, you get things done as they learn.
Given the urgency, I'd have to stick with C++.
Without that, I'd say keep what you got, but feel free to switch to a preferred language when refactoring. That would be the time to do it.
What you should not do, ever, is "port" anything to another language without rewriting or changing functionality in any way. It is a total waste of time, when the "best" outcome you can hope for is that it has no new bugs when you are done.
I would use Python. You could write very basic wrappers using the Python C API and then call said functions from Python with relative ease.