BestJewSinceJC 700 Posting Maven

abstraction: a concept or idea not associated with any specific instance

So in computer science, I think that abstraction deals with what something does, not with how it does it. So saying that all Cars can drive, without considering more specific details of the Car, is an abstraction. I don't know if that is any more helpful than the wikipedia article, though. Perhaps some others can add to the discussion.

BestJewSinceJC 700 Posting Maven

No, I don't think there are non-trivial ways to do it with a standard grading system, other than the obvious ways which have been listed in this thread already. I don't understand the system you listed, but consider that since 90 and 100 are both usually considered A's, you can't really index an array to get the letter 'A' because what indexes would you use? 9 and 10, after division to get the tens digit, are both A's. So your array would not work without a lot of extra work.

BestJewSinceJC 700 Posting Maven

Sergio, my professor has put together some very good beginner Iphone programming (objective c) resources. He has his own slides, but he also links to other resources that he considers useful. If you are interested, you can do the projects there also, they follow the slides, so they are all do-able although they are all more difficult than they look. They start out by teaching the basics and fundamental objective c classes and then branch out into things like OpenGL for the Iphone, Core graphics & animations, etc. I've done all of the projects there so if you go that route and need help or examples for something, you can always post in this forum and PM me.

http://cs491f09.wordpress.com/

BestJewSinceJC 700 Posting Maven

It sounds more logical the way you have it - for example, to have the game class keep a list of what Objects are currently showing on screen, then when the player wants to attack, you can call getClosestObject() or something of that nature to decide how the a button will work. But keep in mind that from what you're suggesting, the Player class will still have to switch (or use a bunch of if statements) on the type of Object that getClosestObject() returns.

BestJewSinceJC 700 Posting Maven

http://en.wikipedia.org/wiki/Hash_table

If you have specific questions ask them and someone will be happy to help, but if you're going to ask things like that, use google.

BestJewSinceJC 700 Posting Maven

I hope your existence on this site is a joke. And obviously the U.S. government is hiding secrets, as is every other government in the world, just nothing like the crazy crap you are talking about.

BestJewSinceJC 700 Posting Maven

Alex:

"That's so pathetic and sad that such a potential person went down on prostitution just for money/pleasure. I feel sorry/sad for her!

She has lost almost any sight of virtue. I hope she'll regret it because it is a bad thing. (and to all who say it's nothing wrong: you're sick and blind of the sin you carry with you!).

Why the history is getting darker? Because people like staying in the dark, not seeing their sins... they don't want to be enlightened, they don't want to see their filthiness!"

Your idea of virtue isn't perfect. Taking a utilitarian point of view, since she was happy (she enjoyed the sex and achieved a higher goal: her degree) and I'm sure that her clients were happy, then the action is good because everyone is happy except you (and you don't count, your viewpoint has no basis in logic, it only has a basis in Jesus).

BestJewSinceJC 700 Posting Maven

Not to be repeating myself. . but call of duty came out recently. .

BestJewSinceJC 700 Posting Maven

Definitely not Mandarin. It is considered one of the hardest languages in the world to learn, so if you want to study computer science and not foreign languages, take something easier. And I should add that I have never heard of it having any advantage as far as cmsc degrees go.

BestJewSinceJC 700 Posting Maven

How do you use the IRC?

BestJewSinceJC 700 Posting Maven

www.eclipse.org
www.netbeans.org (or is it com?)
google

BestJewSinceJC 700 Posting Maven

I actually PMed Dani with this same question a few weeks ago, but I received no response. I didn't want to post it on the forums though. If you guys want to get a one time donation system set up, let me know when I don't have to go out of my way to give you money. But I imagine the real reason no one time system is set up is that it actually makes more money to set up a monthly system because people who might just make a one time donation and then never bother again will sign up monthly instead. Which is perfectly ok if that's the case. But you have to consider people like me who are students, or simply don't want to donate periodically, but would like to do so once in a while.

BestJewSinceJC 700 Posting Maven

I agree that it's getting to be a daft system. Some idiots using it to upset other people. If it's not worth moaning about - if it's not that important - if it's just eye candy - pull the plug.

Down-voting for the sake of it is really sad. If the system is to have any use, an user can check a contributor's rating to see how reliable/popular (etc) their advice/opinions (etc) are. BTW - that would be a bit sad in itself! To my mind, if this is unworkable or unfeasible, pull the mod - it has absolutely no value.

Maybe I misunderstand. But if I was a new member and I didn't know who knew what they were talking about and who didn't, being able to check the user votes percentage might be a pretty useful metric. According to Dani she was trying to create something so people know what thread to click on, but really, it seems to be displayed on the profile as if it was the same thing as 'reputation'. e.g. Rashakil has a pretty horrible vote percentage, but he is very helpful when it comes to many topics. The way it is displayed is misleading.

BestJewSinceJC 700 Posting Maven

The StringTokenizer class documentation says its use is discouraged in new code and to use String class's split method instead.

And you cannot cause a String to be evaluated as if it was a piece of programmer written code. Instead, you could use if statements, for example "if a + is seen, then call method X" etc.

BestJewSinceJC 700 Posting Maven

I guess, but without some degree of feedback, nothing can ever improve.

BestJewSinceJC 700 Posting Maven

If you have a file full of ints then you would just use

while(scanner.hasNextInt())

You would not use scanner.hasNext() and then the if statement, that is an extra unnecessary step. You could try something like

System.out.println("Enter an int");
while(scanner.hasNextInt()){
int i = scanner.nextInt();
System.out.println("Enter an int");
}
BestJewSinceJC 700 Posting Maven

Yeah, I understand how it works. I was saying 50 different members.

Also, jbennet, do you not like sknake? I only ask because I have made more comments about the voting system than he has, but you have replied to my threads much differently than to his.

BestJewSinceJC 700 Posting Maven

Yeah, so did I.

BestJewSinceJC 700 Posting Maven

It's like when a girl punches you -- it means she loves you. Except I'm not a girl. And I don't love you.

That was like when a comedian makes a funny joke. Except you're not a comedian. And that joke wasn't funny.

Anyway, why not just search my name and down vote every post? Don't be so uncommitted. Why should sknake be any more important than I am? And I don't really know who serkan is or care, so that reference is meaningless to me.

BestJewSinceJC 700 Posting Maven

The system is idiotic. Lets see how low we can get this post guys. -50?

BestJewSinceJC 700 Posting Maven

Your LoadStudents method doesn't make sense to me. You said while(s.hasNextLine()) but you never read anything in, so I'd think that would be an infinite loop. Additionally, you kept adding a new Student with the argument 'tempPerson', but tempPerson doesn't seem to be changed anywhere. You'll need to post more code...

BestJewSinceJC 700 Posting Maven

There is no reason you'd ever pass "this" as an argument. "this" just refers to the Object of the classtype that you are currently in. So if your class name is Car, and you say "this." anywhere within a method (other than main) in the Car class, then "this." refers to the instance i.e. the Car Object. So passing "this" to a constructor makes no sense, unless you are in a situation where composition/aggregation is involved. (And even then you'd typically not need to use the "this" keyword).

BestJewSinceJC 700 Posting Maven

Unless you enjoy proving things you're probably going to hate mathematical proofs, so take linear algebra. I'm just being a realist. You can learn a lot in either class, and Rashakil's argument for taking the proofs class can be applied to anything. Yeah, you can learn linear algebra on your own, but you can also learn proof techniques as well as specific proofs on your own. Learning either one on your own will be difficult, so take whichever subject interests you more. (I just highly doubt mathematical proofs interests you, but who knows).

BestJewSinceJC 700 Posting Maven

If you use Java's built in Stack class and Queue class, you can simply call the appropriate methods to add the items on and take them off. For both of them, to add an item on, you probably just use the add method, for stack, to take it off, you probably use pop(), and for queue, it might be called next() or get() or something like that. Just google for the documentation and then read what the method descriptions say. It really is that simple. Although if you don't know what a stack or a queue is, I would recommend building your own. Of course, using the already existing classes is much faster. If you want to learn how to build your own stack and queue, I will help you implement the necessary methods. But if you want to use the easier, preexisting Java classes, then you're on your own because there is already plenty of documentation and examples on the web.

BestJewSinceJC 700 Posting Maven

abccba

if you add each letter in order to the stack and the queue, here is the final stack and queue (in the order they would be popped off)

1. abccba
2. abccba

But looking at something random that isn't a palindrome:

abc

1. cba (stack)
2. abc (queue)

So the idea is that if you add everything to the stack and the queue, then pop off one letter at a time... if the letters are always the same, you have a palindrome, otherwise, you don't. So the first step in your program should be to add everything to both the stack and the queue. And the second step should be to iterate through the lists, making sure the letter popped off the stack is the same as the letter popped off the queue... otherwise, you don't have a palindrome.

Stack is a LIFO data structure and a queue is a FIFO data structure. So a stack is similar to a pile of dishes (last one put on the pile is the first one you pick off the pile to wash) whereas a queue is similar to a line - first one in the line gets to go first - (and in fact, British people call what Americans call a line a queue)

BestJewSinceJC 700 Posting Maven

oops, last post wasn't clear. When I said mods in the java forum, I didn't mean those listed, I meant the few who browse and post most often. (Which does include peter)

And haha @ almost all mods posting in here and few others.

BestJewSinceJC 700 Posting Maven

I haven't worked with Applets, but I think they work the same way as Swing basically? (Edit: confirmed - one whole point of JApplet is that it works with Swing). Use a JPanel or whatever the standard applet window is called, make the layout a GridLayout(x, y) where x and y are the 10x15 (the number of cells you need). Then add one JButton for each cell. Set the text of each JButton to "#" and color it blue or white depending on what it should be.

I realize that is somewhat undetailed, but I think you are going wrong by trying to draw all these rectangles yourself. If you use a strategy similar to what I mentioned above, it will be a lot easier.

BestJewSinceJC 700 Posting Maven

Post your relevant code and tell us what part you're having trouble with. If your problem is not knowing enough about Timer and Threads, then read google. We'll be happy to help you with specific problems, however.

BestJewSinceJC 700 Posting Maven

In your PM, you asked "where should I implement the check condition". Typically do not PM daniweb members, keep questions to the threads. But I will answer anyway.

After each turn, you will need to check for certain things. For example, after a player attempts to move, you will need to verify that they are not moving into check. Again, I highly suggest that you implement the "isThisCheck" method so that it takes a square (i.e. the array index for a position on the board) as a parameter. That way, the check method can be versatile and it can "pretend" the king is at any particular square and decide whether it is check or not for the king to be there. So you need the isThisCheck method for two things

1. To check that player 1 isn't moving their king into check, or otherwise moving a piece that causes their king to be in check. (i.e. there was a bishop in the way so the king wasn't in check, but then you moved the bishop, putting the king in check... that is an illegal move).
2. To check whether or not player 1 puts player 2's king in check.
3. Because of this twofold need for the method, you may also want a parameter that is used to distinguish which player's king you're seeing if it is in check or not.

Anyway, you'll basically have a while loop that continuously waits for players to take …

BestJewSinceJC 700 Posting Maven

http://www.csee.umbc.edu/courses/undergraduate/341/fall08/projects/proj5/HuffmanExplanation.html

That article explains the entire process, in detail, and it is the only resource needed to completely implement the huffman coding algorithm. I know because that is from my course website from Fall 2008 when I had to do that project.

BestJewSinceJC 700 Posting Maven

Overall I'll just say thanks to the mods because they manage to keep a forum this large in order, while still [supposedly] managing to like the site as a member, and I know how difficult that is. My favorites are basically the mods in the Java forum, surprise surprise. And Jbennet because he is a nice guy.

BestJewSinceJC 700 Posting Maven

My question for him is why he couldn't at least thinly veil the obvious COTS "my professor wrote this and then I pasted it on daniweb"... question

BestJewSinceJC 700 Posting Maven

Check is extremely simple actually. If any piece can currently move to the king's position, then the king is in check. Since you already have to implement the ability to allow players to move any given piece to any square (that their piece can move to), deciding if those pieces can be moved to the king's square should be trivial.

For checkmate, it is a little harder, but first decide whether the king can move his piece to a square that puts him out of check (by temporarily 'pretending' the king is at a different square, and seeing if he is in check still, and doing that for every square around him). If he can't, it still might not be checkmate. So now you have to see if there is any piece that can either be moved to a square that blocks the 'check' or that can take the piece that is causing the checkmate.

I suggest you make high usage of the "write a method that does one thing and one thing only" principle. Don't write spaghetti code because that could get you into a world of trouble here.

I actually might write a chess game in Swing when I get a chance just for the heck of it.

kvprajapati commented: cool. +6
adcodingmaster commented: this man is nothing....................................................But THE BEST +1
BestJewSinceJC 700 Posting Maven

Yes but what is the close method supposed to do?

BestJewSinceJC 700 Posting Maven

Sorry, I just edited my post. Confirm the last part for me?

BestJewSinceJC 700 Posting Maven

A binary search should eliminate half of the items each time a search is done. You can think of it similar to a dictionary. The way a binary search program would look up a word in the dictionary is it'd jump to the halfway point automatically. If the word there was greater than your word, then it knows your word is to the left of the word it is at, so it just eliminated half of the words. It continuous eliminating half of the words in this way until it finds the word it was looking for.

for more intuition to help you solve your problem, read this:
http://www.coders2020.com/can-we-do-a-binary-search-on-a-linked-list

edit: wait - were your instructors claiming that a doubly linked list implementation of a BST (which btw makes little sense to do) is better than a singly linked list implementation (which also makes little sense to do)? If so I claim that neither has any advantage over the other. Or were they saying something else?

BestJewSinceJC 700 Posting Maven

Cool. Mark the thread as solved please.

BestJewSinceJC 700 Posting Maven

I think bucket sort or radix sort is supposed to be the best for that, but I don't remember the argument there, so look into it those topics.

BestJewSinceJC 700 Posting Maven

The last part is definitely wrong. digit % 10, if digit = 245, will be 5. But digit never gets modified there, so your program will run forever. What you should be doing is using a combination of % and / .

BestJewSinceJC 700 Posting Maven

Did you add the helpMenu to your JPanel? You didn't provide enough code to see what's going on. The method you posted looks fine but I'm not sure if you ever added the helpMenu (that was returned) to anything. PS after you add helpMenu to the JPanel you might want to call revalidate()

BestJewSinceJC 700 Posting Maven

Again, that depends on what you mean by 'closing an account'. Typically you'd close an account by removing all the money from it, i.e. withdrawing all money from your bank account, then just deleting it or somehow marking it as closed. But we are just programmers, if you need help with implementation or errors that's fine, but I doubt you'll find much help on how to interpret your project's requirements. Is this for a class? If so speak to the professor.

BestJewSinceJC 700 Posting Maven

if e.isSelected makes no sense because you already know which item is selected, and you already know that it's selected because otherwise the actionPerformed method wouldn't have been called. And if you want help writing the rest of the method you should probably mention what you want it to do, which you never said. Do you think we know what your program's requirements are?

BestJewSinceJC 700 Posting Maven

What is a consolidated account? Just an account under both names? What do you have to do to 'make an account consolidated'?

BestJewSinceJC 700 Posting Maven

What is subpanel? Up till line 9 your code seems ok to me, after that I have no idea what you are trying to do.

BestJewSinceJC 700 Posting Maven

A text based table? Or a GUI table? For the first use System.out.println() in a for loop to print your items to the screen, for the second, you can use a JTable and there are tutorials for that on google. In either case, if you are new to Java, you should look into one of our basic java tutorials stickied in this forum, because until you cover how to use methods and other topics, you won't get far.

BestJewSinceJC 700 Posting Maven

If you have purchased a version of Windows, if you then use a different, even stolen version of Windows but can prove that you purchased it previously. . it is still illegal, but highly unlikely that you would ever be prosecuted for it. The same as if you bought a CD before, lost it, still had the receipt, then downloaded the entire thing off the internet.

BestJewSinceJC 700 Posting Maven

Umm you need a dynamic programming algorithm that uses subproblems and memoization to solve this adequately. Pretty sure all of the "solutions" listed in here are wrong.

BestJewSinceJC 700 Posting Maven

Considering mods aren't ever bots, I think it'd be safe to write a quick script to let them do their job quickly. (It can't be that hard to write a check for the user's usergroup?)

BestJewSinceJC 700 Posting Maven

Well, this isn't really the correct forum for job advice, and furthermore, most of the members here are either from the US or the UK.

BestJewSinceJC 700 Posting Maven

Yes, there is a problem, because these threads could potentially access/modify the data at 'unfortunate' times. For example, thread 1 modifies variable A to 2, then thread 2 immediately modifies A to 3 (as a simple but stupid example). Another possibility being that threads 1 and 2 are both using variable A in a series of operations. So both threads want A to maintain some state while they do those operations, but the other threads modifies A, which interferes.