Terry Flint

Greenhorn
+ Follow
since Sep 01, 2013
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
1
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Terry Flint

The issue above has been resolved by the way, though I did have to resort to re-installing to get around it.
6 years ago
Also worth noting is that this is now happening every single time I open Eclipse. A pop-up window displays saying "Building workspace has encountered a problem. Errors occurred during the build". Clicking the details button will reveal this message:

6 years ago
I 'm currently not getting the server failed to start message anymore for some reason, but I'll be sure to record it if it happens again today, which I'm sure it will. Nevertheless, the most recent console output when I tried the Eclipse method was:




Also, in cue this is of any use, I've been trying out your wildly recommendation. I may not be keying in the class path entirely correctly. Maybe you can spot the problem from this image where I have all the relevant files open (I've temporarily moved them to the desktop for clarity's sake).
Here is the link: http://postimg.org/image/fkc9jvxr5/

6 years ago
Also, this is what I keep getting if I try to run a JBoss project in Eclipse by going Run As > Run on server

"Server JBoss 7.1 Runtime Server failed to start."
6 years ago
Just to add further confusion (sorry), a friend linked me to this video: http://www.youtube.com/watch?v=VzxLTGW2gqE and advised me to use 7.1.1.Final instead. Now I have jboss-as-7.1.1.Final downloaded and all the appropriate screens working. I was even able to make a management user on localhost:9990 this time, which is further than I got before. So, how would I adapt it for version 7.1.1.? I'm assuming the path you recommended for 6.1.0 wouldn't work anymore.
6 years ago
Hi guys!

I'm trying to get the HelloWorld from chapter 1 of JBoss in Action to work (chapter available free here: http://www.manning.com/jamae/). First of all a bit of context. I am running a Mac Powerbook pro laptop, using the native Unix OS. I'm running maven 3.2.1 and Java 1.7.0_25. I've downloaded jboss-6.1.0.Final. I've changed permissions on the bin/startup.sh file to chmod 777 and when I go to localhost:8080, I do indeed see the appropriate JBoss screen. So, all of that seems dandy. I really wanted to upload images just to show, but this forum seems to only allow URL images. Did I miss something there?

Where I'm having trouble is the exercise where I need to deploy a Hello World program. As far as I can tell I have created a directory structure exactly like the one he wants. However, when I run this command:


Unless I've misunderstood something, that translates to this on my computer:


This is the result produced when I run the command from inside the helloWorldBuild folder:


So, where should these javax.servlet packages it seems to be looking for be? I didn't see them referenced in the code from the book. Are they meant to be in the JBoss directory structure, or should they have been put in the helloWorldBuild directory at some point?

By the way, if this is going to be too much, I would be quite happy to find a step-by-step guide that will teach me how to use JBoss with Eclipse rather than the command line. I'm told this is supposed to be easy, but I'm just not finding it so. I really appreciate your help.
6 years ago
Okay, so that's not exactly a short example, but I was afraid of losing context, since the changes aren't just in one place.
7 years ago

Campbell Ritchie wrote:Please show us a simple short example of what you are trying.



Well, for starters, here is an example of how I misunderstood what Randall was saying:



7 years ago

Campbell Ritchie wrote:Have you made any progress with your line?



How pathetic is it that I still can't answer this in the affirmative?

I've found examples of what I was looking for that I was able to tweak, but I never managed to adjust this particular piece of code the way I wanted to.
7 years ago
I'm having difficulty figuring out how to draw a line with two mouse clicks. Every bit of sample code I've seen so far seems to either use a click and drag method, or create one long zig zag going through various selected points. I'm pretty sure it's a matter of knowing how to use the appropriate mouseListeners, but I can never seem to modify them in such a way as to get what I want.

Below is the code I've been trying to modify, which creates one line at a time using a click and drag approach. I've tried to change it in various ways, such as changing mousePressed to mouseClicked or adding in another MouseListener, and various similar approaches. I need some help with this.


7 years ago
Simple question here. I'm wondering how to use the getXOnScreen and getYOnScreen methods from the MouseEvent class mentioned here. As far as I understand them, they're supposed to return ints for each of the co-ordinates for where the cursor is at a given pint in time? Is that correct. If so, that seems incredibly useful, but I'm not sure how to actually implement them. I see you can't just employ them by simply importing the MouseEvent class in java.awt, which I had kind of hoped would be the case. I have two classes below designed to display a 400*400 paint window. If possible, could someone give me an example of one of those methods used in this context? If not, any example of them working is fine, as long as a simpleton like me can understand it .



7 years ago
I had my first lecture on algorithms today and the instructor had an exercise he wanted us to work on in class. I thought I'd be able to get around it, given it was first lecture after all, but I was one of the ones who couldn't complete it (not quite the only one). First off, here's the simple example he gave to get the idea into our heads:

Write down a grid, say, 4£4, of the numbers 0, 1, 2,..., that has the property that each number in the grid is the smallest number not appearing above it in the same column, or to its left in the same row.

Naturally, this produces the following table:

0 1 2 3

1 0 3 2

2 3 0 1

3 2 1 0

So far, so good. He then extracted the idea to make a more general algorithm:

Write down an n * n grid, of the numbers 0, 1, 2,,..., that has the property that each number in the grid is the smallest number not appearing above it in the same column, or to its left in the same row.

He asked us to code this in java. Obviously, he wanted it to be a method which would have the parameter int n.
This n will then be used to produce a grid of n*n. I don't know if a 2D array or a 2D ArrayList is more appropriate for this.
I've now started to think an ArrayList makes more sense, because I don't even know if I can reassign an array to a different size.

I am frankly to ashamed of the abominable coding I tried to do in class to show it, and I want to start from scratch.
I don't want outright solutions, but I do want hints on how to do this. I imagine I will be needing two nested for loops to cycle through the array/ArrayList.
I notice that if the square is at [i][j], all the left cells will have the same i value and a lesser j value, and all of the above cells will have the same j value and a lesser i value (I think).
I thought I'd be able to use booleans to check for whether a cell was above or left, but the way I was doing it, that required associating a boolean with an int, which just made no sense.

Now, since facepalming and headdesking doesn't seem to work to well, I thought I'd admit that I need some help.
What should I do? By the way, links to online courses and documentation on algorithms like this would be appreciated if they are available (Beginner level stuff obviously).



7 years ago
I believe this is a more acceptable version than what I had before.

7 years ago
Thanks everyone. All the extra reading was very informative, and now I think I have a better understanding of exactly when to comment my code. Basically, if it adds to the explanation then go for it. If it's redundant, don't bother.
7 years ago
I'm a little confused about something. As far as I understand, there is a rule that all public methods must have javadoc comments, and as far as I can tell an actionperformed method within an action listener is public. Nevertheless, I can't help feeling a bit unsure about whether to comment them or not. Something about it seems incredibly counterintuitive. The fact that I can't find any examples o it also puts me off, so I'd like to know one way or the other.Are you supposed to write javadoc comments for actionperformed methods?
7 years ago