| jni to optimize a java application using native mathematical libraries |
|
 |
Index ‹ java-programmer
|
- Previous
- 2
- jEdit: compiles JDK 1.5.0 ok, but runs JDK 1.4.1 (why?)Hi, I have jEdit (ver 4.2pre15) configured to use
C:\jdk1.5.0\bin\javac
for compiling, but I see no place where I can tell it to execute with
C:\jdk1.5.0\bin\java
unless I hand type it all out in the console plugin. It seems to default to
my /prior/ 1.4.1 jre installation's java.exe (not my prior jedit
installation, since I've never installed it before):
C:\Programs\jdk1.4.1_02\bin\java
When I ask the console plugin for what the current path is, I get this
prepended to the path:
C:\Programs\jdk1.4.1_02\bin;
(...) And this is not showing up in my user path verified both through a
"dos window" and from the control panel->System->Advanced->environment
variables. I'm on windows XP pro.
What's going on? How do I /execute/ on jdk1.5.0 by default?
--
It'salwaysbeenmygoalinlifetocreateasignaturethatendedwiththeword"blarphoogy"
.
- 2
- The Next BIG thing -- $5 into 10,000 within 2weeks
Follow the directions below and in two weeks you could have up to
$2000.00 in your PayPal account. There is a very high rate of
participation in the program because of its low investment and high
rate of return. Just $5.00 to one person!
THAT'S ALL !!!
If you are a skeptic and don't think the program will work, I urge
you to give it a try anyway! It REALLY WORKS! Why do you
think so many people are promoting it ?
LOOK AT IT THIS WAY: If the Program is a total failure for you and you
never get even $1.00 in return, your total loss will
be the $5.00! If you are not yet a paypal member, there is no risk at
all!!! If the Program is only moderately successful for
you, your PayPal account will have several hundred dollars deposited
into it within the next few days! If you actively
participate in the Program, you could have up to $20,000.00 in your
PayPal account within two weeks!
Now let me tell you the simple details.
Getting Started!!
If you're not already a user of PayPal, the very first thing you need
to do is go to PayPal and sign up. It takes two minutes
and Pay Pal will deposit $5.00 in your account just for becoming a
member. That makes this program's total cost $0!!! Follow
this link to open your PayPal account:
https://www.paypal.com
Now log into your PayPal account, and send the PayPal account of the
person listed in Position 1 $5.00 PayPal will ask you to
select type. (Select "service" and put "$5.00 donation" for
subject.) When person in Position 1 receives notification of your
payment, you can simply copy this page and change the names in
position #1 & #2 & #3 as instructed. Remember, only the person
in Position 1 on the list gets your $5.00 donation. Send them a
donation then remove #1PayPal account from the list. Move the
other two accounts up & add your Paypal account to #3 position. After
you have retyped the names in the new order,
IMMEDIATELY send the revised message to as many people as possible.
PROMOTE! PROMOTE! The more you promote the Program, the
more you will receive in donations!! That's all there is to it.
When your name reaches Position 1 (usually in less than a week) it
will be your turn to receive the cash. $5.00 will be sent
to your PayPal account by people just like you who are willing to send
$5.00 donation and receive up to $20,000 in less than
two weeks. Because there are only (3) names on the list you can
anticipate 80% of your cash within two weeks.
Anytime you find yourself short on cash just take out your $5.00
donation program and send it to 50 prospects. Imagine if you
sent it to 100 or even more. Most people spend more than $5 on the
lottery every week with no real hope of ever winning.
THIS PROGRAM WORKS - JUST TRY IT
POSITION # 1 PAYPAL ACCOUNT: email***@***.com
POSITION # 2 PAYPAL ACCOUNT: email***@***.com
POSITION # 3 PAYPAL ACCOUNT: email***@***.com
Integrity and honesty make this plan work.
Participants who actively promote this program will average between $8000
and
$12000 and receive the donations within 3-5 weeks.
This is not a chain letter. You are simply making a donation of $5.00
to another person. The Program does not violate title
18 section 1302 of the Postal and lottery code.
Remember -TIME is of the essence. YOU can choose to live
Paycheck-to-Paycheck or live FREE from FINANCIAL BONDAGE. Become a
part of the donation program and help people help people.
This program is about helping each other!
Success is a journey - Not a destination!
Start Your Journey TODAY!!!!
- 3
- newbie: includes/headersarenaTR wrote:
> Brad:
>
> You're right. thanks for the netiquette reminder.
No problem. Thank-you for taking it so well :).
> Follow-up question: I've seen at the top of java code statements like:
>
> "import something.seomthing.*"
>
> Where is this type of thing found. Or can you give me some background on
> these, they clearly look like include files.
Sure. While similar in syntax to C/C++ style #import statements,
include statements are more of a namespace issue than telling a Java
source file what actual files to include.
The ability to find a particular class (or set of classes) is handled
by your CLASSPATH statement (and by your compiler through its boot
classpath, which automatically knows about the standard classes and
standard extensions). Thus the Java include statement isn't to tell the
compiler where the files should be found, or even what files to use --
it just ensures that the compiler will know what namespaces to
automatically search at compile time.
Java promotes a strong namespacing through the use of /packages/.
Packages are abstract containers in which classes and other packages
(and in some cases resources) reside. For example, most of the core
Java classes live inside the "java" package tree, within various
subclasses that group like classes together. Thus I/O classes are in
"java.io", utility classes are in "java.util", and core language classes
(like the Class class and the Object class) are in "java.lang".
To properly reference an object, you need to refer to it using it's
fully-qualified name, which includes the pagkage name. Thus, if you
want to refer to the InputStream class in the java.io package, you'd use:
java.io.InputStream
As you'll probably realize immediately, this can get really painful if
you have to do this with each and every class your program may
reference. You'd probably want to avoid even using packages if you had
to type all of this out all the time, particularily if your package tree
is deep (for example, in my Open Source Java project, the jSyncManager
(http://www.jsyncmanager.org), we have a class named
org.jSyncManager.API.Protocol.Util.StdApps.AddressAppBlock -- quite the
lengthy name to have to type everytime you need to reference this
class). This is where the import statement comes in.
The import statement allows you to tell the compiler what packages to
search in for classnames where you _don't_ specify the fully-qualified
package/class name. Thus, if I'm working in a class that references
java.io.InputStream 15 times, instead of typing "java.io.InputStream"
all 15 times, I can instead "import java.io.InputStream", and reference
just "InputStream" each time. The compiler will then be able to figure
out what InputStream I'm referencing.
There are some exceptions to this, of course. First off, "java.lang"
is _always_ automatically imported, so you don't have to do this in
every class file you write. The other main exception is that the
current package that your class belongs to will _always_ be searched for
the relevent named class first -- which means you don't have to import
the current package either (you can define what package your class is in
using the "package <name>" statement at the beginning of your source
file, ie: "package org.jSyncManager.API.Protocol.Util.StdApps;").
There is another form of the import statement, one where you don't
specify a specific class name, but instead import _all_ of the classes
in the package. this is done using "*", ie:
import java.io.*;
This will "import" everything in java.io -- thus whenever you reference
a class with just its name (and not it's package), the compiler will
search _all_ of java.io for the classname at compile time.
These namespace issues are important to know, because they're in use
everywhere in Java. There are even rules as to how you should create
your own package names, by using your internet domain name /backwards/,
followed by whatever naming you desire. The actual rules are in section
6.8 and 7.7 of the Java Language Specification. You can read them here:
http://java.sun.com/docs/books/jls/second_edition/html/names.doc.html#73307
http://java.sun.com/docs/books/jls/second_edition/html/packages.doc.html#40169
One thing to note: some people will tell you that the spec requires
the use of only lower-case characters in package names. This is _not_
true (as you can see in the very first example in the spec). The only
case rules are that the top-level-domain must be lowercase, and by
convention classnames _always_ start with an uppercase character.
One last URL on the subjest -- the JLS's sections on use of the
"import" statement (s7.5.1 and s7.5.2):
http://java.sun.com/docs/books/jls/second_edition/html/packages.doc.html#26699
Finally, as I mentioned above, I maintain an Open Source Java project.
It's pretty big, but we pride ourselves in keeping our code clean,
organized, and well documented. If you want to peruse it as a large
example (over 150 classes), feel free. You can view the sources online at:
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsyncmanager/source/
This will start you just outside the top-level package (which is the
TLD of our domain name, "org"). Feel free to find a source file and
look at its package and import statements.
> Thanks in advance!
No problem. Welcome to the wonderful world of Java :).
Brad BARCLAY
--
=-=-=-=-=-=-=-=-=
From the OS/2 WARP v4.5 Desktop of Brad BARCLAY.
The jSyncManager Project: http://www.jsyncmanager.org
- 3
- Easy Book For Learning JavaNeed recommendations on an easy book for learning Java for someone with
only
a passing knowledge of QuickBasic.
Thanks
WDA
email***@***.com
end
- 3
- How to query a Date Column in SQLHi,
I'm sorry if this is a very noddy question, but I seem to have a block
on how to do this...
I am in the process of refactoring a Java application which uses JDBC
to talk to Oracle and MySQL. The old way used to have a DateTime
field that was represented in the database as a text field, a typical
query on this field would be: "Select * from Table1 where DateTime <=
'2004/08/17 09:00:30'".
In the new database schema, the DateTime field is represented as a
Date field. My problem is that I have to parse my query text (which
is not SQL :( ) and create a String from that, which is valid SQL.
This happens in a different part of the application to the actual
database connection, so I cannot use a PreparedStatement and insert
the java.sql.Date value that way. I have found some information about
sql date operators such as DATEDIFF, but not enough to make use of
them, and I was not sure if these would work through the JDBC driver
even if I managed to get them working...
I would be very grateful for any information anyone has on this - I
can't believe it is as difficult as I have found it today to create a
data query SQL string!
Many thanks,
Laura
- 3
- rh91 instead of md91On Sun, 05 Oct 2003 08:51:33 +0000, Daniel O'Connell wrote:
> Also, under that argument, you should also be posting to
> comp.lang.java.*,
good idea. thanks.
> and every other newsgroup for a language that operates under Linux,
> otherwise you are being contradictory.
>
>> I do c# programming with dotnet in Windows and
>> dotgnu in Linux.
>>
>> http://www.dotgnu.org
>> http://www.dotgnu.com
>>
>
> Heh, whatever you wanna say. Your posts are rude, offtopic, and inflamatory.
You're bladder is inflamed.
- 5
- How to mandate license expiry dateHi!!!
The product which i am working on requires that it can be installed
and used for a stipulated number of days from the date of
installation. Also if its installed on one machine then uninstalling
and reinstalling it on the same takes care of counting the days from
first installation and not the latest installation. Hence system date
time check is not useful in this context. Thus like many software
evaluation copies it must work strictly on license validity periods.
Issues to be tackled are :
- Stamp the isntallation date somewhere such that it persists the
subsequent installtion and uninstallation of the software. - How to do
it?
- Check the days passed since installation. Here i must check with
the date of first installation which was stamped. - Accessing stamped
date is a problem?
- Most importantly changing the system date must not affect my
license expiry checks.
One solution which i found was to keep a registry key to store the
installation date which persists the uninstallation of the software.
But this i perceive shall involve JNI(I am not sure about it, Any
inputs would be of great help). I would prefer to avoid using JNI.
Please let me know if the problem i am facing needs more
clarification. Any inputs towards solution of this problem would be of
great help.
thanks and regards.
Amit Kapoor.
- 11
- problem on Get methodHello,
I don't manage to call the method "get" from the class List in the
package java.util
I wrote this :
// addrs is a parameter of the method
cls_list = env->GetObjectClass(addrs);
if(cls_list != NULL)
std::cerr<<"class ok "<<std::endl; // OK
mid = env->GetMethodID(cls_list, "get", "(I;)Ljava/lang/Object");
if( mid != NULL )
std::cerr<<"mid ok " <<std::endl;
It seems JNI doesn't find the "get" method.
I don't understand why ?
could someone help me ?
thanks in advance
- 11
- How expensive are debug messages?"Inertia_sublimation" <email***@***.com> wrote in message
news:Xypcc.3277$email***@***.com...
> Hello everyone!
>
> Im working on a rather large java app. and am currently at a fork in my
> decision road.
>
> Basicly, Im unsure about the best way to have code print certain debug
> messages when it reaches crucial points in its execution.
>
> How expensive is System.out.println()?
>
> Is there a way I can insert a whole bunch of debug statements, and then
> rapidly delete them throughout my entire project? (ex: I have a whole
bunch
> of System.out.println() calls in the classes, then after debugging, do I
> leave the System.out.println() calls in, go through each class and remove
> them (AHHHH!!!) or is there a better solution?)
>
> Perhaps I should make my own Debugger object?
>
Or you could use log4j http://logging.apache.org/log4j/docs/
- 11
- recommend good freeware jsp editorHi.
I asked in the javascript group, and one person sent me over here (I think).
Can someone recommend a jsp editor with at least syntax coloring..
is there such a thing as code completion?..
Thanks
Jeff Kish
- 13
- how do i insert into data base
i'm creating a an web application on attendance, in which a user
after selecting the subject and month he gets all the student info who
has taken that subject.
my problem is i'm able to get the multiple student with the text box
where a user can put up his monthly attendance. how do i insert the
info in database...at the same time after filling the info.
the snapshot of the code is here...
here I'm getting the roll no. along with the text box..
[code]
String str1 = "select roll_no from student where sem_id = (select
sem_id from subject where course_id ='bsc_it' and sub_id =
'"+getsub1+"')";
ResultSet rs = stmt.executeQuery(str1);
%>
<table align="center" width="" cellpadding="0" cellspacing="0"
border="1" cellspacing="1" cellpadding="1">
<tr>
<td><input type="text" value="Total Lecture" readonly=""/></
td>
<td><input type="text" name="total_att" maxlength="2"></td>
</tr>
<tr>
<td><input type="text" value="Student roll no." readonly="" /
></td>
</tr>
<% while(rs.next())
{
%>
<%
stu_roll = rs.getString("roll_no");
%>
<tr bordercolor="#CC3366">
<td>
<%
out.println(stu_roll);
%>
</td>
<td>
<input type="text" name="att" />
</td>
</tr>
<%
}
con.close();
}
catch(SQLException e)
{
out.println("Exception in SQL" + e);
}
%>
[/code]
- 16
- declaring removedo i have to declare remove when trying to remove from an ArrayList or
should java know what this does?
e.g person.remove
- 16
- Can someone PLEASE help me??I have posted to this newsgroup before about this problem, but it sadly
remains unresolved successfully for me, and that is the proper package
structure for a servlet! Now, in the package statement at the top of the
servlet file, and assuming that I am using Tomcat for my servlet container,
should the path be something like "C:\tomcat
5.0\webapps\[context-folder]\web-inf\classes\[org\steve\burrus]" where the
compiled servlet class file "resides"??! And, re. the web.xml file, i.e.,
the web descriptor file, should the contents of the <servlet-class> tag
"mirror" the end of that path above, "org\steve\burrus" appended in front of
the servlet class name? I tell you what, I am getting quite sick and tired
of always seeing that "blasted" old 404 server error page every time that I
try/attempt to execute a Java servlet. It's "driving me nuts" when I have to
see this. I will bet that some in this group, with all that they know about
servlets, NEVER see this page. Thanx in advance for any help that I may get.
(Some day I will get it right with servlet packaging, but it is certainly
not today).
- 16
- Killing a Parent Frame with out killing its child FrameI wrote an application where I am trying to kill a parent frame with
out killing the child one.
I have created a frame (F1) and if I click a button on F1 I am
getting a new frame (F2). Now, if I click a button on F2, I am getting
updated F1. Its fine. But if I close F2, both F2 and F1 are closing. I
am trying to close F2 with out closing F1, but getting mistake.
Pls suggest me how I can do this.
- 16
- reading & writing in serial port from serverHello to everybody,
I've done an application that draws in a frame the trajectory of a
robot. The robot position is readed through the serial port, and
several commands are wrote through the same port to change the
direction of the robot.
The trajectory frame is managed by an applet, and the project works
good when the applet is called by a html document allocated in the
same local machine under W98 where the classes and the serial port
are.
But my intention is now that the serial port is going to be in a
server machine under Linux, and the users will connect with the frame
through internet. And these are the questions:
1.- If the same application that works in a local machine is called by
these users, will it operate with the serial port of the server or the
serial port of the user PC?
2.- With the traditional applets can the users see the trajectory in
the frame with the readed data from the server serial port and operate
through the hmtl document in order to write in the server serial port?
Thanks in advance, and I hope anybody could help me in this trouble.
Bye.
|
| Author |
Message |
dimitri.ognibene

|
Posted: 2006-4-3 5:09:00 |
Top |
java-programmer, jni to optimize a java application using native mathematical libraries
Hi,
I've built an application, nn and simulation with a lot of
visualization , in java, now my computational needs are exceeding the
power of my system.
I usually used the observer pattern to listen to changes on the data
model, and the visualization only redraws if needed and isn't
synchronized with the numerical compuation.
However i read matrix data inside my paint methods.
Can i use jni and an optimized native library to implement the
numerical elaboration?
Doing so, will my visualization code be preserved and reused?
Will my system perform better?
I think that much of the matter is in the grain of jni interface and
data exchanged between the 2 systems.. but I've not the experience to
give you all data without a little preliminary help.
So this data are only to describe the problem in general. I'll give the
details that you tell me are needed
Thanks
|
| |
|
| |
 |
Dimitri Ognibene

|
Posted: 2006-4-3 15:44:00 |
Top |
java-programmer >> jni to optimize a java application using native mathematical libraries
Thanks gordon,
i suppose to use Intel Math Kernel Library to re-implement Neural
Networks code. I will need to extract all data (connections weights and
activation values) any time the gui is refreshed.
so you say
>1)make as few, as "large" calls to native methods as possible.
>2)try to reduce the amount of data you have to copy back and forth.
I think to have only calls to train and evaluate..
but i want that the native library preserve results, becouse they will
be used over and over again in the calculation.. while java needs only
to send new data and read data to display results.
>pass only primitives (or arrays of primitives) to your native
methods in order to reduce their dependency on invoking Java methods
or JNI accessors to get the job done.
I suppose to only pass multi-dim double arrays...so here I've no
problem
I'm still in doubt that in this situation perhaps i'll gain more and
more easily rewriting all using c++ or using something like Ninja
classes by ibm to implement calculation, or find an already built
interface (jni or nio) to optimized mathematical libraries.
Any further suggestion?
Thanks Dimitri
|
| |
|
| |
 |
Gordon Beaton

|
Posted: 2006-4-3 16:08:00 |
Top |
java-programmer >> jni to optimize a java application using native mathematical libraries
On 2 Apr 2006 14:08:59 -0700, email***@***.com wrote:
> Will my system perform better?
>
> I think that much of the matter is in the grain of jni interface and
> data exchanged between the 2 systems..
You have the right idea. JNI is not a guarantee of better performance,
but you can increase its chances of improving your performance by
following a few simple rules:
- make as few, as "large" calls to native methods as possible.
- try to reduce the amount of data you have to copy back and forth.
- pass only primitives (or arrays of primitives) to your native
methods in order to reduce their dependency on invoking Java methods
or JNI accessors to get the job done.
- If you need to return results from a method, use the return value
like it was intended, i.e. avoid writing void methods that pass
results back through object reference arguments or by updating
fields in the calling object.
Note that CPU bound calculations aren't necessarily much faster in
native code than in Java, so the potential gain is easily lost if you
aren't careful.
/gordon
--
[ do not email me copies of your followups ]
g o r d o n + n e w s @ b a l d e r 1 3 . s e
|
| |
|
| |
 |
Remon van Vliet

|
Posted: 2006-4-4 5:23:00 |
Top |
java-programmer >> jni to optimize a java application using native mathematical libraries
"Dimitri Ognibene" <email***@***.com> wrote in message
news:email***@***.com...
> Thanks gordon,
> i suppose to use Intel Math Kernel Library to re-implement Neural
> Networks code. I will need to extract all data (connections weights and
> activation values) any time the gui is refreshed.
> so you say
>>1)make as few, as "large" calls to native methods as possible.
>>2)try to reduce the amount of data you have to copy back and forth.
> I think to have only calls to train and evaluate..
> but i want that the native library preserve results, becouse they will
> be used over and over again in the calculation.. while java needs only
> to send new data and read data to display results.
>>pass only primitives (or arrays of primitives) to your native
> methods in order to reduce their dependency on invoking Java methods
> or JNI accessors to get the job done.
> I suppose to only pass multi-dim double arrays...so here I've no
> problem
>
>
>
> I'm still in doubt that in this situation perhaps i'll gain more and
> more easily rewriting all using c++ or using something like Ninja
> classes by ibm to implement calculation, or find an already built
> interface (jni or nio) to optimized mathematical libraries.
> Any further suggestion?
> Thanks Dimitri
>
Err, i sincerely doubt multi dimensional arrays, mathematics, neural net
computation and such are considerably faster in C++ compared to Java. Have
you actually profiled your code and checked where the hotspots are? Have you
tried running your code in the server VM? Your original post suggests you
overdesigned parts of your code (i.e. implemented the observer pattern).
Basically i dont think your C++ code will be considerably faster than a
direct port in Java. Claiming C++ magically makes your code 5 times as fast
is very 1998.
|
| |
|
| |
 |
Dimitri Ognibene

|
Posted: 2006-4-4 8:52:00 |
Top |
java-programmer >> jni to optimize a java application using native mathematical libraries
hi Remon
i think so too, but i've already profiled a lot, and I'll do it again,
but the intel libraries are very fast adn scalable to multi-core so I
look at them as a possible solution. My application actually is a
simulator running on a desktop but i hope to parellelize it asap, but
there will be big sync and performance issues. do you have any
suggestion to visualize data without requiring "overdesigned" patterns
like observer? my system is pretty complex with some async neural
networks that interact.. and I don't want to fill my code of things
like redraw or similar, i dislike observable.update too, but it the
littlest evil i've found. One other problem is to do the as few copies
of data as possible but I need some buffer to let the components
interact.. and to don't broke my data by error (why not final arrays in
java? :-(
This are the first points i will optimize, and i've seen that jni will
increace array copies...
If you have any suggestion please let me know.
Dimitri
|
| |
|
| |
 |
Roedy Green

|
Posted: 2006-4-4 9:05:00 |
Top |
java-programmer >> jni to optimize a java application using native mathematical libraries
On Mon, 3 Apr 2006 23:22:56 +0200, "Remon van Vliet"
<email***@***.com> wrote, quoted or indirectly quoted someone who
said :
>Claiming C++ magically makes your code 5 times as fast
>is very 1998.
recent benchmarks posted here show the reverse. Java compiler
technology is now ahead of C++.
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
|
| |
|
| |
 |
James Westby

|
Posted: 2006-4-4 11:24:00 |
Top |
java-programmer >> jni to optimize a java application using native mathematical libraries
Roedy Green wrote:
> On Mon, 3 Apr 2006 23:22:56 +0200, "Remon van Vliet"
> <email***@***.com> wrote, quoted or indirectly quoted someone who
> said :
>
>> Claiming C++ magically makes your code 5 times as fast
>> is very 1998.
>
> recent benchmarks posted here show the reverse. Java compiler
> technology is now ahead of C++.
Matlab has recently deprecated the tool that automatically converts .m
files to mex files (kind of JNI for Matlab) as they say that the
run-time optimistation performed in Matlab removes the need to do this.
However I have just finished moving some Matlab code from an m file to
C. The code basically computes a random walk, and so involves numerical
integration of a function involving gaussians. I moved from using
Matlab's randn (very useful to have a generator with gaussian pdf built
in) to using the GNU scientific library. This has speeded up my code a
staggering amount, and makes it reasonable to run the experiments now.
I'm not sure how the randn function is implemented in Matlab, so I'm not
sure where the optimisations are coming from, but they impress me none
the less. I also think that Matlab's JIT is not a Java JIT.
I'm not trying to say Java is slow, and I certainly don't believe it is.
This function is where the code previously spent 99% of it's time, and
was executed approximately 2.5 million times per run, needing to
generate 50 million random numbers in that time, and this is just the
simple test while I'm developing the code, the real numbers will
probably be thousands of times bigger. I realise that this is the
comment usually made about optimisation, that it should be done at
exactly this point, and I agree with the arguments. The optimisation I
did involved switching to highly developed code using rigorously studied
algorithms, far far far better than I could ever have implemented myself.
If I have time then I will be porting a lot of this code over to Java,
and if I do I will post some measurements of how Sun's HotSpot fares on
this code, as I assume it would be a perfect candidate for their
optimisations (Short loops, but enough in them to give the CPU something
to do between branches, highly predictable branching, few memory
requirements, though I wouldn't exactly call it a real-world application).
James
|
| |
|
| |
 |
Roedy Green

|
Posted: 2006-4-4 11:29:00 |
Top |
java-programmer >> jni to optimize a java application using native mathematical libraries
On Tue, 04 Apr 2006 03:23:56 GMT, James Westby <email***@***.com>
wrote, quoted or indirectly quoted someone who said :
> I also think that Matlab's JIT is not a Java JIT.
If you can collect all the jars, try compiling it with Jet and see
what sort of speed you get.
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
|
| |
|
| |
 |
Dimitri Ognibene

|
Posted: 2006-4-4 15:50:00 |
Top |
java-programmer >> jni to optimize a java application using native mathematical libraries
Thanks James,
I've done exaclty the same considerations, the problem (mine specific
problem) is not if java is faster then c++, but to use optimized
libraries like GNU scientific library, that i didn't know till your
answer (thks), or Intel MKL, to replace mine non optimized, and not
truly able to optimize any further, code. In my lab we have used MKL
exp function instead of standard c implementation and we obtained a
speed up of 5 times in our neural network code, and we can't link
statically!!!
Now, I'm sure that those libraries are faster then any code i'll ever
write, but I don't know if interfacing them with my already written
(130 classes) java system. I suppose, as I've said in my first post,
that in my specific application the use of an external library using
JNI will make the system much more complex (And difficult to mantain
and debug) and only a little faster.
I will be happier if I find a good java Math library, even if not as
good as MKL, and I've not to write boring JNI stuff, array copyng
methods and so on.
If I'm right you are translating your entire Matlab simulation to c, i
don't want to do this, at the moment, my coworker want, but I'm the
sw-engineer in the lab so.. much of the effort and of the decisions are
mine.. And i would like to find a compromise using some good Math
library to optimize the code where , as you said, 90% cpu of time is
spent, random, gaussian, sin and similar functions and perhaps Matrix
multiplication.. the use of java multidimensianl arrays isn't good,
I've tried to optimizing using code like:
double matrix1[50][900];
double vector2[900];
for(int i =0;i<50;i++){
final double matrix_col[]=matrix[i];
for(int j=0;j<900;j++){
....}}
But only little speed up is gained..
And I don't have the time to find optimization tricks.. so a library
perhaps would be a better solution..
If you have any suggestion, please let me know
|
| |
|
| |
 |
Dimitri Ognibene

|
Posted: 2006-4-4 16:58:00 |
Top |
java-programmer >> jni to optimize a java application using native mathematical libraries
Thanks Gordon,
I already know this page, it looks outdated.. but it contains several
interesting links.. Like the colt project. However the libraries links
that I've found look outdated too.. has numerical compuation in java
disappeared? If you have ever used one of this libraries or have any
other insight please let me know.
p.s. I've found a project on sf to interface java to gsl
http://sourceforge.net/projects/gsl-java, does anyone ever used it? It
look outadated tooooo :(
Good work
Dimitri
|
| |
|
| |
 |
Gordon Beaton

|
Posted: 2006-4-4 17:18:00 |
Top |
java-programmer >> jni to optimize a java application using native mathematical libraries
On 4 Apr 2006 00:50:28 -0700, Dimitri Ognibene wrote:
> And I don't have the time to find optimization tricks.. so a library
> perhaps would be a better solution..
Do any of these libraries help?
http://math.nist.gov/javanumerics/
--
[ do not email me copies of your followups ]
g o r d o n + n e w s @ b a l d e r 1 3 . s e
|
| |
|
| |
 |
Chris Uppal

|
Posted: 2006-4-4 17:22:00 |
Top |
java-programmer >> jni to optimize a java application using native mathematical libraries
email***@***.com wrote:
> I usually used the observer pattern to listen to changes on the data
> model, and the visualization only redraws if needed and isn't
> synchronized with the numerical compuation.
> However i read matrix data inside my paint methods.
I suspect that you should use /more/ copying of data, not less. Your
simulation engine will run best if it can ignore the possibility that something
else is reading the same data. So it runs at full speed on one thread (not
doing any synchronisation). At extremely long intervals by computer
standards -- roughly once a second, say -- it makes a copy of the current state
of the simulation, and saves it. The test for whether to do that is in the
outermost loop of the simulation, and so that will have negligible effect on
the overall speed. When it determines that it is time to make a copy, it does
so, and then (and only then) uses a synchronised method to save the new
description of the state.
The GUI meantime (running on a different thread) updates the screen display at
regular intervals. To do that it uses a synchronised method to get the most
recent copy and refreshed from that. It keeps that copy around so that it can
repaint() itself as necessary.
Depending on how you've structured your existing code, making the copy may be
almost trivial. Note that you will have no display-related code in the
simulation engine at all (not even triggering notifications for any Observers).
> Can i use jni and an optimized native library to implement the
> numerical elaboration?
> Doing so, will my visualization code be preserved and reused?
> Will my system perform better?
A lot depends on how much work you do in each call to JNI. If you are just
doing something trivial like generating the next random number, then almost
certainly not. The cost of crossing the JNI barrier is pretty high, and will
swamp the gains from using (say) Intel's maths libraries. On the other hand,
if you have some slow operation (like matrix multiplication) where the time
taken is high, and -- more importantly -- the time required to copy any
necessary data across the JNI barrier is small in comparison[*] then using the
native libraries may help you.
([*] Copy is O(N) but if the operation is, say, O(N**2) then you can ignore the
cost of the copy.)
It may be that your code is dominated by a small number of slow operations
which can be implemented quickly in an external library. For instance it may
be that array multiplication dominates the time, and that the Intel library has
a particularly well-tuned implementation of that. If that applies then you may
see big gains by using JNI for array multiplication. If not then you'll have
to rewrite your code so that the bulk of the implementation /is/ in C/C++ if
you want to take advantage of Intel's libraries -- e..g make each step of your
simulation into a single call to JNI.
BTW, the way that Java represents 2D arrays is not efficient, and is probably
incompatible with what an external library would expect. If you represent a
logically two-dimensional array of doubles as a double[][] then each access
will require two indirections. A better scheme (albeit quite a bit more work)
is to represent it as a single double[] and use arithmetic combinations of the
row/column coordinates to find each element. The external library will expect
to find the data in this format anyway, so by using it internally you minimise
the messing around (and perhaps the copying too) when you cross the JNI
barrier. For instance from one of your later posts in this thread:
> double matrix1[50][900];
> for(int i =0;i<50;i++){
> final double matrix_col[]=matrix[i];
> for(int j=0;j<900;j++){
> ....}}
becomes:
double[] matrix = new double[50*900];
for (int i = 0; i < 50; i++)
{
int start = i * 900;
int end = start + 900;
for (int j = start; j < end; j++)
{
float elem = matix[j];
...
}
}
Some people have reported seeing useful speedups using that technique (not huge
but useful), but the main reason for using it is so that highly tuned external
implementations of the array operation can work on the data more-or-less
directly.
-- chris
|
| |
|
| |
 |
Dimitri Ognibene

|
Posted: 2006-4-4 18:04:00 |
Top |
java-programmer >> jni to optimize a java application using native mathematical libraries
thank you for your general advices,
my simulation code si built by many components, and not any of them
changes its state at every step, so an update method is usefull for me,
another problem is that i'm afraid of modifing by mystake data inside
the model step, I had very small time so I'm not sure of some pieces of
code, so I copy my data between model components.. Yes it's my mistake
and i will remove superfluos copies asap.
Do you know if there is some pre-compiler tool that can verify write
violations like the const keyword of c++?
Another thing that I can't use is the synch of the gui, because it is
not important in displaying large data set, only global data, a few
doubles, are synchronized, and obviously copied as args of updates.
>A lot depends on how much work you do in each call to JNI. If you are just
>doing something trivial like generating the next random number, then almost
>certainly not. The cost of crossing the JNI barrier is pretty high, and will
>swamp the gains from using (say) Intel's maths libraries. On the other hand,
>if you have some slow operation (like matrix multiplication) where the time
>taken is high, and -- more importantly -- the time required to copy any
>necessary data across the JNI barrier is small in comparison[*] then using the
>native libraries may help you.
Do you know where i can find some resource on the performance of JNI
barrier?
I've a matrix of 900X400.. but it's element are the results of the
previews computation... so i wish to leave a copy in the native library
and only extract a copy when I need one...
I'm starting to think that it is easier to rewrite all in c++ MKL and
qt... If i'll obtain less then 2 time speedup..
I was thinking of unwindin matrix operation like you suggested but I've
some operation like appling moving 2D filters that are a little
complex, now that i've seen them work in simple non-unwinded mode,
perhaps i can optimize them.. Can you suggest a manner to profile
effective speed-up?
Thanks,
Dimitri
|
| |
|
| |
 |
James Westby

|
Posted: 2006-4-4 18:19:00 |
Top |
java-programmer >> jni to optimize a java application using native mathematical libraries
Dimitri Ognibene wrote:
> Thanks James,
>
> I've done exaclty the same considerations, the problem (mine specific
> problem) is not if java is faster then c++, but to use optimized
> libraries like GNU scientific library, that i didn't know till your
> answer (thks), or Intel MKL, to replace mine non optimized, and not
> truly able to optimize any further, code. In my lab we have used MKL
> exp function instead of standard c implementation and we obtained a
> speed up of 5 times in our neural network code, and we can't link
> statically!!
> Now, I'm sure that those libraries are faster then any code i'll ever
> write, but I don't know if interfacing them with my already written
> (130 classes) java system. I suppose, as I've said in my first post,
> that in my specific application the use of an external library using
> JNI will make the system much more complex (And difficult to mantain
> and debug) and only a little faster.
That is a problem that you should avoid if possible. There is a
trade-off between the speedup you can get and the increased complexity
in maintaining the code.
> I will be happier if I find a good java Math library, even if not as
> good as MKL, and I've not to write boring JNI stuff, array copyng
> methods and so on.
> If I'm right you are translating your entire Matlab simulation to c, i
> don't want to do this, at the moment, my coworker want, but I'm the
> sw-engineer in the lab so.. much of the effort and of the decisions are
> mine.. And i would like to find a compromise using some good Math
> library to optimize the code where , as you said, 90% cpu of time is
> spent, random, gaussian, sin and similar functions and perhaps Matrix
> multiplication.. the use of java multidimensianl arrays isn't good,
> I've tried to optimizing using code like:
I've only moved one small part to C, the bit that was taking all the
time when I profiled the code. Have you done that? I don't know of maths
libraries in Java, it would like to know if there are any good ones.
>
> double matrix1[50][900];
> double vector2[900];
> for(int i =0;i<50;i++){
> final double matrix_col[]=matrix[i];
> for(int j=0;j<900;j++){
> ....}}
>
Matrix multiplication is a slow operation, and probably a good candidate
for optimistation, either by you or by swapping the code for something
specialised (BLAS springs to mind, but I can only find a small mention
to jBLAS by Google).
> But only little speed up is gained..
> And I don't have the time to find optimization tricks.. so a library
> perhaps would be a better solution..
> If you have any suggestion, please let me know
>
James
|
| |
|
| |
 |
Dimitri Ognibene

|
Posted: 2006-4-4 18:47:00 |
Top |
java-programmer >> jni to optimize a java application using native mathematical libraries
Thanks James, I'll take a look to jBLAS api, if they are developed by
google they should be usefull and updated, i hope
thanks
Dimitri
|
| |
|
| |
 |
James Westby

|
Posted: 2006-4-4 19:12:00 |
Top |
java-programmer >> jni to optimize a java application using native mathematical libraries
Dimitri Ognibene wrote:
> Thanks James, I'll take a look to jBLAS api, if they are developed by
> google they should be usefull and updated, i hope
> thanks
> Dimitri
>
No, it was a Google search. But it looked like the API was not fully
developed yet, so it probably wont be very useful.
James
|
| |
|
| |
 |
Chris Uppal

|
Posted: 2006-4-6 18:02:00 |
Top |
java-programmer >> jni to optimize a java application using native mathematical libraries
Dimitri Ognibene wrote:
> Do you know if there is some pre-compiler tool that can verify write
> violations like the const keyword of c++?
No. Sorry ;-)
> Do you know where i can find some resource on the performance of JNI
> barrier?
Not offhand, and it varies according to what you are doing anyway. You'll have
to measure it yourself.
FWIW, I recently measured that on this 1.5 GHz WinXP box, the time taken for a
JNI call to a native method declared as:
static native int nothing(int i);
is about 30 nanoeconds on a 1.5.0 JVM. The actual implementation is:
JNIEXPORT jint JNICALL
Java_Test_nothing(JNIEnv *e, jclass c, jint i)
{
return i;
}
so presumably the time is almost all JNI overhead. Other JNI operations have
different overheads.
> I've a matrix of 900X400.. but it's element are the results of the
> previews computation... so i wish to leave a copy in the native library
> and only extract a copy when I need one...
Given my point that you are probably not copying /enough/, I doubt if this is
the right way to go.
> I was thinking of unwindin matrix operation like you suggested but I've
> some operation like appling moving 2D filters that are a little
> complex, now that i've seen them work in simple non-unwinded mode,
> perhaps i can optimize them.. Can you suggest a manner to profile
> effective speed-up?
Just try it. If the re-write is too difficult to be feasible as an experiment,
then it's probably too complex to use for production purposes.
-- chris
|
| |
|
| |
 |
| |
 |
Index ‹ java-programmer |
- Next
- 1
- java appletsAm having problems running java applets.
When I click on an icon on a web page that wants tot run a java applet IE
hangs.
In another instance a program I run puts out Java applets. When I try to
run up the applet I ge the message in the status bar saying "Applet xml
Player started" but all i see where the applet is on the html page is a grey
box.
Please help
lk
- 2
- I write Tic-Tac-Toe in JavaThis is the most sophisticated game known to mankind and I'm not sure
if Java is good enough for it, but I'm trying anyway.
- 3
- default value of data member.Hi
I have a problem about default value of data member!
+++++++ cut here++++++
class CComputer
{
private double cpu=3.0;
private double memory=1.0;
public void set(double c)
{
if(c<0)
System.out.println("Input cpu error, cpu is default value");
else
this.cpu=c;
}
public void set_memory(double m)
{
if(m<0)
System.out.println("Input memory error, memory is default
value");
else
{
memory=m;
show_memory();
}
}
public void set(double c,double m)
{
set(c);
set_memory(m);
}
void show_cpu()
{
System.out.println("cpu="+this.cpu);
}
void show_memory()
{
System.out.println("memory="+this.memory);
}
void show_all()
{
this.show_cpu();
this.show_memory();
}
}
public class bbb
{
public static void main(String args[])
{
CComputer c1=new CComputer();
c1.set(-3.5,1.5);
c1.show_all();
c1.set(-3.5,-2.0);
c1.show_all();
c1.set(-3.5);
c1.show_all();
}
}
+++++++
The output of "c1.set(-3.5,-2.0);" shows memory=1.5.
The output of " c1.set(-3.5);" also shows memory=1.5;
Why? I thought memory should be default value, i.e. 1.0.
Thank you in advance.
Mike
- 4
- MI5-Persecution: MI5 Waste Taxpayer Millions on Pointless Hate-Campaign (18598)I don't know what the hell this is. But he/she/it asked for a respond. I
sent a 19 MB picture of my middle toe. I hope they liked it, and I have no
message saying the message did not go through. Say they must like it. I am
working on 100 MB pictures
--
AZ
<email***@***.com> wrote in message news:email***@***.com...
>
> MI5 Persecution Update: Friday 30 April, 1999
>
> If You Intend To Reply, Please Read This
> Please.... keep your response to one page!. Faxes over a page or two will
> be deleted without being read.
>
> Somewhere between 0 and 100%
>
> The last few days there have been no clear recordable instances of
> abuse. However, while travelling on the Underground, while walking around
> near my home and going to friends homes, I am constantly troubled by
> thoughts that those people over there might be about to get at me; that
> the couple sitting in the opposite seats laughing are in fact laughing at
> me; et cetera, et cetera.
>
> A comment by a scientist to the BSE inquiry sticks in my mind. He
> described the possible scale of the epidemic as "between 0% and 100%". It
> might not be happening, it might not happen at all, to any discernable
> degree.... or it might be total. Without clear recording, which seems to
> have become impossible the last couple of weeks, there is no way of
> knowing whether the harassment really is continuing, whether we have
> entered a temporary hiatus, or whether perhaps it has perhaps stopped for
> now.
>
> But for the time being I think there arent any reasons to dicontinue these
> faxes. I only re-started them six weeks ago in response to a resumption of
> MI5 harassment; and I think I will need to be more convinced of absence of
> persecution before I discontinue my complaints.
>
> The Newscasters are still watching
>
> In the last few weeks there have been at least a couple of fairly overt
> instances of "interactive watching" by newscasters. I reported this in a
> previous "MI5 Persecution Update".
>
> These instances are really very rare compared to 1990-91, when there were
> many dozens of such occurrences. Undoubtedly the reduction is due to my
> practice of videotaping everything I see. Recently I had the opportunity
> of showing this years "happenings" (Jon Snow/Nicholas Witchell) to my
> psychiatrist, and he agreed that in both cases the newscasters were
> expressing merriment without visible cause, and that objectively it might
> be possible for my claims to be true - although of course other people
> reported similar thoughts to him, and this thinking is usually a symptom
> of illness.
>
> Read About the MI5 Persecution on the World Wide Web
>
> The March 1998 issue (number 42) of .net Magazine reviews the website
> describing it as an "excellent site". Since August 11, 1996 over 50,000
> people have browsed this website.
>
> You are encouraged to read the web pages which include
>
> a FAQ (frequently asked questions) section outlining the nature of the
> persecutors, their methods of harassment through the media, people at work
> and among the general public
>
> an evidence section, which carries audio and video clips of media and
> workplace harassment, rated according to how directly I think they refer
> to me
>
> objective descriptions of the state security agencies involved
>
> scanned texts of the complaints I have made to media and state security
> agencies involved
>
> posts which have been made to netnews over the last four years on this
> topic
>
> Keith Hill MP (Labour - Streatham), my elected representative, as ever
> refuses to help.
>
> MI5 Waste Taxpayer Millions on Pointless Hate-Campaign
>
> Recently I was talking to an independent observer about the nature and
> purpose of the perceived campaign of persecution against me. The person I
> spoke to, a highly intelligent man, said he was struck by the utter
> pointlessness of the perceived campaign against me. He also said that, if
> my theories were in fact true, many people would have to be involved, in
> the surveillance itself, and in the technical side of the delivery of
> information from my home to TV studios for example, if the "interactive
> watching" were happening as described. He voiced these thoughts without
> any prompting from me; but both I and other observers had arrived at
> pretty much the same conclusions, some years ago.
>
> I saw a team of four men at Toronto Airport in 1993
>
> To carry out the surveillance alone, full-time, would employ four or five
> men, or their equivalent in terms of man-hours. Each man would "work" an
> eight-hour shift, so you would need at least three men doing the
> surveillance, plus a connecting link / manager. An indicator that this
> estimate is correct arrived in 1993, when I was accosted by one of a group
> of four men at Toronto Airport; he said, laughing, "if he tries to run
> away well find him". Plainly these were the men who had been involved in
> the intrusive surveillance of me for the preceding three years.
>
> On other occasions, I have seen the same man on two or three occasions. On
> one such occasion, at Ottawas Civic Hospital in November 1996; he gave his
> name to the doctor as "Alan Holdsworth" or some such; my hearing is not
> very good sometimes and I am not sure of the surname, although I am sure
> "Alan" was his first name. I saw exactly the same man again in Ottawa, at
> the airport, in July 1998. Obviously, other people must be "working" with
> this person; he would not be the sole agent employed in this case.
>
> Usenet readers views on the Cost to MI5 of Running the Campaign
>
> Here's what a couple of other people on internet newsgroups / Usenet
> (uk.misc) had to say regarding the cost of running such an operation...
>
> PO: >Have some sense, grow up and smell reality. What you are talking
> about
> PO: >would take loads of planning, tens of thousands of pounds and lots of
> PO: >people involved in the planning, execution and maintenance of it. You
> PO: >must have a very high opinion of yourself to think you are worth it.
>
> and......
>
> PM: >But why? And why you? Do you realize how much it would cost to keep
> PM: >one person under continuous surveillance for five years? Think about
> PM: >all the man/hours. Say they _just_ allocated a two man team and a
> PM: >supervisor. OK., Supervisor's salary, say, #30,000 a year. Two men,
> PM: >#20,000 a year each. But they'd need to work in shifts -- so it would
> PM: >be six men at #20,000 (which with on-costs would work out at more
> like
> PM: >#30,000 to the employer.)
> PM: >
> PM: >So, we're talking #30,000 x 6. #180,000. plus say, #40,000 for the
> PM: >supervisor. #220,000. Then you've got the hardware involved. And
> PM: >any transcription that needs doing. You don't think the 'Big Boss'
> PM: >would listen to hours and hours of tapes, do you.
> PM: >
> PM: >So, all in all, you couldn't actually do the job for much less than
> PM: >a quarter million a year. Over five years. What are you doing that
> makes
> PM: >it worth the while of the state to spend over one and a quarter
> million
> PM: >on you?
>
> Those are pretty much the sort of calculations that went through my head
> once I stopped to consider what it must be costing them to run this
> operation. At the very least, a quarter million a year - and probably much
> more, given the intrusive and human-resource-intensive methods
> employed. Times nine years. Equals well over two million pounds - and
> probably much, much more.
>
> Its wasteful for someone with my skills to be unemployed
>
> The wastefulness of the MI5 campaign against me is not just that of futile
> expenditure on their side. It is also extremely wasteful for someone with
> my talents to be unemployed and on a disability pension. I am highly
> qualified in numerate disciplines, yet am unable to work, specifically
> because of the MI5 hate-campaign against me. It is a terrible waste of
> resources for a supposedly efficient economy like that of the UK to be
> squandering the talents of a skilled and capable worker.
>
> I made every effort to remain in employment for as long as I could, but
> ultimately I was defeated by MI5s employment of massive resources
> specifically targeted on my workplaces with the sole aim of seeing me
> evicted from those workplaces. You might expect this sort of behaviour
> from the Stasi or some other secret police force in a communist country
> where labour is cheap, and the governments aim on seeing its citizens
> confined; but for a supposedly free and efficient economy like Britains,
> the wastefulness resulting both directly and indirectly from the Security
> Services activities is simply criminal, and should never be allowed.
>
> The international dimension means the costs are multiplied many times
> overoer had any sense, then they have surely taken leave of them over the
> last nine years.
>
> Four years of persecution in Canada
>
> The persecution re-started within less than five minutes of my arrival in
> Canada, as documented above, and in the "frequently asked
> questions" article on the website. The words, "if he tries to run away
> well find him" spoken by one of the harassers at Toronto Airport are now
> imprinted on my mind.
>
> A year later I emigrated to Canada, intending to find a job and settle
> there, hoping that MI5s interest in me might dim with time. I did manage
> to find work there, but my hopes of avoiding Security Service interest
> were ground into dust. As detailed above, I saw the same man in November
> 1996 and July 1998, both times in Ottawa. Apart from these encounters,
> there were numerous incidents between 1994 and 1998 of harassment, of an
> identical nature and in most cases using identical words to what had
> occurred in the UK. It became quite clear to me that the permanent
> surveillance and harassment operation which MI5 had subjected me to in
> England was being continued.
>
> For a team of four or five men to be employed overseas must cost a lot
> more than if they operate in their home country. And for MI5 to continue
> the operation for a period of over four years, continuously, must cost
> many hundreds of thousands of pounds. This confirms my belief that the
> state is funding the campaign against mehat the Security Service receives
> current annual funding of #160M. Divided by 1850 staff, works out at
> #86,000. But the unit annual cost of each "watcher" must be much higher
> than this, especially given the frequently mobile and overseas nature of
> their actions of the last few years. A very conservative figure might be a
> little over #100,000 pa for each of a team of five people, or half a
> million pounds per year. For nine years, so far. So the most conservative
> estimate of the surveillance element alone is perhaps four or five million
> pounds since 1990.
>
> This guesstimate is of course theoretical - I am not privy to inside
> details of how MI5 split their funding. But to take some other examples,
> the cost of a US counter-surveillance specialist per day is USD
> 5,000. Even if the agents permanently assigned to me are not of this
> calibre - even if they employ specialists when difficult work planting
> bugs etc is encountered - their salary and support costs must still be
> very high. The individual agents are doing well for themselves as they are
> well-paid to exercise psychopathic instincts which in any sane society
> would see them in prison; but the taxpayers who must fund this terribly
> wasteful exercise are being "done" out of hundreds of thousands of pounds
> each year.
>
> It must be emphasised that the above estimates are highly
> conservative. Besides the surveillance operation, it must carry a high
> cost in man-hours to propagate covert slanders through the population; to
> setup and maintain the "interactive watching" links to TV and radio
> stations, which these organisations continue desparately to "lie and
> deny"; and to induce antipathy in co-workers which would not otherwise
> exist.
>
> Why they are wasting Millions of Pounds on a "Nobody from South London"
>
> As remarked in the prologue to this article, it is really most
> extraordinary that the Security Service spends a chunk of its budget,
> every year for nine years so far, on a meaningless campaign against a
> "nobody from South London". That they are spending such a large amount of
> money has been confirmed to me on several occasions, usually by oblique
> references to "its costing this country millions". The supposed
> "logic" behind the persecution is that MI5 wish to avoid their harassment
> of me, and the involvement of the UK media, to be made public; yet as the
> reader will appreciate that is a circular argument, "theyre doing it
> because they want to keep it secret and avoid humiliation for themselves
> and their country" begs the question, "why did they start doing it in the
> first place?", to which in truth I myself do not know the answer.
>
> Plainly MI5 with its rich budget can afford half a million pounds a year
> to waste on a "nobody from South London". Some time ago I was talking to a
> British surveillance professional on Compuserve who told me "this work
> costs a lot of money and is usally because the person I am following has
> done something (usually criminal) to warrant all this money and time being
> spent." Yet in this particular case it is plainly not the "victims
> fault" that the harassment is taking place. The hate-campaign against me
> is completely the creation of the obsessive psychologies of the MI5 agents
> who have made themselves my persecutors; it is obviously a
> "personal" campaign for them, and for years they misuse taxpayer funding
> to feed their insane, unnatural and fixated fantasies.
>
> 18598
>
>
> --
> Posted via NewsDemon.com - Premium Uncensored Newsgroup Service
> ------->>>>>>http://www.NewsDemon.com<<<<<<------
> Unlimited Access, Anonymous Accounts, Uncensored Broadband Access
- 5
- Ussgin JUnit add ons to get the superclass
Hi, I am using J-UNIT to test my code. I have some instances where
the class heirarchy is makeing my shake my head as to how to test.
Hope I can explain this so that someone can help...
Here Goes . I have a class 'A', with a private attribute 'attrib', and a
public accessor 'getAttrib'.
Now there is another class, 'B' which is derived from 'A', however, it
also has it's own private attribute 'attrib', and a public accessor
'getAttrib'.
We have software that loads A & B from XML Files, and i am trying to
verify that they are working correctly (later on these classes will be
persisted in a database, so I want to make sure that I can save and load
them correctly).
What i am trying to do is find out what is stored in 'A's attrib.
Sort of like this :
// The XML files holds teh data for both the super class and the sub
class
// The returned object is of Class 'B'
A myA = B.loadFromXMLFile ( "FileName.xml" ) ;
// Works Great, But how do i get to the getAttrib of the A object
(super class) ?
assertEquals ( "attrib", 123, myA.getAttrib () ) ;
Now is there a way to get the attribute for the attrib of 'A' ?
Using the NetBeans debugger I can se the value for attrib= 5
is there a way to do something like the following ?
// This does not work, but is there any way to acheive the
// Same results ?
A theRealA = PrivateAccessor.getField( myA, "super" ) ; // ??
// and then
assertEquals ( "attrib", 5, theRealA.getAttrib () ) ;
Thanks in Advance !
Joe
- 6
- linking from one portlet to another portlet in the same pagehi,
I am running bea portal 4.0. I designed a page with two portlets. The left
portlet has some url links. When the user clicks on a link the content of
the right portlet shall be updated. So can anyone tell me if it is possible
to do that or do I have to look for a different solution.
Michael
- 7
- Process.waitFor(): a strange behaviourI have a strange behaviour with the Process.waitFor() method under
linux mdk 10.1 and java 1.4.2.
my jar archive reacha.jar launches an external programm via
Runtime.getRuntime().exec,
as done bellow,
proc = Runtime.getRuntime().exec("rv toto.rvqe");
proc.waitFor();
where rv is a shell that lauches a command eprover as shown bellow
gess 28182 0.2 1.6 218592 12532 pts/2 S<l+ 11:03 0:00 java
-jar reacha.jar test.mch
gess 29561 0.0 0.7 7424 6044 pts/2 S<+ 11:05 0:00
/usr/bin//rv toto.rvqe
gess 29727 0.0 0.1 2880 1424 pts/2 S<+ 11:05 0:00 sh -c
eprover ....
gess 29728 99.6 3.3 27376 26300 pts/2 R<+ 11:05 3:03 eprover
...
Sometime, when the eprover command spends a lot of time, and ends after
some minutes,
the method waitFor() does not seem to catch the end of the programm
and does not stop to wait...
gess 28182 0.2 1.6 218592 12532 pts/2 S<l+ 11:03 0:00 java
-jar reacha.jar test.mch
gess 29561 0.0 0.7 7424 6044 pts/2 S<+ 11:05 0:00
/usr/bin//rv toto.rvqe
When I launch by hand the programm rv, it stops alone after the end of
the eprover as shown bellow
gess 522 0.0 0.7 7424 6044 pts/2 S<+ 12:02 0:00 rv
toto.rvqe
gess 688 0.0 0.1 2876 1420 pts/2 S<+ 12:02 0:00 sh -c
eprover ...
gess 689 99.6 2.6 21436 20340 pts/2 R<+ 12:02 1:06 eprover
...
And next no more reference to rv by the ps aux command
Thank a lot for your help.
- 8
- 9
- Disappearing JVM - strange errorHello,
I'm having a very strange problem in one of my applications. This is
what's happening:
A few JVMs crash without giving any clues as to what is happening. No
error messages, no stack traces, no core dumps. Nothing. Nada. They
just disappear.
I'm running on Windows 2000 and I had the same problem using JDKs
1.3.1_07 and 1.3.1_08. Sometimes I also notice a Windows error dialog
say that the "Application log is full" but I'm not sure it is related
(because when the problem happens and the dialog is NOT there we can't
see any entries in the application log).
The application is a JBoss server process which is part of a cluster.
In the process we have a RMI application running. The nodes that crash
are the nodes where this RMI client/server is deployed. When the app
server process starts we bind the RMI server stub in to the JNDI tree
and this server object communicates with a number of different
applications.
I suspect that this could be related to RMI (distributed gc, maybe?)
or the fact that this service running within the JBoss process is
multi-threaded (relies heavily on waits and notifies). But I don't
really know. The process simply disappears.
We have deployed the RMI service in different machines to rule out the
possibility of hardware failure but the crash happened anyway.
We have a memory monitor that checks the memory usage every 30
seconds. The logs show that the memory usage should not be a problem.
It is possible, though, that we have a memory spike that takes less
than 30 seconds to show up and crash the system in such a dramatic
way.
Has anyone here ever experienced or seen anything like this?
Thanks in advance for any help.
JS
- 10
- A strange linux command execution problem from ProcessHi All,
I am using Process class to run scripts on a Fedora Core Linux
bash shell
All of my scripts are running except tho one in which i am using diff
command.
I am using simple diff command. My script is
-------------------------------------------------------------------------------------
#/bin/sh
if [ $# -eq 0 ];
then
echo "Usage: newFile oldFile outputFile"
exit
fi
FILE1=$1
FILE2=$2
OUTPUT_FILE=$3
echo "diff -c $FILE1 $FILE2 > $OUTPUT_FILE"
#diff -c $FILE1 $FILE2 > $OUTPUT_FILE
diff -c $FILE1 $FILE2 > $OUTPUT_FILE
------------------------------------------------------------------------------------------------
And I am also consuming the error and output streams so not blocking
the process.
the process returns with exit value > 0.
It would be a great help to me. If you help me solve this problem.
-Thanks,
Ratnesh.
- 11
- Java to C++ converterHi,
I am looking for Java to C++ converter tool. Any existing tool available?
Thanks for your help in advance.
- 12
- Child question + illegal start of expression errorI have a form with a question and child questions
eg q1 program - Yes/no
q2 web; desktop
q3 java; .net; #C
My form is:
Q6a: Waterproblem (yes/NO)
Q6b: Current - radiobutton (curent, 1-5 years)
Q6c: Location Home (yes/No); Garden (Yes/No); common (yes/no)
If user selects Q6a = Yes (1)
....
Q6c Home (0/1); Garden (0/1); common (0/1)
I want to check, if user selects Yes for Q6a, then they need
select 1 from Q6c.
If they don't select one choice, want to have a simple error warning.
Yes = 1 No = 0
The code shows an illegal start of expression error????
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
if( page8.getWasteWaterProblem() == 1 ) ||
(getWasteWaterLocationProblemHome() == 0) ||
(getWasteWaterLocationProblemGarden() == 0) ||
(getWasteWaterLocationProblemCommonArea() ==0){
validationResultPage8.addWarning("WasteWaterProlemHome", "warning for
WasteWaterProlemHome from type 6c");
}
- 13
- How to Escape a Single Quote in Java 1.5 javax.xml.xpath.* ?Hi everybody,
How to escape a single quote in java 1.5 javax.xml.xpath XPath queries?
Eg. meta[@name='Tom Jastrzebski's question']
I have tried numerous approaches that typically work but none of them did.
Does anybody KNOW how to do it?
Thanks in advance.
Tom
- 14
- Useless Google Holding (was Re: Jewke Hatekass)"Luke Tulkas" <email***@***.com> wrote in message news:<email***@***.com>...
> "JTK" <email***@***.com> wrote in message
> news:p0ned.749845$email***@***.com...
>
> >> 2. I don't know if he speaks Yiddish or not. Perhaps you'd provide
> >> information either way. Moreover, speaking various languages makes people
> >> multilingual but not necessarily multinational. I speak English (well,
>
> [snip]
Way back, Google's purchase of old Usenet bulletin boards was probably
a good thing (through purchase, I believe, of Deja News). Now with
the continuing evolution of the Internet - with Blogs and associated
RSS feeds, etc. - this type of forum is becoming largely irrelevant
and should be done away with. I would like to thank all of you
nimrods posting this kind of crap on this board for opening my eyes
completely to this fact. Do you actually regard yourself so highly
that you think that people actually CARE to read your constant
blatherings on this and that nonsense?
Every now and then I return to c.l.j.a. just to see if anything of
interest has been posted - kind of like how I leaf through JDJ to see
if they've managed to write a decent article. This will hopefully be
my last visit unless I end up here by mistake or by habit. Thanks
again.
- 15
- portal library needed ?Hi all ,
I am trying to build a portal which will consist of functions like log
in , user management and some cms stuff and will probably develop more in
the future. So I am trying to search for some portal building library. Has
anyone try one of these portal library like jetspeed, jPorta, liferay ... ?
Is it really that useful ? On what basis should I use one ? As i think the
learning curve maybe quite large that I am sure i can build faster without
it. But I am not sure if I would need it when I further develop the site.
And can anyone share some pros and cons of the library.
Thanks.
Perseus
|
|
|