Talk:Rosetta Code/Count examples
The method of counting header template uses may still give an incorrect count of programming examples, but I think it's as close as we can get without getting unreasonably complex. For instance, we could count the number of start lang tags, but some examples use pre and some more still have one example split into sections with explanations. The method used for this task does not account for iterative and recursive solutions for one task, or splits like on the String Length page. What we end up with for the total across all tasks is the same as counting the members in each language category and subtracting the language implementations (which seems more complicated). --Mwn3d 19:30, 9 February 2009 (UTC)
We can count anything under "triple equals" but it will duplicate results. Like:
1. Python 1.1. A 1.2. B
Will count 3, not 2.
A complex solution, will be read all sections, but will take a long time, and will be buggy.
Traceback for problem with Python version
Traceback (most recent call last): File "count.py", line 8, in <module> y = urllib.urlopen("http://www.rosettacode.org/w/index.php?title=%s&action=raw" % t) File "d:\Python26\lib\urllib.py", line 87, in urlopen return opener.open(url) File "d:\Python26\lib\urllib.py", line 178, in open fullurl = unwrap(toBytes(fullurl)) File "d:\Python26\lib\urllib.py", line 1028, in toBytes " contains non-ASCII characters") UnicodeError: URL u'http://www.rosettacode.org/w/index.php?title=Catmull\u2013Clark_subdivision_s urface&action=raw' contains non-ASCII characters
cmlimit may not be over 500 for users
Attempts to read more than 500 tasks using the XML query fail with this error. Everybody seems to have used this method (rather than downloading the HTML page for example) so presumably it's not considered to be incorrect. RichardRussell 12:29, 17 November 2012 (UTC)
- Nevertheless I have modified the BBC BASIC solution to read the full set of tasks. RichardRussell 12:14, 21 November 2012 (UTC)