|
|
| Author |
Message |
| 5v3d3b0 |
This post is not being displayed .
|
 5v3d3b0 World Chat Champion
Joined: 24 Sep 2006 Karma :     
|
|
| Back to top |
|
You must be logged in to rate posts |
|
 |
| 5v3d3b0 |
This post is not being displayed .
|
 5v3d3b0 World Chat Champion
Joined: 24 Sep 2006 Karma :     
|
 Posted: 20:25 - 14 Nov 2010 Post subject: |
 |
|
These are the questions, then I have to write a page or 2 explaining why I've used the scripts I've chosen. How screwed am I? I can't see the light at the end of this one :/
i) function URL(page) - to return the URL part (not including the brackets) part of page (which is a string). [Note that this function will not contain an alert]
Example call: URL("[www.lboro.ac.uk]Loughborough University offers degree programmes and world class research. ")
Example result: "www.lboro.ac.uk"
ii) function content(page) - to return the content part (not including the URL) part of page (which is a string). [Note that this function will not contain an alert]
Example call: content(pages[0])
Example result: "Loughborough University offers degree programmes and world class research. "
iii) function find1C(s,p) - p is a number which is an index to the pages array and thus identifies one particular page. The function is to discover if the string s appears in the content (not the URL) part of page p. Gives an alert message containing the value of s together with either the text 'found' or 'not found'. [Note that s need not be a full word so that if p was 0 and s had any of the values "programmes", "programme", "program", "prog", "rog", "og", or "g" the result would be 'found' but if s had the value 'PROG' the result would be 'not found' because this is a case sensitive search. ]
Example call: find1C("prog",0)
Example result:
example result iii
[Note: The image above and two others below were added 9/11/2010 to replace the previous textual representation of the Example result.]
iv) function findAnyU(s) - to discover if string s appears in any of the URLs in the array pages. Gives an alert of s together with 'found' or 'not found' as for find1C. [Note that the search should be case insensitive so that 'lboro' and 'Lboro' and 'LBORO' would all be found in 'www.lboro.ac.uk' - all remaining functions should also be case insensitive in this way]
Example call: findAnyU("Lboro")
Example result:
Example result iv
v) function findIdxsC(s) - to return a string containing the indexes in the pages array where s was found in the content part, e.g. "prog found in pages 0,3,5,6,9" [Note that this function will not contain an alert]
Example call:findIdxsC("prog")
Example result:"prog found in pages 0,3,5,6,9"
vi) function findScoresC(s) - to return an array of scores for each content string in the pages array. [Score 0 for string s not found, 1 for string s found once, 2 for string s found twice, etc. Try to ensure that your program does not find s more than once in each word - e.g. if s='w' then it should be found twice in "The WWW. Hello world", not four times. ]
Example call: scores=findScoresC("prog")
Exploring the (array) result: alert(scores[2])
vii) function sortScores(scoreRecs) - to take an array of score records (each containing a score and a page index) return a sorted version where the records are arranged in descending order of score.
Example call: sortScores( [ { score:0, index:0 }, { score:2, index:1 }, { score:1, index:2 } ] )
Example result: [ { score:2, index:1 }, { score:1, index:2 }, { score:0, index:0 } ]
viii) function findScoreC2(s) - to find scores information as in findScoresC but return it in an array of records suitable as data for function sortScores. However this time the score is not just a straight count of the number of matches but a percentage score. The percentage score is obtained by the number of times the pattern occurs in the page divided by the number of words in the page, expressed as a percentage.
Example call: findScoreC2("prog")
Example result (an array): [ { score:0, index:0 }, { score:20, index:1 }, { score:10, index:2 } ]
ix) function findRanked(s) - to find scores information as in findScoresC2 and sort them as in sortScores and to finally return a string containing '(URL, %)\n' pairs where the percentage scores are in descending order.
Example call: findRanked("prog")
Example result: (www.lboro.ac.uk, 20%)
(www.other.com, 10%)
(www.zzz.tv, 1%)
x) function findMulti(wds) - to discover if any of the words in wds appear in the string pages[0]. This is a multiword search. The value for wds could be "univ deg LOUGH". Gives an alert of 'found' if any combination of 'univ' or 'deg' or 'LOUGH' is found.
Example call: findMulti("univ deg LOUGH")
Example result: |
|
| Back to top |
|
You must be logged in to rate posts |
|
 |
| The Shaggy D.A. |
This post is not being displayed .
|
 The Shaggy D.A. Super Spammer

Joined: 12 Sep 2008 Karma :  
|
 Posted: 20:56 - 14 Nov 2010 Post subject: |
 |
|
https://buzzedition.com/wp-content/uploads/2010/01/FAIL-Cats-We-shall-decide.jpg ____________________ Chances are quite high you are not in my Monkeysphere, and I don't care about you. Don't take it personally.
Currently : Royal Enfield 350 Meteor
Previously : CB100N > CB250RS > XJ900F > GT550 > GPZ750R/1000RX > AJS M16 > R100RT > Bullet 500 > CB500 > LS650P > Bullet Electra X & YBR125 > Bullet 350 "Superstar" & YBR125 Custom > Royal Enfield Classic 500 Despatch Limited Edition (28 of 200) & CB Two-Fifty Nighthawk > ER5 |
|
| Back to top |
|
You must be logged in to rate posts |
|
 |
| 5v3d3b0 |
This post is not being displayed .
|
 5v3d3b0 World Chat Champion
Joined: 24 Sep 2006 Karma :     
|
 Posted: 23:03 - 14 Nov 2010 Post subject: |
 |
|
Thanks for the support  |
|
| Back to top |
|
You must be logged in to rate posts |
|
 |
| Astridax |
This post is not being displayed .
|
 Astridax Nitrous Nuisance
Joined: 27 Jul 2010 Karma :     
|
|
| Back to top |
|
You must be logged in to rate posts |
|
 |
| Luke_Retrofly |
This post is not being displayed .
|
 Luke_Retrofly Silly Lesbian

Joined: 05 Jul 2003 Karma :     
|
|
| Back to top |
|
You must be logged in to rate posts |
|
 |
| chris-red |
This post is not being displayed .
|
 chris-red Have you considered a TDM?

Joined: 21 Sep 2005 Karma :   
|
|
| Back to top |
|
You must be logged in to rate posts |
|
 |
| skatefreak |
This post is not being displayed .
|
 skatefreak World Chat Champion

Joined: 06 Feb 2010 Karma :    
|
|
| Back to top |
|
You must be logged in to rate posts |
|
 |
| el_oso |
This post is not being displayed .
|
 el_oso World Chat Champion

Joined: 17 May 2008 Karma :  
|
|
| Back to top |
|
You must be logged in to rate posts |
|
 |
| 5v3d3b0 |
This post is not being displayed .
|
 5v3d3b0 World Chat Champion
Joined: 24 Sep 2006 Karma :     
|
 Posted: 18:36 - 15 Nov 2010 Post subject: |
 |
|
Yes I go to lufbra, anyone else?  |
|
| Back to top |
|
You must be logged in to rate posts |
|
 |
| Kickstart |
This post is not being displayed .
|
 Kickstart The Oracle

Joined: 04 Feb 2002 Karma :     
|
|
| Back to top |
|
You must be logged in to rate posts |
|
 |
| 5v3d3b0 |
This post is not being displayed .
|
 5v3d3b0 World Chat Champion
Joined: 24 Sep 2006 Karma :     
|
|
| Back to top |
|
You must be logged in to rate posts |
|
 |
| The Shaggy D.A. |
This post is not being displayed .
|
 The Shaggy D.A. Super Spammer

Joined: 12 Sep 2008 Karma :  
|
 Posted: 19:36 - 15 Nov 2010 Post subject: |
 |
|
Don't worry about it, just leave it until the night before and post a request for help on BCF. ____________________ Chances are quite high you are not in my Monkeysphere, and I don't care about you. Don't take it personally.
Currently : Royal Enfield 350 Meteor
Previously : CB100N > CB250RS > XJ900F > GT550 > GPZ750R/1000RX > AJS M16 > R100RT > Bullet 500 > CB500 > LS650P > Bullet Electra X & YBR125 > Bullet 350 "Superstar" & YBR125 Custom > Royal Enfield Classic 500 Despatch Limited Edition (28 of 200) & CB Two-Fifty Nighthawk > ER5 |
|
| Back to top |
|
You must be logged in to rate posts |
|
 |
| Syris the Indomitable |
This post is not being displayed .
|
 Syris the Indomitable Crazy Courier

Joined: 22 Oct 2010 Karma :    
|
|
| Back to top |
|
You must be logged in to rate posts |
|
 |
| Syris the Indomitable |
This post is not being displayed .
|
 Syris the Indomitable Crazy Courier

Joined: 22 Oct 2010 Karma :    
|
|
| Back to top |
|
You must be logged in to rate posts |
|
 |
| bazza |
This post is not being displayed .
|
 bazza World Chat Champion
Joined: 27 Aug 2004 Karma :  
|
|
| Back to top |
|
You must be logged in to rate posts |
|
 |
| Christopher |
This post is not being displayed .
|
 Christopher Derestricted Danger
Joined: 01 Oct 2008 Karma :  
|
|
| Back to top |
|
You must be logged in to rate posts |
|
 |
| Frost |
This post is not being displayed .
|
 Frost World Chat Champion

Joined: 26 May 2004 Karma :  
|
|
| Back to top |
|
You must be logged in to rate posts |
|
 |
| Astridax |
This post is not being displayed .
|
 Astridax Nitrous Nuisance
Joined: 27 Jul 2010 Karma :     
|
|
| Back to top |
|
You must be logged in to rate posts |
|
 |
| paledude101 |
This post is not being displayed .
|
 paledude101 L Plate Warrior
Joined: 02 Apr 2010 Karma :  
|
|
| Back to top |
|
You must be logged in to rate posts |
|
 |
Old Thread Alert!
The last post was made 15 years, 336 days ago. Instead of replying here, would creating a new thread be more useful? |
 |
|
|