Rosetta Code/Count examples: Difference between revisions
Thundergnat (talk | contribs) m (→{{header|Perl 6}}: Add a few more bells and whistles) |
Thundergnat (talk | contribs) m (→{{header|Perl 6}}: Give draft tasks a different background color, add a better progress indicator, add some explanatory verbiage) |
||
Line 1,639: | Line 1,639: | ||
=={{header|Perl 6}}== |
=={{header|Perl 6}}== |
||
{{works with|Rakudo|2018.03}} |
{{works with|Rakudo|2018.03}} |
||
Retrieves counts for both Tasks and Draft Tasks. Save / Display results as a sortable wikitable rather than a static list. Click on a column header to sort on that column. To do a secondary sort, hold down the shift key and click on a second column. Tasks have a gray (default) background, Draft Tasks have a yellow background. |
|||
<lang perl6>use HTTP::UserAgent; |
<lang perl6>use HTTP::UserAgent; |
||
use URI::Escape; |
use URI::Escape; |
||
use JSON::Fast; |
use JSON::Fast; |
||
class Progress-Bar { |
|||
has $.width = 40; |
|||
has $.count is rw = 0; |
|||
has @!bar = < ▏ ▎ ▍ ▌ ▋ ▊ ▉ █ >; |
|||
method inc { |
|||
($.count += 1) mod= $.width * 8; |
|||
self.clear ~ @!bar.tail x $.count div 8 ~ @!bar[ $.count % 8 ] |
|||
~ ' ' x $.width - 1 - ($.count / 8).floor |
|||
} |
|||
method clear { |
|||
"\r" ~ ' ' x $.width ~ "\r" |
|||
} |
|||
} |
|||
# Friendlier descriptions for task categories |
# Friendlier descriptions for task categories |
||
Line 1,661: | Line 1,678: | ||
note 'Retrieving task information...'; |
note 'Retrieving task information...'; |
||
my $progress = Progress-Bar.new(width => 79); |
|||
for %cat.keys -> $cat { |
for %cat.keys -> $cat { |
||
Line 1,679: | Line 1,698: | ||
my $count = +$page.comb(/'=={{header|'/); |
my $count = +$page.comb(/'=={{header|'/); |
||
%tasks{.<title>} = {'cat' => %cat{$cat}, :$count}; |
%tasks{.<title>} = {'cat' => %cat{$cat}, :$count}; |
||
print $progress.inc; |
|||
print "\b" x 40, ' ' x 40, "\b" x 40, '█' x $throbber; |
|||
}) |
}) |
||
} |
} |
||
print $progress.clear; |
|||
print "\b" x 40, ' ' x 40, "\b" x 40; |
|||
note "\nTask information saved to local file: {$hashfile.IO.absolute}"; |
note "\nTask information saved to local file: {$hashfile.IO.absolute}"; |
||
Line 1,713: | Line 1,731: | ||
; |
; |
||
# Sort tasks by count then add |
# Sort tasks by count then add row |
||
for %tasks.sort: -*.value<count> -> $task { |
for %tasks.sort: -*.value<count> -> $task { |
||
$out.say: |
$out.say: |
||
( $task.value<cat> eq 'Draft' |
|||
"|-\n", |
|||
?? "|- style=\"background-color: #ffc\"\n" |
|||
!! "|-\n" |
|||
), |
|||
"| { $task.value<count> }\n", |
"| { $task.value<count> }\n", |
||
( $task.key ~~ /\d/ |
( $task.key ~~ /\d/ |
||
Line 1,747: | Line 1,768: | ||
sub naturally ($a) { $a.lc.subst(/(\d+)/, ->$/ {0~(65+$0.chars).chr~$0},:g) } |
sub naturally ($a) { $a.lc.subst(/(\d+)/, ->$/ {0~(65+$0.chars).chr~$0},:g) } |
||
</lang> |
</lang> |
||
{{out}} |
{{out}} |
||
<div style="height:80ex;overflow:scroll;"> |
<div style="height:80ex;overflow:scroll;"> |
||
{|class="wikitable sortable" |
{|class="wikitable sortable" |
||
|+ As of 2018-03- |
|+ As of 2018-03-30 :: Tasks: 871 :: Draft Tasks: 209 :: Total Tasks: 1080 :: Total Examples: 56069 |
||
! Count !! Task !! Category |
! Count !! Task !! Category |
||
|- |
|- |
||
Line 3,304: | Line 3,326: | ||
| [[Runge-Kutta%20method|Runge-Kutta method]] |
| [[Runge-Kutta%20method|Runge-Kutta method]] |
||
| Task |
| Task |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 57 |
| 57 |
||
| [[Proper%20divisors|Proper divisors]] |
| [[Proper%20divisors|Proper divisors]] |
||
Line 3,552: | Line 3,574: | ||
| [[Sequence%20of%20primes%20by%20trial%20division|Sequence of primes by trial division]] |
| [[Sequence%20of%20primes%20by%20trial%20division|Sequence of primes by trial division]] |
||
| Task |
| Task |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 51 |
| 51 |
||
| [[Repeat|Repeat]] |
| [[Repeat|Repeat]] |
||
Line 3,684: | Line 3,706: | ||
| [[Modular%20exponentiation|Modular exponentiation]] |
| [[Modular%20exponentiation|Modular exponentiation]] |
||
| Task |
| Task |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 48 |
| 48 |
||
| [[Modulinos|Modulinos]] |
| [[Modulinos|Modulinos]] |
||
Line 3,940: | Line 3,962: | ||
| [[Longest%20string%20challenge|Longest string challenge]] |
| [[Longest%20string%20challenge|Longest string challenge]] |
||
| Task |
| Task |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 41 |
| 41 |
||
| [[Two%20Sum|Two Sum]] |
| [[Two%20Sum|Two Sum]] |
||
Line 4,040: | Line 4,062: | ||
| [[Bitmap%2FRead%20a%20PPM%20file|Bitmap/Read a PPM file]] |
| [[Bitmap%2FRead%20a%20PPM%20file|Bitmap/Read a PPM file]] |
||
| Task |
| Task |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 39 |
| 39 |
||
| [[Extract%20file%20extension|Extract file extension]] |
| [[Extract%20file%20extension|Extract file extension]] |
||
Line 4,140: | Line 4,162: | ||
| [[Subtractive%20generator|Subtractive generator]] |
| [[Subtractive%20generator|Subtractive generator]] |
||
| Task |
| Task |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 36 |
| 36 |
||
| [[Dijkstra%27s%20algorithm|Dijkstra's algorithm]] |
| [[Dijkstra%27s%20algorithm|Dijkstra's algorithm]] |
||
Line 4,236: | Line 4,258: | ||
|data-sort-value="sum to 0D100"| [[Sum%20to%20100|Sum to 100]] |
|data-sort-value="sum to 0D100"| [[Sum%20to%20100|Sum to 100]] |
||
| Task |
| Task |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 35 |
| 35 |
||
|data-sort-value="base0C64 encode data"| [[Base64%20encode%20data|Base64 encode data]] |
|data-sort-value="base0C64 encode data"| [[Base64%20encode%20data|Base64 encode data]] |
||
Line 4,276: | Line 4,298: | ||
| [[Average%20loop%20length|Average loop length]] |
| [[Average%20loop%20length|Average loop length]] |
||
| Task |
| Task |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 34 |
| 34 |
||
| [[Longest%20common%20prefix|Longest common prefix]] |
| [[Longest%20common%20prefix|Longest common prefix]] |
||
Line 4,380: | Line 4,402: | ||
| [[Pascal%27s%20triangle%2FPuzzle|Pascal's triangle/Puzzle]] |
| [[Pascal%27s%20triangle%2FPuzzle|Pascal's triangle/Puzzle]] |
||
| Task |
| Task |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 32 |
| 32 |
||
| [[Multiline%20shebang|Multiline shebang]] |
| [[Multiline%20shebang|Multiline shebang]] |
||
Line 4,444: | Line 4,466: | ||
| [[Break%20OO%20privacy|Break OO privacy]] |
| [[Break%20OO%20privacy|Break OO privacy]] |
||
| Task |
| Task |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 31 |
| 31 |
||
| [[Vector|Vector]] |
| [[Vector|Vector]] |
||
Line 4,500: | Line 4,522: | ||
| [[Cartesian%20product%20of%20two%20or%20more%20lists|Cartesian product of two or more lists]] |
| [[Cartesian%20product%20of%20two%20or%20more%20lists|Cartesian product of two or more lists]] |
||
| Task |
| Task |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 30 |
| 30 |
||
| [[Permutations%20with%20repetitions|Permutations with repetitions]] |
| [[Permutations%20with%20repetitions|Permutations with repetitions]] |
||
Line 4,512: | Line 4,534: | ||
| [[Bitmap%2FB%C3%A9zier%20curves%2FCubic|Bitmap/Bézier curves/Cubic]] |
| [[Bitmap%2FB%C3%A9zier%20curves%2FCubic|Bitmap/Bézier curves/Cubic]] |
||
| Task |
| Task |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 29 |
| 29 |
||
| [[Input%2FOutput%20for%20Pairs%20of%20Numbers|Input/Output for Pairs of Numbers]] |
| [[Input%2FOutput%20for%20Pairs%20of%20Numbers|Input/Output for Pairs of Numbers]] |
||
Line 4,588: | Line 4,610: | ||
| [[Flipping%20bits%20game|Flipping bits game]] |
| [[Flipping%20bits%20game|Flipping bits game]] |
||
| Task |
| Task |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 28 |
| 28 |
||
| [[Parse%20command-line%20arguments|Parse command-line arguments]] |
| [[Parse%20command-line%20arguments|Parse command-line arguments]] |
||
Line 4,596: | Line 4,618: | ||
| [[Bitmap%2FB%C3%A9zier%20curves%2FQuadratic|Bitmap/Bézier curves/Quadratic]] |
| [[Bitmap%2FB%C3%A9zier%20curves%2FQuadratic|Bitmap/Bézier curves/Quadratic]] |
||
| Task |
| Task |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 27 |
| 27 |
||
| [[File%20extension%20is%20in%20extensions%20list|File extension is in extensions list]] |
| [[File%20extension%20is%20in%20extensions%20list|File extension is in extensions list]] |
||
Line 4,608: | Line 4,630: | ||
| [[Multiple%20regression|Multiple regression]] |
| [[Multiple%20regression|Multiple regression]] |
||
| Task |
| Task |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 27 |
| 27 |
||
| [[Sattolo%20cycle|Sattolo cycle]] |
| [[Sattolo%20cycle|Sattolo cycle]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 27 |
| 27 |
||
| [[Input%2FOutput%20for%20Lines%20of%20Text|Input/Output for Lines of Text]] |
| [[Input%2FOutput%20for%20Lines%20of%20Text|Input/Output for Lines of Text]] |
||
Line 4,636: | Line 4,658: | ||
| [[RSA%20code|RSA code]] |
| [[RSA%20code|RSA code]] |
||
| Task |
| Task |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 26 |
| 26 |
||
| [[Sorting%20Algorithms%2FCircle%20Sort|Sorting Algorithms/Circle Sort]] |
| [[Sorting%20Algorithms%2FCircle%20Sort|Sorting Algorithms/Circle Sort]] |
||
Line 4,684: | Line 4,706: | ||
| [[Formal%20power%20series|Formal power series]] |
| [[Formal%20power%20series|Formal power series]] |
||
| Task |
| Task |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 25 |
| 25 |
||
| [[Subset%20sum%20problem|Subset sum problem]] |
| [[Subset%20sum%20problem|Subset sum problem]] |
||
Line 4,692: | Line 4,714: | ||
| [[Execute%20SNUSP|Execute SNUSP]] |
| [[Execute%20SNUSP|Execute SNUSP]] |
||
| Task |
| Task |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 25 |
| 25 |
||
| [[Check%20output%20device%20is%20a%20terminal|Check output device is a terminal]] |
| [[Check%20output%20device%20is%20a%20terminal|Check output device is a terminal]] |
||
Line 4,744: | Line 4,766: | ||
| [[Same%20Fringe|Same Fringe]] |
| [[Same%20Fringe|Same Fringe]] |
||
| Task |
| Task |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 25 |
| 25 |
||
|data-sort-value="read a file character by character/utf0B8"| [[Read%20a%20file%20character%20by%20character%2FUTF8|Read a file character by character/UTF8]] |
|data-sort-value="read a file character by character/utf0B8"| [[Read%20a%20file%20character%20by%20character%2FUTF8|Read a file character by character/UTF8]] |
||
Line 4,756: | Line 4,778: | ||
| [[Use%20another%20language%20to%20call%20a%20function|Use another language to call a function]] |
| [[Use%20another%20language%20to%20call%20a%20function|Use another language to call a function]] |
||
| Task |
| Task |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 25 |
| 25 |
||
| [[Longest%20Common%20Substring|Longest Common Substring]] |
| [[Longest%20Common%20Substring|Longest Common Substring]] |
||
Line 4,768: | Line 4,790: | ||
| [[Egyptian%20division|Egyptian division]] |
| [[Egyptian%20division|Egyptian division]] |
||
| Task |
| Task |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 24 |
| 24 |
||
| [[Musical%20scale|Musical scale]] |
| [[Musical%20scale|Musical scale]] |
||
Line 4,784: | Line 4,806: | ||
| [[Rosetta%20Code%2FFix%20code%20tags|Rosetta Code/Fix code tags]] |
| [[Rosetta%20Code%2FFix%20code%20tags|Rosetta Code/Fix code tags]] |
||
| Task |
| Task |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 24 |
| 24 |
||
| [[Sorting%20algorithms%2FCycle%20sort|Sorting algorithms/Cycle sort]] |
| [[Sorting%20algorithms%2FCycle%20sort|Sorting algorithms/Cycle sort]] |
||
Line 4,816: | Line 4,838: | ||
| [[Keyboard%20macros|Keyboard macros]] |
| [[Keyboard%20macros|Keyboard macros]] |
||
| Task |
| Task |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 23 |
| 23 |
||
| [[Find%20first%20and%20last%20set%20bit%20of%20a%20long%20integer|Find first and last set bit of a long integer]] |
| [[Find%20first%20and%20last%20set%20bit%20of%20a%20long%20integer|Find first and last set bit of a long integer]] |
||
Line 4,868: | Line 4,890: | ||
| [[Pattern%20matching|Pattern matching]] |
| [[Pattern%20matching|Pattern matching]] |
||
| Task |
| Task |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 23 |
| 23 |
||
| [[Sorting%20algorithms%2FPatience%20sort|Sorting algorithms/Patience sort]] |
| [[Sorting%20algorithms%2FPatience%20sort|Sorting algorithms/Patience sort]] |
||
Line 4,888: | Line 4,910: | ||
| [[Terminal%20control%2FCursor%20movement|Terminal control/Cursor movement]] |
| [[Terminal%20control%2FCursor%20movement|Terminal control/Cursor movement]] |
||
| Task |
| Task |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 22 |
| 22 |
||
| [[Word%20count|Word count]] |
| [[Word%20count|Word count]] |
||
Line 4,900: | Line 4,922: | ||
| [[Galton%20box%20animation|Galton box animation]] |
| [[Galton%20box%20animation|Galton box animation]] |
||
| Task |
| Task |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 22 |
| 22 |
||
| [[Text%20between|Text between]] |
| [[Text%20between|Text between]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 22 |
| 22 |
||
| [[Prime%20conspiracy|Prime conspiracy]] |
| [[Prime%20conspiracy|Prime conspiracy]] |
||
Line 4,932: | Line 4,954: | ||
| [[The%20ISAAC%20Cipher|The ISAAC Cipher]] |
| [[The%20ISAAC%20Cipher|The ISAAC Cipher]] |
||
| Task |
| Task |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 21 |
| 21 |
||
| [[Welch%27s%20t-test|Welch's t-test]] |
| [[Welch%27s%20t-test|Welch's t-test]] |
||
Line 4,956: | Line 4,978: | ||
| [[Verify%20distribution%20uniformity%2FChi-squared%20test|Verify distribution uniformity/Chi-squared test]] |
| [[Verify%20distribution%20uniformity%2FChi-squared%20test|Verify distribution uniformity/Chi-squared test]] |
||
| Task |
| Task |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 21 |
| 21 |
||
| [[Currency|Currency]] |
| [[Currency|Currency]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 21 |
| 21 |
||
| [[Check%20input%20device%20is%20a%20terminal|Check input device is a terminal]] |
| [[Check%20input%20device%20is%20a%20terminal|Check input device is a terminal]] |
||
Line 4,972: | Line 4,994: | ||
| [[URL%20parser|URL parser]] |
| [[URL%20parser|URL parser]] |
||
| Task |
| Task |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 21 |
| 21 |
||
| [[Implicit%20type%20conversion|Implicit type conversion]] |
| [[Implicit%20type%20conversion|Implicit type conversion]] |
||
Line 4,980: | Line 5,002: | ||
| [[Honeycombs|Honeycombs]] |
| [[Honeycombs|Honeycombs]] |
||
| Task |
| Task |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 21 |
| 21 |
||
| [[Table%20creation|Table creation]] |
| [[Table%20creation|Table creation]] |
||
Line 4,996: | Line 5,018: | ||
| [[Permutations%2FRank%20of%20a%20permutation|Permutations/Rank of a permutation]] |
| [[Permutations%2FRank%20of%20a%20permutation|Permutations/Rank of a permutation]] |
||
| Task |
| Task |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 20 |
| 20 |
||
| [[Birthday%20problem|Birthday problem]] |
| [[Birthday%20problem|Birthday problem]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 20 |
| 20 |
||
| [[Multi-dimensional%20array|Multi-dimensional array]] |
| [[Multi-dimensional%20array|Multi-dimensional array]] |
||
Line 5,012: | Line 5,034: | ||
| [[Shoelace%20formula%20for%20polygonal%20area|Shoelace formula for polygonal area]] |
| [[Shoelace%20formula%20for%20polygonal%20area|Shoelace formula for polygonal area]] |
||
| Task |
| Task |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 20 |
| 20 |
||
| [[Substitution%20Cipher|Substitution Cipher]] |
| [[Substitution%20Cipher|Substitution Cipher]] |
||
Line 5,024: | Line 5,046: | ||
| [[Partition%20an%20integer%20X%20into%20N%20primes|Partition an integer X into N primes]] |
| [[Partition%20an%20integer%20X%20into%20N%20primes|Partition an integer X into N primes]] |
||
| Task |
| Task |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 20 |
| 20 |
||
| [[Decimal%20floating%20point%20number%20to%20binary|Decimal floating point number to binary]] |
| [[Decimal%20floating%20point%20number%20to%20binary|Decimal floating point number to binary]] |
||
Line 5,032: | Line 5,054: | ||
| [[Simulate%20input%2FKeyboard|Simulate input/Keyboard]] |
| [[Simulate%20input%2FKeyboard|Simulate input/Keyboard]] |
||
| Task |
| Task |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 20 |
| 20 |
||
| [[Ramsey%27s%20theorem|Ramsey's theorem]] |
| [[Ramsey%27s%20theorem|Ramsey's theorem]] |
||
Line 5,044: | Line 5,066: | ||
| [[Chat%20server|Chat server]] |
| [[Chat%20server|Chat server]] |
||
| Task |
| Task |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 20 |
| 20 |
||
| [[Cycle%20detection|Cycle detection]] |
| [[Cycle%20detection|Cycle detection]] |
||
Line 5,080: | Line 5,102: | ||
| [[Record%20sound|Record sound]] |
| [[Record%20sound|Record sound]] |
||
| Task |
| Task |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 19 |
| 19 |
||
| [[Old%20Russian%20measure%20of%20length|Old Russian measure of length]] |
| [[Old%20Russian%20measure%20of%20length|Old Russian measure of length]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 19 |
| 19 |
||
| [[Idiomatically%20determine%20all%20the%20lowercase%20and%20uppercase%20letters|Idiomatically determine all the lowercase and uppercase letters]] |
| [[Idiomatically%20determine%20all%20the%20lowercase%20and%20uppercase%20letters|Idiomatically determine all the lowercase and uppercase letters]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 19 |
| 19 |
||
| [[Elliptic%20curve%20arithmetic|Elliptic curve arithmetic]] |
| [[Elliptic%20curve%20arithmetic|Elliptic curve arithmetic]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 19 |
| 19 |
||
| [[Damm%20algorithm|Damm algorithm]] |
| [[Damm%20algorithm|Damm algorithm]] |
||
Line 5,120: | Line 5,142: | ||
| [[Cut%20a%20rectangle|Cut a rectangle]] |
| [[Cut%20a%20rectangle|Cut a rectangle]] |
||
| Task |
| Task |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 19 |
| 19 |
||
| [[Decision%20tables|Decision tables]] |
| [[Decision%20tables|Decision tables]] |
||
Line 5,148: | Line 5,170: | ||
| [[Stream%20Merge|Stream Merge]] |
| [[Stream%20Merge|Stream Merge]] |
||
| Task |
| Task |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 18 |
| 18 |
||
| [[Reflection%2FList%20methods|Reflection/List methods]] |
| [[Reflection%2FList%20methods|Reflection/List methods]] |
||
Line 5,156: | Line 5,178: | ||
| [[Parse%20an%20IP%20Address|Parse an IP Address]] |
| [[Parse%20an%20IP%20Address|Parse an IP Address]] |
||
| Task |
| Task |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 18 |
| 18 |
||
| [[Dice%20game%20probabilities|Dice game probabilities]] |
| [[Dice%20game%20probabilities|Dice game probabilities]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 18 |
| 18 |
||
| [[Make%20a%20backup%20file|Make a backup file]] |
| [[Make%20a%20backup%20file|Make a backup file]] |
||
Line 5,168: | Line 5,190: | ||
| [[Poker%20hand%20analyser|Poker hand analyser]] |
| [[Poker%20hand%20analyser|Poker hand analyser]] |
||
| Task |
| Task |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 17 |
| 17 |
||
| [[Display%20a%20linear%20combination|Display a linear combination]] |
| [[Display%20a%20linear%20combination|Display a linear combination]] |
||
Line 5,176: | Line 5,198: | ||
| [[Pig%20the%20dice%20game%2FPlayer|Pig the dice game/Player]] |
| [[Pig%20the%20dice%20game%2FPlayer|Pig the dice game/Player]] |
||
| Task |
| Task |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 17 |
| 17 |
||
| [[Playfair%20cipher|Playfair cipher]] |
| [[Playfair%20cipher|Playfair cipher]] |
||
Line 5,196: | Line 5,218: | ||
| [[Polyspiral|Polyspiral]] |
| [[Polyspiral|Polyspiral]] |
||
| Task |
| Task |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 17 |
| 17 |
||
| [[Modular%20arithmetic|Modular arithmetic]] |
| [[Modular%20arithmetic|Modular arithmetic]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 17 |
| 17 |
||
| [[Integer%20roots|Integer roots]] |
| [[Integer%20roots|Integer roots]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 17 |
| 17 |
||
| [[Sequence%20of%20primorial%20primes|Sequence of primorial primes]] |
| [[Sequence%20of%20primorial%20primes|Sequence of primorial primes]] |
||
Line 5,220: | Line 5,242: | ||
| [[Plasma%20effect|Plasma effect]] |
| [[Plasma%20effect|Plasma effect]] |
||
| Task |
| Task |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 16 |
| 16 |
||
| [[Kahan%20summation|Kahan summation]] |
| [[Kahan%20summation|Kahan summation]] |
||
Line 5,240: | Line 5,262: | ||
| [[Pythagorean%20quadruples|Pythagorean quadruples]] |
| [[Pythagorean%20quadruples|Pythagorean quadruples]] |
||
| Task |
| Task |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 16 |
| 16 |
||
| [[Linux%20CPU%20utilization|Linux CPU utilization]] |
| [[Linux%20CPU%20utilization|Linux CPU utilization]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 16 |
| 16 |
||
| [[Perlin%20noise|Perlin noise]] |
| [[Perlin%20noise|Perlin noise]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 16 |
| 16 |
||
| [[Elementary%20cellular%20automaton%2FRandom%20Number%20Generator|Elementary cellular automaton/Random Number Generator]] |
| [[Elementary%20cellular%20automaton%2FRandom%20Number%20Generator|Elementary cellular automaton/Random Number Generator]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 16 |
| 16 |
||
| [[Idiomatically%20determine%20all%20the%20characters%20that%20can%20be%20used%20for%20symbols|Idiomatically determine all the characters that can be used for symbols]] |
| [[Idiomatically%20determine%20all%20the%20characters%20that%20can%20be%20used%20for%20symbols|Idiomatically determine all the characters that can be used for symbols]] |
||
Line 5,264: | Line 5,286: | ||
| [[Active%20Directory%2FSearch%20for%20a%20user|Active Directory/Search for a user]] |
| [[Active%20Directory%2FSearch%20for%20a%20user|Active Directory/Search for a user]] |
||
| Task |
| Task |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 15 |
| 15 |
||
| [[Levenshtein%20distance%2FAlignment|Levenshtein distance/Alignment]] |
| [[Levenshtein%20distance%2FAlignment|Levenshtein distance/Alignment]] |
||
Line 5,276: | Line 5,298: | ||
| [[Compiler%2Flexical%20analyzer|Compiler/lexical analyzer]] |
| [[Compiler%2Flexical%20analyzer|Compiler/lexical analyzer]] |
||
| Task |
| Task |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 15 |
| 15 |
||
| [[Bacon%20cipher|Bacon cipher]] |
| [[Bacon%20cipher|Bacon cipher]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 15 |
| 15 |
||
| [[Card%20shuffles|Card shuffles]] |
| [[Card%20shuffles|Card shuffles]] |
||
Line 5,288: | Line 5,310: | ||
| [[Negative%20base%20numbers|Negative base numbers]] |
| [[Negative%20base%20numbers|Negative base numbers]] |
||
| Task |
| Task |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 14 |
| 14 |
||
| [[Faulhaber%27s%20formula|Faulhaber's formula]] |
| [[Faulhaber%27s%20formula|Faulhaber's formula]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 14 |
| 14 |
||
| [[Elementary%20cellular%20automaton%2FInfinite%20length|Elementary cellular automaton/Infinite length]] |
| [[Elementary%20cellular%20automaton%2FInfinite%20length|Elementary cellular automaton/Infinite length]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 14 |
| 14 |
||
| [[Deming%27s%20Funnel|Deming's Funnel]] |
| [[Deming%27s%20Funnel|Deming's Funnel]] |
||
Line 5,304: | Line 5,326: | ||
| [[Magic%20squares%20of%20singly%20even%20order|Magic squares of singly even order]] |
| [[Magic%20squares%20of%20singly%20even%20order|Magic squares of singly even order]] |
||
| Task |
| Task |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 14 |
| 14 |
||
| [[Names%20to%20numbers|Names to numbers]] |
| [[Names%20to%20numbers|Names to numbers]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 14 |
| 14 |
||
| [[Reverse%20the%20gender%20of%20a%20string|Reverse the gender of a string]] |
| [[Reverse%20the%20gender%20of%20a%20string|Reverse the gender of a string]] |
||
Line 5,320: | Line 5,342: | ||
| [[Solve%20a%20Hopido%20puzzle|Solve a Hopido puzzle]] |
| [[Solve%20a%20Hopido%20puzzle|Solve a Hopido puzzle]] |
||
| Task |
| Task |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 14 |
| 14 |
||
| [[Chebyshev%20coefficients|Chebyshev coefficients]] |
| [[Chebyshev%20coefficients|Chebyshev coefficients]] |
||
Line 5,328: | Line 5,350: | ||
| [[K-d%20tree|K-d tree]] |
| [[K-d%20tree|K-d tree]] |
||
| Task |
| Task |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 14 |
| 14 |
||
| [[Native%20shebang|Native shebang]] |
| [[Native%20shebang|Native shebang]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 14 |
| 14 |
||
| [[Selective%20File%20Copy|Selective File Copy]] |
| [[Selective%20File%20Copy|Selective File Copy]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 14 |
| 14 |
||
| [[Assertions%20in%20design%20by%20contract|Assertions in design by contract]] |
| [[Assertions%20in%20design%20by%20contract|Assertions in design by contract]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 14 |
| 14 |
||
| [[Tonelli-Shanks%20algorithm|Tonelli-Shanks algorithm]] |
| [[Tonelli-Shanks%20algorithm|Tonelli-Shanks algorithm]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 14 |
| 14 |
||
| [[AudioAlarm|AudioAlarm]] |
| [[AudioAlarm|AudioAlarm]] |
||
Line 5,352: | Line 5,374: | ||
| [[Vigen%C3%A8re%20cipher%2FCryptanalysis|Vigenère cipher/Cryptanalysis]] |
| [[Vigen%C3%A8re%20cipher%2FCryptanalysis|Vigenère cipher/Cryptanalysis]] |
||
| Task |
| Task |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 14 |
| 14 |
||
| [[Index%20finite%20lists%20of%20positive%20integers|Index finite lists of positive integers]] |
| [[Index%20finite%20lists%20of%20positive%20integers|Index finite lists of positive integers]] |
||
Line 5,364: | Line 5,386: | ||
| [[Bitcoin%2Fpublic%20point%20to%20address|Bitcoin/public point to address]] |
| [[Bitcoin%2Fpublic%20point%20to%20address|Bitcoin/public point to address]] |
||
| Task |
| Task |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 13 |
| 13 |
||
| [[Type%20detection|Type detection]] |
| [[Type%20detection|Type detection]] |
||
Line 5,380: | Line 5,402: | ||
| [[Sierpinski%20pentagon|Sierpinski pentagon]] |
| [[Sierpinski%20pentagon|Sierpinski pentagon]] |
||
| Task |
| Task |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 13 |
| 13 |
||
| [[A%2A%20search%20algorithm|A* search algorithm]] |
| [[A%2A%20search%20algorithm|A* search algorithm]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 13 |
| 13 |
||
| [[Create%20an%20object%2FNative%20demonstration|Create an object/Native demonstration]] |
| [[Create%20an%20object%2FNative%20demonstration|Create an object/Native demonstration]] |
||
Line 5,404: | Line 5,426: | ||
| [[Rendezvous|Rendezvous]] |
| [[Rendezvous|Rendezvous]] |
||
| Task |
| Task |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 13 |
| 13 |
||
| [[Superpermutation%20minimisation|Superpermutation minimisation]] |
| [[Superpermutation%20minimisation|Superpermutation minimisation]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 13 |
| 13 |
||
| [[Cipolla%27s%20algorithm|Cipolla's algorithm]] |
| [[Cipolla%27s%20algorithm|Cipolla's algorithm]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 13 |
| 13 |
||
| [[Fivenum|Fivenum]] |
| [[Fivenum|Fivenum]] |
||
Line 5,424: | Line 5,446: | ||
| [[Retrieve%20and%20search%20chat%20history|Retrieve and search chat history]] |
| [[Retrieve%20and%20search%20chat%20history|Retrieve and search chat history]] |
||
| Task |
| Task |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 12 |
| 12 |
||
| [[Diversity%20prediction%20theorem|Diversity prediction theorem]] |
| [[Diversity%20prediction%20theorem|Diversity prediction theorem]] |
||
Line 5,436: | Line 5,458: | ||
| [[Lucky%20and%20even%20lucky%20numbers|Lucky and even lucky numbers]] |
| [[Lucky%20and%20even%20lucky%20numbers|Lucky and even lucky numbers]] |
||
| Task |
| Task |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 12 |
| 12 |
||
| [[Most%20frequent%20k%20chars%20distance|Most frequent k chars distance]] |
| [[Most%20frequent%20k%20chars%20distance|Most frequent k chars distance]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 12 |
| 12 |
||
| [[Untrusted%20environment|Untrusted environment]] |
| [[Untrusted%20environment|Untrusted environment]] |
||
Line 5,452: | Line 5,474: | ||
| [[Reflection%2FGet%20source|Reflection/Get source]] |
| [[Reflection%2FGet%20source|Reflection/Get source]] |
||
| Task |
| Task |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 12 |
| 12 |
||
| [[Word%20break%20problem|Word break problem]] |
| [[Word%20break%20problem|Word break problem]] |
||
Line 5,464: | Line 5,486: | ||
| [[Bitmap%2FRead%20an%20image%20through%20a%20pipe|Bitmap/Read an image through a pipe]] |
| [[Bitmap%2FRead%20an%20image%20through%20a%20pipe|Bitmap/Read an image through a pipe]] |
||
| Task |
| Task |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 12 |
| 12 |
||
| [[I.Q.%20Puzzle|I.Q. Puzzle]] |
| [[I.Q.%20Puzzle|I.Q. Puzzle]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 12 |
| 12 |
||
| [[Convex%20hull|Convex hull]] |
| [[Convex%20hull|Convex hull]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 11 |
| 11 |
||
| [[Find%20URI%20in%20text|Find URI in text]] |
| [[Find%20URI%20in%20text|Find URI in text]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 11 |
| 11 |
||
| [[NYSIIS|NYSIIS]] |
| [[NYSIIS|NYSIIS]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 11 |
| 11 |
||
| [[Knuth%27s%20power%20tree|Knuth's power tree]] |
| [[Knuth%27s%20power%20tree|Knuth's power tree]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 11 |
| 11 |
||
| [[Faulhaber%27s%20triangle|Faulhaber's triangle]] |
| [[Faulhaber%27s%20triangle|Faulhaber's triangle]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 11 |
| 11 |
||
| [[Polynomial%20synthetic%20division|Polynomial synthetic division]] |
| [[Polynomial%20synthetic%20division|Polynomial synthetic division]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 11 |
| 11 |
||
| [[Arithmetic%20coding%2FAs%20a%20generalized%20change%20of%20radix|Arithmetic coding/As a generalized change of radix]] |
| [[Arithmetic%20coding%2FAs%20a%20generalized%20change%20of%20radix|Arithmetic coding/As a generalized change of radix]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 11 |
| 11 |
||
| [[Monads%2FMaybe%20monad|Monads/Maybe monad]] |
| [[Monads%2FMaybe%20monad|Monads/Maybe monad]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 11 |
| 11 |
||
| [[Shortest%20common%20supersequence|Shortest common supersequence]] |
| [[Shortest%20common%20supersequence|Shortest common supersequence]] |
||
Line 5,508: | Line 5,530: | ||
| [[Ramer-Douglas-Peucker%20line%20simplification|Ramer-Douglas-Peucker line simplification]] |
| [[Ramer-Douglas-Peucker%20line%20simplification|Ramer-Douglas-Peucker line simplification]] |
||
| Task |
| Task |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 11 |
| 11 |
||
| [[Bilinear%20interpolation|Bilinear interpolation]] |
| [[Bilinear%20interpolation|Bilinear interpolation]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 11 |
| 11 |
||
| [[List%20rooted%20trees|List rooted trees]] |
| [[List%20rooted%20trees|List rooted trees]] |
||
Line 5,520: | Line 5,542: | ||
| [[Vogel%27s%20approximation%20method|Vogel's approximation method]] |
| [[Vogel%27s%20approximation%20method|Vogel's approximation method]] |
||
| Task |
| Task |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 11 |
| 11 |
||
| [[N-body%20problem|N-body problem]] |
| [[N-body%20problem|N-body problem]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 11 |
| 11 |
||
| [[Proof|Proof]] |
| [[Proof|Proof]] |
||
Line 5,536: | Line 5,558: | ||
| [[Find%20the%20intersection%20of%20a%20line%20with%20a%20plane|Find the intersection of a line with a plane]] |
| [[Find%20the%20intersection%20of%20a%20line%20with%20a%20plane|Find the intersection of a line with a plane]] |
||
| Task |
| Task |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 11 |
| 11 |
||
| [[Separate%20the%20house%20number%20from%20the%20street%20name|Separate the house number from the street name]] |
| [[Separate%20the%20house%20number%20from%20the%20street%20name|Separate the house number from the street name]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 10 |
| 10 |
||
| [[Find%20duplicate%20files|Find duplicate files]] |
| [[Find%20duplicate%20files|Find duplicate files]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 10 |
| 10 |
||
| [[P-value%20correction|P-value correction]] |
| [[P-value%20correction|P-value correction]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 10 |
| 10 |
||
| [[Generate%20random%20chess%20position|Generate random chess position]] |
| [[Generate%20random%20chess%20position|Generate random chess position]] |
||
Line 5,556: | Line 5,578: | ||
| [[Commatizing%20numbers|Commatizing numbers]] |
| [[Commatizing%20numbers|Commatizing numbers]] |
||
| Task |
| Task |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 10 |
| 10 |
||
| [[Mersenne%20primes|Mersenne primes]] |
| [[Mersenne%20primes|Mersenne primes]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 10 |
| 10 |
||
| [[Monads%2FList%20monad|Monads/List monad]] |
| [[Monads%2FList%20monad|Monads/List monad]] |
||
Line 5,568: | Line 5,590: | ||
| [[Zeckendorf%20arithmetic|Zeckendorf arithmetic]] |
| [[Zeckendorf%20arithmetic|Zeckendorf arithmetic]] |
||
| Task |
| Task |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 10 |
| 10 |
||
| [[Aspect%20Oriented%20Programming|Aspect Oriented Programming]] |
| [[Aspect%20Oriented%20Programming|Aspect Oriented Programming]] |
||
Line 5,576: | Line 5,598: | ||
| [[Nonogram%20solver|Nonogram solver]] |
| [[Nonogram%20solver|Nonogram solver]] |
||
| Task |
| Task |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 10 |
| 10 |
||
| [[Markov%20chain%20text%20generator|Markov chain text generator]] |
| [[Markov%20chain%20text%20generator|Markov chain text generator]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 10 |
| 10 |
||
| [[Determine%20if%20two%20triangles%20overlap|Determine if two triangles overlap]] |
| [[Determine%20if%20two%20triangles%20overlap|Determine if two triangles overlap]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 10 |
| 10 |
||
| [[Readline%20interface|Readline interface]] |
| [[Readline%20interface|Readline interface]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 10 |
| 10 |
||
| [[Snake|Snake]] |
| [[Snake|Snake]] |
||
Line 5,608: | Line 5,630: | ||
| [[Compiler%2Fcode%20generator|Compiler/code generator]] |
| [[Compiler%2Fcode%20generator|Compiler/code generator]] |
||
| Task |
| Task |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 10 |
| 10 |
||
| [[Topological%20sort%2FExtracted%20top%20item|Topological sort/Extracted top item]] |
| [[Topological%20sort%2FExtracted%20top%20item|Topological sort/Extracted top item]] |
||
Line 5,616: | Line 5,638: | ||
| [[Bitmap%2FPPM%20conversion%20through%20a%20pipe|Bitmap/PPM conversion through a pipe]] |
| [[Bitmap%2FPPM%20conversion%20through%20a%20pipe|Bitmap/PPM conversion through a pipe]] |
||
| Task |
| Task |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 9 |
| 9 |
||
| [[XML%20Validation|XML Validation]] |
| [[XML%20Validation|XML Validation]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 9 |
| 9 |
||
| [[Suffix%20tree|Suffix tree]] |
| [[Suffix%20tree|Suffix tree]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 9 |
| 9 |
||
|data-sort-value="base0C58check encoding"| [[Base58Check%20encoding|Base58Check encoding]] |
|data-sort-value="base0C58check encoding"| [[Base58Check%20encoding|Base58Check encoding]] |
||
Line 5,632: | Line 5,654: | ||
| [[Eertree|Eertree]] |
| [[Eertree|Eertree]] |
||
| Task |
| Task |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 9 |
| 9 |
||
| [[VList|VList]] |
| [[VList|VList]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 9 |
| 9 |
||
| [[Code%20segment%20unload|Code segment unload]] |
| [[Code%20segment%20unload|Code segment unload]] |
||
Line 5,644: | Line 5,666: | ||
| [[Word%20search|Word search]] |
| [[Word%20search|Word search]] |
||
| Task |
| Task |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 9 |
| 9 |
||
| [[Transportation%20problem|Transportation problem]] |
| [[Transportation%20problem|Transportation problem]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 9 |
| 9 |
||
| [[Abbreviations%2C%20automatic|Abbreviations, automatic]] |
| [[Abbreviations%2C%20automatic|Abbreviations, automatic]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 9 |
| 9 |
||
| [[File%20size%20distribution|File size distribution]] |
| [[File%20size%20distribution|File size distribution]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 9 |
| 9 |
||
| [[Four%20is%20magic|Four is magic]] |
| [[Four%20is%20magic|Four is magic]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 9 |
| 9 |
||
| [[Color%20wheel|Color wheel]] |
| [[Color%20wheel|Color wheel]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 9 |
| 9 |
||
| [[Free%20polyominoes%20enumeration|Free polyominoes enumeration]] |
| [[Free%20polyominoes%20enumeration|Free polyominoes enumeration]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 9 |
| 9 |
||
| [[Continued%20fraction%2FArithmetic%2FG%28matrix%20NG%2C%20Contined%20Fraction%20N%29|Continued fraction/Arithmetic/G(matrix NG, Contined Fraction N)]] |
| [[Continued%20fraction%2FArithmetic%2FG%28matrix%20NG%2C%20Contined%20Fraction%20N%29|Continued fraction/Arithmetic/G(matrix NG, Contined Fraction N)]] |
||
Line 5,676: | Line 5,698: | ||
| [[Compiler%2FAST%20interpreter|Compiler/AST interpreter]] |
| [[Compiler%2FAST%20interpreter|Compiler/AST interpreter]] |
||
| Task |
| Task |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 8 |
| 8 |
||
| [[Self-hosting%20compiler|Self-hosting compiler]] |
| [[Self-hosting%20compiler|Self-hosting compiler]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 8 |
| 8 |
||
| [[Loops%2FIncrement%20loop%20index%20within%20loop%20body|Loops/Increment loop index within loop body]] |
| [[Loops%2FIncrement%20loop%20index%20within%20loop%20body|Loops/Increment loop index within loop body]] |
||
Line 5,688: | Line 5,710: | ||
| [[Hunt%20The%20Wumpus|Hunt The Wumpus]] |
| [[Hunt%20The%20Wumpus|Hunt The Wumpus]] |
||
| Task |
| Task |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 8 |
| 8 |
||
| [[Montgomery%20reduction|Montgomery reduction]] |
| [[Montgomery%20reduction|Montgomery reduction]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 8 |
| 8 |
||
| [[Kosaraju|Kosaraju]] |
| [[Kosaraju|Kosaraju]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 8 |
| 8 |
||
| [[Largest%20number%20divisible%20by%20its%20digits|Largest number divisible by its digits]] |
| [[Largest%20number%20divisible%20by%20its%20digits|Largest number divisible by its digits]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 8 |
| 8 |
||
| [[Perceptron|Perceptron]] |
| [[Perceptron|Perceptron]] |
||
Line 5,708: | Line 5,730: | ||
| [[Compiler%2Fsyntax%20analyzer|Compiler/syntax analyzer]] |
| [[Compiler%2Fsyntax%20analyzer|Compiler/syntax analyzer]] |
||
| Task |
| Task |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 8 |
| 8 |
||
| [[Finite%20state%20machine|Finite state machine]] |
| [[Finite%20state%20machine|Finite state machine]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 7 |
| 7 |
||
| [[Run%20as%20a%20daemon%20or%20service|Run as a daemon or service]] |
| [[Run%20as%20a%20daemon%20or%20service|Run as a daemon or service]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 7 |
| 7 |
||
| [[Mastermind|Mastermind]] |
| [[Mastermind|Mastermind]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 7 |
| 7 |
||
| [[Time-based%20One-time%20Password%20Algorithm|Time-based One-time Password Algorithm]] |
| [[Time-based%20One-time%20Password%20Algorithm|Time-based One-time Password Algorithm]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 7 |
| 7 |
||
| [[Particle%20Swarm%20Optimization|Particle Swarm Optimization]] |
| [[Particle%20Swarm%20Optimization|Particle Swarm Optimization]] |
||
Line 5,732: | Line 5,754: | ||
| [[The%20Name%20Game|The Name Game]] |
| [[The%20Name%20Game|The Name Game]] |
||
| Task |
| Task |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 7 |
| 7 |
||
| [[Generalised%20floating%20point%20addition|Generalised floating point addition]] |
| [[Generalised%20floating%20point%20addition|Generalised floating point addition]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 7 |
| 7 |
||
| [[Singly-linked%20list%2FElement%20removal|Singly-linked list/Element removal]] |
| [[Singly-linked%20list%2FElement%20removal|Singly-linked list/Element removal]] |
||
Line 5,744: | Line 5,766: | ||
|data-sort-value="deconvolution/0B2d+"| [[Deconvolution%2F2D%2B|Deconvolution/2D+]] |
|data-sort-value="deconvolution/0B2d+"| [[Deconvolution%2F2D%2B|Deconvolution/2D+]] |
||
| Task |
| Task |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 7 |
| 7 |
||
| [[Orbital%20elements|Orbital elements]] |
| [[Orbital%20elements|Orbital elements]] |
||
Line 5,752: | Line 5,774: | ||
| [[Canny%20edge%20detector|Canny edge detector]] |
| [[Canny%20edge%20detector|Canny edge detector]] |
||
| Task |
| Task |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 7 |
| 7 |
||
| [[Abbreviations%2C%20easy|Abbreviations, easy]] |
| [[Abbreviations%2C%20easy|Abbreviations, easy]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 7 |
| 7 |
||
| [[User%20defined%20pipe%20and%20redirection%20operators|User defined pipe and redirection operators]] |
| [[User%20defined%20pipe%20and%20redirection%20operators|User defined pipe and redirection operators]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 7 |
| 7 |
||
| [[IPC%20via%20named%20pipe|IPC via named pipe]] |
| [[IPC%20via%20named%20pipe|IPC via named pipe]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 7 |
| 7 |
||
| [[Monads%2FWriter%20monad|Monads/Writer monad]] |
| [[Monads%2FWriter%20monad|Monads/Writer monad]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 6 |
| 6 |
||
| [[Just%20in%20time%20processing%20on%20a%20character%20stream|Just in time processing on a character stream]] |
| [[Just%20in%20time%20processing%20on%20a%20character%20stream|Just in time processing on a character stream]] |
||
Line 5,776: | Line 5,798: | ||
| [[Catmull%E2%80%93Clark%20subdivision%20surface|Catmull–Clark subdivision surface]] |
| [[Catmull%E2%80%93Clark%20subdivision%20surface|Catmull–Clark subdivision surface]] |
||
| Task |
| Task |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 6 |
| 6 |
||
| [[French%20Republican%20calendar|French Republican calendar]] |
| [[French%20Republican%20calendar|French Republican calendar]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 6 |
| 6 |
||
| [[Parse%20EBNF|Parse EBNF]] |
| [[Parse%20EBNF|Parse EBNF]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 6 |
| 6 |
||
| [[Addition%20chains|Addition chains]] |
| [[Addition%20chains|Addition chains]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 6 |
| 6 |
||
| [[Morpion%20solitaire|Morpion solitaire]] |
| [[Morpion%20solitaire|Morpion solitaire]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 6 |
| 6 |
||
| [[Banker%27s%20algorithm|Banker's algorithm]] |
| [[Banker%27s%20algorithm|Banker's algorithm]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 5 |
| 5 |
||
| [[Spelling%20of%20ordinal%20numbers|Spelling of ordinal numbers]] |
| [[Spelling%20of%20ordinal%20numbers|Spelling of ordinal numbers]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 5 |
| 5 |
||
| [[Sorting%20algorithms%2FTree%20sort%20on%20a%20linked%20list|Sorting algorithms/Tree sort on a linked list]] |
| [[Sorting%20algorithms%2FTree%20sort%20on%20a%20linked%20list|Sorting algorithms/Tree sort on a linked list]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 5 |
| 5 |
||
| [[Combinations%20with%20repetitions%2FSquare%20Digit%20Chain|Combinations with repetitions/Square Digit Chain]] |
| [[Combinations%20with%20repetitions%2FSquare%20Digit%20Chain|Combinations with repetitions/Square Digit Chain]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 5 |
| 5 |
||
| [[Abbreviations%2C%20simple|Abbreviations, simple]] |
| [[Abbreviations%2C%20simple|Abbreviations, simple]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 5 |
| 5 |
||
| [[Audio%20frequency%20generator|Audio frequency generator]] |
| [[Audio%20frequency%20generator|Audio frequency generator]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 5 |
| 5 |
||
| [[Imaginary%20base%20numbers|Imaginary base numbers]] |
| [[Imaginary%20base%20numbers|Imaginary base numbers]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 5 |
| 5 |
||
| [[ASCII%20art%20diagram%20converter|ASCII art diagram converter]] |
| [[ASCII%20art%20diagram%20converter|ASCII art diagram converter]] |
||
Line 5,828: | Line 5,850: | ||
| [[Pinstripe%2FPrinter|Pinstripe/Printer]] |
| [[Pinstripe%2FPrinter|Pinstripe/Printer]] |
||
| Task |
| Task |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 5 |
| 5 |
||
| [[Starting%20a%20web%20browser|Starting a web browser]] |
| [[Starting%20a%20web%20browser|Starting a web browser]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 5 |
| 5 |
||
| [[OpenGL%20Pixel%20Shader|OpenGL Pixel Shader]] |
| [[OpenGL%20Pixel%20Shader|OpenGL Pixel Shader]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 4 |
| 4 |
||
| [[Using%20the%20Meetup.com%20API|Using the Meetup.com API]] |
| [[Using%20the%20Meetup.com%20API|Using the Meetup.com API]] |
||
Line 5,844: | Line 5,866: | ||
|data-sort-value="0C15 puzzle solver"| [[15%20puzzle%20solver|15 puzzle solver]] |
|data-sort-value="0C15 puzzle solver"| [[15%20puzzle%20solver|15 puzzle solver]] |
||
| Task |
| Task |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 4 |
| 4 |
||
| [[Snake%20And%20Ladder|Snake And Ladder]] |
| [[Snake%20And%20Ladder|Snake And Ladder]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 4 |
| 4 |
||
| [[Gauss-Jordan%20matrix%20inversion|Gauss-Jordan matrix inversion]] |
| [[Gauss-Jordan%20matrix%20inversion|Gauss-Jordan matrix inversion]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 4 |
| 4 |
||
|data-sort-value="continued fraction/arithmetic/g(matrix ng, contined fraction n0B1, contined fraction n0B2)"| [[Continued%20fraction%2FArithmetic%2FG%28matrix%20NG%2C%20Contined%20Fraction%20N1%2C%20Contined%20Fraction%20N2%29|Continued fraction/Arithmetic/G(matrix NG, Contined Fraction N1, Contined Fraction N2)]] |
|data-sort-value="continued fraction/arithmetic/g(matrix ng, contined fraction n0B1, contined fraction n0B2)"| [[Continued%20fraction%2FArithmetic%2FG%28matrix%20NG%2C%20Contined%20Fraction%20N1%2C%20Contined%20Fraction%20N2%29|Continued fraction/Arithmetic/G(matrix NG, Contined Fraction N1, Contined Fraction N2)]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 4 |
| 4 |
||
| [[Four%20is%20the%20number%20of%20letters%20in%20the%20...|Four is the number of letters in the ...]] |
| [[Four%20is%20the%20number%20of%20letters%20in%20the%20...|Four is the number of letters in the ...]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 4 |
| 4 |
||
| [[Geometric%20algebra|Geometric algebra]] |
| [[Geometric%20algebra|Geometric algebra]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 4 |
| 4 |
||
| [[Data%20Encryption%20Standard|Data Encryption Standard]] |
| [[Data%20Encryption%20Standard|Data Encryption Standard]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 4 |
| 4 |
||
| [[Tetris|Tetris]] |
| [[Tetris|Tetris]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 4 |
| 4 |
||
| [[Pentomino%20tiling|Pentomino tiling]] |
| [[Pentomino%20tiling|Pentomino tiling]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 4 |
| 4 |
||
| [[Fibonacci%20heap|Fibonacci heap]] |
| [[Fibonacci%20heap|Fibonacci heap]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 4 |
| 4 |
||
| [[Remote%20agent%2FAgent%20interface|Remote agent/Agent interface]] |
| [[Remote%20agent%2FAgent%20interface|Remote agent/Agent interface]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 4 |
| 4 |
||
| [[Functional%20coverage%20tree|Functional coverage tree]] |
| [[Functional%20coverage%20tree|Functional coverage tree]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 4 |
| 4 |
||
| [[Greed|Greed]] |
| [[Greed|Greed]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 4 |
| 4 |
||
| [[Addition-chain%20exponentiation|Addition-chain exponentiation]] |
| [[Addition-chain%20exponentiation|Addition-chain exponentiation]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 4 |
| 4 |
||
| [[Rosetta%20Code%2FRun%20examples|Rosetta Code/Run examples]] |
| [[Rosetta%20Code%2FRun%20examples|Rosetta Code/Run examples]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 4 |
| 4 |
||
| [[Remote%20agent%2FSimulation|Remote agent/Simulation]] |
| [[Remote%20agent%2FSimulation|Remote agent/Simulation]] |
||
Line 5,908: | Line 5,930: | ||
| [[Colour%20pinstripe%2FPrinter|Colour pinstripe/Printer]] |
| [[Colour%20pinstripe%2FPrinter|Colour pinstripe/Printer]] |
||
| Task |
| Task |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 4 |
| 4 |
||
| [[Remote%20agent%2FAgent%20logic|Remote agent/Agent logic]] |
| [[Remote%20agent%2FAgent%20logic|Remote agent/Agent logic]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 4 |
| 4 |
||
| [[Railway%20circuit|Railway circuit]] |
| [[Railway%20circuit|Railway circuit]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 4 |
| 4 |
||
| [[Using%20a%20Speech%20engine%20to%20highlight%20words|Using a Speech engine to highlight words]] |
| [[Using%20a%20Speech%20engine%20to%20highlight%20words|Using a Speech engine to highlight words]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 4 |
| 4 |
||
| [[One-time%20pad|One-time pad]] |
| [[One-time%20pad|One-time pad]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 4 |
| 4 |
||
| [[Tarjan|Tarjan]] |
| [[Tarjan|Tarjan]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 3 |
| 3 |
||
| [[Hexapawn|Hexapawn]] |
| [[Hexapawn|Hexapawn]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 3 |
| 3 |
||
| [[OpenGL%2FUtah%20Teapot|OpenGL/Utah Teapot]] |
| [[OpenGL%2FUtah%20Teapot|OpenGL/Utah Teapot]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 3 |
| 3 |
||
| [[Rosetta%20Code%2FRank%20languages%20by%20number%20of%20users|Rosetta Code/Rank languages by number of users]] |
| [[Rosetta%20Code%2FRank%20languages%20by%20number%20of%20users|Rosetta Code/Rank languages by number of users]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 3 |
| 3 |
||
| [[Robots|Robots]] |
| [[Robots|Robots]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 3 |
| 3 |
||
| [[Boids|Boids]] |
| [[Boids|Boids]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 3 |
| 3 |
||
| [[Text%20to%20HTML|Text to HTML]] |
| [[Text%20to%20HTML|Text to HTML]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 3 |
| 3 |
||
| [[Rosetta%20Code%2FTasks%20without%20examples|Rosetta Code/Tasks without examples]] |
| [[Rosetta%20Code%2FTasks%20without%20examples|Rosetta Code/Tasks without examples]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 3 |
| 3 |
||
| [[Simulated%20annealing|Simulated annealing]] |
| [[Simulated%20annealing|Simulated annealing]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 2 |
| 2 |
||
| [[Recursive%20descent%20parser%20generator|Recursive descent parser generator]] |
| [[Recursive%20descent%20parser%20generator|Recursive descent parser generator]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 2 |
| 2 |
||
| [[Tamagotchi%20emulator|Tamagotchi emulator]] |
| [[Tamagotchi%20emulator|Tamagotchi emulator]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 2 |
| 2 |
||
| [[OpenWebNet%20Password|OpenWebNet Password]] |
| [[OpenWebNet%20Password|OpenWebNet Password]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 2 |
| 2 |
||
| [[Solve%20a%20Rubik%27s%20Cube|Solve a Rubik's Cube]] |
| [[Solve%20a%20Rubik%27s%20Cube|Solve a Rubik's Cube]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 2 |
| 2 |
||
| [[External%20sort|External sort]] |
| [[External%20sort|External sort]] |
||
Line 5,984: | Line 6,006: | ||
| [[OLE%20Automation|OLE Automation]] |
| [[OLE%20Automation|OLE Automation]] |
||
| Task |
| Task |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 2 |
| 2 |
||
| [[Audio%20Overlap%20Loop|Audio Overlap Loop]] |
| [[Audio%20Overlap%20Loop|Audio Overlap Loop]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 2 |
| 2 |
||
| [[Chess%20player|Chess player]] |
| [[Chess%20player|Chess player]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 2 |
| 2 |
||
| [[Penrose%20tiling|Penrose tiling]] |
| [[Penrose%20tiling|Penrose tiling]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 1 |
| 1 |
||
| [[Terminal%20control%2FRestricted%20width%20positional%20input%2FWith%20wrapping|Terminal control/Restricted width positional input/With wrapping]] |
| [[Terminal%20control%2FRestricted%20width%20positional%20input%2FWith%20wrapping|Terminal control/Restricted width positional input/With wrapping]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 1 |
| 1 |
||
| [[Solving%20coin%20problems|Solving coin problems]] |
| [[Solving%20coin%20problems|Solving coin problems]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 1 |
| 1 |
||
| [[Generalised%20floating%20point%20multiplication|Generalised floating point multiplication]] |
| [[Generalised%20floating%20point%20multiplication|Generalised floating point multiplication]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 1 |
| 1 |
||
| [[Multidimensional%20Newton-Raphson%20metod|Multidimensional Newton-Raphson metod]] |
| [[Multidimensional%20Newton-Raphson%20metod|Multidimensional Newton-Raphson metod]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 1 |
| 1 |
||
| [[Terminal%20control%2FRestricted%20width%20positional%20input%2FNo%20wrapping|Terminal control/Restricted width positional input/No wrapping]] |
| [[Terminal%20control%2FRestricted%20width%20positional%20input%2FNo%20wrapping|Terminal control/Restricted width positional input/No wrapping]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 1 |
| 1 |
||
| [[IRC%20gateway|IRC gateway]] |
| [[IRC%20gateway|IRC gateway]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 1 |
| 1 |
||
| [[Rosetta%20Code%2FList%20authors%20of%20task%20descriptions|Rosetta Code/List authors of task descriptions]] |
| [[Rosetta%20Code%2FList%20authors%20of%20task%20descriptions|Rosetta Code/List authors of task descriptions]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 1 |
| 1 |
||
| [[Process%20SMIL%20directives%20in%20XML%20data|Process SMIL directives in XML data]] |
| [[Process%20SMIL%20directives%20in%20XML%20data|Process SMIL directives in XML data]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 1 |
| 1 |
||
| [[Black%20Box|Black Box]] |
| [[Black%20Box|Black Box]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 0 |
| 0 |
||
| [[Waveform%20analysis%2FDoh%20ray%20me|Waveform analysis/Doh ray me]] |
| [[Waveform%20analysis%2FDoh%20ray%20me|Waveform analysis/Doh ray me]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 0 |
| 0 |
||
| [[Rosetta%20Code%2FTasks%20sorted%20by%20average%20lines%20of%20code|Rosetta Code/Tasks sorted by average lines of code]] |
| [[Rosetta%20Code%2FTasks%20sorted%20by%20average%20lines%20of%20code|Rosetta Code/Tasks sorted by average lines of code]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 0 |
| 0 |
||
| [[Waveform%20analysis%2FTop%20and%20tail|Waveform analysis/Top and tail]] |
| [[Waveform%20analysis%2FTop%20and%20tail|Waveform analysis/Top and tail]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 0 |
| 0 |
||
| [[Ukkonen%E2%80%99s%20Suffix%20Tree%20Construction|Ukkonen’s Suffix Tree Construction]] |
| [[Ukkonen%E2%80%99s%20Suffix%20Tree%20Construction|Ukkonen’s Suffix Tree Construction]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 0 |
| 0 |
||
| [[Weather%20Routing|Weather Routing]] |
| [[Weather%20Routing|Weather Routing]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 0 |
| 0 |
||
| [[Chess%20player%2FSearch%20and%20evaluation|Chess player/Search and evaluation]] |
| [[Chess%20player%2FSearch%20and%20evaluation|Chess player/Search and evaluation]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 0 |
| 0 |
||
| [[Blackjack%20strategy|Blackjack strategy]] |
| [[Blackjack%20strategy|Blackjack strategy]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 0 |
| 0 |
||
| [[Chess%20player%2FProgram%20options%20and%20user%20interface|Chess player/Program options and user interface]] |
| [[Chess%20player%2FProgram%20options%20and%20user%20interface|Chess player/Program options and user interface]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 0 |
| 0 |
||
| [[Chess%20player%2FMove%20generation|Chess player/Move generation]] |
| [[Chess%20player%2FMove%20generation|Chess player/Move generation]] |
||
| Draft |
| Draft |
||
|- style="background-color: #ffc" |
|||
|- |
|||
| 0 |
| 0 |
||
| [[Unicode%20polynomial%20equation|Unicode polynomial equation]] |
| [[Unicode%20polynomial%20equation|Unicode polynomial equation]] |
Revision as of 14:10, 30 March 2018
You are encouraged to solve this task according to the task description, using any language you may know.
Find the total number of programming examples for each task and the total for all tasks.
Essentially, count the number of occurrences of =={{header| on each task page.
Output:
100 doors: 20 examples. 99 Bottles of Beer: 29 examples. Abstract type: 10 examples. Total: X examples.
You'll need to use the Media Wiki API, which you can find out about locally, here, or in Media Wiki's API documentation at, API:Query
Ada
Parsing XML file with XMLAda from AdaCore <lang Ada>with Aws.Client, Aws.Messages, Aws.Response, Aws.Resources, Aws.Url; with Dom.Readers, Dom.Core, Dom.Core.Documents, Dom.Core.Nodes, Dom.Core.Attrs; with Input_Sources.Strings, Unicode, Unicode.Ces.Utf8; with Ada.Strings.Unbounded, Ada.Strings.Fixed, Ada.Text_IO, Ada.Command_Line; with Ada.Containers.Vectors;
use Aws.Client, Aws.Messages, Aws.Response, Aws.Resources, Aws.Url; use Dom.Readers, Dom.Core, Dom.Core.Documents, Dom.Core.Nodes, Dom.Core.Attrs; use Aws, Ada.Strings.Unbounded, Ada.Strings.Fixed, Input_Sources.Strings; use Ada.Text_IO, Ada.Command_Line;
procedure Count_Examples is
package Members_Vectors is new Ada.Containers.Vectors ( Index_Type => Positive, Element_Type => Unbounded_String); use Members_Vectors;
Exemples : Vector; Nbr_Lg, Total : Natural := 0;
procedure Get_Vector (Category : in String; Mbr_Vector : in out Vector) is Reader : Tree_Reader; Doc : Document; List : Node_List; N : Node; A : Attr; Page : Aws.Response.Data; Uri_Xml : constant String := "http://rosettacode.org/mw/api.php?action=query&list=categorymembers" & "&format=xml&cmlimit=500&cmtitle=Category:"; begin Page := Client.Get (Uri_Xml & Category); if Response.Status_Code (Page) not in Messages.Success then raise Client.Connection_Error; end if; declare Xml : constant String := Message_Body (Page); Source : String_Input; begin Open (Xml'Unrestricted_Access, Unicode.Ces.Utf8.Utf8_Encoding, Source); Parse (Reader, Source); Close (Source); end; Doc := Get_Tree (Reader); List := Get_Elements_By_Tag_Name (Doc, "cm"); for Index in 1 .. Length (List) loop N := Item (List, Index - 1); A := Get_Named_Item (Attributes (N), "title"); Append (Mbr_Vector, To_Unbounded_String (Value (A))); end loop; Free (List); Free (Reader); end Get_Vector;
function Scan_Page (Title : String) return Natural is Page : Aws.Response.Data; File : Aws.Resources.File_Type; Buffer : String (1 .. 1024); Languages, Position, Last : Natural := 0; begin Page := Client.Get ("http://rosettacode.org/mw/index.php?title=" & Aws.Url.Encode (Title) & "&action=raw"); Response.Message_Body (Page, File); while not End_Of_File (File) loop Resources.Get_Line (File, Buffer, Last); Position := Index (Source => Buffer (Buffer'First .. Last), Pattern => "=={{header|"); if Position > 0 then Languages := Languages + 1; end if; end loop; Close (File); return Languages; end Scan_Page;
begin
Get_Vector ("Programming_Tasks", Exemples);
for I in First_Index (Exemples) .. Last_Index (Exemples) loop declare Title : constant String := To_String (Members_Vectors.Element (Exemples, I)); begin Nbr_Lg := Scan_Page (Title); Total := Total + Nbr_Lg; Put_Line (Title & " :" & Integer'Image (Nbr_Lg) & " exemples."); end; end loop;
Put_Line ("Total :" & Integer'Image (Total) & " exemples.");
end Count_Examples; </lang> Output :
100 doors : 107 exemples. 24 game : 30 exemples. .... Yahoo! search interface : 10 exemples. Zig-zag matrix : 49 exemples. Total : 17238 exemples.
AutoHotkey
<lang AutoHotkey>UrlDownloadToFile
, http://www.rosettacode.org/w/api.php?action=query&list=categorymembers&cmtitle=Category:Programming_Tasks&cmlimit=500&format=xml , tasks.xml
FileRead, tasks, tasks.xml pos = 0 quote = " ; " regtitle := "<cm.*?title=" . quote . "(.*?)" . quote While, pos := RegExMatch(tasks, regtitle, title, pos + 1) {
UrlDownloadToFile , % "http://www.rosettacode.org/w/index.php?title=" . title1 . "&action=raw" , task.xml FileRead, task, task.xml RegExReplace(task, "\{\{header\|", "", count) current := title1 . ": " . count . " examples.`n" output .= current TrayTip, current, % current
} MsgBox % output Return</lang>
BBC BASIC
<lang bbcbasic> VDU 23,22,640;512;8,16,16,128+8 : REM Enable UTF-8 support
SYS "LoadLibrary", "URLMON.DLL" TO urlmon% SYS "GetProcAddress", urlmon%, "URLDownloadToFileA" TO UDTF special$ = "+()'" url$ = "http://www.rosettacode.org/w/api.php?action=query" + \ \ "&list=categorymembers&cmtitle=Category:Programming_Tasks" + \ \ "&cmlimit=500&format=xml" file$ = @tmp$ + "tasks.xml" SYS UDTF, 0, url$, file$, 0, 0 TO fail% IF fail% ERROR 100, "File download failed (tasks)" Total% = 0 file% = OPENIN(file$) WHILE NOT EOF#file% a$ = GET$#file% i% = 0 REPEAT i% = INSTR(a$, "title=", i%+1) IF i% THEN j% = INSTR(a$, ">", i%) title$ = MID$(a$, i%+7, j%-i%-10) REM Replace HTML codes: REPEAT k% = INSTR(title$, "&") IF k% THEN l% = INSTR(title$, ";", k%) title$ = LEFT$(title$,k%-1) + \ \ FNhtml(MID$(title$,k%,l%-k%+1)) + MID$(title$,l%+1) ENDIF UNTIL k% = 0 t$ = title$ REM Substitute characters not allowed in a URL: FOR s% = 1 TO LEN(special$) REPEAT s$ = MID$(special$, s%, 1) k% = INSTR(t$, s$) IF k% t$ = LEFT$(t$,k%-1) + "%" + STR$~ASCs$ + MID$(t$,k%+1) UNTIL k% = 0 NEXT url$ = "http://www.rosettacode.org/w/index.php?title=" + t$ + \ \ "&action=raw" file$ = @tmp$ + "title.htm" SYS UDTF, 0, url$, file$, 0, 0 TO fail% IF fail% ERROR 100, "File download failed " + t$ examples% = 0 task% = OPENIN(file$) WHILE NOT EOF#task% IF INSTR(GET$#task%, "=={{header|") examples% += 1 ENDWHILE CLOSE #task% Total% += examples% PRINT title$ ": " ; examples% " examples." ENDIF UNTIL i% = 0 i% = INSTR(a$, "cmcontinue=") IF i% THEN CLOSE #file% j% = INSTR(a$, """", i%+1) k% = INSTR(a$, """", j%+1) url$ = "http://www.rosettacode.org/w/api.php?action=query" + \ \ "&list=categorymembers&cmtitle=Category:Programming_Tasks" + \ \ "&cmlimit=500&format=xml&cmcontinue=" + MID$(a$,j%+1,k%-j%) REPEAT i% = INSTR(url$, "|") IF i% url$ = LEFT$(url$,i%-1) + "%7C" + MID$(url$,i%+1) UNTIL i% = 0 file$ = @tmp$ + "tasks.xml" SYS UDTF, 0, url$, file$, 0, 0 TO fail% IF fail% ERROR 100, "File download failed (continue)" file% = OPENIN(file$) ENDIF ENDWHILE CLOSE #file% PRINT ' "Total: " ; Total% " examples." END DEF FNhtml(h$) IF LEFT$(h$,2) = "&#" THEN = CHR$(VALMID$(h$,3)) CASE h$ OF WHEN """: = """" ENDCASE = h$</lang>
Sample output:
100 doors: 154 examples. 24 game: 53 examples. 24 game/Solve: 30 examples. 99 Bottles of Beer: 181 examples. A+B: 124 examples. Abstract type: 49 examples. Accumulator factory: 65 examples. Ackermann function: 126 examples. Active Directory/Connect: 12 examples. Active Directory/Search for a user: 13 examples. ...... XML/DOM serialization: 33 examples. XML/Input: 50 examples. XML/Output: 41 examples. XML/XPath: 33 examples. Y combinator: 51 examples. Yahoo! search interface: 13 examples. Yin and yang: 36 examples. Zebra puzzle: 11 examples. Zeckendorf number representation: 14 examples. Zig-zag matrix: 64 examples. Total: 27004 examples.
Bracmat
<lang bracmat>( ( get-page
= . sys$(str$("wget -q -O wget.out \"" !arg \")) & get$("wget.out",HT ML) )
& get-page$"http://rosettacode.org/wiki/Category:Programming_Tasks"
: ? (table.?) ?tasklist (.table.) ?
& 0:?list & whl
' ( !tasklist : ? ( a . (href.@(?:"/wiki/" ?href)) (title.?title) & get-page$(str$("http://rosettacode.org/wiki/" !href)) : ?task & 0:?cnt & whl ' ( !task : ? ( (span.(class.mw-headline) (id.?)) ?span (.span.) ?task & !span : ? ( a . (href.@(?:"/wiki/Category:" ?)) (title.@(?:"Category:" ?)) ) @ (.a.) ? ) & 1+!cnt:?cnt ) & (!cnt.!title)+!list:?list ) ?tasklist )
& lst$(list,taskfreq,NEW)
)</lang>
Output (in file tasqfreq
):
list= (2."OLE Automation") + (3."Canny edge detector") + ( 3 . "Continued fraction/Arithmetic/G(matrix NG, Contined Fraction N1, Contined Fraction N2)" ) + (4."Colour pinstripe/Printer") + (4."Vogel's approximation method") + (5."Catmull–Clark subdivision surface") + (5."Percolation/Bond percolation") + (5.Pinstripe/Printer) + (5."Zeckendorf arithmetic") + (6."Continued fraction/Arithmetic/G(matrix NG, Contined Fraction N)") + (6."Percolation/Mean cluster density") + (7."Bitmap/PPM conversion through a pipe") + (7."Deconvolution/2D+") + (7."K-d tree") .... + (125."Greatest element of a list") + (127."Averages/Arithmetic mean") + (131.Arrays) + (131."Increment a numerical string") + (132."Greatest common divisor") + (133.Loops/While) + (134."Conditional structures") + (136.Arithmetic/Integer) + (137.Loops/For) + (145.Loops/Infinite) + (147."Ackermann function") + (148."Reverse a string") + (152."A+B") + (152."Function definition") + (160."Empty program") + (163."Fibonacci sequence") + (164.Factorial) + (182.FizzBuzz) + (187."100 doors") + (188.Comments) + (216."99 Bottles of Beer") + (269."Hello world/Text");
C#
Object-oriented solution.
<lang csharp>using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; using System.Net;
class Task {
private string _task; private int _examples;
public Task(string task, int examples) { _task = task; _examples = examples; }
public string Name { get { return _task; } }
public int Examples { get { return _examples; } }
public override string ToString() { return String.Format("{0}: {1} examples.", this._task, this._examples); }
}
class Program {
static List<string> GetTitlesFromCategory(string category, WebClient wc) { string content = wc.DownloadString( String.Format("http://www.rosettacode.org/w/api.php?action=query&list=categorymembers&cmtitle=Category:{0}&cmlimit=500&format=json", category) );
return new Regex("\"title\":\"(.+?)\"").Matches(content).Cast<Match>().Select(x => x.Groups[1].Value.Replace("\\/", "/")).ToList(); }
static string GetSourceCodeFromPage(string page, WebClient wc) { return wc.DownloadString( String.Format("http://www.rosettacode.org/w/index.php?title={0}&action=raw", page) ); }
static void Main(string[] args) { WebClient wc = new WebClient(); List<Task> tasks = new List<Task>(); List<string> tasknames = GetTitlesFromCategory("Programming_Tasks", wc);
foreach (string task in tasknames) { string content = GetSourceCodeFromPage(task, wc); int count = new Regex("=={{header", RegexOptions.IgnoreCase).Matches(content).Count; Task t = new Task(task, count);
Console.WriteLine(t); tasks.Add(t); }
Console.WriteLine("\nTotal: {0} examples.", tasks.Select(x => x.Examples).Sum()); }
}</lang>
Clojure
<lang clojure>(ns count-examples
(:import [java.net URLEncoder]) (:use [clojure.contrib.http.agent :only (http-agent string)] [clojure.contrib.json :only (read-json)] [clojure.contrib.string :only (join)]))
(defn url-encode [v] (URLEncoder/encode (str v) "utf-8"))
(defn rosettacode-get [path params]
(let [param-string (join "&" (for [[n v] params] (str (name n) "=" (url-encode v))))] (string (http-agent (format "http://www.rosettacode.org/w/%s?%s" path param-string)))))
(defn rosettacode-query [params]
(read-json (rosettacode-get "api.php" (merge {:action "query" :format "json"} params))))
(defn list-cm
([params] (list-cm params nil)) ([params continue] (let [cm-params (merge {:list "categorymembers"} params (or continue {})) result (rosettacode-query cm-params)] (concat (-> result (:query) (:categorymembers)) (if-let [cmcontinue (-> result (:query-continue) (:categorymembers))] (list-cm params cmcontinue))))))
(defn programming-tasks []
(let [result (list-cm {:cmtitle "Category:Programming_Tasks" :cmlimit 50})] (map #(:title %) result)))
(defn task-count [task]
[task (count (re-seq #"==\{\{header" (rosettacode-get "index.php" {:action "raw" :title task})))])
(defn print-result []
(let [task-counts (map task-count (programming-tasks))] (doseq [[task count] task-counts] (println (str task ":") count) (flush)) (println "Total: " (reduce #(+ %1 (second %2)) 0 task-counts))))
</lang> <lang clojure>count-examples> (print-result) 100 doors: 73 24 game: 18 24 game/Solve: 14 99 Bottles of Beer: 89 Abstract type: 27 Accumulator factory: 23 Ackermann function: 73 Active Directory/Connect: 4 Active Directory/Search for a user: 3 Active object: 14 Add a variable to a class instance at runtime: 21 Address of a variable: 20 ... Total: 11216 nil </lang>
D
<lang D> import tango.io.Stdout; import tango.net.http.HttpClient; import tango.net.http.HttpHeaders; import tango.text.xml.Document; import tango.text.Util;
alias HttpHeader.ContentLength CL;
auto url = "http://www.rosettacode.org/w/api.php?action=query&list=categorymembers&cmtitle=Category:Programming_Tasks&cmlimit=500&format=xml"; void main() {
auto client = new HttpClient (HttpClient.Get, url); client.open(); char[] mainData, tmp; int total, i;
void cat(void[] content) { tmp ~= cast(char[]) content; }
if (client.isResponseOK) { client.read(&cat, client.getResponseHeaders.getInt(CL)); mainData = tmp; tmp = null;
auto doc = new Document!(char); doc.parse(mainData); foreach (n; doc.query.descendant("cm").attribute("title")) { auto subClient = new HttpClient(HttpClient.Get, "http://www.rosettacode.org/w/index.php?title=" ~ replace(n.value.dup, ' ', '_') ~ "&action=raw"); subClient.open(); if (! subClient.isResponseOK) { Stderr (client.getResponse); break; } subClient.read(&cat, subClient.getResponseHeaders.getInt(CL)); foreach (segment; patterns(cast(char[])tmp, "=={{header|")) i++; --i; if (i) --i; Stdout.formatln ("{0,-40} - {}", n.value, i); total += i; tmp = null; i = 0; } Stdout("total examples: ", total).newline; } else { Stderr (client.getResponse); }
} </lang>
EGL
A graphical implementation with a grid showing the number of implementations for each Rosetta Code task as well as total task and implementation counts. Uses MediaWiki API service call to fetch tasks/categories in a JSON format and meets API data limit and continuation requirements to consume 100% of the items.
User Interface: RosettaCodeHandler.egl <lang EGL>package com.eglexamples.client;
import org.eclipse.edt.rui.widgets.*;
handler RosettaCodeHandler type RUIhandler{initialUI =[ui], title = "Rosetta Code Tasks and Counts"}
ui GridLayout{columns = 3, rows = 4, cellPadding = 4, children = [ b1, dg1, l1, l2, l3, l4 ]}; b1 Button{ layoutData = new GridLayoutData{ row = 1, column = 1 }, text = "Go!", onClick ::= b1_onClick }; l1 TextLabel{ layoutData = new GridLayoutData{ row = 1, column = 2 }, text = "Total Tasks:" }; l2 TextLabel{ layoutData = new GridLayoutData{ row = 1, column = 3 }, text = "0" };
l3 TextLabel{ layoutData = new GridLayoutData{ row = 2, column = 2 }, text = "Total Implementations:" }; l4 TextLabel{ layoutData = new GridLayoutData{ row = 2, column = 3 }, text = "0" }; dg1 DataGrid{ layoutData = new GridLayoutData{ row = 3, column = 1, horizontalSpan = 3 }, pageSize = 10, showScrollbar = true,
columns = [ new DataGridColumn{name = "title", displayName = "Task", width=220}, new DataGridColumn{name = "count", displayName = "Count", width=100} ] };
cmcontinue string?; title string?; allTasks Task[];
restBindingTasks IHttp? = new HttpRest{ restType = eglx.rest.ServiceType.TrueRest, request.uri = "http://rosettacode.org/mw/api.php?action=query&list=categorymembers&cmtitle=Category:Programming_Tasks&cmlimit=1&format=json"};
restBindingPageDetail IHttp? = new HttpRest{ restType = eglx.rest.ServiceType.TrueRest, request.uri = "http://rosettacode.org/mw/index.php"};
function b1_onClick(event Event in)
call ProxyFunctions.listTasks("") using restBindingTasks
returning to listTasksCallBack onException exceptionHandler; end function listTasksCallBack(retResult RosettaCodeJSON in)
title = retResult.query.categorymembers[1].title; cmcontinue = retResult.queryContinue.categorymembers.cmcontinue;
call ProxyFunctions.fetchPageDetail(title) using restBindingPageDetail
returning to pageDetailCallBack onException exceptionHandler; end
function pageDetailCallBack(pageResults string in) count int = countSubstring("=={{header", pageResults); allTasks.appendElement(new Task { title = title, count = count });
l2.text = l2.text as int + 1; l4.text = l4.text as int + count;
if(cmcontinue != null)
call ProxyFunctions.listTasks(cmcontinue) using restBindingTasks returning to listTasksCallBack onException exceptionHandler; else dg1.data = allTasks as any[]; end
end function countSubstring(substr string in, str string in) returns(int)
if(str.length() > 0 and substr.length() > 0) return (str.length() - str.replaceStr(subStr, "").length()) / subStr.length(); else return 0; end
end
function exceptionHandler(exp AnyException in) end
end
record Task title string; count int; end</lang>
Service Interface: ProxyFunctions.egl <lang EGL>package com.eglexamples.client;
library ProxyFunctions
function listTasks(continueLocation String in) returns (RosettaCodeJSON) {
@Rest{method = _GET, uriTemplate = "&cmcontinue={continueLocation}", requestFormat = None, responseFormat = JSON}
} end
function fetchPageDetail(title String in) returns (String) {
@Rest{method = _GET, uriTemplate = "?title={title}&action=raw", requestFormat = None, responseFormat = None}
} end
end
record RosettaCodeJSON
query Query; queryContinue QueryContinue{JSONName = "query-continue"};
end
record Query
categorymembers Categorymembers[];
end
record Categorymembers
cmcontinue string?; pageid int?; ns int?; title string?;
end
record QueryContinue
categorymembers Categorymembers;
end</lang>
Erlang
<lang erlang> -module(rosseta_examples). -include_lib("xmerl/include/xmerl.hrl").
-export([main/0]).
main() ->
application:start(inets), Titles = read_titles(empty), Result = lists:foldl(fun(Title,Acc) -> Acc + calculate_one(Title) end, 0, Titles), io:format("Total: ~p examples.\n",[Result]), application:stop(inets).
read_titles(CurrentContinue) ->
URL0 = "http://rosettacode.org/mw/api.php?" ++ "action=query&list=categorymembers&cmtitle=Category:Programming_Tasks" ++ "&cmlimit=500&format=xml", URL = case CurrentContinue of empty -> URL0; _ -> URL0 ++ "&cmcontinue=" ++ CurrentContinue end, {ok,Answer} = httpc:request(URL), {Document,_} = xmerl_scan:string(lists:last(tuple_to_list(Answer))), Continue = [Value || #xmlAttribute{value = Value} <- xmerl_xpath:string("//@cmcontinue", Document)], Titles = [Value || #xmlAttribute{value = Value} <- xmerl_xpath:string("//@title", Document)], case Continue of []-> Titles; [ContValue | _] -> Titles ++ read_titles(ContValue) end.
calculate_one(Title0) ->
Title = replace_chars(Title0), URL = "http://www.rosettacode.org/w/index.php?title=" ++ Title ++ "&action=raw", case httpc:request(URL) of {ok,Result} -> {match,Found} = re:run(lists:last(tuple_to_list(Result)), "\n=={{header(|)", [global]), io:format("~ts: ~p examples.\n",[Title0,length(Found)]), length(Found); {error,socket_closed_remotely} -> io:format("Socket closed remotely. Retry.\n"), calculate_one(Title0) end.
replace_chars(String) ->
replace_chars(String,[]).
replace_chars([$ | T],Acc) ->
replace_chars(T, [$_| Acc]);
replace_chars([$+| T],Acc) ->
replace_chars(T, lists:reverse("%2B") ++ Acc);
replace_chars([8211| T],Acc) ->
replace_chars(T, lists:reverse("%E2%80%93") ++ Acc);
replace_chars([Other| T],Acc) ->
replace_chars(T, [Other| Acc]);
replace_chars([],Acc) ->
lists:reverse(Acc).
</lang>
Outputs:
> rosseta_examples:main(). 100 doors: 165 examples. 24 game: 56 examples. 24 game/Solve: 33 examples. ... Zebra puzzle: 12 examples. Zeckendorf number representation: 18 examples. Zig-zag matrix: 65 examples. Total: 28629 examples.
F#
Using asynchronous workflows to perform downloads concurrently:
<lang fsharp>#r "System.Xml.Linq.dll"
let uri1 = "http://www.rosettacode.org/w/api.php?action=query&list=categorymembers&cmtitle=Category:Programming_Tasks&cmlimit=500&format=xml" let uri2 task = sprintf "http://www.rosettacode.org/w/index.php?title=%s&action=raw" task
[|for xml in (System.Xml.Linq.XDocument.Load uri1).Root.Descendants() do
for attrib in xml.Attributes() do if attrib.Name.LocalName = "title" then yield async { let uri = uri2 (attrib.Value.Replace(" ", "_") |> System.Web.HttpUtility.UrlEncode) use client = new System.Net.WebClient() let! html = client.AsyncDownloadString(System.Uri uri) let sols' = html.Split([|"{{header|"|], System.StringSplitOptions.None).Length - 1 lock stdout (fun () -> printfn "%s: %d examples" attrib.Value sols') return sols' }|]
|> Async.Parallel |> Async.RunSynchronously |> fun xs -> printfn "Total: %d examples" (Seq.sum xs)</lang>
This is 21× faster than the python thanks to the concurrency.
Factor
Runs in about a minute. The number of threads is limited to 10 avoid cloudfare's protection mechanism.
<lang factor>USING: arrays assocs concurrency.combinators concurrency.semaphores formatting hashtables http.client io json.reader kernel math math.parser sequences splitting urls.encoding ; IN: rosetta-code.count-examples
CONSTANT: list-url "http://rosettacode.org/mw/api.php?action=query&list=categorymembers&cmtitle=Category:Programming_Tasks&cmlimit=500&cmprop=title&format=json"
- titles ( query -- titles )
"query" of "categorymembers" of [ "title" of ] map ;
- continued-url ( query -- url/f )
"query-continue" of "categorymembers" of [ assoc>query list-url swap "&" glue ] [ f ] if* ;
- (all-programming-titles) ( titles url -- titles' url' )
http-get nip json> [ titles append ] [ continued-url ] bi [ (all-programming-titles) ] [ f ] if* ;
- all-programming-titles ( -- titles ) { } list-url (all-programming-titles) drop ;
CONSTANT: content-base-url "http://rosettacode.org/mw/index.php?title=&action=raw"
- content-url ( title -- url )
" " "_" replace "title" associate assoc>query content-base-url swap "&" glue ;
- occurences ( seq subseq -- n ) split-subseq length 1 - ;
- count-examples ( title -- n )
content-url http-get nip "=={{header|" occurences ;
- print-task ( title n -- ) "%s: %d examples.\n" printf ;
- print-total ( assoc -- ) values sum "Total: %d examples.\n" printf ;
- fetch-counts ( titles -- assoc )
10 <semaphore> [ [ dup count-examples 2array ] with-semaphore ] curry parallel-map ;
- print-counts ( titles -- )
[ [ print-task ] assoc-each nl ] [ print-total ] bi ;
- rosetta-examples ( -- )
all-programming-titles fetch-counts print-counts ;
MAIN: rosetta-examples</lang> Outputs:
100 doors: 169 examples. 24 game: 58 examples. ... Zeckendorf number representation: 22 examples. Zig-zag matrix: 66 examples. Total: 30745 examples.
Go
<lang go>package main
import (
"bytes" "encoding/xml" "fmt" "io" "io/ioutil" "net/http" "net/url" "strings"
)
func req(u string, foundCm func(string)) string {
resp, err := http.Get(u) if err != nil { fmt.Println(err) // connection or request fail return "" } defer resp.Body.Close() for p := xml.NewDecoder(resp.Body); ; { t, err := p.RawToken() switch s, ok := t.(xml.StartElement); { case err == io.EOF: return "" case err != nil: fmt.Println(err) return "" case !ok: continue case s.Name.Local == "cm": for _, a := range s.Attr { if a.Name.Local == "title" { foundCm(a.Value) } } case s.Name.Local == "categorymembers" && len(s.Attr) > 0 && s.Attr[0].Name.Local == "cmcontinue": return url.QueryEscape(s.Attr[0].Value) } } return ""
}
func main() {
taskQuery := "http://rosettacode.org/mw/api.php?action=query" + "&format=xml&list=categorymembers&cmlimit=500" + "&cmtitle=Category:Programming_Tasks" continueAt := req(taskQuery, count) for continueAt > "" { continueAt = req(taskQuery+"&cmcontinue="+continueAt, count) } fmt.Printf("Total: %d examples.\n", total)
}
var marker = []byte("=={{header|") var total int
func count(cm string) {
taskFmt := "http://rosettacode.org/mw/index.php?title=%s&action=raw" taskEsc := url.QueryEscape(strings.Replace(cm, " ", "_", -1)) resp, err := http.Get(fmt.Sprintf(taskFmt, taskEsc)) var page []byte if err == nil { page, err = ioutil.ReadAll(resp.Body) resp.Body.Close() } if err != nil { fmt.Println(err) return } examples := bytes.Count(page, marker) fmt.Printf("%s: %d\n", cm, examples) total += examples
}</lang>
- Output
- (May 25, 2011):
... Y combinator: 40 Yahoo! search interface: 10 Yin and yang: 18 Zig-zag matrix: 50 Total: 18290 examples.
Haskell
from HackageDB
<lang haskell>import Network.Browser import Network.HTTP import Network.URI import Data.List import Data.Maybe import Text.XML.Light import Control.Arrow
justifyR w = foldl ((.return).(++).tail) (replicate w ' ') showFormatted t n = t ++ ": " ++ justifyR 4 (show n)
getRespons url = do
rsp <- Network.Browser.browse $ do setAllowRedirects True setOutHandler $ const (return ()) -- quiet request $ getRequest url return $ rspBody $ snd rsp
getNumbOfExampels p = do
let pg = intercalate "_" $ words p rsp <- getRespons $ "http://www.rosettacode.org/w/index.php?title=" ++ pg ++ "&action=raw" let taskPage = rsp countEx = length $ filter (=="=={{header|") $ takeWhile(not.null) $ unfoldr (Just. (take 11 &&& drop 1)) taskPage return countEx
progTaskExamples = do
rsp <- getRespons "http://www.rosettacode.org/w/api.php?action=query&list=categorymembers&cmtitle=Category:Programming_Tasks&cmlimit=500&format=xml"
let xmls = onlyElems $ parseXML $ rsp tasks = concatMap (map (fromJust.findAttr (unqual "title")). filterElementsName (== unqual "cm")) xmls
taskxx <- mapM getNumbOfExampels tasks let ns = taskxx tot = sum ns
mapM_ putStrLn $ zipWith showFormatted tasks ns putStrLn $ ("Total: " ++) $ show tot</lang>
some output: <lang haskell>*Main> progTaskExamples 100 doors: 56 24 game: 11 24 game Player: 9 99 Bottles of Beer: 73 Abstract type: 23 Ackermann Function: 61 Active object: 9 ... Total: 9156</lang>
Icon and Unicon
The following code uses features exclusive to Unicon. This version handles all tasks, not just the first 500.
<lang Unicon>$define RCINDEX "http://rosettacode.org/mw/api.php?format=xml&action=query&list=categorymembers&cmtitle=Category:Programming_Tasks&cmlimit=500" $define RCTASK "http://rosettacode.org/mw/index.php?action=raw&title=" $define RCUA "User-Agent: Unicon Rosetta 0.1" $define RCXUA "X-Unicon: http://unicon.org/" $define TASKTOT "* Total Tasks *" $define TOTTOT "* Total Headers*"
link strings link hexcvt
procedure main(A) # simple single threaded read all at once implementation
Tasks := table(0) every task := taskNames() do { Tasks[TASKTOT] +:= 1 # count tasks every lang := languages(task) do { # count languages Tasks[task] +:= 1 Tasks[TOTTOT] +:= 1 } } every insert(O := set(),key(Tasks)) # extract & sort keys O := put(sort(O--set(TOTTOT,TASKTOT)),TASKTOT,TOTTOT) # move totals to end every write(k := !O, " : ", Tasks[k]," examples.") # report
end
- Generate task names
procedure taskNames()
continue := "" while \(txt := ReadURL(RCINDEX||continue)) do { txt ? { while tab(find("<cm ") & find(s :="title=\"")+*s) do suspend tab(find("\""))\1 if tab(find("cmcontinue=")) then { continue := "&"||tab(upto(' \t')) } else break } }
end
- Generate language headers in a task
procedure languages(task)
static WS initial WS := ' \t' page := ReadURL(RCTASK||CleanURI(task)) page ? while (tab(find("\n==")),tab(many(WS))|"",tab(find("{{"))) do { header := tab(find("==")) header ? { while tab(find("{{header|")) do { suspend 2(="",tab(find("")))\1 } } }
end
procedure CleanURI(u) #: clean up a URI
static tr,dxml # xml & http translation initial { tr := table() every c := !string(~(&digits++&letters++'-_.!~*()/\'`')) do tr[c] := "%"||hexstring(ord(c),2) every /tr[c := !string(&cset)] := c tr[" "] := "_" # wiki convention every push(dxml := [],"&#"||right(ord(c := !"&<>'\""),3,"0")||";",c) } dxml[1] := u # insert URI as 1st arg u := replacem!dxml # de-xml it every (c := "") ||:= tr[!u] # reencode everything c := replace(c,"%3E","'") # Hack to put single quotes back in c := replace(c,"%26quot%3B","\"") # Hack to put double quotes back in return c
end
procedure ReadURL(url) #: read URL into string
page := open(url,"m",RCUA,RCXUA) | stop("Unable to open ",url) text := "" if page["Status-Code"] < 300 then while text ||:= reads(page,-1) else write(&errout,image(url),": ", page["Status-Code"]," ",page["Reason-Phrase"]) close(page) return text
end</lang>
strings provides replacem hexcvt provides hexstring
Sample Output for July 6, 2013 (abridged):
100 doors : 171 examples. 24 game : 60 examples. 24 game/Solve : 37 examples. 9 billion names of God the integer : 12 examples. 99 Bottles of Beer : 199 examples. A+B : 137 examples. Abstract type : 54 examples. Accumulator factory : 67 examples. Ackermann function : 137 examples. ... Y combinator : 56 examples. Yahoo! search interface : 18 examples. Yin and yang : 39 examples. Zebra puzzle : 12 examples. Zeckendorf arithmetic : 3 examples. Zeckendorf number representation : 21 examples. Zig-zag matrix : 67 examples. * Total Tasks * : 676 examples. * Total Headers* : 31146 examples.
J
Solution:
Using getCategoryMembers
from Find unimplemented tasks.
<lang j>require 'web/gethttp'
getAllTaskSolnCounts=: monad define
tasks=. getCategoryMembers 'Programming_Tasks' counts=. getTaskSolnCounts &> tasks tasks;counts
)
getTaskSolnCounts=: monad define
makeuri=. 'http://www.rosettacode.org/w/index.php?title=' , ,&'&action=raw' wikidata=. gethttp makeuri urlencode y ([: +/ '{{header|'&E.) wikidata
)
formatSolnCounts=: monad define
'tasks counts'=. y tasks=. tasks , &.>':' res=. ;:^:_1 tasks ,. (8!:0 counts) ,. <'examples.' res , 'Total examples: ' , ": +/counts
)</lang>
Example Usage: <lang j> formatSolnCounts getAllTaskSolnCounts 100 doors: 61 examples. 24 game: 15 examples. 24 game Player: 11 examples. 99 Bottles of Beer: 76 examples. ...</lang>
Java
<lang java5> import java.util.ArrayList; import ScreenScrape;
public class CountProgramExamples {
private static final String baseURL = "http://rosettacode.org/wiki/"; private static final String rootURL = "http://www.rosettacode.org/w/" + "api.php?action=query&list=categorymembers" + "&cmtitle=Category:Programming_Tasks&cmlimit=500&format=xml"; private static final String taskBegin = "title=\""; private static final String taskEnd = "\""; private static final String exmplBegin = ""; private static final String exmplEnd = ""; private static final String editBegin = "";
/** * @param args */ public static void main(String[] args) { int exTotal = 0; try { // Get root query results ArrayList<String> tasks = new ArrayList<String>(); ScreenScrape ss = new ScreenScrape(); String rootPage = ss.read(rootURL); while (rootPage.contains(taskBegin)) { rootPage = rootPage.substring(rootPage.indexOf(taskBegin) + taskBegin.length()); String title = rootPage.substring(0, rootPage.indexOf(taskEnd)); if (!title.contains("Category:")) { tasks.add(title); } rootPage = rootPage.substring(rootPage.indexOf(taskEnd)); } // Loop through each task and print count for (String task : tasks) { String title = task.replaceAll("'", "'"); String taskPage = ss.read(baseURL + title.replaceAll(" ", "_")); int exSubTot; if (taskPage.contains(exmplBegin)) { int startPos = taskPage.lastIndexOf(exmplBegin) + exmplBegin.length(); String countStr = taskPage.substring(startPos, taskPage.indexOf(exmplEnd, startPos)); exSubTot = Integer .parseInt(countStr.contains(".") ? countStr .substring(0, countStr.indexOf(".")) : countStr); } else { exSubTot = 0; while (taskPage.contains(editBegin)) { taskPage = taskPage.substring(taskPage .indexOf(editBegin) + editBegin.length()); exSubTot++; } } exTotal += exSubTot; System.out.println(title + ": " + exSubTot + " examples."); } // Print total System.out.println("\nTotal: " + exTotal + " examples."); } catch (Exception e) { System.out.println(title); System.out.println(startPos + ":" + taskPage.indexOf(exmplEnd, startPos)); System.out.println(taskPage); e.printStackTrace(System.out); } }
} </lang> ScreenScrape class
jq
jq does not duplicate the functionality of `curl` but works seamlessly with it, as illustrated by the following bash script. Note in particular the use of jq's `@uri` filter in the bash function `titles`.
<lang bash>#!/bin/bash
- Produce lines of the form: URI TITLE
function titles {
local uri="http://www.rosettacode.org/mw/api.php?action=query&list=categorymembers" uri+="&cmtitle=Category:Programming_Tasks&cmlimit=5000&format=json" curl -Ss "$uri" | jq -r '.query.categorymembers[] | .title | "\(@uri) \(.)"'
}
- Syntax: count URI
function count {
local uri="$1" curl -Ss "http://rosettacode.org/mw/index.php?title=${uri}&action=raw" | jq -R -n 'reduce (inputs|select(test("=={{header\\|"))) as $x(0; .+1)'
}
local n=0 i while read uri title do
i=$(count "$uri") echo "$title: $i examples." n=$((n + i))
done < <(titles) echo Total: $n examples.</lang>
- Output:
100 doors: 252 examples. 15 Puzzle Game: 36 examples. 2048: 24 examples. ... Order two numerical lists: 65 examples. Ordered Partitions: 28 examples. Ordered words: 85 examples. Palindrome detection: 136 examples. Total: 32416 examples.
Lasso
<lang Lasso>local(root = json_deserialize(curl('http://rosettacode.org/mw/api.php?action=query&list=categorymembers&cmtitle=Category:Programming_Tasks&cmlimit=10&format=json')->result)) local(tasks = array, title = string, urltitle = string, thiscount = 0, totalex = 0) with i in #root->find('query')->find('categorymembers') do => {^ #thiscount = 0 #title = #i->find('title') #urltitle = #i->find('title') #urltitle->replace(' ','_')
#title+': ' local(src = curl('http://rosettacode.org/mw/index.php?title='+#urltitle->asBytes->encodeurl+'&action=raw')->result->asString) #thiscount = (#src->split('==[[:Category:{PercentEncode Xr}
else
{Append &%|{PercentEncode Xr}
else
{Append &%]] [[Category:{PercentEncode Xr}
else
{Append &%]] Property "Implemented in language" (as page type) with input value "{PercentEncode Xr}</br> else</br> {Append &%" contains invalid characters or is incomplete and therefore can cause unexpected results during a query or annotation process.
end
end
end
fun {ToHex2 X}
[{ToHex1 X div 16} {ToHex1 X mod 16}]
end
fun {ToHex1 X}
if X >= 0 andthen X =< 9 then &0 + X
elseif X >= 10 andthen X =< 15 then &A + X - 10
end
end
in
{Main}</lang>
Example output:
100 doors: 86 examples. 24 game: 22 examples. 24 game/Solve: 15 examples. 99 Bottles of Beer: 108 examples. A+B: 59 examples. ... Xiaolin Wu's line algorithm: 5 examples. Y combinator: 29 examples. Yahoo! Search: 10 examples. Zig-zag matrix: 43 examples. Total: 14099 examples.
Perl
<lang Perl>use LWP::Simple;
my $site = "http://rosettacode.org"; my $list_url = "/mw/api.php?action=query&list=categorymembers&cmtitle=Category:Programming_Tasks&cmlimit=500&format=xml";
for (get("$site$list_url") =~ /cm.*?title="(.*?)"/g) {
(my $slug = $_) =~ tr/ /_/; my $count = () = get("$site/wiki/$slug") =~ /toclevel-1/g; print "$_: $count examples\n";
}</lang>
<lang Perl>use v5.10; use Mojo::UserAgent;
my $site = "http://rosettacode.org"; my $list_url = "/mw/api.php?action=query&list=categorymembers&cmtitle=Category:Programming_Tasks&cmlimit=500&format=xml";
my $ua = Mojo::UserAgent->new; $ua->get("$site$list_url")->res->dom->find('cm')->each(sub {
(my $slug = $_->{title}) =~ tr/ /_/; my $count = $ua->get("$site/wiki/$slug")->res->dom->find("#toc .toclevel-1")->size; say "$_->{title}: $count examples";
});</lang>
Perl 6
Retrieves counts for both Tasks and Draft Tasks. Save / Display results as a sortable wikitable rather than a static list. Click on a column header to sort on that column. To do a secondary sort, hold down the shift key and click on a second column. Tasks have a gray (default) background, Draft Tasks have a yellow background. <lang perl6>use HTTP::UserAgent; use URI::Escape; use JSON::Fast;
class Progress-Bar {
has $.width = 40; has $.count is rw = 0; has @!bar = < ▏ ▎ ▍ ▌ ▋ ▊ ▉ █ >;
method inc { ($.count += 1) mod= $.width * 8; self.clear ~ @!bar.tail x $.count div 8 ~ @!bar[ $.count % 8 ] ~ ' ' x $.width - 1 - ($.count / 8).floor }
method clear { "\r" ~ ' ' x $.width ~ "\r" }
}
- Friendlier descriptions for task categories
my %cat = (
'Programming_Tasks' => 'Task', 'Draft_Programming_Tasks' => 'Draft'
);
my $client = HTTP::UserAgent.new;
my $url = 'http://rosettacode.org/mw';
my $hashfile = './RC_Task_count.json'; my $tablefile = './RC_Task_count.txt';
my %tasks;
- =begin update
note 'Retrieving task information...';
my $progress = Progress-Bar.new(width => 79);
for %cat.keys -> $cat {
mediawiki-query( $url, 'pages', :generator<categorymembers>, :gcmtitle("Category:$cat"), :gcmlimit<350>, :rawcontinue(), :prop<title> ).map({ my $page = mediawiki-query( $url, 'pages', :titles(.<title>), :prop<revisions>, :rvprop<content>, ); my $count = +$page.comb(/'=={{header|'/); %tasks{.<title>} = {'cat' => %cat{$cat}, :$count}; print $progress.inc; })
}
print $progress.clear;
note "\nTask information saved to local file: {$hashfile.IO.absolute}"; $hashfile.IO.spurt(%tasks.&to-json);
- =end update
- Load information from local file
%tasks = $hashfile.IO.e ?? $hashfile.IO.slurp.&from-json !! ( );
- Convert saved task / author info to a table
note "\nBuilding table..."; my $count = +%tasks; my $taskcnt = +%tasks.grep: *.value.<cat> eq %cat<Programming_Tasks>; my $draftcnt = $count - $taskcnt; my $total = sum %tasks{*}»<count>;
- Dump table to a file
my $out = open($tablefile, :w) or die "$!\n";
- Add table boilerplate and caption
$out.say:
'
'{|class="wikitable sortable"', "\n", "|+ As of { Date.today } :: Tasks: { $taskcnt } :: Draft Tasks: ", "{ $draftcnt } :: Total Tasks: { $count } :: Total Examples: { $total }\n", "! Count !! Task !! Category"
- Sort tasks by count then add row
for %tasks.sort: -*.value<count> -> $task {
$out.say: ( $task.value<cat> eq 'Draft' ?? "|- style=\"background-color: #ffc\"\n" !! "|-\n" ), "| { $task.value<count> }\n", ( $task.key ~~ /\d/ ?? "|data-sort-value=\"{ $task.key.&naturally }\"| [[{uri-escape $task.key}|{$task.key}]]\n" !! "| [[{uri-escape $task.key}|{$task.key}]]\n" ), "| { $task.value<cat> }"
}
$out.say( "|}\n", '' );
$out.close;
note "Table file saved as: {$tablefile.IO.absolute}";
sub mediawiki-query ($site, $type, *%query) {
my $url = "$site/api.php?" ~ uri-query-string( :action<query>, :format<json>, :formatversion<2>, |%query); my $continue = ;
gather loop { my $response = $client.get("$url&$continue"); my $data = from-json($response.content); take $_ for $data.<query>.{$type}.values; $continue = uri-query-string |($data.<query-continue>{*}».hash.hash or last); }
}
sub uri-query-string (*%fields) { %fields.map({ "{.key}={uri-escape .value}" }).join("&") }
sub naturally ($a) { $a.lc.subst(/(\d+)/, ->$/ {0~(65+$0.chars).chr~$0},:g) } </lang>
- Output:
PicoLisp
<lang PicoLisp>(load "@lib/http.l")
(client "rosettacode.org" 80
"mw/api.php?action=query&list=categorymembers&cmtitle=Category:Programming_Tasks&cmlimit=500&format=xml"
(while (from " title=\"")
(let Task (till "\"")
(client "rosettacode.org" 80 (pack "wiki/" (replace Task " " "_"))
(let Cnt 0
(while (from "")
(unless (sub? "." (till "<" T))
(inc 'Cnt) ) )
(out NIL (prinl (ht:Pack Task) ": " Cnt)) ) ) ) ) )</lang>
Output (05may10):
100 doors: 79 24 game: 21 24 game/Solve: 15 99 Bottles of Beer: 95 A+B: 37 Abstract type: 29 ...
PureBasic
<lang PureBasic>Procedure handleError(value, msg.s)
If value = 0 MessageRequester("Error", msg) End EndIf
EndProcedure
handleError(InitNetwork(), "Unable to initialize network functions.") If OpenConsole()
Define url$, x1$, y1$, title$, unescapedTitle$, encodedURL$ Define x2, i, j, totalExamples, totalTasks url$ = "http://www.rosettacode.org/mw/api.php?action=query" + "&list=categorymembers&cmtitle=Category:Programming_Tasks" + "&cmlimit=500&format=xml" Repeat handleError(ReceiveHTTPFile(url$, "tasks.xml"), "Unable to access tasks URL.") handleError(ReadFile(0, "tasks.xml"), "Unable to read 'task.xml' file.") x1$ = ReadString(0) CloseFile(0) Repeat x2 = FindString(x1$, "title=", x2 + 1) If x2 title$ = Mid(x1$, x2 + 7, 99) title$ = Left(title$, FindString(title$, ">", 1) - 4) unescapedTitle$ = UnescapeString(ReplaceString(title$, "'", "'"), #PB_String_EscapeXML) encodedURL$ = URLEncoder("http://www.rosettacode.org/mw/index.php?title=" + unescapedTitle$ + "&action=raw") If ReceiveHTTPFile(encodedURL$, "task.xml") ReadFile(0, "task.xml") While Not Eof(0) y1$ = ReadString(0) If FindString(y1$, "=={{header|", 1, #PB_String_NoCase) totalExamples + 1 EndIf Wend CloseFile(0) PrintN(unescapedTitle$ +": " + Str(totalExamples) + " examples") totalTasks + totalExamples totalExamples = 0 EndIf EndIf Until x2 = 0 ;check for additional pages of tasks x2 = FindString(x1$, "cmcontinue=") If x2 i = FindString(x1$, #DQUOTE$, x2 + 1) j = FindString(x1$, #DQUOTE$, i + 1) url$ = URLEncoder("http://www.rosettacode.org/mw/api.php?action=query" + "&list=categorymembers&cmtitle=Category:Programming_Tasks" + "&cmlimit=500&format=xml&cmcontinue=" + Mid(x1$, i + 1, j - i)) Else Break ;all done EndIf ForEver PrintN("Total: " + Str(totalTasks) + " examples") Input() CloseConsole()
EndIf</lang> Sample output:
100 doors: 224 examples 24 game: 78 examples 24 game/Solve: 46 examples 9 billion names of God the integer: 33 examples 99 Bottles of Beer: 253 examples A+B: 187 examples ...... Zeckendorf arithmetic: 6 examples Zeckendorf number representation: 37 examples Zero to the zero power: 71 examples Zhang-Suen thinning algorithm: 18 examples Zig-zag matrix: 83 examples Total: 44140 examples
Python
<lang python>import urllib, xml.dom.minidom
x = urllib.urlopen("http://www.rosettacode.org/w/api.php?action=query&list=categorymembers&cmtitle=Category:Programming_Tasks&cmlimit=500&format=xml")
tasks = [] for i in xml.dom.minidom.parseString(x.read()).getElementsByTagName("cm"):
t = i.getAttribute('title').replace(" ", "_") y = urllib.urlopen("http://www.rosettacode.org/w/index.php?title=%s&action=raw" % t.encode('utf-8')) tasks.append( y.read().lower().count("{{header|") ) print t.replace("_", " ") + ": %d examples." % tasks[-1]
print "\nTotal: %d examples." % sum(tasks)</lang>
R
<lang R> library(XML) library(RCurl) doc <- xmlInternalTreeParse("http://www.rosettacode.org/w/api.php?action=query&list=categorymembers&cmtitle=Category:Programming_Tasks&cmlimit=500&format=xml") nodes <- getNodeSet(doc,"//cm") titles = as.character( sapply(nodes, xmlGetAttr, "title") ) headers <- list() counts <- list() for (i in 1:length(titles)){ headersi <- getURL( paste("http://rosettacode.org/mw/index.php?title=", gsub(" ", "_", titles[i]), "&action=raw", sep="") ) countsi <- strsplit(headersi,split=" ")1 countsi <- grep("\\{\\{header", countsi) cat(titles[i], ":", length(countsi), "examples\n") } cat("Total: ", length(unlist(counts)), "examples\n") </lang>
Racket
<lang racket>
- lang racket
(require net/url net/uri-codec json (only-in racket/dict [dict-ref ref]))
(define (RC-get verb params)
((compose1 get-pure-port string->url format) "http://rosettacode.org/mw/~a.php?~a" verb (alist->form-urlencoded params)))
(define (get-category catname)
(let loop ([c #f]) (define t ((compose1 read-json RC-get) 'api `([action . "query"] [format . "json"] [list . "categorymembers"] [cmtitle . ,(format "Category:~a" catname)] [cmcontinue . ,(and c (ref c 'cmcontinue))] [cmlimit . "500"]))) (define (c-m key) (ref (ref t key '()) 'categorymembers #f)) (append (for/list ([page (c-m 'query)]) (ref page 'title)) (cond [(c-m 'query-continue) => loop] [else '()]))))
(printf "Total: ~a\n"
(for/sum ([task (get-category 'Programming_Tasks)]) (define s ((compose1 length regexp-match-positions*) #rx"=={{" (RC-get 'index `([action . "raw"] [title . ,task])))) (printf "~a: ~a\n" task s) s))
</lang>
Ruby
First, a RosettaCode module, saved as rosettacode.rb: <lang ruby>require 'open-uri' require 'rexml/document'
module RosettaCode
URL_ROOT = "http://rosettacode.org/mw"
def self.get_url(page, query) begin # Ruby 1.9.2 pstr = URI.encode_www_form_component(page) qstr = URI.encode_www_form(query) rescue NoMethodError require 'cgi' pstr = CGI.escape(page) qstr = query.map {|k,v| "%s=%s" % [CGI.escape(k.to_s), CGI.escape(v.to_s)]}.join("&") end url = "#{URL_ROOT}/#{pstr}?#{qstr}" p url if $DEBUG url end
def self.get_api_url(query) get_url "api.php", query end
def self.category_members(category) query = { "action" => "query", "list" => "categorymembers", "cmtitle" => "Category:#{category}", "format" => "xml", "cmlimit" => 500, } while true url = get_api_url query doc = REXML::Document.new open(url)
REXML::XPath.each(doc, "//cm") do |task| yield task.attribute("title").value end
continue = REXML::XPath.first(doc, "//query-continue") break if continue.nil? cm = REXML::XPath.first(continue, "categorymembers") query["cmcontinue"] = cm.attribute("cmcontinue").value end end
end</lang>
Then, we implement the task with: <lang ruby>require 'rosettacode'
total_examples = 0
RosettaCode.category_members("Programming_Tasks") do |task|
url = RosettaCode.get_url("index.php", {"action" => "raw", "title" => task}) examples = open(url).read.scan("=={{header").length puts "#{task}: #{examples}" total_examples += examples
end
puts puts "Total: #{total_examples}"</lang>
Rust
<lang rust>extern crate reqwest; extern crate url; extern crate rustc_serialize;
use std::io::Read; use self::url::Url; use rustc_serialize::json::{self, Json};
pub struct Task {
page_id: u64, pub title: String,
}
- [derive(Debug)]
enum ParseError {
/// Something went wrong with the HTTP request to the API. Http(reqwest::Error),
/// There was a problem parsing the API response into JSON. Json(json::ParserError),
/// Unexpected JSON format from response UnexpectedFormat,
} impl From<json::ParserError> for ParseError {
fn from(error: json::ParserError) -> Self { ParseError::Json(error) }
}
impl From<reqwest::Error> for ParseError {
fn from(error: reqwest::Error) -> Self { ParseError::Http(error) }
}
fn construct_query_category(category: &str) -> Url {
let mut base_url = Url::parse("http://rosettacode.org/mw/api.php").unwrap(); let cat = format!("Category:{}", category); let query_pairs = vec![("action", "query"), ("format", "json"), ("list", "categorymembers"), ("cmlimit", "500"), ("cmtitle", &cat), ("continue", "")]; base_url.query_pairs_mut().extend_pairs(query_pairs.into_iter()); base_url
}
fn construct_query_task_content(task_id: &str) -> Url {
let mut base_url = Url::parse("http://rosettacode.org/mw/api.php").unwrap(); let mut query_pairs = vec![("action", "query"), ("format", "json"), ("prop", "revisions"), ("rvprop", "content")]; query_pairs.push(("pageids", task_id)); base_url.query_pairs_mut().extend_pairs(query_pairs.into_iter()); base_url
}
fn query_api(url: Url) -> Result<Json, ParseError> {
let mut response = try!(reqwest::get(url.as_str())); // Build JSON let mut body = String::new(); response.read_to_string(&mut body).unwrap();
Ok(try!(Json::from_str(&body)))
}
fn parse_all_tasks(reply: &Json) -> Result<Vec<Task>, ParseError> {
let json_to_task = |json: &Json| -> Result<Task, ParseError> { let page_id: u64 = try!(json.find("pageid") .and_then(|id| id.as_u64()) .ok_or(ParseError::UnexpectedFormat)); let title: &str = try!(json.find("title") .and_then(|title| title.as_string()) .ok_or(ParseError::UnexpectedFormat));
Ok(Task { page_id: page_id, title: title.to_owned(), }) }; let tasks_json = try!(reply.find_path(&["query", "categorymembers"]) .and_then(|tasks| tasks.as_array()) .ok_or(ParseError::UnexpectedFormat));
// Convert into own type tasks_json.iter().map(json_to_task).collect()
} fn count_number_examples(task: &Json, task_id: u64) -> Result<u32, ParseError> {
let revisions = try!(task.find_path(&["query", "pages", task_id.to_string().as_str(), "revisions"]) .and_then(|content| content.as_array()) .ok_or(ParseError::UnexpectedFormat)); let content = try!(revisions[0] .find("*") .and_then(|content| content.as_string()) .ok_or(ParseError::UnexpectedFormat)); Ok(content.split("=={{header").count() as u32)
}
pub fn query_all_tasks() -> Vec<Task> {
let query = construct_query_category("Programming_Tasks"); let json: Json = query_api(query).unwrap(); parse_all_tasks(&json).unwrap()
}
pub fn query_a_task(task: &Task) -> u32 {
let query = construct_query_task_content(&task.page_id.to_string()); let json: Json = query_api(query).unwrap(); count_number_examples(&json, task.page_id).unwrap()
}</lang>
The function is then run using the following: <lang rust> extern crate count_examples; fn main() {
let all_tasks = count_examples::query_all_tasks(); for task in &all_tasks { let count = count_examples::query_a_task(task); println!("Task: {} has {} examples", task.title, count); }
}</lang>
Run BASIC
<lang runbasic>html "
"a$ = httpGet$("http://rosettacode.org/wiki/Category:Programming_Tasks")
a$ = word$(a$,1,"Num | Task | Examples |
")
i = instr(a$,"<a href=""/wiki/") i = instr(a$,"<a href=""/wiki/",i+1) while i > 0
count = count + 1 i = instr(a$,"<a href=""/wiki/",i+1) j = instr(a$,">",i+5) a1$ = mid$(a$,i+15,j-i) taskId$ = word$(a1$,1,"""") task$ = word$(a1$,3,"""") url$ = "http://rosettacode.org/wiki/";taskId$ a2$ = httpGet$(url$) ii = instr(a2$,"") jj = 0 while ii > 0 jj = ii ii = instr(a2$,"",ii+10) wend if jj = 0 then examp = 0 else kk = instr(a2$,"<",jj+24) examp = int(val(mid$(a2$,jj+24,kk-jj-24))) end if
html "";count;"";task$;"";examp;""
totExamp = totExamp + examp
wend
html "**** Total **";totExamp;""
end</lang>
Num | Task | Examples |
1 | 100 doors | 165 |
2 | 24 game | 56 |
3 | 24 game/Solve | 34 |
4 | 99 Bottles of Beer | 192 |
5 | A+B | 129 |
6 | Abstract type | 51 |
7 | Accumulator factory | 65 |
8 | Ackermann function | 132 |
9 | Active Directory/Connect | 13 |
10 | Active Directory/Search for a user | 13 |
11 | Active object | 22 |
12 | Add a variable to a class instance at runtime | 37 |
... | ... | ... |
655 | Y combinator | 53 |
656 | Yahoo! search interface | 16 |
657 | Yin and yang | 38 |
658 | Zebra puzzle | 12 |
659 | Zeckendorf number representation | 18 |
660 | Zig-zag matrix | 65 |
** | ** Total ** | 28611 |
Scala
<lang Scala>import scala.language.postfixOps
object TaskCount extends App {
import java.net.{ URL, URLEncoder } import scala.io.Source.fromURL
System.setProperty("http.agent", "*") val allTasksURL = "http://www.rosettacode.org/w/api.php?action=query&list=categorymembers&cmtitle=Category:Programming_Tasks&cmlimit=500&format=xml" val allTasks = xml.parsing.XhtmlParser(fromURL(new URL(allTasksURL)))
val regexExpr = "(?i)==\\{\\{header\\|".r
def oneTaskURL(title: String) = { println(s"Check $title") "http://www.rosettacode.org/w/index.php?title=%s&action=raw" format URLEncoder.encode(title.replace(' ', '_'), "UTF-8") }
def count(title: String) = regexExpr findAllIn fromURL(new URL(oneTaskURL(title)))(io.Codec.UTF8).mkString length
val counts = for (task <- allTasks \\ "cm" \\ "@title" map (_.text)) yield scala.actors.Futures.future((task, count(task)))
counts map (_.apply) map Function.tupled("%s: %d examples." format (_, _)) foreach println println("\nTotal: %d examples." format (counts map (_.apply._2) sum))
}</lang>
Sidef
<lang ruby>var lwp = require('LWP::UserAgent').new(agent => 'Mozilla/5.0');
var site = 'http://rosettacode.org'; var list_url = '/mw/api.php?action=query&list=categorymembers&'+
'cmtitle=Category:Programming_Tasks&cmlimit=500&format=xml';
var content = lwp.get(site + list_url).decoded_content;
while (var m = content.match(/cm.*?title="(.*?)"/g)) {
(var slug = m[0]).gsub!(' ', '_'); var count = lwp.get("#{site}/wiki/#{slug}").decoded_content.count(/toclevel-1/g); say "#{m[0]}: #{count} examples";
}</lang>
- Output:
100 doors: 2180 examples 24 game: 760 examples 24 game/Solve: 450 examples 9 billion names of God the integer: 320 examples 99 Bottles of Beer: 2330 examples A+B: 1800 examples ABC Problem: 720 examples Abstract type: 680 examples ...
Tcl
<lang tcl>package require Tcl 8.5 package require http package require json
fconfigure stdout -buffering none
proc get_tasks {category} {
set start [clock milliseconds] puts -nonewline "getting $category members..." set base_url http://www.rosettacode.org/w/api.php set query {action query list categorymembers cmtitle Category:%s format json cmlimit 500} set this_query [dict create {*}[split [format $query $category]]] set tasks [list]
while {1} { set url [join [list $base_url [http::formatQuery {*}$this_query]] ?] set response [http::geturl $url] if {[set s [http::status $response]] ne "ok" || [http::ncode $response] != 200} { error "Oops: url=$url\nstatus=$s\nhttp code=[http::code $response]" } set data [json::json2dict [http::data $response]] http::cleanup $response # add tasks to list foreach task [dict get $data query categorymembers] { lappend tasks [dict get [dict create {*}$task] title] } if {[catch {dict get $data query-continue categorymembers cmcontinue} continue_task] != 0} { # no more continuations, we're done break } dict set this_query cmcontinue $continue_task } puts " found [llength $tasks] tasks in [expr {[clock milliseconds] - $start}] milliseconds" return $tasks
}
- This proc can be replaced by a single regexp command:
- set count [regexp -all "***=$needle" $haystack]
- However this proc is more efficient -- we're dealing with plain strings only.
proc count_substrings {needle haystack} {
set count 0 set idx 0 while {[set idx [string first $needle $haystack $idx]] != -1} { incr count incr idx } return $count
}
set total 0 foreach task [get_tasks Programming_Tasks] {
set url [format "http://www.rosettacode.org/w/index.php?title=%s&action=raw" [string map {{ } _} $task]] set response [http::geturl $url] if {[set s [http::status $response]] ne "ok" || [http::ncode $response] != 200} { error "Oops: url=$url\nstatus=$s\nhttp code=[http::code $response]" } set count [count_substrings "\{\{header|" [http::data $response]] puts [format "%3d examples in %s" $count $task] http::cleanup $response incr total $count
}
puts "\nTotal: $total examples"</lang>
TUSCRIPT
<lang tuscript>$$ MODE TUSCRIPT url="http://www.rosettacode.org/w/api.php?action=query&list=categorymembers&cmtitle=Category:Programming_Tasks&cmlimit=500&format=xml" data=REQUEST (url)
BUILD S_TABLE beg=* DATA :title=": BUILD S_TABLE end=* DATA :":
titles=EXTRACT (data,beg|,end,1,0,"~~") titles=SPLIT (titles,":~~:") sz_titles=SIZE (titles)
BUILD R_TABLE header=":==\{\{header|:" all=*
ERROR/STOP CREATE ("tasks",seq-e,-std-)
COMPILE LOOP title=titles ask=* ask =SET_VALUE(ask,"title",title) ask =SET_VALUE(ask,"action","raw") ask =ENCODE (ask,cgi) http ="http://www.rosettacode.org/mw/index.php" url =CONCAT (http,"?",ask) data =REQUEST (url) header =FILTER_INDEX (data,header,-) sz_header=SIZE(header) line =CONCAT (title,"=",sz_header," members") FILE "tasks" = line all =APPEND(all,sz_header) ENDLOOP
ENDCOMPILE all =JOIN(all),sum=SUM(all),time=time() line=CONCAT (time,": ", sz_titles, " Programing Tasks: ", sum, " solutions")
FILE "tasks" = line </lang> Output in file "tasks":
100 doors=104 members 24 game=27 members 24 game/Solve=21 members 99 Bottles of Beer=124 members A+B=76 members Abstract type=35 members Accumulator factory=44 members ... XML/Input=39 members XML/Output=32 members XML/XPath=24 members Xiaolin Wu's line algorithm=0 members Y combinator=33 members Yahoo! search interface=10 members Zig-zag matrix=46 members 2011-01-15 03:41:30: 455 Programing Tasks: 16009 solutions
zkl
Uses shared libraries YAJL and cURL and handles "continue" responses. <lang zkl>var [const] YAJL=Import("zklYAJL")[0], CURL=Import("zklCurl");
fcn getTasks(language){
continueValue,tasks:="",Data(0,String); // "nm\0nm\0...." do{ page:=CURL().get(("http://rosettacode.org/mw/api.php?" "action=query&cmlimit=500"
"&format=json" "&list=categorymembers" "&cmtitle=Category:%s" "&cmcontinue=%s").fmt(language,continueValue));
page=page[0].del(0,page[1]); // get rid of HTML header json:=YAJL().write(page).close(); json["query"]["categorymembers"].pump(tasks,T("get","title")); continueValue=json.find("continue") //continue:-||,cmcontinue:page|954|19) .toList().apply("concat","=").concat("&"); }while(continueValue); tasks
} re:=RegExp(0'!\s+==\s*{{\s*header\s*|!); // == {{ header | zkl foreach task in (getTasks("Programming_Tasks")){
page:=CURL().get( "http://www.rosettacode.org/mw/index.php?title=%s&action=raw" .fmt(CURL.urlEncode(task))); page=page[0].del(0,page[1]); // get rid of HTML header cnt,n:=0,0; while(re.search(page,True,n)){ cnt+=1; n=re.matched[0].sum(0); } "%4d: %s".fmt(cnt,task).println();
}</lang>
- Output:
229: 100 doors 15: 15 Puzzle Game ... 257: 99 Bottles of Beer 199: A+B ... 28: Calendar - for "REAL" programmers ... 9: Stream Merge ... 78: Zero to the zero power 19: Zhang-Suen thinning algorithm 83: Zig-zag matrix
- Programming Tasks
- Rosetta Code related
- Ada
- AWS
- AutoHotkey
- BBC BASIC
- Bracmat
- C sharp
- Clojure
- D
- EGL
- Erlang
- Xmerl
- F Sharp
- Factor
- Go
- Haskell
- HTTP XML
- Unicon
- ",tab(find("
- Icon Programming Library
- J
- Java
- Jq
- Lasso
- Perl
- Mojolicious
- Perl 6
- PicoLisp
- PureBasic
- Python
- R
- XML (R)
- RCurl
- Racket
- Ruby
- REXML
- Rust
- Run BASIC
- Scala
- Sidef
- Tcl
- Tcllib
- TUSCRIPT
- Zkl
- Batch File/Omit
- Brainf***/Omit
- Brlcad/Omit
- GUISS/Omit
- Lilypond/Omit
- Maxima/Omit
- Openscad/Omit
- PostScript/Omit
- TI-83 BASIC/Omit
- TI-89 BASIC/Omit
- Yorick/Omit
- ZX Spectrum Basic/Omit