Dave McQueen

Greenhorn
+ Follow
since May 22, 2009
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Dave McQueen

For this it sounds like your source isn't set up properly. If you look at the little icon for your class, do you see a "J" (for Java class) beside the class name as having a blue outline? If it's a "J" with a blue outline as opposed to a solid blue "J" (where it's all blue, not just the outline) then it means Eclipse isn't finding your source, even though it should!!
To fix this right click on your class, Choose Build Path -> Configure Build Path and choose the Source tab. Make sure that there is something in here as it tells Eclipse where to find your source (as I understand Eclipse) and that the folder points to your source file. Sometimes it just stays at <root package>/src even though it should change to where you've put your class e.g. <root package>/Implementation/Pages. You would therefore need to remove this <root package>/src folder and click 'Add folder' and choose <root package>/Implementation/Pages.
I don't know whether this is a Java necessity or an Eclipse one but it causes many problems!
I too am getting the same sort of error when running Selenium. Did anyone find a solution to this? I'm running on Ubuntu 11 so this is probably why the problem is occurring. However I'm not sure what the systemroot is, how you set it, why you set, what you set it to or where. Basically if someone could offer some help here you'd be shining a light on a very dark place!

Dave
13 years ago

Kevin Workman wrote:
One of the nice things about programming is that you never have to assume anything. You could have thrown together a simple program that tested your assumptions in less time than it took to write this post and wait for a reply.



Kevin, you're ASSUMING that I have the JDK, JRE and IDE all downloaded or if not, would be able to download them all before I got a reply - which I have to say, was very, very quick.

Incidentally, you're right, I do have them and that was a pretty safe assumption and I realise I could have done that. DOH!
Thanks for your responses folks,

Dave
14 years ago
Hi,
I'm rereading parts of the SCJP study guide for Java 6 book by Bert Bates and Kathy Sierra but am confused about something:- the book says that 'As of Java 6, the for loop took on a second structure'. Wasn't the enhanced for loop new to Java 5 and not 6? I'm reading all over the web that this is the case, so is this just a typo (page 345 beginning of paragraph Using For Loops)?
As usual, your help is appreciated,
Dave
Is List <? super Dog> someList = new ArrayList <Dog>(); allowed even though the instance is not a 'super' of the generic type? I assume it is, since the whole point is to use things polymorphically, but as those annoying company-men types say "When you assume, you make an ASS of 'U' and ME". Brilliant.

Incidentally, I had to put apostrophes around the 'U' since the application assumed I was using the letter instead of the word in the second person. Kind of ruins the moment...
14 years ago
David, thanks for your response - useful stuff.
I guess I'm just wondering, why isn't there a tool or application that allows you to see the java rules and data flow in some sort of flow-chart way, diagrammatically, pictorially, more abstract and general but quicker to read through, rather than having to go through code line by line, then through configuration code by line, and backwards and forwards?
It'd be great if a java application could be defined like this somehow (not sure if it can), with a series of flowcharts, perhaps at different levels, so that you could perhaps double click on a 'diamond shaped boolean section (like the parts that have 'yes' coming off one corner and 'no' off another)' and 'zoom in' on the code that's present there?
Does that even make sense? It just feels unnecessary to have to read through code when all you want to see is *where* the application can go, and not necessarily *how* it goes there (in terms of code).
A benefit would be that the business wouldn't need to understand the code and could just write flow charts, and the IT function wouldn't need to understand the business (which if my work is the norm, is pretty much a definite). They could define the business rules using a flow chart and the programmer could 'zoom in' on each flow chart section and write the code.
I'm just surprised something this obvious doesn't exist?
14 years ago
Hi,
I'm not the most experienced or skill java programmer (although am certified) so i'd be interested to have the opinions of others who are if possible?
I currently find it extremely difficult to understand large scale jEE applications. For instance, in my workplace we're given applications that we're 'reps' on, and we're expected to understand how they work. However the applications are typically, as an order of magnitude estimate, 100,000 lines of code in length, with large chunks being reused. What's more, the application in the file system is not in order of use, it's stored alphabetically according to packages then classes.
The task to digest this conceptually can be conservatively compared to taking a book the size of Lord of the Rings, cutting up all of the paragraphs, messing them up, then giving these to someone who's never read the book to sort them in the correct order and/or figure out what the plot is and who the main players are.
I'd be interested to know, why this problem exists? Is OO code supposed to simlify this? I actually find OO makes things harder to understand than procedural sometimes as for a particular use case for example, it's hard to see what method in this use case, affected my object of interest, as it's correctly been reused throughout the application. Then you have to repeat this to find the method calling the method that you've found, and so on etc.
I've been unsure about asking this question previously in case it's trivialised with a response along the lines of 'you should always be able to tell what method is calling your object in your particular use case', but I just don't find this is the case in practise. Plus with decoupling structures like Spring, Hibernate and Struts, this kind of thing can be even harder.
So enough preamble, does anyone know whether this problem is due to bad design, a lack of tools to simplify this, like something that abstracts and generalizes a code and splits up parts like a flow diagram according to use cases, or something else entirely?
Idle speculation to wildly imaginative visions of future technologies - and everything in between - are welcome!
14 years ago
That's an excellent idea. Exactly along the lines of what should happen.

Wasn't even aware that there were such listeners. I should really be thinking more loosely.

It would potenially be possible then to track a value (not a variable) all through it's 'life'. That would mean something could be tracked from the back end, for instance, to the front end and treated this whole process could be treated almost like a single process.

I'm liking the sound of this...
14 years ago
David, the wiki is something we keep trying to get off the ground here. Hopefully with Sharepoint it will finally take off.

I will look at the Mylyn product. We use RAD7 so since it's built on Eclipse so it should still work, hopefully.

Michael, thanks for that. You've hit on the exact method that I use: I check to see where the value is in the call stack, then put a break point there, run again then check where that variable came from, then repeat. This can however prove difficult with values in the session scope however e.g. there's a value being read of "0.00584" which I find in the session object. To find out where this is added to the session object, rather than check references in the workspace, I put breakpoints all over the place and each time the application stops to start debugging, I check to see if it's in the session or request etc yet. If it's not then I just move on to the next randomly-placed-I-should-add breakpoint, and check again and repeat this until I find it. When I do I place breakpoins in all the references to that particular variable and then start the process all over again.

The problems are that it's very time consuming, and it depends on me being sure I've found all the references to that particular variable again (which I might not have as the spelling might be different, or the programmer might have put the method over two lines or something).

The call stack is useful for telling me where the methods originate, and their variable, but not the variables values unfortunately. It's these elusive things that I've yet to find software or methods to track successfully.

I'm convinced there's an excellent opportunity to develop software that does just this, and make some money from it, or even just make my job easier! Unfortunately I severly lack the knowledge or experience. Feel free to take this idea and run with it. Just so long as you make my job easier!

Thanks for your help again folks,

Dave
14 years ago
David, thanks again, this is really useful stuff. It's highlighting the source of the pitfalls and making me rethink what's perhaps at fault here.

I'm not sure how much thought goes into either creating our applications from an architectural perspective, but think it can't be that much as I imagine that to extend or modify an application with this in mind, thorough documentation should be present to give the new developer a thorough grounding on not just how the application works, but how also it's supposed to work. There's only a few apps here that I can genuinely say that applies to, that there is anything near the information necessary to figure out what the code does, without painstakingly going through it line by line.

Ruby's something I have to learn, not sure what it can do but definitely sounds useful.

The "theString" was just an example however; we do use constants. Though when you use the IDE to search for references, often the figure returned is in triple figures and it's back to the problem of trying to figure out what reference refers to your particular situation.

Thanks again,

Dave
14 years ago
David, thanks for your reply. I'll need to look up a sequence diagram and see if that's the kind of thing I'm imagining.

You're right about being able to tell it's from a session - though even this can get tricky if it's been stored in a bean, which was in a hashmap, which is declared in a different JSP that only combines them at run time using tiles, but which is hard to tell which versions are going to be combined as the rules are calculated at run time etc. but I see your point.

The hard part is usually guessing when it's been added to the session because you usually have to search for a string (like Find-> "setAttribute("theString", object))and unless you know the exact wording the programmer used to add it to the session, then your search is bound to fail - and you might only be a whitespace character out. Plus if it shows up in numerous places (which it perhaps should as it's being reused) then you won't know which one was the culprit!

Karthik, I'll have to try that debugger. However, does it track the variable, or the variable value? For instance if you had:-

String someValue = "somethingOrOther";
session.setAttribute("theString", someValue) then I would want to know about "theString" from then on, and not the 'someValue' if that makes sense?

Cheers,

Dave
14 years ago
Hi all. This is probably hard to understand because I won't be able to describe it very effectively but please bear with me.

I'm debugging through a lot of code at the moment. An example is there's a figure been printed in a field and I have to back track through the code to see where this comes from. So I look on the JSP and it's been taken from a bean, I go further and see that the bean was taken from the session, I check to see when it was added to the session, then when the figure was added to the bean, then where that figure came from and so on.

Generally I find that as Java is all about reusing code and methods, trying to find which use of thisMethodThatsUsedAllOverTheWorkspace THIS time can be a very long and drawn out process and I keep forgetting where I am and the direction I'm going through the code etc.

I now write things down, but it doesn't seem like the clearest way and I'm kind of developing my own 'language' to describe only the parts of the code I'm interested in.

SO NOW TO THE POINT:
Can anyone please let me know if there's any such thing as a formal way of documenting a 'path' backwards through code - some method, standard, model - ANYTHING that would help make this clearer?
AND/OR
Is there an easier way than repeatedly running through the code and baby stepping a bit backwards through the code each time to find out where a figure's come from?

Apologies if this just sounds like nonsense but it would be REALLY helpful if this could be examined.

Cheers,
Dave
14 years ago
David, thanks once again for your response. Often in getting an answer to a problem you realise that there is no problem: It seems that confusion for RAD7 is the norm, not the exception. At the very least I feel better that I'm not missing the obvious.
Cheers!

David Newton wrote:If you're *mindlessly* pointing, clicking, deleting, and pasting, eventually finding a solution by pure chance, then you're doing it wrong. Take the time to figure out *why* what you did worked



Cheers for your response David. You're right I am doing it wrong: That's why I'm here looking for help. But the "taking the time to figure out why it worked" solution is not this solution, it's this problem: Trying to figure out why it worked has gotten me to post this question in the first place, as I can't figure out why it worked. Unfortunately you're being too generous in estimating how much knowledge and experience I have to draw upon to be able to figure this out. Hence the reason I'm looking for tutorials/courses etc.
Thanks for the info on the JEE tutorials. Looks like that's a good place to start.
Tim, thanks for your response. I don't understand most of what you say unfortunately but appreciate the effort.

I appreciate the distinction between workspace and projects. It's going to come in useful when searching for what I should learn.

All of our projects are created and held in RAD7 and Clearcase. However when importing an existing project and getting it to read from databases and setting up Websphere 6.1 etc all of this is what confuses me.

Here's an example: I need to add existing projects to the modules in the application.xml file. (Bear in mind that to learn THAT i have to do this took weeks. Literally weeks, simply because I've got no idea what WHY I have to do this: I have no idea what this does and what it fixes. All I know is that it's something I have to do because it helps make the application work. Incidentally there's no point explaining, it will merely raise other questions and concepts that I need answers to that by the time I get to the end of the trail and get to somewhere I understand, I'll have forgotten where the trail begun!)
Now for some reason I can't add them. I now know that this is because the .settings file was deleted so I had to add new project facets.
This solution can be arrived at in two ways:
1. By knowing what this whole modules things is and means and why you have it and what it does etc and using this information to figure out why you can't add the projects.
OR
2. Because you have no idea what all this refers to, you delete things, add things, click things, look up the internet, perhaps you close your left eye, perhaps you whistle the national anthem and suddenly, it WORKS!

The first way is the best way. What I need to know is, how can I learn these kind of things that I need to be able to troubleshoot problems like above, without having to go through weeks and weeks of literally mindless and uninformed pointing, clicking, deleting and pasting until somehow, through pure chance, I eventually find a solution? Please don't suggest trial and error. There has to be a discipline, subject, tutorial, subject I can read about that will get me up to speed on this quicker than trial an d error.