stephen84s 550 Nearly a Posting Virtuoso Featured Poster

dread

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

690

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

bad

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

686

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Well if the problem is solved it would be nice if you could mark this thread as solved too.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Contact thier host/isp and tell them whats going on

Chill JBennet, the topic is more than three years old, thats why Salem gave webdeb the bad cookie

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Now to connect via a Proxy **I think** you need to use the following method while opening the URL Connection using this "openConnection()" method of the URL class.

It takes an object of the Proxy class as an argument.

To construct the Proxy using the Proxy(Proxy(ProxyType, SocketAddress)) constructor itself you will need two items, First is the Proxy type, I am guessing yours is an HTTP proxy server so use Proxy.Type.HTTP as the first argument.
Next you will need a SocketAddress, the SocketAddress class is itself abstract so you will need to use the InetSocketAddress class which is its concrete sub class. Using InetSocketAddress(String hostname, int port) create an object of the InetSocketAddress of your Proxy Server (using the host name and port on which your proxy is running).

So that **should** do the job of getting past your Proxy.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

-1054

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Here is your problem, line 28 of FWT2_PO

double[][] x=wc;

You cannot copy arrays like that in Java. "x" would still refer to the original array.
Use something like this to copy your array wc to x:-

int[] copy = (int[])aArray.clone();

<EDIT>
:P Again javaAddict beat me to it.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

The IWT2_PO.transform method does not change anything to the first input argument. The first input argument to this function is immediately copied to a new variable. Also, shouldn't the input variable have a different scope anyway?

Incorrect, you are passing an Array, so it will be passed by reference and not passed by value, so any modifications done in that function to it would be reflected here.

Try out this piece of code, you will make out the concept:-

class ArrayTester {

  public static void modify(int a[]) {
    a[0]=99;
  }
  public static void main(String[] args) {
    int beta[] = new int[10];
    beta[0]=1;
    System.out.println("beta[0] = " + beta[0]);
    modify(beta);
    System.out.println("beta[0] = " + beta[0]);
  }
}

It will output :-

stephen@steve:~/Development/java/daniweb> java ArrayTester
beta[0] = 1
beta[0] = 99

<EDIT>

I guess JavaAddict beat to the next post.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Since you have not posted the code of the two functions I can only guess that the transform function mentioned in the commented line here :-

recovered=IWT2_PO.transform(denoised, 4, QMF);

is performing some modification(although it appears that it should not do so) in the value of the denoised array, (whose contents you are printing). Theres nothing strange in that, its normal.
Also reframe your way of asking questions, by the title of the thread strange java behaviour? , and also the way you posted, it appears as though you have claimed to have found a bug in the JDK, but it is the very basic concept of passing variables to functions (pass by value and pass by reference) which is at work here.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

-1052

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Please post your code in tags, its almost impossible to read without them.

Already had given her this advice in the first clone of this thread, but she just rather chose to just ignore it and created this one

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

First please help us try to help you by :-

  1. Putting your code inside [code=java]and [/code] tags, that way your formatting, Indentation (if any) is maintained and it also provides syntax highlighting so the code becomes more readable. you can read more about them here.
  2. Next tell us what you have achieved so far, you have pasted the code, which is OK, but tell us what output it is giving (or is there a compile error or a runtime exception occurring along with whatever the compiler or the JRE is throwing up at you) and what exactly it should achieve with sample output preferably so that we do not have to waste our brain cycles for these rudimentary things
stephen84s 550 Nearly a Posting Virtuoso Featured Poster

678

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Please paste the compiler error or whatever message you are getting. I mean how can we help you solve your problem if we do not know what the problem is ???

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

674

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

inFile is a non-static class variable while your main is a static method (which has to be in Java). And non-static instance variables cannot be accessed directly from static methods (to do so you will need to create an instance of the class and then access that instances inFile variable)

So you could either declare "inFile" as a static variable or a much better option would be just moving the declaration of inFile and console inside the main method.

BTW I really hope these are just your first steps in Java because you have actually reduced Java from a powerful Object Oriented Language to a Structured Language.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

well it has screenshots, etc... its not plain text

Yep had already checked it, thats why I had suggested the JOptionPane class for getting the dialog boxes, my bet is that he wants us to also post the code for the text processing stuff, which if this program is a part of some competition the thread starter is participating in, I do not think any one should even drop a hint on.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

670

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

-1050

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Try this link.
And if you still cannot figure it out then let us know.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

-1048

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Well Deven the error speaks for itself, let us look at your declaration of the method insert(Node,Node) (also I do not know why would you want two Nodes to be passed to the insert() method) in the Tree class: -

protected abstract Node<E> insert(Node<E> curr, Node<E> node);

Now you have declared this as abstract, no hassles here, since you want to force the extending class to provide an implementation, But the only insert() method I see in the child class "BinarySearchTree" is this :-

private Node insert(Comparable temp, Node curr) {

So you haven't actually provided an implementation for the insert(Node,Node) method of the Tree class and hence the compiler is complaining about it. Also I think you should get more errors when you are actually try to create an instance of the BinarySearchTree class.

One fix I see is changing the declaration of insert(Node,Node) in the parent Tree class to insert(Comparable,Node).
Also you are reducing the visibility of the method from "protected" to "private" in the child class, which **I think** should also cause problems.

Note I haven't paid too much attention to your design or the rest of the code, so you should be a better judge as to what solution you should opt for.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

i got this code, unfortunately it refuses to run.. please help..
Something is wrong with "A", dnt know what it is...

im not really good in making classes.. some gave this to me but i don't fully understand...

this is the code i guess...

Now how are we supposed to help you on this information given by you ???
If you are not good at creating classes, I recommend you purchase a good book like "Head First Java" or something similar which till teach you object oriented programming along with Java.
Also the "Starting Java" thread at the top as the name suggests has been created specifically for users like yourself who are just begining to do programming.

Also asking questions like the one above and asking us to fix it will only make you more dependent on others to get your work done and if you intend making a career in this field, I am pretty sure you do not want that.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

To quote the Javadocs of URLConnection to which I had already linked to in the previous post :

1. The connection object is created by invoking the openConnection method on a URL.
2. The setup parameters and general request properties are manipulated.
3. The actual connection to the remote object is made, using the connect method.
4. The remote object becomes available. The header fields and the contents of the remote object can be accessed.

So you need to first connect and then check whether the content is available.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

I checked the site, I think you will have to purchase the script from SmsNexus, if you want to change that.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

///verruckt24:::But more importantly whats this got to do with Java ?
I dont understand this...i want to access this from a java class

Verruckt asked that because you simply had forgotten to mention that fact.

I know that it can be done only by setting the Url..

I do not what you are talking about here, but to access files over HTTP you will definitely be needing the URL and URLConnection classes. They can be used connect to URLs over an HTTP connection.

Here is an example that deals with text files.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

this is for my project i have to create a gui for a pet store

You were creating a GUI for a Pet Store, so chances are you have have that class but haven't noticed it.

oh ok i understand you now yes i havent got a petshop class at the momment. so if i was to do this would it make much of a difference as i was doing a gui??

Well if you do not have anything resembling PetShop or PetStore, then I would actually recommend you create a new class by that name and assign it the appropriate responsibility (methods and attributes).
For example variables in your PetStore / PetShop class could be like StoreKeeper (A Pet Store has a Store Keeper) , ArrayList of Pets, etc.
Methods that you can have there include methods for adding pets to the ArrayList (to indicate new arrivals) / removing methods from the ArrayList to indicate Sale of Pets, Modifying the Store Keeper attribute, etc.

Now let us talk about your GUI, According to me you should separate out your GUI from your core logic which performs the processing. For example if tomorrow you have to switch to using the Console for running your program, if your code is too tightly coupled with your GUI you may have to rewrite your entire code.

On the other hand if your processing logic is in separate classes, and you have made appropriate methods available for performing a …

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

pet is split into 4 sections

What you are referring to is called the IS-A relationship.
ex:
A mammal IS-A pet.
A reptile IS-A pet.
Better known as Inheritance. I suppose your reptile, mammal etc are extending the Pet class.

Now in case you are looking where to put the ArrayList of Pets, check if in your Class structure you have any class resembling PetShop, the ArrayList would go there.

So then you can say the PetShop HAS-AN ArrayList of Pets that is the PetShop HAS-A Collection of Pets.

Got to call it a night here, bye for now.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Whenever you are trying to add a variable to a Class always check for a "HAS-A" relationship.

For ex: If you were to declare a Car class, it would definitely have the 4 tyre variables. Because A Car HAS Tyres.

So you are talking of adding the ArrayList to your Pet class, But does "a Pet HAS ArrayList (which is a Collection of Pets)" sound logical to you ???

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Honestly even I have not been able to encounter any such method of editing files. What I do is read the contents of the original file into a String or StringBuffer, using the methods of the String or StringBuffer class perform the required string manipulation on the file content, write this content to a temporary file, then delete the original file and rename the temporary file with the name of the original.

Although this work around would work, I would still suggest waiting to see what the likes of Ezzaral or Masijade would suggest, because I haven't really messed around with files as much in Java.
<EDIT>
Eeeps !!! forgot to mention ~s.o.s~ in that list, any way I guess you now know from the below post why I suggested you wait for either of their suggestions.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

The page looks wrong when the default font sizes are bigger, when used with smaller resolutions. Also check the settings in the display option in Windows Control Panel. Certain combinations of text box settings and font size or text size settings can cause that. Also note that scrollbars can disappear if the scrollbar size setting is set to a number larger than 17 with a large font selection

I guess I had missed this post.

And now I feel like a nut. :icon_redface: :icon_redface: :icon_redface:

Grrrr .... And the worst fact is all I had to do was check it in Konqueror and that would have been enough to establish I had made a mess of the Firefox or GTK settings somewhere.

Sorry for the trouble Dani, jbennet.

Well on the positive side at least I got to talk with the Queen of Daniweb, :P for the first time I guess.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Hi guys,
Noticed this problem with the User Interface for Sending private messages. I am kind of finding it difficult to describe so just attached the snapshot. Only problem is the UI looks a little messed up apart from that nothing else.


And I am also guessing this problem also might be faced by me only because of my (OpenSuse 11 & Firefox 3.0.1 on x86_64 on 1024x768 resolution ) combination.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster
System.out.print(iterator.next() + " ");

The above code is your problem. Here you are printing the object and not its contents, hence the reason for getting those strange values in your output.
The reason is because you see the above code is exactly like :-

System.out.print(iterator.next().toString() + " ");

And by default the toSring() method of the Object (the super class of all objects in Java) class is called which prints that stuff.

What I suggest is that in our Kontakt class override the method "toString()" method and return a properly formatted String which you would displayed whenever anyone made such a call on the Kontakt class.

An example would be like:-

public class Kontakt {
.
.
.
.
  public String toString() {
    return "Name : " + name + " Surname : " + surname + 
        " Number : " + number;
}

Note above code is just for illustration, I haven't compiled it or anything.

BTW use [code=java] [/code] to envelop your code. That way it will also provide syntax highlighting also.

Ezzaral commented: Helpful. +15
stephen84s 550 Nearly a Posting Virtuoso Featured Poster

@clueless101
Why did you put what you are saying inside [QUOTE] tags. Any specific reason for it ?
I remember you doing that in some other thread too.

Also just like javaAddict, recommend you read the Javadocs more often in fact whenever you are planning to use a certain class from the java library, it always advisable to go through its Javadocs and the Javadocs of the classes related to it, that way not only will you be able to clear your concepts about the classes you are planning to use, but you might actually discover a lot more valuable information along the way which could be useful in your future adventures with Java.

The following is the link to the core Java SE 6 docs:-

http://java.sun.com/javase/6/docs/api/

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

ipod touch 32GB,

I do not have even 10 GB worth of Music files with me :P


Sun or MicroSoft

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

You can use the Java Bean interface provided by Adobe for viewing PDF files in a JFrame.
From here you can download the Java Bean interface for an Acrobat viewer and here is the tutorial on how to use it.

Both of them found on the First Page of Google Search for "display PDF in JFrame"

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

no it didnt work.... i just want to display a text document in a JFRAME .... its okk, if its PDF or wat ever the type is,,, just a document....

You have lost us now, Do you mean to say that anytype of document (PDF, Word, Word2007, ODF, .... ) should be viewable in your JFrame or just a good old normal Plain Text File (the one we create with Notepad).

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Take a look at the Runtime class. Although I have not tried it with parameters, I think all you have to do is give the entire command to execute to its exec() method and it will return you a reference to that Process.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

My advice would be to confirm that really the file cannot be found. Take a look at the javadocs of File class. It has an "exists()" method using which you can really confirm whether the file can be read by your Java program or not.
If the "exists()" method returns false thens its confirmed that your code cannot reach the XML file but if ii returns true then I guess you have to check your XML file.
Now in case it returns false, you could try moving the xml file inside the folder which holds the your Eclipse Project (not the workspace, project folder is inside the workspace) and use just the relative path (i.e "blank.xml" if it is placed directly inside the project folder).

Also keep in mind the case of the filename in Java. Although I cannot confirm it since I am mostly on Linux, *I think* Java is case sensitive about file / folder names even though Windows is not, so also try renaming your file to all lower case and do the same while accessing it from your program to see if it works.

Hope it helps.

Tyster commented: Many Thanks for your help! +2
stephen84s 550 Nearly a Posting Virtuoso Featured Poster

thanks very much m8 i will try this 2moro hope i can get it 2 work thanks

Too much of an effort to type in the full words ???
Let me just quote some of the member rules here:-

We strive to be a community geared towards the professional. We strongly encourage all posts to be in full-sentence English. Please do not use "leet" speak or "chatroom" speak.

Besides being against the rules here and plain annoying, the opposite person can spend more time solving your problem rather that trying to understand what you are actually saying.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Table Tennis


PS3 or XBox360

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Considering the fact that you have a negative Rep and the fact that you have not even put in the slightest effort to do this assignment on your own made me think ten times before posting this.

The dialog boxes shown in your snapshot can be done using the JOptionPane class. Reading through it you should be able to figure out which dialog to use when.

And as you have not mentioned where you need help, I will leave it at that.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Thanks for the heads up on that one. Never imagined tinyurls could cause become that type of a menace.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

666 -> Number of the AntiChrist :P

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

21 out of 30

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

I am assuming you want to do that in an image, So check out the java.awt.image.BufferedImage class

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Gmail

Speakers or Head phones.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

this is just like that Michael Jackson Video!

I think you are talking about "Black or White"