| Child question + illegal start of expression error |
|
 |
Index ‹ java-programmer
|
- Previous
- 1
- 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
- 1
- 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
- 2
- 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
- 2
- 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.
- 5
- 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
- 5
- 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).
- 5
- 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
- 5
- jni to optimize a java application using native mathematical librariesHi,
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
- 6
- 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
- 7
- 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.
- 8
- 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.
- 8
- 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
- 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"
.
- 13
- 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
- 14
- 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
|
| Author |
Message |
cliveswan@yahoo.co.uk

|
Posted: 2007-4-17 4:52:00 |
Top |
java-programmer, Child question + illegal start of expression error
I 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");
}
|
| |
|
| |
 |
Eric Sosman

|
Posted: 2007-4-17 5:08:00 |
Top |
java-programmer >> Child question + illegal start of expression error
email***@***.com wrote On 04/16/07 16:51,:
> I 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 ) ||
^
The test portion of the `if' statement ends at
this parenthesis. What follows should be an executable
statement, but what actually follows is `||'. `||' is
not valid as the start of an expression or statement.
Possible cure: Delete that parenthesis. Alternative
cure: Insert an opening parenthesis just before `page8'.
Either way, you will also need to add another closing
parenthesis just before the `}' below.
Still another cure: Get rid of all the parentheses
except the one right after `if', the one right before
`}', and the pairs after each method call.
> (getWasteWaterLocationProblemHome() == 0) ||
> (getWasteWaterLocationProblemGarden() == 0) ||
> (getWasteWaterLocationProblemCommonArea() ==0){
>
> validationResultPage8.addWarning("WasteWaterProlemHome", "warning for
> WasteWaterProlemHome from type 6c");
> }
Note, too, that the logic is flawed: The test (after
correction) will produce a validation warning if the
first box is checked or if any of the others is unchecked.
From your description, I doubt that's what you want.
--
email***@***.com
|
| |
|
| |
 |
Lew

|
Posted: 2007-4-17 7:16:00 |
Top |
java-programmer >> Child question + illegal start of expression error
Eric Sosman wrote:
>> I have a form with a question and child questions
email***@***.com wrote On 04/16/07 16:51,:
> Note, too, that the logic is flawed: The test (after
> correction) will produce a validation warning if the
> first box is checked or if any of the others is unchecked.
> From your description, I doubt that's what you want.
Also note that multi-posting causes people to answer your questions without
knowledge of each other's answers and is very rude, as it makes those of us
who try to help feel that you have taken advantage of us and caused us to
waste our time.
Please do not multi-post.
> Lew wrote:
>> Clive wrote:
>>> if( page8.getWasteWaterProblem() == 1 ) ||
>> . . .
>>> Shows an illegal start of expression error????
>>
>> You're not allowed to put the OR operator (||) after the closing
>> parenthesis of the condition.
--
Lew
|
| |
|
| |
 |
| |
 |
Index ‹ java-programmer |
- Next
- 1
- Java to C++ converterHi,
I am looking for Java to C++ converter tool. Any existing tool available?
Thanks for your help in advance.
- 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
- 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
- 4
- Infinite loops in hashCode() and equals()What do you think the following fragment prints?:
List l = new ArrayList();
l.add(l);
System.out.println(l.hashCode());
Trick question. The result is an infinite recursion (i.e. a stack
overflow), since the hash code for a List is calculated from the hash codes
of its members.
Likewise, the following causes an infinite recursion, since lists are
defined to be equal when they have the same members.
List l1 = new ArrayList();
List l2 = new ArrayList();
l1.add(l2);
l2.add(l1);
System.out.println(l1.equals(l2));
These cases are simple to spot, but the same situation could occur with any
cyclic graph of objects that compute hash code and/or equality based on the
values of their members. Also, equals() and hashCode() are often called
implicitly, for instance when adding an object to a HashSet or HashMap.
I don't see any way this could be addressed other than by keeping track of
which objects have already been processed by the current hashCode() or
equals() call, and there's no way to do that without changing the method
signatures, to, say, add a Set:
in Object:
public final int hashCode() {
return hashCode(new HashSet());
}
public final int hashCode(Set processed)
{
if (processed.contains(this)) {
return System.identityHashCode(this);
}
else {
processed.add(this);
return this.calculateHashCode(processed);
}
}
public int calculateHashCode(processed) {
return return System.identityHashCode(this);
}
with calculateHashCode(Set) being the method that classes can override and
hashCode(Set) the method List et al. call on their members. And that is a
pipe dream, since it isn't possible to make this sort of incompatible change
at this late date.
- 5
- R: JTable and db connectionThere is a good example in JTable example ad www.sun.com. By the way, it is
based on the idea of copying all the records in a Vector array, and then
send all to the JTable...
IMHO this isn't a good approach, but it is a good example to understand the
JTable
Bye
Giuseppe
Liguori Ferdinando <email***@***.com> wrote in message
bhl1va$55u$email***@***.com...
>
> Could you help me to definy a trouble.
> I wish see data retring db connection in a JTable.
> Could you mailing an example.
> Thanks.
>
>
- 6
- 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
- 7
- 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.
- 8
- 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
- 9
- ToolTip for Graphical ItemsHello,
I'm trying to make a tool tip pop up whenever the user does a
mouse-over on a filled rectangle that I've drawn on the screen. I have
no trouble creating the rectangle
Rectangle test = new Rectangle();
And it seems like there should be something like
test.setToolTipText("rectangle"), but as far as I can tell, there's
nothing like that. Is there some way to do this?
Thanks,
Ben
- 10
- 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
- 11
- 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
- 12
- 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.
- 13
- 14
- 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
- 15
- NoClassDefFound puzzleNoClassDefFound is my least favourite error message. This one has me
stumped. I have been very sick the last few days and my brain in not
yet fully engaged, so I hope it is something simple.
I compile this fine, but when I run it, it says class
com.mindprod.example.TestProgessFilter is not defined.
The program seems too simple to have a NoClassDefFound problem.
package com.mindprod.example;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FilterInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
/**
* @author Roedy Green, Canadian Mind Products
* @version 1.0, 2007-08-03 Created with IntelliJ IDEA.
*/
public class TestProgessFilter extends FilterInputStream {
/**
* tracks how many bytes we have read so far
*/
long progress;
// -------------------------- PUBLIC INSTANCE METHODS
--------------------------
/**
* Constructor
*
* @param in input stream to progress monitor
*/
public TestProgessFilter( InputStream in )
{
super( in );
}
/**
* Reads the next byte of data from this input stream.
*/
public int read() throws IOException
{
int ret = super.read();
progress++;
reportProgress();
return ret;
}
/**
* Reads up to byte.length bytes of data from this input stream
into an
* array of bytes.
*/
public int read( byte[] b ) throws IOException
{
int ret = super.read( b );
progress += b.length;
reportProgress();
return ret;
}
/**
* Reads up to len bytes of data from this input stream into an
array of
* bytes.
*/
public int read( byte[] b, int off, int len ) throws IOException
{
int ret = super.read( b, off, len );
progress += len;
reportProgress();
return ret;
}
/**
* Skips over and discards n bytes of data from this input stream.
*
*/
public long skip( long n ) throws IOException
{
long ret = super.skip( n );
progress += n;
reportProgress();
return ret;
}
// -------------------------- OTHER METHODS
--------------------------
/**
* report the progress to the user
*/
private void reportProgress()
{
// this is a dummy routine. A real version would send an event
// to a progress meter.
System.out.println( progress );
}
// --------------------------- main() method
---------------------------
/**
* test driver
*
* @param args arg[0] is UTF-8 filename to read
*/
public static void main( String args[] )
{
try
{
// O P E N
FileInputStream fis = new FileInputStream( new File( args[
0 ] ) );
TestProgessFilter tpfis = new TestProgessFilter( fis );
InputStreamReader eisr = new InputStreamReader( tpfis,
"UTF-8" );
BufferedReader br = new BufferedReader( eisr, 400/*
buffsize */ );
// R E A D
while ( true )
{
if ( br.readLine() == null )
{
// line == null means EOF
break;
}
}
// C L O S E
br.close();
}
catch ( Exception e )
{
System.err.println( e );
e.printStackTrace( System.err );
}
}
}
--
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com
|
|
|