| OT(?) - Java Applet and Browser Issue |
|
 |
Index ‹ java-programmer
|
- Previous
- 2
- How Robots Will Steal Your JobProgrammer Dude wrote:
> Richard Heathfield wrote:
<snip>
>
>>If so, they could easily be under observation in their turn. Or
>>not. We don't know either way.
>
> We do know they aren't making physical recordings of any kind.
> Most (if not all) human scientists do of necessity. They also
> don't appear to be concerned about sharing their findings.
How exactly do we /know/ they're not making any physical recordings?
Because we haven't seen any? That'd be like my brother saying that he
/knows/ I don't own any white shirts (which I do) because he's never
seen me wear one (which I don't).
Absense of evidence... ah, you must be sick of hearing that by now. You
don't appear to be taking any notice of it anyway.
Regardless of that though, why is it required that they make physical
recordings? How many "witch doctors" and "medice (wo)men" (your words
elsethread) record their observations?
--
Corey Murtagh
The Electric Monk
"Quidquid latine dictum sit, altum viditur!"
- 4
- monthly earning $1000 to $5000monthly earning $1000 to $5000
simple online surveys
create your membership visit
******************************
www.awsurveys.comhomemain.cfm
*********************************
refid= siva icici
*********************************
- 5
- static initialization of arraysHi guys,
I started to write some Java today, see the code below. What I want to
do is produce a static array V from several static arrays A, B, ...,
but I don't want V to have any duplicate elements. I was wondering if
there is a better way of coding this up? Also, is there a way to
guarantee that arrays A, B, ... are constructed before S and V without
relying on the order in which they are declared?
Thanks,
Johan
-----------------------------------------
import java.util.*;
class StringSet extends TreeSet<String>
{
public void addAll( String[] strings )
{
for (String s: strings )
{
add( s );
}
}
};
class Main
{
private static final String[] A = { "A1", "A2", "B1" };
private static final String[] B = { "B1", "B2" };
...
private static final StringSet S =
new StringSet ()
{
{
addAll( A );
addAll( B );
...
}
};
private static final String[] V = S.toArray(new String[S.size()]);
...
}
- 8
- javax.net.ssl.HttpsURLConnectionHello,
I need the library javax.net.ssl.HttpsURLConnection.
But all the package i find where there is javax.net.ssl do not
contained the class HttpsURLConnection.
Does anyone have an idea where i can find it ?
Thank's a lot for your help
Sorry for my English?I'm French ;)
- 10
- hi reg jsp page redirecthi all i have jsp page -where the user fills up some fields.basically i
dont want user to fill up those forms during nightime . so
i take system time which is cst and calculate whether its am or pm and
if its between 7pm and 6am i redirect saying u cannot fill it up.
the executables are placed in server which is located in cst time zone.
what happens is when any person from asian counties click the link its
not redirecting its still shows the form .
when i test it locally its fine .any help cant i take the system time
and redirect based on that
thanks for the help
- 12
- duplicating Properties Dialog boxHi there,
Wondering if anyone there has duplicated a properties dialog box before. I
need to do exactly that for a project I'm working on. You know what I mean,
eh? The kind you can find in JBuilder. The one there is obviously using a
Tab control...one tab for properties and the other for events. The one I
intend to make doesn't need a Tab control. I'm only displaying properties,
no events.
So, I'm going to need a JScrollPane, but what would you recommend I use to
get the two columned list that one typically sees in a properties dialog
box? The two columned list generally shows the property name in the left
column and either provides a textfield in the second column or a button that
opens a more detailed dialog box for that particular property.
Any suggestions?
Alan
- 12
- How to get path to current directory?Hello.
How to get path to current directory and put this path to object of class
String?
I found FileSystemView.getHomeDirectory() but it returns path to home
directory for example:
C:\Documments and Settings\Thomas
Thanks for help.
- 12
- ajax server design questionI am going to write a multi-player board game (I've actually already
written one version, with a java server and VB client). I'd like the
players to be able to play over the web, through an ajax client. I
don't know much about ajax yet. It appears that the XMLHttpRequest (or
whatever it is called) can only generate GET and POST requests through
the http protocol. In that case, I am going to have to either
a) write a server that understands http (maybe not too hard with java's
built-in classes)
or
b) use servlets w/tomcat or some other framework that will handle the
http for me and have the servlet keep a socket connection to the game
server, which speaks its own protocol.
Which should I go for? Also, I am concerned about losing some power by
going to http - like the server is not able to initiate contact with
the client (to notify it of moves made by the other player), and there
is no notification if the client shuts down their window (is that
true?). Is there any better way to accomplish these things than just
having the clients poll the server every 500ms or so?
Thanks for any advice.
- 12
- 64-bit Sparc laptopIf you are a Solaris on SPARC user, you might want to know that
Tadpole is running a drawing on its websit, www.tadpolecomputer.com,
for one of its new 64-bit SPARC laptops.
John Davis
- 13
- 13
- package com.ibm.security.x509 does not existHow to fix this compile error with jdk 1.5.0_14 on windows 2000:
AsnName.java:144: package com.ibm.security.x509 does not exist
encoding = (new
com.ibm.security.x509.X500Name(mName)).getEncoded();
...
- 13
- iPlanet and Tomcat configurationHi,
I am trying to configure iPlanet 4.1 or 6.0 to work with Tomcat 4.1.
I followed the instruction on Apache site
(http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jk2/jk/neshowto.html)
but got no luck. Could not even get the examples (at the end of the
config.) to show up....:(
Has anybody gotten some successes on this front?
Any pointers will be appreciated.
Ming
- 13
- 13
- How to download a text file from server to client?hi,
I am devoloping a web application using JSP and Servlets.
The first thing I need to know is how to create a text file in the
sever.
Once the text file is created there should be an option for
downloading it to the client.It could a link.On click of that link the
user should be able to save it to the client.
any help will be great!
thanks in advance.
---------------------------chik
- 13
- Reading HDD serialNoHi all,
Could you help me please to find out how to read the harddisk serial
number in java ?
Thanks a lot!!
|
| Author |
Message |
K2

|
Posted: 2005-8-14 4:42:00 |
Top |
java-programmer, OT(?) - Java Applet and Browser Issue
I'm trying to troubleshoot the cause of the following errors:
basic: Registered modality listener
basic: Referencing classloader: sun.plugin.ClassLoaderInfo@a6aeed,
refcount=1
basic: Added progress listener: sun.plugin.util.GrayBoxPainter@af8358
basic: Loading applet ...
basic: Initializing applet ...
basic: Starting applet ...
network: Connecting http://www.java.com/jsp_utils/JavaCallJS.class with
proxy=DIRECT
network: Connecting http://www.java.com/jsp_utils/JavaCallJS/class.class
with proxy=DIRECT
load: class JavaCallJS.class not found.
java.lang.ClassNotFoundException: JavaCallJS.class
at sun.applet.AppletClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadCode(Unknown Source)
at sun.applet.AppletPanel.createApplet(Unknown Source)
at sun.plugin.AppletViewer.createApplet(Unknown Source)
at sun.applet.AppletPanel.runLoader(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.io.IOException: open HTTP connection failed.
at sun.applet.AppletClassLoader.getBytes(Unknown Source)
at sun.applet.AppletClassLoader.access$100(Unknown Source)
at sun.applet.AppletClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
... 10 more
basic: Exception: java.lang.ClassNotFoundException: JavaCallJS.class
The error that has caught my eye is "open HTTP connection failed". I
have local Java apps (Eclipse IDE, Unlimited FTP) that run fine but
can't access the internet. But applets don't run - just generate errors
like above. Turns out that there are no Java related plugins in the
Firefox plugins directory. I've got Quicktime and Flash related files
there, but nothing Java related. If I try to install JRE 5, it tells me
that it's already installed. Yet applets (e.g. www.java.com) cause
General Exception Errors and I still have no Java related files in my
plugins directory.
Anybody have ideas as to the cause of this? Coudl somebody tell me
which files need to be in the plugins directory? Maybe I can just copy
them there myself.
Thx
-K2
|
| |
|
| |
 |
| |
 |
Index ‹ java-programmer |
- Next
- 1
- wholesale,hoody ( paypal accept ) ( www.top-saler.com ) wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
wholesale,hoody ( paypal accept ) ( www.top-saler.com
)
- 2
- Perfomance for multiple inserts> Statement stmt = con.createStatement();
> stmt.addBatch("insert into table_name1 ...");
> stmt.addBatch("insert into table_name2 ...");
> stmt.addBatch("update table_name3 ...");
> stmt.addBatch("update table_name4 ...");
> stmt.addBatch("delete from table_name5 ...");
> stmt.executeBatch();
>
> And that is a good idea because the critical part of operations
> like this is the Statement-object. That has the direct connection
> with the SQL-server-side. And now you are able to execute a lot
> of statements with only 1 Statement-object, this looks like
> an sql-batch-script.
And if you (original author) going to benchmark, you could try concatenating
insert queries into a one large sql formula. Then you just run it and let
dbserver do the job.
StringBuffer sBuffer = new StringBuffer();
sBuffer.append("Insert Into ....;");
sBuffer.append("Insert Into ....;")
sBuffer.append("Insert Into ....;");
stmt = connection.createStatement(sBuffer.toString());
stmt.execute();
- 3
- Notifying ClientsHi,
I want my server to notify all the clients connected to it.
Basically the server should send the no. of files (count) in each
directories. I don't want the server to send this to each and every
client individually. This should be done in an efficient way.
Will JMS be used efficiently for this? or Is there any other way
to do this efficiently?
Thanks,
Ganesh
- 4
- Microsoft Hatred FAQemail***@***.com wrote...
> On Tue, 25 Oct 2005 15:35:47 +0000, Not Bill Gates wrote:
>
> > Heck, I dunno. Like you, I don't even really care all that much.
>
> You don't care that innovation in desktop software has been crippled by
> the actions of the monopoly player Microsoft?
You need to first prove innovation in desktop software has been
crippled, don't you?
- 5
- opening default browserHello everybody.
I'm new to Java.
I have created simple JPanel: Help->About.
I have placed there a link to my web page with message: download the
newest version.
OK it is a text message - I want to add sth like in Eclipse's
Help->About - a link to my page.
How can I open in Java a page in default system browser?
I'm newbie, I searched with google but every time I entered word
related to browser or opening browser I have - yes - Java but 'Java
Script' results...
thanks in advance for Your help
best regards R
- 6
- 7
- 8
- How to intercept Ctrl key - eg Ctrl E being pressed on Java console programHello
I am writing console programs and my program waits streaming in text input
from the screen. But I need a way for the user to abort - I thought Ctrl
E - but how can I know when Ctrl E has been pressed.
I am roughly doing this sort of thing:
import java.io.*;
public class blah
{
public static void main(String[] args)
{
// declaration section:
BufferedReader cin = null; // console input
String conline;
try
{
cin = new BufferedReader(new InputStreamReader(System.in));
System.out.println("Enter strings to remove last character");
System.out.println("waiting... Press Ctrl E to end session");
while ((conline = cin.readLine()) != null)
{
// If Ctrl E detected abort - break out - BUT HOW???
System.out.println("processing: " + conline);
int len = conline.length();
String strRemovedot = conline.substring(0,len-1);
System.out.println(strRemovedot);
}
cin.close();
}
catch (IOException e)
{
System.err.println("IOException: " + e);
}
}
}
- 9
- Oracle JDBC executeQuery() hanging with a to_char() in the selectCalling statement.executeQuery() hangs, anyone experienced this? Using
the Oracle thin driver v9.2.0.1.0 running on a Solaris 8 box. The
code:
Connection connection = cdrDataSource.getConnection();
Statement statement = connection.createStatement();
String sql = "SELECT
TO_CHAR(SOFIXML.SOFI_LIB.SOFI_GET_XML('CA89352LAC42', NULL, NULL))
FROM DUAL";
ResultSet resultSet = statement.executeQuery(sql);
if(resultSet.next()) {
return resultSet.getString(1);
}
The SOFI_GET_XML function returns a CLOB and I'm using TO_CHAR() to
convert is into a VARCHAR2 for speed. Not doing a TO_CHAR and
processing the CLOB works fine but is a little slow. The query runs
fine through both TOAD and SQLPlus.
Thanks, Chris
- 10
- Ltd. Enrollment NotificationAttention Potential Candidate:
You may now qualify for our unique University Education Program. For a limited amount of students - No tests, classes, books, or interviews required*
Yourself, and a limited number of other candidates are invited to take advantage of this Special Enrollment
Bachelors, Masters, MBA, and Doctorate (PhD) available in the field of your choice - 100% Verifiable Documents will be shipped to you within 2 weeks.
CALL US 24-7 - This Special Enrollment Ends Soon
1 (310) 281 - 6248
Thank You
Erin Reilly,
Educational Counsellor,
Internet Admissions Office
*Education awarded on life and past work experience.
--
To UNSUBSCRIBE, email to email***@***.com
with a subject of "unsubscribe". Trouble? Contact email***@***.com
- 11
- problem with Retroguard and Java 2 JDK?Hello
I have previously used Retroguard with jdk 1.1.8 but am having
problems using j2sdk 1.4.2_03. Get the following errors in the log
file. Any ideas why please?! The scr and run batch files which I am
using follow the error messages...
Geoff
# Unrecoverable error during obfuscation:
# java.lang.ClassNotFoundException:
symantec.itools.awt.util.dialog.ModalDialog
java.lang.ClassNotFoundException:
symantec.itools.awt.util.dialog.ModalDialog
at java.net.URLClassLoader$1.run(URLClassLoader.java:199)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:141)
at a.a.a.f.a(Unknown Source)
at a.a.a.f.a(Unknown Source)
at a.a.a.f.j(Unknown Source)
at a.a.a.j$4.a(Unknown Source)
at a.a.a.j.a(Unknown Source)
at a.a.a.j.a(Unknown Source)
at a.a.a.j.a(Unknown Source)
at a.a.a.j.a(Unknown Source)
at a.a.a.j.a(Unknown Source)
at a.a.a.j.if(Unknown Source)
at a.a.a.s.do(Unknown Source)
at a.a.a.s.a(Unknown Source)
at RetroGuard.a(Unknown Source)
at RetroGuard.a(Unknown Source)
at RetroGuard.main(Unknown Source)
1. scr batch file
set CLASSPATH=d:\retro\retroguard.jar;d:\retro\symbeans.jar
c:\j2sdk1~1.2_0\bin\java -classpath %CLASSPATH% RGgui
2. run bacth file
set CLASSPATH=d:\retro\retroguard.jar;d:\retro\symbeans.jar
c:\j2sdk1.4.2_03\bin\java -classpath %CLASSPATH% RetroGuard 030204.jar
ob030204.jar 030204.rgs 030204.log
- 12
- Finding Available JREs I'm hoping someone here can point me in the right direction. What
is the most reliable way to detect the available JREs installed on a
target system? Is the Windows registry sufficient under Windows?
Where does one look on a Linux system?
Any help on this matter would be greatly appreciated.
Thanks!
Damon Courtney
- 13
- Hel me! I'm going mad!!!Excuse me if I'm repetitive but I need help.
I thank Micheal Dunn but his suggestion is too particular and it's too
legates to a specific map of a museum.
I have this problem.
I have a map of a generic museum. Every room has maximum 4 links to other
room. These links have not a cost(the cost is always 1). I must implement a
algorithm to determinate the shortest path from a room to another room.
I have created a Class room, this class have these methods eand these data:
Method:
public int getNumVicini() //this method gives the number of room linked the
the object room in question;
public int getVicino(int v)//this method returns the 1st or the2nd or the
3rd or the 4th
public int getId()//return the id of the room
public String getPercorsi(int i)//return the path from the object room to
the room with id equals to i
public boolean verifyVicino(int v)//This method verify if a room with id
equals to v is linked to the object room
The there are the method addVicino(int i) that insert i inthe array vicini,
the method setname, setid, getname, getid etc.
Data:
private int vicini[]=new int[4];//this array contains the id of the linked
rooms
public String percorsi[]= new String[9];//this array contain the path from
the object room to all the others rooms in percorsi[0] there is the path
from object room to the room with id=0, in percrosi[1] path from object room
to the room with id[1], etc.
private int id;//in this int there's the id of the room
private String nome;//in this string there's the name of the room
In the main I have an array that contains all the room of the museum(Room
museum[]=new Room[x]).
The I have created a class Path to determinate the shortest path from a room
to another room.
This is the class Path:
public class Path {
private Room start;
public Path(Room r){ //the constructor take a room the room of start
and set the path to the linked room
for(int i=0; i<r.getNumVicini(); i++){
r.verifica[r.getVicino(i)]=true; //r.getVicino(i) give the id of
the linked rooms and set the verify[x], where x is the id of the linked
room, to true, because the shortest path is immediate
r.percorsi[r.getVicino(i)]+=r.getId()+ " " +
r.getVicino(i);//set the path to the linked room i equals to the id of the
start room an the id of the end room in this case the is of the end room is
the id a linked room
}
start=r;//it assigns the object r to start
}
private void findRoad2(Room end){ //this method permit to calculate
the path from 2 rooms that have a common linked room, but I don't know how
do to determinate a path for 2 room if between these 2 rooms there is more
of one room for example if I have these room 2-9-6-8(hte number are the id
of the room , the - are the link), with this method I am able to
derterminate the path from 2 to 9, from 2 to 6, but not for 2 to 8
for(int i=0; i<start.getNumVicini(); i++){
for(int j=0; j<end.getNumVicini(); j++){
if(start.getVicino(i)==end.getVicino(j) &&
start.verifica[end.getId()]==false){//This cycle verify if there is a common
linked room(like the room 9 in the example of the path from 2to6)
start.verifica[end.getId()]=true; //if there is this
common linked room it sets the verify[end.getId()] to true to indicate that
the path it is been determinated
start.percorsi[end.getId()]=start.getId()+ " " +
start.getVicino(i) + " " + end.getId(); //set the path, this path is equals
to start id and the id of the common linked room and end room id
}
}
}
}
If I have a map of the museum of this type:
7-8-3
| | |
6-4-2
| | |
5-0-1
(this map is only an example I could have a museum with 13 rooms that are
arranged in irregular way)
with the code that I have written I can determinate the path from 7 to 8,
from 7 to 6, from 7 to 4, from 7 to 3 and from 7 to 5, but NOT from 7 to 0,
from 7 to 1 or from 7 to 2
At the same way I can determinate the path from 0 to 5, from 0 to 1m from 0
to 4, from 0 to 8, from 0 to 2, from 0 to 6, but NOT from 0 to 3, from 0 to
7.
The some thing is for the rest of the rooms. I don't know how do to
determinate the rest of the path.
How can I do?
Thanks and excuse me.
- 14
- Passing an unknown number of parameters to AntHEllo,
You can pass parameters from the command line to your ant build file
by using properties.
Using ant -Dname=value lets you define values for properties on the
Ant command line.
These properties can then be used within your build file as any normal
property: ${name} will put in value.
However,
Let's say that I have the following java program:
++++++++++++++
class Test {
public static void main(String argv[]) {
for (int i = 0; i < argv.lenght;i++)
System.out.println("param " + i + ": " + argv[i]);
}
}
++++++++++++++
and I have the following ant file:
++++++++++++++
<project basedir=".">
<target name="run">
<java fork="true" classname="Test"/>
</target>
</project>
++++++++++++++
How do I need to modify the ant file so that executing "ant run one
two three" from the command line, produces:
++++++++++++++
param 1: one
param 2: two
param 3: three
++++++++++++++
(and it works for any number of parameters)
Many thanks,
DAvid
- 15
|
|
|