Win a copy of Java Challengers this week in the Java in General forum!

Aniruddha Chaudhari

Greenhorn
+ Follow
since May 19, 2010
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Aniruddha Chaudhari

Hi all,

I believe, many would have faced this situation. I hope I would get good guidance.
I have passed SCJP 6 and SCWCD 5. I am thinking of starting preparation of another certification exam. But have difficult time in choosing the right exam to start my preparation. I am thinking of either SCEA or SCDJWS. Talking about interest, I would say, I am equally interested in both. So, everything narrows down to how much knowledge I am going to get, and which is more valuable with job prospects and may be, required background for each exam.

Could any of you guide me to compare these two with respect to the job prospects, difficulty level, amount of time to prepare, links to good study material?

Thank you.

Tom Reilly wrote:Here's a guess (I know nothing about MatLab). Rather than trying to cast the array of objects to array of floats/Floats, try casting the first element of the array from an Object to float/Float



Thanks for the suggestion. I found there are again arrays of objects (instead of one object) in the previous array of object. It seems even one single value returned from matlab is perceived as array of Objects (not the actual type) in java.
But still the first value in the first array returned is array of Strings, so I was thinking, may be somehow I shall be able to extract Floats out of the second value. But alas, seems nobody has used this or some bug still unexplored.
10 years ago

Wouter Oet wrote:I looked it up and this is what I found:

Z = boolean
B = bytebyte
C = char
D = double
F = float
I = int
J = long
S = short
class/interface = Lclassname;

[F = float[]
[[F = float[][]

so [Ljava.lang.Object is an array of objects.



Thanks for the reply.
yes, I understand. But the values in matlab are floats which are being returned to the Java application.
1) Since those values are treated as arrays in Matlab, they are received in java as array of objects even though the value returned is just one float.
2) When I type cast that array of objects to Float array, it gives me ClassCastException.
3) When I invoke getClass.getName(), gives me [Ljava.lang.Object and not [Ljava.lang.Float. So I am stuck, even though the value that is being returned from Matlab is Float, I am unable to retrieve it in Java application.
10 years ago

Wouter Oet wrote:Maybe you're looking for the float[] (notice the primitive not the wrapper). If that also fails you can check the classname with object.getClass().getName() and classed it to that class.



Thanks for your reply.
No, I am using Float[] (wrapper class) and i already checked the class name. that is [Ljava.lang.Object. Isn't there any other way?
10 years ago

Devaka Cooray wrote:

Aniruddha Chaudhari wrote:Anyway, I figured out the solution.


Can you share that solution with us?



Here's a link to know how to interact with Matlab in remote sessions.

http://code.google.com/p/matlabcontrol/wiki/RemoteWalkthrough

This is where you can download MatlabControl.jar
http://code.google.com/p/matlabcontrol/
10 years ago
Hi,

I am writing a java application in which I call Matlab function via JMI (Java Matlab Interface).
In Matlab, every variable is treated as an array. So, after the (custom made) function (involving complex image processing operations) in matlab is completed, it returns an array, say a, of length 2, in which a[0] is of type [Ljava.lang.String and a[1] is of type [Ljava.lang.Object.
a[1] again contains objects of [Ljava.lang.Object where I expect array of floats.
When i try to cast them to Float array, i get ClassCastException.

How do I retrieve float values out of the object array which is non compliant to casting to Float array?

Any suggestions would be of great help.
THanks,
10 years ago
I am sorry for posting so vaguely. I shall remember next time.
Anyway, I figured out the solution. Thank you.
10 years ago
Hi,

I am trying to call MATLAB functions from my java application. While I was following the directions given @ some website, where it was mentioned to use jmi.jar from Matlab's jar files to access MatlabControl class in java application which further can be used to invoke Matlab functions.
Well, it seems I am not able to create object of MatlabControl class even after adding jmi.jar to my project.

Any help would be highly appreciated.

thanks,
10 years ago
thanks for the reply. anyway, I got my requirement satisfied by a library in php.
10 years ago
I want to get a random frame (in some image file format) from the video that is in the video database without actually playing the video.
Is it possible? If yes, could you please guide me through it?
10 years ago
Hi,

I am trying to call C++ libraries in ImageMagick via jmagick JNI. I initially got an exception as

Exception in thread "main" java.lang.UnsatisfiedLinkError: C:\Program Files\Java\jdk1.6.0_16\bin\jmagick.dll: Can't load IA 32-bit .dll on a AMD 64-bit platform



I could not get 64 bit jmagick.dll that's why, I replaced 64 bit JDK by 32 bit JDK and thought it would work.
But, now its giving me similar exception with different description

Exception in thread "main" java.lang.UnsatisfiedLinkError: C:\Program Files (x86)\Java\jdk1.6.0_21\bin\jmagick.dll: %1 is not a valid Win32 application



I am unable to resolve the problem.
Any help would be highly appreciated.
10 years ago
Anybody from Mumbai wants to sell the book at reasonable price?
I am interested..