|
Eh?
Mar 27, 2002 20:46:24 GMT -5
Post by Brutal_Chicken on Mar 27, 2002 20:46:24 GMT -5
Ok... so they tell us we have to reuse our modified TwoEndedLinkedList and LinkIterator from A2.
BUT we're better off if we got A4 up and running and reuse that instead. So, my question is: can we use the Tree from A4 (assuming it works) to handle all that jazz about adding and stuff and use Tag/Link Iterator to process through all the links/tags.
So, in other words: TagIterator will cycle through the tags and returns each one, LinkIterator only returns the proper links, and your A4 tree takes in the proper URLs and makes tree nodes with them.
Doesn't it suck that you'd get so little lines of instruction for your major project? If I wanted to be creative I'd smoke weed and raid the nearest Home Depot.
|
|
|
Eh?
Mar 30, 2002 0:49:14 GMT -5
Post by Brutal_Chicken on Mar 30, 2002 0:49:14 GMT -5
Alright. I think I have this 'figured' out. I'm keeping almost everything the same, adding in the TagIterator, LinkIterator, etc but I'm only using A4 for the map command.
That should work out right? You're not really adding what they tell you to map to your list. You're just gonna print out the links from that page onwards.
What I really wanted to ask was if someone could post their html test cases for A2 since I think my iterators are a bit funky. They work with what I throw at them but I just wanna be safe.
|
|
|
Eh?
Mar 30, 2002 1:18:27 GMT -5
Post by Tony on Mar 30, 2002 1:18:27 GMT -5
yea, your approach is basically what i figured would work... basically we just need to add the map command, at least thats what seems right...
|
|
|
Eh?
Mar 30, 2002 11:55:46 GMT -5
Post by Sylph on Mar 30, 2002 11:55:46 GMT -5
but then we have to account for fully specified urls, which start with "http://", and is different from the original definition of a url from a4.
|
|
|
Eh?
Mar 30, 2002 12:03:15 GMT -5
Post by Tony on Mar 30, 2002 12:03:15 GMT -5
oh, yea, that reminds me
basically we need to just find a way to account for the two slashes in http://
|
|
|
Eh?
Mar 30, 2002 17:35:51 GMT -5
Post by CooLiBoP on Mar 30, 2002 17:35:51 GMT -5
oh, yea, that reminds me basically we need to just find a way to account for the two slashes in http:// Can we assume that each input will have http://? cause then its easy...just ignore the first 7 characters
|
|
|
Eh?
Mar 30, 2002 23:24:15 GMT -5
Post by Brutal_Chicken on Mar 30, 2002 23:24:15 GMT -5
I was thinking the same thing. They're all going to be 'children' of 'http://' right so why not make the root, originally "", be 'http://' and ignore it when it's entered.
A little help here for the openstream method. This is what I used for a BR:
BufferedReader htmlFile = new BufferedReader (new InputStreamReader(url.openStream()));
I think it's right but I don't think I'm doing it correctly.
|
|
barp
Full Member
Posts: 28
|
Eh?
Mar 31, 2002 0:32:06 GMT -5
Post by barp on Mar 31, 2002 0:32:06 GMT -5
Is anyone here using the A4 code, or are you changing it???~or~ starting over( which I tried..grrr...not fun..well actually not that bad..but I still don't get what I want..so maybe I should just stick with A4..I wish they gave us some damn hints!!!!!)
I started by just inserting.. normally...but of course then it's not nested at all...hmm.. maybe I should start again at A4...
Anyways, enough about me.. what are you guys doing here?
|
|
|
Eh?
Mar 31, 2002 10:10:54 GMT -5
Post by Brutal_Chicken on Mar 31, 2002 10:10:54 GMT -5
I noticed the same thing. It's all because of the 'http://' in front that screws it all up. If I get around that, A4 will be fine for the map command.
|
|
|
Eh?
Mar 31, 2002 10:21:20 GMT -5
Post by Sylph on Mar 31, 2002 10:21:20 GMT -5
well it's good to start with the a4 code, but modify to the point where it's really different... at least that's what i did.
if we put everything as children of 'http://'. then it might add to the tree everything that is under 'http://', that is, any fully specified url -- u might map the whole world wide web!
|
|
barp
Full Member
Posts: 28
|
Eh?
Mar 31, 2002 12:03:22 GMT -5
Post by barp on Mar 31, 2002 12:03:22 GMT -5
|
|
barp
Full Member
Posts: 28
|
Eh?
Mar 31, 2002 12:04:26 GMT -5
Post by barp on Mar 31, 2002 12:04:26 GMT -5
|
|
|
Eh?
Mar 31, 2002 12:05:46 GMT -5
Post by Brutal_Chicken on Mar 31, 2002 12:05:46 GMT -5
I took the lazy way and just added it when it's toString()'d after removing it first when inserting. EDIT: Well, I 'think' I got mine to work for the most part except that it doesn't handle dead links. What I was going to do was just make all the links found be put into the same tree. Then I'll write a method in URLTree that'll just 'toString' the subtree from a specific child downwards. But this brings up a problem: EX) Say I map this successfuly: www.a.com/b/In /b/ there are numerous links and one of them says www.z.com/y/. But in /y/ there is at least one link that would be a child of www.a.com/b/, say it was www.a.com/b/c/. Here's the kicker; what if www.a.com/b/ didn't have a link to www.a.com/b/c/? What happens is that even though www.z.com/y/ wasn't a child of www.a.com/b/, it still added one of www.z.com/y/'s links, namely www.a.com/b/c/. So, my cop-out of an approach will yield the wrong results. Meaning we can't 'brute' our way through all the links. It won't take much to have an if statement somewhere to check the urls BEFORE you add them, and it might make it easier to just 'toString' the tree since you'll only put the correct urls there. I hope my frustration would be of some use to some other poor schmuck out there.
|
|
|
Eh?
Mar 31, 2002 14:50:54 GMT -5
Post by Sylph on Mar 31, 2002 14:50:54 GMT -5
but i read somewhere, like the announcements or something, that u can nest b, c, d, etc. and it'd be ok too.
|
|
Yin
Junior Member
umm...let me meditate and get my answer...umm
Posts: 21
|
Eh?
Mar 31, 2002 17:29:19 GMT -5
Post by Yin on Mar 31, 2002 17:29:19 GMT -5
i dun understand.. do we need A4's toString() to map???
|
|