Rosetta Code/List authors of task descriptions: Difference between revisions
Thundergnat (talk | contribs) m (→{{header|Perl 6}}: Tweak code a bit. Just leave a short sample output with task. Separate and update full list) |
Thundergnat (talk | contribs) m (update full list) |
||
Line 21: | Line 21: | ||
Please '''DO NOT''' add a full output for ''each'' programming language; just show a representative sample. One full list is useful. Multiple full lists just use space and bandwidth. |
Please '''DO NOT''' add a full output for ''each'' programming language; just show a representative sample. One full list is useful. Multiple full lists just use space and bandwidth. |
||
<div style="height:80ex;overflow:scroll;border-style:ridge;"> |
<div style="height:80ex;overflow:scroll;border-style:ridge;"><table border="1" cellpadding="4"><tr><th colspan="2">As of 2017-10-01 | Total: 1068 / Tasks: 860 / Draft Tasks: 208<tr><th>User</th><th>Authored</th></tr> |
||
<table border="1" cellpadding="4"><tr><th colspan="2">As of 2017-09-10 | Total: 1064 / Tasks: 858 / Draft Tasks: 206<tr><th>User</th><th>Authored</th></tr> |
|||
<tr><td>2Powers</td><td><ol><li>Draft: [[Names_to_numbers|Names to numbers]]</li><li>Draft: [[Solving_coin_problems|Solving coin problems]]</ol></td></tr> |
<tr><td>2Powers</td><td><ol><li>Draft: [[Names_to_numbers|Names to numbers]]</li><li>Draft: [[Solving_coin_problems|Solving coin problems]]</ol></td></tr> |
||
<tr><td>12.175.32.19</td><td><ol><li>Task: [[Soundex|Soundex]]</ol></td></tr> |
<tr><td>12.175.32.19</td><td><ol><li>Task: [[Soundex|Soundex]]</ol></td></tr> |
||
Line 68: | Line 67: | ||
<tr><td>Alegend</td><td><ol><li>Task: [[Evaluate_binomial_coefficients|Evaluate binomial coefficients]]</ol></td></tr> |
<tr><td>Alegend</td><td><ol><li>Task: [[Evaluate_binomial_coefficients|Evaluate binomial coefficients]]</ol></td></tr> |
||
<tr><td>AlexLehm</td><td><ol><li>Task: [[Langton%27s_ant|Langton's ant]]</ol></td></tr> |
<tr><td>AlexLehm</td><td><ol><li>Task: [[Langton%27s_ant|Langton's ant]]</ol></td></tr> |
||
<tr><td>Aloisdg</td><td><ol><li>Draft: [[Diversity_prediction_theorem|Diversity prediction theorem]]</li><li> |
<tr><td>Aloisdg</td><td><ol><li>Draft: [[Diversity_prediction_theorem|Diversity prediction theorem]]</li><li>Task: [[Munchausen_numbers|Munchausen numbers]]</li><li>Draft: [[Sattolo_cycle|Sattolo cycle]]</li><li>Draft: [[Two_Sum|Two Sum]]</ol></td></tr> |
||
<tr><td>AnatolV</td><td><ol><li>Task: [[Kronecker_product_based_fractals|Kronecker product based fractals]]</li><li>Task: [[Kronecker_product|Kronecker product]]</ol></td></tr> |
<tr><td>AnatolV</td><td><ol><li>Task: [[Kronecker_product_based_fractals|Kronecker product based fractals]]</li><li>Task: [[Kronecker_product|Kronecker product]]</ol></td></tr> |
||
<tr><td>Avi</td><td><ol><li>Task: [[Cholesky_decomposition|Cholesky decomposition]]</li><li>Task: [[Element-wise_operations|Element-wise operations]]</li><li>Task: [[Euler_method|Euler method]]</li><li>Task: [[LU_decomposition|LU decomposition]]</li><li>Task: [[Numerical_integration/Gauss-Legendre_Quadrature|Numerical integration/Gauss-Legendre Quadrature]]</li><li>Task: [[QR_decomposition|QR decomposition]]</li><li>Task: [[UTF-8_encode_and_decode|UTF-8 encode and decode]]</ol></td></tr> |
<tr><td>Avi</td><td><ol><li>Task: [[Cholesky_decomposition|Cholesky decomposition]]</li><li>Task: [[Element-wise_operations|Element-wise operations]]</li><li>Task: [[Euler_method|Euler method]]</li><li>Task: [[LU_decomposition|LU decomposition]]</li><li>Task: [[Numerical_integration/Gauss-Legendre_Quadrature|Numerical integration/Gauss-Legendre Quadrature]]</li><li>Task: [[QR_decomposition|QR decomposition]]</li><li>Task: [[UTF-8_encode_and_decode|UTF-8 encode and decode]]</ol></td></tr> |
||
Line 103: | Line 102: | ||
<tr><td>Davgot</td><td><ol><li>Task: [[Chinese_remainder_theorem|Chinese remainder theorem]]</ol></td></tr> |
<tr><td>Davgot</td><td><ol><li>Task: [[Chinese_remainder_theorem|Chinese remainder theorem]]</ol></td></tr> |
||
<tr><td>DavidMcCabe</td><td><ol><li>Task: [[Send_an_unknown_method_call|Send an unknown method call]]</ol></td></tr> |
<tr><td>DavidMcCabe</td><td><ol><li>Task: [[Send_an_unknown_method_call|Send an unknown method call]]</ol></td></tr> |
||
<tr><td>Daxim</td><td><ol |
<tr><td>Daxim</td><td><ol><li>Task: [[100_doors|100 doors]]</li><li>Task: [[FizzBuzz|FizzBuzz]]</li><li>Task: [[HTTPS/Authenticated|HTTPS/Authenticated]]</li><li>Task: [[OpenGL|OpenGL]]</ol></td></tr> |
||
<tr><td>Dbohdan</td><td><ol><li>Task: [[2048|2048]]</li><li>Task: [[FTP|FTP]]</li><li>Task: [[Retrieve_and_search_chat_history|Retrieve and search chat history]]</ol></td></tr> |
<tr><td>Dbohdan</td><td><ol><li>Task: [[2048|2048]]</li><li>Task: [[FTP|FTP]]</li><li>Task: [[Retrieve_and_search_chat_history|Retrieve and search chat history]]</ol></td></tr> |
||
<tr><td>Dgamey</td><td><ol><li>Task: [[Deepcopy|Deepcopy]]</li><li>Task: [[Galton_box_animation|Galton box animation]]</li><li>Task: [[Longest_string_challenge|Longest string challenge]]</li><li>Task: [[MD5/Implementation|MD5/Implementation]]</li><li>Task: [[Sierpinski_triangle/Graphical|Sierpinski triangle/Graphical]]</li><li>Task: [[State_name_puzzle|State name puzzle]]</ol></td></tr> |
<tr><td>Dgamey</td><td><ol><li>Task: [[Deepcopy|Deepcopy]]</li><li>Task: [[Galton_box_animation|Galton box animation]]</li><li>Task: [[Longest_string_challenge|Longest string challenge]]</li><li>Task: [[MD5/Implementation|MD5/Implementation]]</li><li>Task: [[Sierpinski_triangle/Graphical|Sierpinski triangle/Graphical]]</li><li>Task: [[State_name_puzzle|State name puzzle]]</ol></td></tr> |
||
Line 116: | Line 115: | ||
<tr><td>Dubs</td><td><ol><li>Draft: [[Solve_a_Rubik%27s_Cube|Solve a Rubik's Cube]]</ol></td></tr> |
<tr><td>Dubs</td><td><ol><li>Draft: [[Solve_a_Rubik%27s_Cube|Solve a Rubik's Cube]]</ol></td></tr> |
||
<tr><td>Dukzcry</td><td><ol><li>Task: [[AVL_tree|AVL tree]]</ol></td></tr> |
<tr><td>Dukzcry</td><td><ol><li>Task: [[AVL_tree|AVL tree]]</ol></td></tr> |
||
<tr><td>Dwarring</td><td><ol><li> |
<tr><td>Dwarring</td><td><ol><li>Task: [[Poker_hand_analyser|Poker hand analyser]]</ol></td></tr> |
||
<tr><td>Ed Davis</td><td><ol><li>Task: [[Compiler/AST_interpreter|Compiler/AST interpreter]]</li><li>Task: [[Compiler/code_generator|Compiler/code generator]]</li><li>Task: [[Compiler/lexical_analyzer|Compiler/lexical analyzer]]</li><li>Task: [[Compiler/syntax_analyzer|Compiler/syntax analyzer]]</li><li>Task: [[Compiler/virtual_machine_interpreter|Compiler/virtual machine interpreter]]</ol></td></tr> |
<tr><td>Ed Davis</td><td><ol><li>Task: [[Compiler/AST_interpreter|Compiler/AST interpreter]]</li><li>Task: [[Compiler/code_generator|Compiler/code generator]]</li><li>Task: [[Compiler/lexical_analyzer|Compiler/lexical analyzer]]</li><li>Task: [[Compiler/syntax_analyzer|Compiler/syntax analyzer]]</li><li>Task: [[Compiler/virtual_machine_interpreter|Compiler/virtual machine interpreter]]</ol></td></tr> |
||
<tr><td>Edmund</td><td><ol><li>Task: [[Babbage_problem|Babbage problem]]</li><li>Draft: [[French_Republican_calendar|French Republican calendar]]</ol></td></tr> |
<tr><td>Edmund</td><td><ol><li>Task: [[Babbage_problem|Babbage problem]]</li><li>Draft: [[French_Republican_calendar|French Republican calendar]]</ol></td></tr> |
||
Line 132: | Line 131: | ||
<tr><td>Geoffhacker</td><td><ol><li>Draft: [[Longest_Common_Substring|Longest Common Substring]]</ol></td></tr> |
<tr><td>Geoffhacker</td><td><ol><li>Draft: [[Longest_Common_Substring|Longest Common Substring]]</ol></td></tr> |
||
<tr><td>Georg Peter</td><td><ol><li>Task: [[Integer_overflow|Integer overflow]]</ol></td></tr> |
<tr><td>Georg Peter</td><td><ol><li>Task: [[Integer_overflow|Integer overflow]]</ol></td></tr> |
||
<tr><td>Gerard Schildberger</td><td><ol><li>Task: [[4-rings_or_4-squares_puzzle|4-rings or 4-squares puzzle]]</li><li>Task: [[Bernoulli_numbers|Bernoulli numbers]]</li><li>Task: [[Commatizing_numbers|Commatizing numbers]]</li><li>Draft: [[Egyptian_fractions|Egyptian fractions]]</li><li>Task: [[Emirp_primes|Emirp primes]]</li><li>Task: [[Exponentiation_order|Exponentiation order]]</li><li>Task: [[Farey_sequence|Farey sequence]]</li><li>Task: [[Find_palindromic_numbers_in_both_binary_and_ternary_bases|Find palindromic numbers in both binary and ternary bases]]</li><li>Draft: [[Idiomatically_determine_all_the_characters_that_can_be_used_for_symbols|Idiomatically determine all the characters that can be used for symbols]]</li><li>Draft: [[Idiomatically_determine_all_the_lowercase_and_uppercase_letters|Idiomatically determine all the lowercase and uppercase letters]]</li><li>Draft: [[Knuth%27s_power_tree|Knuth's power tree]]</li><li>Task: [[Left_factorials|Left factorials]]</li><li> |
<tr><td>Gerard Schildberger</td><td><ol><li>Task: [[4-rings_or_4-squares_puzzle|4-rings or 4-squares puzzle]]</li><li>Draft: [[Abbreviations,_automatic|Abbreviations, automatic]]</li><li>Draft: [[Abbreviations,_easy|Abbreviations, easy]]</li><li>Draft: [[Abbreviations,_simple|Abbreviations, simple]]</li><li>Task: [[Bernoulli_numbers|Bernoulli numbers]]</li><li>Task: [[Commatizing_numbers|Commatizing numbers]]</li><li>Draft: [[Egyptian_fractions|Egyptian fractions]]</li><li>Task: [[Emirp_primes|Emirp primes]]</li><li>Task: [[Exponentiation_order|Exponentiation order]]</li><li>Task: [[Farey_sequence|Farey sequence]]</li><li>Task: [[Find_palindromic_numbers_in_both_binary_and_ternary_bases|Find palindromic numbers in both binary and ternary bases]]</li><li>Draft: [[Four_is_the_number_of_letters_in_the_...|Four is the number of letters in the ...]]</li><li>Draft: [[Idiomatically_determine_all_the_characters_that_can_be_used_for_symbols|Idiomatically determine all the characters that can be used for symbols]]</li><li>Draft: [[Idiomatically_determine_all_the_lowercase_and_uppercase_letters|Idiomatically determine all the lowercase and uppercase letters]]</li><li>Draft: [[Knuth%27s_power_tree|Knuth's power tree]]</li><li>Task: [[Left_factorials|Left factorials]]</li><li>Task: [[Leonardo_numbers|Leonardo numbers]]</li><li>Draft: [[Lucky_and_even_lucky_numbers|Lucky and even lucky numbers]]</li><li>Task: [[Magic_squares_of_odd_order|Magic squares of odd order]]</li><li>Task: [[Partition_an_integer_X_into_N_primes|Partition an integer X into N primes]]</li><li>Task: [[Pernicious_numbers|Pernicious numbers]]</li><li>Task: [[Population_count|Population count]]</li><li>Task: [[Primorial_numbers|Primorial numbers]]</li><li>Task: [[Pythagorean_quadruples|Pythagorean quadruples]]</li><li>Task: [[Reverse_words_in_a_string|Reverse words in a string]]</li><li>Task: [[Sort_three_variables|Sort three variables]]</li><li>Draft: [[Spelling_of_ordinal_numbers|Spelling of ordinal numbers]]</li><li>Task: [[Split_a_character_string_based_on_change_of_character|Split a character string based on change of character]]</li><li>Task: [[Sum_to_100|Sum to 100]]</li><li>Task: [[Taxicab_numbers|Taxicab numbers]]</li><li>Task: [[Ulam_spiral_(for_primes)|Ulam spiral (for primes)]]</li><li>Task: [[Zero_to_the_zero_power|Zero to the zero power]]</ol></td></tr> |
||
<tr><td>Gfannes</td><td><ol><li>Task: [[Apply_a_callback_to_an_array|Apply a callback to an array]]</li><li>Task: [[Filter|Filter]]</li><li>Task: [[Hash_from_two_arrays|Hash from two arrays]]</li><li>Task: [[Remove_duplicate_elements|Remove duplicate elements]]</li><li>Task: [[XML/XPath|XML/XPath]]</ol></td></tr> |
<tr><td>Gfannes</td><td><ol><li>Task: [[Apply_a_callback_to_an_array|Apply a callback to an array]]</li><li>Task: [[Filter|Filter]]</li><li>Task: [[Hash_from_two_arrays|Hash from two arrays]]</li><li>Task: [[Remove_duplicate_elements|Remove duplicate elements]]</li><li>Task: [[XML/XPath|XML/XPath]]</ol></td></tr> |
||
<tr><td>Glennj</td><td><ol><li>Task: [[Boolean_values|Boolean values]]</li><li>Task: [[Date_manipulation|Date manipulation]]</li><li>Task: [[Doubly-linked_list/Traversal|Doubly-linked list/Traversal]]</li><li>Task: [[Loop_over_multiple_arrays_simultaneously|Loop over multiple arrays simultaneously]]</li><li>Task: [[Loops/For_with_a_specified_step|Loops/For with a specified step]]</li><li>Task: [[Repeat_a_string|Repeat a string]]</ol></td></tr> |
<tr><td>Glennj</td><td><ol><li>Task: [[Boolean_values|Boolean values]]</li><li>Task: [[Date_manipulation|Date manipulation]]</li><li>Task: [[Doubly-linked_list/Traversal|Doubly-linked list/Traversal]]</li><li>Task: [[Loop_over_multiple_arrays_simultaneously|Loop over multiple arrays simultaneously]]</li><li>Task: [[Loops/For_with_a_specified_step|Loops/For with a specified step]]</li><li>Task: [[Repeat_a_string|Repeat a string]]</ol></td></tr> |
||
Line 240: | Line 239: | ||
<tr><td>TBH</td><td><ol><li>Task: [[Forward_difference|Forward difference]]</ol></td></tr> |
<tr><td>TBH</td><td><ol><li>Task: [[Forward_difference|Forward difference]]</ol></td></tr> |
||
<tr><td>TheWombat</td><td><ol><li>Task: [[Validate_International_Securities_Identification_Number|Validate International Securities Identification Number]]</ol></td></tr> |
<tr><td>TheWombat</td><td><ol><li>Task: [[Validate_International_Securities_Identification_Number|Validate International Securities Identification Number]]</ol></td></tr> |
||
<tr><td>Thundergnat</td><td><ol><li>Task: [[Benford%27s_law|Benford's law]]</li><li>Draft: [[Imaginary_base_numbers|Imaginary base numbers]]</li><li>Draft: [[Largest_number_divisible_by_its_digits|Largest number divisible by its digits]]</li><li>Task: [[Pathological_floating_point_problems|Pathological floating point problems]]</li><li>Task: [[Self-referential_sequence|Self-referential sequence]]</ol></td></tr> |
<tr><td>Thundergnat</td><td><ol><li>Task: [[Benford%27s_law|Benford's law]]</li><li>Draft: [[Four_is_magic|Four is magic]]</li><li>Draft: [[Imaginary_base_numbers|Imaginary base numbers]]</li><li>Draft: [[Largest_number_divisible_by_its_digits|Largest number divisible by its digits]]</li><li>Task: [[Pathological_floating_point_problems|Pathological floating point problems]]</li><li>Task: [[Self-referential_sequence|Self-referential sequence]]</ol></td></tr> |
||
<tr><td>Til</td><td><ol><li>Task: [[Regular_expressions|Regular expressions]]</ol></td></tr> |
<tr><td>Til</td><td><ol><li>Task: [[Regular_expressions|Regular expressions]]</ol></td></tr> |
||
<tr><td>TimSC</td><td><ol><li>Draft: [[A*_search_algorithm|A* search algorithm]]</li><li>Draft: [[Angle_difference_between_two_bearings|Angle difference between two bearings]]</li><li>Draft: [[Apply_a_digitial_filter_(direct_form_II_transposed)|Apply a digitial filter (direct form II transposed)]]</li><li>Draft: [[Determine_if_two_triangles_overlap|Determine if two triangles overlap]]</li><li>Draft: [[Eertree|Eertree]]</li><li>Draft: [[Find_the_intersection_of_a_line_with_a_plane|Find the intersection of a line with a plane]]</li><li>Draft: [[Find_the_intersection_of_two_lines|Find the intersection of two lines]]</li><li>Draft: [[Negative_base_numbers|Negative base numbers]]</li><li>Draft: [[Ramer-Douglas-Peucker_line_simplification|Ramer-Douglas-Peucker line simplification]]</ol></td></tr> |
<tr><td>TimSC</td><td><ol><li>Draft: [[A*_search_algorithm|A* search algorithm]]</li><li>Draft: [[Angle_difference_between_two_bearings|Angle difference between two bearings]]</li><li>Draft: [[Apply_a_digitial_filter_(direct_form_II_transposed)|Apply a digitial filter (direct form II transposed)]]</li><li>Draft: [[Determine_if_two_triangles_overlap|Determine if two triangles overlap]]</li><li>Draft: [[Eertree|Eertree]]</li><li>Draft: [[Find_the_intersection_of_a_line_with_a_plane|Find the intersection of a line with a plane]]</li><li>Draft: [[Find_the_intersection_of_two_lines|Find the intersection of two lines]]</li><li>Draft: [[Negative_base_numbers|Negative base numbers]]</li><li>Draft: [[Ramer-Douglas-Peucker_line_simplification|Ramer-Douglas-Peucker line simplification]]</ol></td></tr> |
Revision as of 14:04, 1 October 2017
In this task, the goal is to compile an authorship list for task descriptions. A pseudocode example (in imperative style) that should accomplish this is as follows:
<lang pseudocode>for each task page
grab page source, discard everything after the first ==section==.
Cache as $previous. Note $author.
for each revision grab page source, discard everything after first ==section==.
Cache as $previous2. Note $author2
compare $previous2 to $previous. If different, record $author to $list. replace $previous with $previous2 replace $author with $author2</lang>
The following resources for HTTP interface information for MediaWiki may prove to be useful:
- https://www.mediawiki.org/wiki/Index.php#Raw
- https://www.mediawiki.org/wiki/Index.php#History
- https://www.mediawiki.org/wiki/API:Main_page
Conversely, some languages have libraries which abstract these interfaces into language-native idioms. Use of these abstractions is perfectly fine.
Please DO NOT add a full output for each programming language; just show a representative sample. One full list is useful. Multiple full lists just use space and bandwidth.
Perl 6
The pseudocode above is no longer really useful as the page format has changed. Rather than checking every edit to see if it was a change to the task description, we'll just assume the user that created the page is the task author. This isn't 100% accurate; a very few pages got renamed and recreated by someone other than the original author without preserving the history, so they are misreported (15 Puzzle Game for instance,) but is as good as it is likely to get without extensive manual intervention. Any further edits to the task description are not credited. As it is, we must still make thousands of requests and pound the server pretty hard. Checking every edit would make the task several of orders of magnitude more abusive of the server (and my internet connection.)
Each stage of the scraping process is saved to local files so it can be restarted without losing all your progress in the event of a timeout or error. If that happens though, you need to manually adjust where to restart the process.
<lang perl6>use HTTP::UserAgent; use Gumbo; use Sort::Naturally;
my $ua = HTTP::UserAgent.new;
for 'Programming_Tasks', 'Draft_Programming_Tasks' -> $category { # Get lists of Tasks & Draft Tasks
# last; # Uncomment to skip this step my $page = "http://rosettacode.org/wiki/Category:$category"; my $html = $ua.get($page).content;
my $xmldoc = parse-html($html, :TAG
my $line = $0.lines.tail; # Parse out the User name $line ~~ m| 'title="User:' <-[>]>+? '>' (.+?) '</a>' |;
my $auth = $0; # Oops, no user name, must be anonymous, get IP address instead unless $auth { $line ~~ m| '"mw-userlink mw-anonuserlink">' (.+?) '</a>' |; $auth = $0; }
# Parse out human readable title $line ~~ m| '<a href="/mw/index.php?title=' $title '&' .+? 'title="'(<-["]>+)'"' |; #"'
my $decoded = $0;
# report progress say "$decoded: $auth";
# save it to a file my $f = open("./RC_Authors.txt", :a) or die "$!\n"; $f.say( "$decoded\t$category\t$auth" ); $f.close;
sleep 3; # Don't pound the server }
}
- Read in saved author info
my %authors; my ($cnt, $draftcnt, $taskcnt); "./RC_Authors.txt".IO.slurp.lines.map: {
my ($task, $cat, $auth) = $_.split("\t"); $cnt++; if $cat.contains('Draft') { $cat = 'Draft:'; $draftcnt++; } else { $cat = 'Task: '; $taskcnt++; } %authors{$auth}.push: "$cat $task";
};
- Dump an HTML table to a file
my $out = open("./RC_Authors.html", :w) or die "$!\n";
$out.say( '' );for %authors.sort(*.key.&naturally) -> $a {
$out.print( '' );}
$out.say( 'As of ', Date.today, ' | Total: ',
$cnt, ' / Tasks: ', $taskcnt, ' / Draft Tasks: ', $draftcnt,' | |
---|---|
User | Authored |
', $a.key, ' |
|
$out.close;</lang>
- Sample output
As of 2017-09-04 | Total: 1059 / Tasks: 854 / Draft Tasks: 205 | |
---|---|
User | Authored |
2Powers |
|
12.175.32.19 |
|
12Me21 |
|
Many rows omitted... | |
Zorro1024 |
|
Zzo38 |
|
Русский |
|