verruckt24 438 Posting Shark

No, I don't love to throw myself at anybody.

Do you love winter ?

verruckt24 438 Posting Shark

@masijade : And I forgot to mention one thing, it's not a database he is connecting to, rather he hadn't mention to what program he was connecting at all, thats the reason I felt it to keep very generic in my post. And quite wonderfully, thats what the case is I guess, from his previous post.

verruckt24 438 Posting Shark

Ever heard about deserialization ? You can deserialize a previously serialized object, so that it represents an object exactly matching the one that was serialized.

verruckt24 438 Posting Shark

@masijade : Actually I didn't even take an evaluative look at his code and just assumed that he was saying the same thing what you did.

verruckt24 438 Posting Shark

Yes masijade gives a more specific answer in your case.

PS : And yes crazy does know, that verruckt = crazy in German, actually I got crazy translated in german, from google langauge tools. ;)

verruckt24 438 Posting Shark

@umairsario : Do you think you have added any thing in your post apart from whats already mentioned ? I appreciate you are trying to help someone but if you care to look at the post of masijade, he exactly mentions the same thing. You, actually degrade the value of the solution by not writing it in code tags, and making it even more confusing to understand. masijade had hinted towards the solution using code tags.

EDIT : Not to mention that sillyboy already mentions the disadvantage of posting without code tags.

verruckt24 438 Posting Shark

If you see the javadocs for ConnectException class, it tells you that this could be typically due to the fact that no process is listening on the port. Make sure the port number that you are using (32133) is being listened by some process.

verruckt24 438 Posting Shark

Instead of asking us you can write out the main method and other required methods for each of your assignments one by one and (as mentioned) test the code for multiple inputs. If the outputs exactly match what you have been expecting the program to do to the input then the code, you can assume, is correct.

This will not only be a mechanism to "test" your assignments but, this will also help you understand your code better, where does it fail and why does it fail, if at all it fails. It will also help your deugging skills if you are required to correct a failing program.

verruckt24 438 Posting Shark

@javaAddict : Yes, you had already given him enough hint for him to workout the solution, but I observed that he was busy talking about the modulus then too. Thats the reason I mentioned him that he needs to look at whats sited to him.

verruckt24 438 Posting Shark

@Cohen : May we know the reason behind the two questions, in your previous posts ? I just wanted to figure out where we are going with this. Whats shortlisting Member of the Month or it's process got to do anything with how frequently the Newsletter comes out or when does it come out ?

verruckt24 438 Posting Shark

Firstly gabec94 I would like to note a few things that I have observed while going through this thread. You are not taking any heed of the advice and help given to you and just want to stick to the method of doing something in the langauge that you have worked with in the past. While learning different langauges you will come to know that you need to appreciate each langauge for the things that can be done with it and do them the way they can be done in it.

>I would like to work with modulus because that is what I have learned, rather than teaching myself new things
If this is the case then why learn new langauges at all ?
Also even if this is somekind of assignment that you are absolutely being made to do in the Java langauge, still, why not do it in the proper way.

Coming to your problem : I suppose you want the user to insert to an n-digit number and then output to him the n digits separated by spaces.
You don't need to go to the "using-modulus-to-separate-each-digit" method over here, as it would involve more coding on your part, plus the String class of java offers much easier mechanisms to do this same thing, not to mention that treating a string like an integer and then again converting it to a string doesn't seem to be a logical flow.
To explain what …

verruckt24 438 Posting Shark

I would go with the following logic:

if no integer portion is provided, check if decimal is given along with atleast one fractinal portion of the decimal, also forces user to give atleast one digit
to avoid the empty string NumberFormatException when user provides ""
OR
if a single integer portion is provided, you may or may not give a fraction portion with or without a decimal "."
match the precision and scale first as a decimal number, pretty much solves avoiding NumberFormatException

if(Pattern.compile("^(\\d{0," + maxIntegralDigits + "}(\\.\\d{1," + maxFractionalDigits + "}))+|(\\d{1," + maxIntegralDigits + "}(\\.\\d{0," + maxFractionalDigits + "})?)$").matcher(fieldValue).matches()

which turns out to be

^(\\d{0,18}(\\.\\d{1,6}))+|(\\d{1,18}(\\.\\d{0,6})?)$

for an (18,6) (precision+scale, scale) representation

Atleast check the dates while posting, the last post on this thread is more than an year old !!!

verruckt24 438 Posting Shark

@nav33n : I chose not to give him the exact query but describe what it should be like and let him do the work.

verruckt24 438 Posting Shark

Use a query that groups users by status and in the second column put their count. Try to form a query for this.

verruckt24 438 Posting Shark

For you first question, read the tuttorial in the JSP section, by peter_budo. Extracting only the information of some specific column depends on the query you write.

For your second question, search this forum as there have been several queries about crawlers in java. They have been given enough help/pointers.

For your third question, search google.

verruckt24 438 Posting Shark

Such databases are often only sold commercially, if you are ready to pay a fee, ip2location has just what you want.

verruckt24 438 Posting Shark

Depends upon how much data you would want to store. varchar is a choice, tinytext - max 255 chars, text - max 65535 chars are other options. There are also mediumtext and longtext .
Choose according to your needs. A complete summary of MySQL field types can be found here

verruckt24 438 Posting Shark

@masijade:

but still it shows the K meanspoints class needed error

Thats the error he is looking to sort out. And look at the solution he is trying,

I also tried with vector class, but it shows error.

Thats a simple error he has been asked to chuck off by his tutor. That explains my previous post.

verruckt24 438 Posting Shark

From your program I don't see any OOP concepts into play here. Create a class Person, create a class Relation which determines the type of relationship (this could be a string representing the relation). Create a class Association that has a Relation object and a Person object. Then you could model your application accordingly.
Example : Imagine two brothers being married to two sisters. So here you have some people with multiple relations within them. Person A is the brother-in-law of Person B, Person B is sister-in-law of Person A. To depict this situation in your model, you have two person objects A and B. You have two Relation objects "brother-in-law" and "sister-in-law". Now Person A has an Association object within itself, which itself has a Relation object "brother-in-law" and Person B objects' reference.
I hope you get it.

verruckt24 438 Posting Shark

Why do you think your trainer gave this to you to be debugged, only for you to pass it onto somebody else, naah, he wants YOU to do that, so probably there's something in it that he wants you to learn. Step through the program, see whats it expected to do, observe what is actually does, do some figuring out using dry running etc to find out the reason for the difference. I think this help should be enough for you to start working on it.

verruckt24 438 Posting Shark

@rapture and @ithelp : You have given him links, but he doesn't want hints, pointers, where to start from help. All he wants is for us to give him the solution. So I guess he isn't going to buy that.

verruckt24 438 Posting Shark

Detail out your problem, I ain't getting from this description what it is that you want to do exactly.

verruckt24 438 Posting Shark

You need to have a member variable of type Other in your Array class, then in the constructor you initialize it to whatever is being passed to you. And then you make use of this variable to access methods of Other class.

Note : The methods of the Other class that you need to access from Away.java should be made public or have a package scope and Away and Other should share the same package.

verruckt24 438 Posting Shark

>I'm not looking for instructions on how to learn the code, just 'mini' programs that I can program so that it helps me learn the language.

Learning the code and learning the langauge... Hmm Will you be able to tell the difference to me ?

If you learn the langauge ground up, learning all the basics such as Classes, Abstract Classes, Interfaces, Threads, Exceptions, JDBC, Serialization, Garbage collection etc., you might be able to cook up enough ideas in your brain to try programs based on or related to these concepts.

verruckt24 438 Posting Shark

Did this miss your attention or you ignored it ? Cause it's really difficult to miss that.

verruckt24 438 Posting Shark

i am developing a small record management application for a school. Tasks will be Add Record, Edit Record, Delete Record, List Records.
Each Record contains: Name(max 100 char), Age, Notes(No Maximum Limit)
No database should be used. All data must be stored in one or two files.
Listing records should print the names of the users in alphabetical order.
so plz give solution to my problem......

Another post but the same demand. Read the rules which you said you would adhere to when you registered for this forum. Nobody here is going to give you the solution. I hope you understand that. Show us some effort from your side first. Ans ask specific questions. Then maybe you can hope that someone will contribute towards solving your queries.

verruckt24 438 Posting Shark

>i want to Write a program to download a website from a given URL
Umm.. Well you can proceed...

> plz give me solution for this as early as possible its urgent......
What ?? Didn't you just said YOU were going to write the program ?

verruckt24 438 Posting Shark

You may want to take a look at the book named Java I/O its available in amazon.com, FatBrain

Why only I/O, if he is starting Java, he should learn the basics which could be found, written well, in any beginning Java book. Rather books such as the one you mention cover a specific area in detail, and they, obviously assume some working knowledge of the langauge. So instead the OP should go for these only after a good grasp of the basics.

verruckt24 438 Posting Shark

No, you cannot create a trigger from inside a stored procedure.

The thread has already gone silent for almost 3 months, the last post is on 9th Dec'08, do you think the OP is going to return ?

Or is it just to advertise those links ???

verruckt24 438 Posting Shark

Can anyone think on any programs ideas that I can create to practise?

Hmm...Well yes, we can do that, but may I know one thing before that, why can't you do it on your own ?
Cook up some ideas just like that, they could be anything, and start working on it.

verruckt24 438 Posting Shark
public PaymentDDJ();

This is wrong, you need to provide a method body to the constructor. Also this is wrong :

String header = Format.justify('l', "NAME", 12) +
Format.justify('r', "MONTH", 15) +
Format.justify('r', "CURRENT BALANCE OWED", 15) +
Format.justify('r', "INTEREST OWED", 15) +
Format.justify('r', "PRINCIPAL OWED", 15) +
Format.justify('r', "TOTAL MONTHLY PAYMENT", 15) +
Format.justify('r', "REMAINING BALANCE", 15) + "\n";

// Instantiate the window objects.//
name = addLabel ("Name" ,1,1,1,1);
purchasedprice = addLabel ("Purchased price $" ,2,1,1,1);
nameField = addTextField ("" ,1,1,1,1);
purchasedpriceField = addTextField ("0" ,1,1,1,1);
enter = addButton ("Enter" ,1,1,1,1);
balance = addTextArea (header ,1,1,1,1);

You cannot have these statements outside a method body, they need to be inside some method.

verruckt24 438 Posting Shark

And, if you don't want to be mean, why not just give someone good rep one day and bad rep the next?

I absolutely agree here with ddanbe, there's no point in giving someone a good rep and then just waiting for a chance to bad rep him, just for the reason that you want to split your good rep points. Also it won't be possible for anyone to remember who all you gave good reps and who all from among them did not deserve all of it so who all you should just go and give a bad rep.

Also as mentioned here, I too agree with the fact that one should not be too obsessed with the numbers - whether it is the solved threads, rep power or reputation points - but all I wanted to mention was that, that there should be a way to tell an excelltent post from a good post if at all the rep giver wanted it to. And yes, this can certainly be demonstrated from a comment, which in one way is absolutely fine, but just sometimes and really just sometimes, and this happens with the regulars too, that you take a look at the reputation points first and not the overall +ve reps, and not that this matters too much but I just felt it worth mentioning.

verruckt24 438 Posting Shark

Read the documentation given on the URL mentioned, you can either use it directly or extend the classes yourself to add customised behaviour.

verruckt24 438 Posting Shark

Yes, ddanbe comes up with a very good solution here. Yes one might think about a comment in either a good or bad way but there is a certain degree to the goodness of the comment and to the likeness of the rep giver. Currently there's no way to distinguish between a good a great and an excellent post. Why can we not have such varying degrees to it.
As a matter of fact I would have given an 'excellent=100%' for this suggestion from ddanbe.

verruckt24 438 Posting Shark

@superstar288: You have been given enough hints on where and how to make the array of Seats, also on the attributes about the Seats etc. I suggest if you are still not able to figure this out then you go read some Java Tutorials on classes, array and how to make arrays within classes etc.

verruckt24 438 Posting Shark

Like it.

Sailing ?

verruckt24 438 Posting Shark

Yes would like.

Do you make it nice ?

verruckt24 438 Posting Shark

rid die ire

tricks

verruckt24 438 Posting Shark

592

verruckt24 438 Posting Shark

Superstar288 sent me a PM mentioning this:

Hey thanks for your quick reply once again, i understand what you mean. but can i construct that array in the seat class like int[] upper= {1,2,3,4,5,6,7,8,9,10}; for the seats?
or would i have to make it seperate?? sorry im only learning java not had 2 much experince you see.

Create a Seat class and then create an array of Seat objects the same way you would create one for String or int etc.,

Seat [] seats = new Seats [10];
verruckt24 438 Posting Shark

Well, thats the game...

Is garfield throwing his arms up ? .........................(Or just spreading them in joy)

verruckt24 438 Posting Shark

-1147

verruckt24 438 Posting Shark

As I mentioned in first post you need to model your program close to the real world scenario. In our world a Theatre is made up of a collection of seats, so what you can do is, make a Seat class as suggested in the previous posts and then you could have an array of the Seat objects.

verruckt24 438 Posting Shark

Yes recursion is very efficient in case of trees. I suppose from your question in the first post that you want to know how to load the tree.
Well this depends on what purpose you want to use the tree for. If you are using the tree for sorting, you populate the tress in this way.
First element becomes the root, then for every element after that, we (recursively) decide it's position depending upon whether the element at the current node is greater than or less than the element to be inserted. If the element to be inserted is greater than the element at the current node we move to right of the current node else to left node of the current node. For elements found to be equal we can decide either way, in this case we decide to move towards the left node of the current node.

Applying the above given algorithm to the numbers you have given we proceed to build the tree this way:
Sequence of numbers : 1,5,3,4,2
1
5
3
2 4
Here number 1 is at the root, number 5 to it's right node, number 3 to the left node of 5, number 2 on the left node of 3, number 4 on the right node of number 3.
Now a normal Inorder traversal of the tree would yield you a sorted list.

In inorder traversal we first visit the left node,then …

verruckt24 438 Posting Shark

What I meant was, if your seats do differ a lot in attributes other than price you would want to have a different class for each of them, say, UpperCircleSeat, DressCircleSeat, LowerCircleSeat etc. where all of these could be deriving from one common Seat base class. But as you mention that it's not the case, you can just have one Seat class with attributes such as Price, Type (UpperCircle,LowerCircle etc), isBooked, SeatNo which could be combination of row number and seat number within that row say, A4, F5 etc. These are all the attributes that come to mind.

verruckt24 438 Posting Shark

It's a bit difficult to give an example of memory leak, because it almost always happens accidently without the developer even knowing it. Memory leaks bugs almost always plant themselves so subtly that they are often too difficult to trace even for an experienced programmer and the only way he comes to know about them is through the (in)famous "segmentation fault" which is when the system runs out of available memory.

@shasha82110: You can mark the other thread as solved so people know where to post.

verruckt24 438 Posting Shark

Depending on the attributes that different seats may have you can choose to either implement them as different type of seats or keep a 'type' attribute in the Seat class that gives their type, if they do not differ much.

>also i have to make sure that the seats are not doubled booked
To avoid double booking you can keep a flag isBooked in the seat class that tells whether the seat is booked or not.

I assume you are acqauinted with OOPS concepts, if not you can read about that on the net.

verruckt24 438 Posting Shark

Why not you can go ahead and start one. I am sure there are enough C/C++ "gurus" who might be able to throw much more light on that subject and also bring out a few things that many of us still don't know.

verruckt24 438 Posting Shark

You would have to do the same that you do in your previous effort in the main method. To detect the button click you would have to implement listeners in Swing and then do the same task within the method for e.g actionPerformed().
Read about the Swing Event Delegation Model, ActionEvents, Listeners etc if you are new to those.

verruckt24 438 Posting Shark

What are the criteria that one could be selected for the title. (MotM) Is it that it is only the number of posts that count ? Posting in the Java community I have come across several members that might not have those many posts, but have been a real help for others, the sheer number of their Solved Threads and Reputation tells the story. One such member has already been named, Ezzaral, He has been a revelation with all his posts, masijade, stephen84s and javaAddict are other such members.
And I haven't been in the C++ forum that much but around there, niek_e seems to be one such.

stephen84s commented: I second niek_e, hes the one who gave me my first good rep :P +6