Rosetta Code/Find unimplemented tasks: Difference between revisions
Content deleted Content added
m →{{header|Phix}}: syntax coloured |
→{{header|Python}}: Add page info generator solution using requests |
||
(29 intermediate revisions by 15 users not shown) | |||
Line 13:
{{libheader|AWS}}
Parsing XML with XMLAda from Adacore
<syntaxhighlight lang
with
with Input_Sources.Strings, Unicode, Unicode.
with Ada.Strings.Unbounded, Ada.Text_IO, Ada.Command_Line;
with Ada.Containers.Vectors;
use
use
use
use Ada.Text_IO, Ada.Command_Line;
procedure Not_Coded is
package Members_Vectors is new Ada.Containers.Vectors
use Members_Vectors;
Line 39 ⟶ 38:
N : Node;
A : Attr;
Page :
S : Messages.Status_Code;
-- Query has cmlimit value of
-- retrieve the complete list of Programming_category
Uri_Xml : constant String :=
"&format=xml&cmlimit=500&cmtitle=Category:";
Cmcontinue : Unbounded_String := Null_Unbounded_String;
begin
loop
Page :=
S := AWS.Response.Status_Code (Page);
if S not
Put_Line
("Unable to retrieve data => Status Code :" & Image (S) &
raise Connection_Error;
end if;
declare
Xml : constant String := Message_Body (Page);
Line 67 ⟶ 64:
begin
Open
(Xml'Unrestricted_Access, Unicode.CES.Utf8.Utf8_Encoding,
Source);
Parse (Reader, Source);
Line 79 ⟶ 75:
A := Get_Named_Item (Attributes (N), "title");
Members_Vectors.Append
(Mbr_Vector, To_Unbounded_String (Value (A)));
end loop;
Free (List);
List := Get_Elements_By_Tag_Name (Doc, "
if Length (List) = 0 then
-- we are done
Free (List);
Free (Reader);
exit;
end if;
N :=
A := Get_Named_Item (Attributes (N), "cmcontinue");
Cmcontinue :=
Free (List);
Free (Reader);
Line 103 ⟶ 97:
Beginning, Position : Extended_Index;
begin
-- take adavantage that both lists are already sorted
Beginning := First_Index (From);
for I in First_Index (Substract) .. Last_Index (Substract) loop
Position :=
if not (Position = No_Index) then
Delete (From, Position);
Line 123 ⟶ 117:
return;
else
Put ("Language given: ");
Put_Line (Argument (1));
Get_Vector (Argument (1), Language_Members);
end if;
Line 135 ⟶ 131:
("Numbers of tasks not implemented :=" &
Integer'Image (Last_Index ((All_Tasks))));
end Not_Coded;</
=={{header|ARM Assembly}}==
{{works with|as|Raspberry Pi <br> or android 32 bits with application Termux}}
<syntaxhighlight lang ARM Assembly>
/* ARM assembly Raspberry PI */
/* program tasksearchRasp.s */
/* access RosettaCode.org and data extract */
/* use openssl for access to port 443 */
/* test openssl : package libssl-dev */
/* REMARK 1 : this program use routines in a include file
see task Include a file language arm assembly
for the routine affichageMess conversion10
see at end of this program the instruction include */
/*******************************************/
/* Constantes */
/*******************************************/
.include "../constantes.inc"
//.equ EXIT, 1
.equ TAILLEBUFFER, 500
.equ SSL_OP_NO_SSLv3, 0x02000000
.equ SSL_OP_NO_COMPRESSION, 0x00020000
.equ SSL_MODE_AUTO_RETRY, 0x00000004
.equ SSL_CTRL_MODE, 33
.equ BIO_C_SET_CONNECT, 100
.equ BIO_C_DO_STATE_MACHINE, 101
.equ BIO_C_SET_SSL, 109
.equ BIO_C_GET_SSL, 110
.equ LGBUFFERREQ, 512001
.equ LGBUFFER2, 128001
/*********************************/
/* Initialized data */
/*********************************/
.data
szMessDebutPgm: .asciz "Program 32 bits start \n"
szRetourLigne: .asciz "\n"
szMessFinOK: .asciz "Program end OK. \n"
szMessErreur: .asciz "Erreur !!!"
//szMessExtractArea: .asciz "Extraction = "
szMessConnectOK: .asciz "Connexion site OK.\n"
szMessInitOK: .asciz "Initialisation SSL OK.\n"
szMessReqOK: .asciz "Send requete OK.\n"
szNomSite1: .asciz "www.rosettacode.org:443" @ host name and port
szLibStart: .asciz "<query><categorymembers>" @ search string
szLibsearch1: .asciz "<cm pageid="
szLibsearch2: .asciz "title="
szNomrepCertif: .asciz "/pi/certificats"
szRequete1: .asciz "GET /w/api.php?action=query&list=categorymembers&cmtitle=Category:Programming_Tasks&cmlimit=1000&format=xml HTTP/1.1 \r\nHost: rosettacode.org\r\nConnection: keep-alive\r\nContent-Type: text/plain\r\n\r\n"
szRequete2: .asciz "GET /w/api.php?action=query&list=categorymembers&cmtitle=Category:ARM%20Assembly&cmlimit=500&format=xml HTTP/1.1 \r\nHost: rosettacode.org\r\nConnection: keep-alive\r\nContent-Type: text/plain\r\n\r\n"
/*********************************/
/* UnInitialized data */
/*********************************/
.bss
.align 4
sBufferreq: .skip LGBUFFERREQ
sBufferreq1: .skip LGBUFFERREQ
szExtractArea: .skip TAILLEBUFFER
szExtractArea1: .skip TAILLEBUFFER
szTaskName: .skip 128
szTaskNamePgm: .skip 128
.align 4
stNewSSL: .skip 200
/*********************************/
/* code section */
/*********************************/
.text
.global main
main:
ldr r0,iAdrszMessDebutPgm
bl affichageMess @ start message
/* connexion host port 443 and send query */
ldr r0,iAdrszNomSite1
ldr r1,iAdrszRequete1
ldr r2,iAdrsBufferreq
bl envoiRequete
cmp r0,#-1
beq 99f @ error ?
ldr r0,iAdrszNomSite1
ldr r1,iAdrszRequete2
ldr r2,iAdrsBufferreq1
bl envoiRequete
cmp r0,#-1
beq 99f @ error ?
bl analyseReponse
ldr r0,iAdrszMessFinOK @ end message
bl affichageMess
mov r0, #0 @ return code ok
b 100f
99:
ldr r0,iAdrszMessErreur @ error
bl affichageMess
mov r0, #1 @ return code error
b 100f
100:
mov r7,#EXIT @ program end
svc #0 @ system call
iAdrszMessDebutPgm: .int szMessDebutPgm
iAdrszMessFinOK: .int szMessFinOK
iAdrszMessErreur: .int szMessErreur
iAdrszNomSite1: .int szNomSite1
iAdrszRequete2: .int szRequete2
iAdrszRequete1: .int szRequete1
iAdrsBufferreq: .int sBufferreq
iAdrsBufferreq1: .int sBufferreq1
/*********************************************************/
/* connexion host port 443 and send query */
/*********************************************************/
envoiRequete:
push {r2-r9,lr} @ save registers
mov r8,r0 @ save address site name
mov r9,r1 @ save address requete
mov r7,r2 @ save address buffer
@*************************************
@ openSsl functions use *
@*************************************
@init ssl
mov r0,#0
bl OPENSSL_init_crypto
bl ERR_load_BIO_strings
mov r2, #0
mov r1, #0
mov r0, #2
bl OPENSSL_init_crypto
mov r2, #0
mov r1, #0
mov r0, #0
bl OPENSSL_init_ssl
cmp r0,#0
blt erreur
bl TLS_client_method
bl SSL_CTX_new
cmp r0,#0
ble erreur
mov r6,r0 @ save ctx
ldr r1,iFlag
bl SSL_CTX_set_options
mov r0,r6
mov r1,#0
ldr r2,iAdrszNomrepCertif
bl SSL_CTX_load_verify_locations
cmp r0,#0
ble erreur
mov r0,r6
bl BIO_new_ssl_connect
cmp r0,#0
beq erreur
cmp r0,#-1
beq erreur
mov r5,r0 @ save bio
ldr r0,iAdrszMessInitOK
bl affichageMess
mov r0,r5
mov r1,#BIO_C_GET_SSL
mov r2,#0
ldr r3,iAdrstNewSSL
bl BIO_ctrl
ldr r0,iAdrstNewSSL
ldr r0,[r0]
mov r1,#SSL_CTRL_MODE
mov r2,#SSL_MODE_AUTO_RETRY
mov r3,#0
bl SSL_ctrl
mov r0,r5 @ bio
mov r1,#BIO_C_SET_CONNECT
mov r2,#0
mov r3,r8 @ site address
bl BIO_ctrl
mov r0,r5 @ bio
mov r1,#BIO_C_DO_STATE_MACHINE
mov r2,#0
mov r3,#0
bl BIO_ctrl
cmp r0,#0
blt erreur
ldr r0,iAdrszMessConnectOK
bl affichageMess
@ compute query length
mov r2,#0 @ init length
mov r1,r9 @ query address
1: @ loop compute length query
ldrb r0,[r1,r2]
cmp r0,#0
addne r2,#1
bne 1b
@ send query
mov r0,r5 @ bio
@ r1 = address query
@ r2 = length query
mov r3,#0
bl BIO_write @ send query
cmp r0,#0
blt erreur
ldr r0,iAdrszMessReqOK
bl affichageMess
2: @ begin loop to read datas
mov r0,r5 @ bio
mov r1,r7 @ buffer address
mov r2,#LGBUFFERREQ - 1
mov r3,#0
bl BIO_read
cmp r0,#0
ble 4f @ error ou pb server
mov r1,r7
add r7,r0
sub r2,r7,#6
ldr r2,[r2]
ldr r3,iCharEnd
cmp r2,r3 @ text end ?
beq 4f
mov r1,#0xFF @ delay loop
3:
subs r1,#1
bgt 3b
b 2b @ loop read other chunk
4: @ read end
//ldr r0,iAdrsBufferreq @ to display buffer response of the query
//bl affichageMess
mov r0, r5 @ close bio
bl BIO_free_all
mov r0,#0
b 100f
erreur: @ error display
ldr r1,iAdrszMessErreur
bl afficheerreur
mov r0,#-1 @ error code
b 100f
100:
pop {r2-r9,pc} @ restaur registers
iFlag: .int SSL_OP_NO_SSLv3 | SSL_OP_NO_COMPRESSION
iAdrstNewSSL: .int stNewSSL
iAdrszNomrepCertif: .int szNomrepCertif
iCharEnd: .int 0x0A0D300A
iAdrszMessConnectOK: .int szMessConnectOK
iAdrszMessInitOK: .int szMessInitOK
iAdrszMessReqOK: .int szMessReqOK
/*********************************************************/
/* response analyze */
/*********************************************************/
analyseReponse:
push {r1-r6,lr} @ save registers
@ search start in task buffer
ldr r0,iAdrsBufferreq @ buffer address
mov r7,r0
ldr r1,iAdrszLibStart @ key text address
bl rechercheSousChaine
cmp r0,#-1
beq 99f
add r7,r7,r0 @ new search buffer address
mov r0,r7
@ search start in task buffer
ldr r0,iAdrsBufferreq11 @ buffer address
mov r5,r0
ldr r1,iAdrszLibStart @ key text address
bl rechercheSousChaine
cmp r0,#-1
beq 99f @ error ?
add r5,r5,r0
mov r0,r5
1: @ loop begin to find task in program buffer
mov r0,r5
ldr r1,iAdrszLibsearch1 @ text code task address
mov r2,#1 @ occurence key text
mov r3,#2 @ offset
ldr r4,iAdrszExtractArea1 @ address result area
bl extChaine
cmp r0,#-1
beq 99f @ error ?
mov r5,r0 @ new address to search
ldr r0,iAdrszExtractArea1
bl conversionAtoD @ conversion code task to numeric
mov r10,r0 @ save numeric code
mov r0,r5 @ search task name in pgm buffer @
ldr r1,iAdrszLibsearch2 @ key text address
mov r2,#1 @ occurence key text
mov r3,#2 @ offset
ldr r4,iAdrszTaskNamePgm @ address result area
bl extChaine
cmp r0,#-1
beq 99f
mov r5,r0 @ new address to search
2: @ loop search buffer tasks
mov r0,r7
ldr r1,iAdrszLibsearch1 @ key text address
mov r2,#1 @ occurence key text
mov r3,#2 @ offset
ldr r4,iAdrszExtractArea @ address result area
bl extChaine
cmp r0,#-1
beq 99f
mov r7,r0
mov r0,r7
ldr r1,iAdrszLibsearch2 @ key text address
mov r2,#1 @ occurence key text
mov r3,#2 @ offset
ldr r4,iAdrszTaskName @ address result area
bl extChaine
cmp r0,#-1
beq 99f
mov r7,r0 @ new search address in task buffer
ldr r0,iAdrszExtractArea
bl conversionAtoD @ conversion code task in numeric
cmp r10,r0 @ compere two task code
beq 10f @ search next codes if equals
ldr r0,iAdrszTaskName @ else display task name
bl affichageMess
ldr r0,iAdrszRetourLigne
bl affichageMess
add r0,r7,#4 @ search if end of task list
ldrb r2,[r0]
cmp r2,#'/'
bne 2b @ no -> loop
add r0,#1
ldrb r2,[r0]
cmp r2,#'c'
bne 2b @ no -> loop
b 100f @ yes -> list end
10:
add r0,r5,#4 @ search if end of pgm task list
ldrb r2,[r0]
cmp r2,#'/'
bne 1b
add r0,#1
ldrb r2,[r0]
cmp r2,#'c'
bne 1b
b 100f @ list pgm end
99:
ldr r0,iAdrszMessErreur1 @ error
bl affichageMess
mov r0, #-1 @ error return code
b 100f
100:
pop {r1-r6,pc} @ restaur registers
iAdrsBufferreq11: .int sBufferreq1
iAdrszLibStart: .int szLibStart
iAdrszLibsearch1: .int szLibsearch1
iAdrszLibsearch2: .int szLibsearch2
iAdrszTaskName: .int szTaskName
iAdrszTaskNamePgm: .int szTaskNamePgm
iAdrszExtractArea: .int szExtractArea
iAdrszExtractArea1: .int szExtractArea1
iAdrszRetourLigne: .int szRetourLigne
iAdrszMessErreur1: .int szMessErreur
/*********************************************************/
/* Text Extraction behind text key */
/*********************************************************/
/* r0 buffer address */
/* r1 key text to search */
/* r2 number occurences to key text */
/* r3 offset */
/* r4 result address */
extChaine:
push {r2-r8,lr} @ save registers
mov r5,r0 @ save buffer address
mov r6,r1 @ save key text
@ compute text length
mov r7,#0
1: @ loop
ldrb r0,[r5,r7] @ load a byte
cmp r0,#0 @ end ?
addne r7,#1 @ no -> loop
bne 1b
add r7,r5 @ compute text end
mov r8,#0
2: @ compute length text key
ldrb r0,[r6,r8]
cmp r0,#0
addne r8,#1
bne 2b
3: @ loop to search nième(r2) key text
mov r0,r5
mov r1,r6
bl rechercheSousChaine
cmp r0,#0
blt 100f
subs r2,#1
addgt r5,r0
addgt r5,r8
bgt 3b
add r0,r5 @ add address text to index
add r3,r0 @ add offset
sub r3,#1
@ and add length key text
add r3,r8
cmp r3,r7 @ > at text end
movge r0,#-1 @ yes -> error
bge 100f
mov r0,#0
4: @ character loop copy
ldrb r2,[r3,r0]
strb r2,[r4,r0]
cmp r2,#0 @ text end ?
moveq r0,#0 @ return zero
beq 100f
cmp r2,#'"' @ text end ?
beq 5f
cmp r0,#48 @ extraction length
beq 5f
add r0,#1
b 4b @ and loop
5:
mov r2,#0 @ store final zéro
strb r2,[r4,r0]
add r0,#1
add r0,r3 @ r0 return the last position of extraction
@ it is possible o search another text
100:
pop {r2-r8,pc} @ restaur registers
/******************************************************************/
/* search substring in string */
/******************************************************************/
/* r0 contains address string */
/* r1 contains address substring */
/* r0 return start index substring or -1 if not find */
rechercheSousChaine:
push {r1-r6,lr} @ save registers
mov r2,#0 @ index position string
mov r3,#0 @ index position substring
mov r6,#-1 @ search index
ldrb r4,[r1,r3] @ load first byte substring
cmp r4,#0 @ zero final ?
moveq r0,#-1 @ error
beq 100f
1:
ldrb r5,[r0,r2] @ load string byte
cmp r5,#0 @ zero final ?
moveq r0,#-1 @ yes -> not find
beq 100f
cmp r5,r4 @ compare character two strings
beq 2f
mov r6,#-1 @ not equal - > raz index
mov r3,#0 @ and raz byte counter
ldrb r4,[r1,r3] @ and load byte
add r2,#1 @ and increment byte counter
b 1b @ and loop
2: @ characters equal
cmp r6,#-1 @ first character equal ?
moveq r6,r2 @ yes -> start index in r6
add r3,#1 @ increment substring counter
ldrb r4,[r1,r3] @ and load next byte
cmp r4,#0 @ zero final ?
beq 3f @ yes -> search end
add r2,#1 @ else increment string index
b 1b @ and loop
3:
mov r0,r6 @ return start index substring in the string
100:
pop {r1-r6,pc} @ restaur registres
/***************************************************/
/* ROUTINES INCLUDE */
/***************************************************/
.include "../affichage.inc"
</syntaxhighlight>
{{Out}}
<pre>
Program 32 bits start
Initialisation SSL OK.
Connexion site OK.
Send requete OK.
Initialisation SSL OK.
Connexion site OK.
Send requete OK.
Abstract type
Accumulator factory
Active Directory/Connect
Active Directory/Search for a user
Active object
Add a variable to a class instance at runtime
Algebraic data types
</pre>
=={{header|AutoHotkey}}==
The GUI overkill version with comments.
<syntaxhighlight lang="autohotkey">
#NoEnv ; do not resolve environment variables (speed)
#SingleInstance force ; allow only one instance
Line 325 ⟶ 812:
ExitApp ; exit the script
Return
</syntaxhighlight>
===Output===
Loads a list of all languages. Pick the language you would like to see the unimplemented tasks of, press the button, double click the selected task to launch in default browser. It will download the languages to file and redownload if older than 3 days (to save unnecessary bandwith).
[[Image:Ahk_find_unimplemented.png]]
=={{header|BBC BASIC}}==
{{works with|BBC BASIC for Windows}}
<syntaxhighlight lang="bbcbasic"> SYS "LoadLibrary", "URLMON.DLL" TO U%
IF U% == 0 ERROR 100, "DLL not available in your OS"
SYS "GetProcAddress", U%, "URLDownloadToFileA" TO U%
Q$=CHR$34 : REM The quote
BlkSize%=256 * 1024 : REM 256k must be enough
DIM Blk% BlkSize% - 1 : REM Reserve memory block to load data into
PROCFetchData("Programming_Tasks")
REM Count number of tasks and declare and populate Task$() array.
P%=Blk%
REPEAT
I%=INSTR($$P%, "title")
IF I% Tasks%+=1 : P%+=I%
UNTIL I% == 0
DIM Task$(Tasks%-1)
P%=Blk%
FOR I%=0 TO Tasks% - 1
Task$(I%)=FNValue(P%, "title")
NEXT
PROCShowUnimplemented("BBC_BASIC")
PROCShowUnimplemented("C++")
END
REM -------------------------------------------------------------------------
REM Compare each task title against loaded language data in memory.
DEF PROCShowUnimplemented(language$)
LOCAL i%, j%, mem%, n%
PROCFetchData(language$)
mem%=Blk%
PRINT "Unimplemented tasks for the '" language$ "' programming language:"
FOR i%=0 TO Tasks% - 1
j%=INSTR($$mem%, Task$(i%))
IF j% THEN
mem%+=j%
ELSE
n%+=1
PRINT " -" Task$(i%)
ENDIF
NEXT
PRINT "Total is: ";n% '
ENDPROC
REM -------------------------------------------------------------------------
REM Stitch the pages for this category together in the memory block.
DEF PROCFetchData(category$)
LOCAL mem%, continue$, e%, f%, tempfile$, url$
tempfile$=@tmp$ + "result.json"
mem%=Blk%
REPEAT
url$="http://www.rosettacode.org/w/api.php?" +\
\ "action=query&list=categorymembers&cmtitle=Category:" + category$ +\
\ "&cmlimit=500&format=json&cmcontinue=" + continue$
SYS U%, 0, url$, tempfile$, 0, 0 TO e% : REM Get one page to a file
IF e% ERROR 100, "Can't get data from Rosetta API"
f%=OPENINtempfile$ : e%=EXT#f% : CLOSE#f% : REM Get file size
IF mem% - Blk% + e% > BlkSize% ERROR 100, "Insufficient memory to load data"
OSCLI "LOAD " + tempfile$ + " " + STR$~mem% : REM Append to previous
e%=mem% + e%
?e%=0 : REM Terminating 0x00
continue$=FNValue(mem%, "cmcontinue") : REM Loaded page contains this name?
mem%=e% : REM Advance memory pointer
UNTIL continue$ == ""
ENDPROC
REM -------------------------------------------------------------------------
REM Retrieve value for a JSON name from address p% and advance p% afterwards.
DEF FNValue(RETURN p%, name$)
LOCAL s%
name$=Q$ + name$ + Q$ + ":"
s%=INSTR($$p%, name$)
IF s% == 0 THEN =""
p%+=s% + LENname$
=LEFT$($$p%, INSTR($$p%, Q$) - 1)</syntaxhighlight>
{{out}}
<pre>
Unimplemented tasks for the 'BBC_BASIC' programming language:
-100 prisoners
-15 puzzle solver
-21 game
......
-Zhang-Suen thinning algorithm
-Zsigmondy numbers
-Zumkeller numbers
Total is: 697
Unimplemented tasks for the 'C++' programming language:
-Abelian sandpile model/Identity
-Achilles numbers
-Add a variable to a class instance at runtime
......
-Yahoo! search interface
-Zsigmondy numbers
-Zumkeller numbers
Total is: 172
</pre>
=={{header|C sharp|C#}}==
Using JSON (not parsed, just Regex.)
Line 336 ⟶ 927:
To help demonstrate paging, the cmlimit parameter has been omitted from the search query so that 10 rows are returned by default
<
using System.Collections.Generic;
using System.Linq;
Line 382 ⟶ 973:
foreach (string i in unimpl) Console.WriteLine(i);
}
}</
=={{header|Clojure}}==
This uses a couple of core libraries, and a Java method for URL encoding.
<
'[clojure.xml :as xml]
'[clojure.set :as set]
'[clojure.string :as string])
(import '[java.net URLEncoder])</
The ''titles-cont'' function fetches and parses an XML response, and walks over it extracting titles. It also extracts the ''cmcontinue'' value, if present. Returns a pair ''[titles,cmcontinue]''.
<
(let [docseq (-> url xml/parse xml-seq)]
((juxt #(filter string? %), #(-> (filter map? %) first :cmcontinue))
Line 399 ⟶ 990:
(if (= tag :cm)
(attrs :title)
(-> content first :attrs))))))</
The ''get-titles'' function has 1- and 2-argument versions. The former takes the name of a category, composes the appropriate URL query, and calls the 2-argument version. The 2-argument version gets a title list (with possible ''cmcontinue'' value), chaining further calls as necessary into the lazy sequence result.
<
(defn param [p v] (str p (urlencode v)))
Line 420 ⟶ 1,011:
(if continue
(lazy-cat titles (get-titles url continue))
titles))))</
The ''unimplemented'' function gets a set of all titles and of language-implemented titles and returns the difference. It uses ''future'' in order to do the necessary URL requests in parallel.
<
(let [title-set #(future (apply sorted-set (get-titles %)))
all-titles (title-set "Programming_Tasks")
Line 431 ⟶ 1,022:
(doseq [title titles] (println title))
(println "count: " (count titles)))
(shutdown-agents)</
=={{header|E}}==
Line 437 ⟶ 1,028:
Using JSON.
<
# NOTE: This program will not work in released E, because TermL is an
Line 443 ⟶ 1,034:
# If you build E from the latest source in SVN then it will work.
#
# Usage: rosettacode-cat-subtract.e [<
#
# Prints a list of tasks which have not been completed in the language.
Line 541 ⟶ 1,132:
# Whoops, something went wrong
stderr.println(`$p${p.eStack()}`)
}</
=={{header|Erlang}}==
init_http/0 is used by many tasks. rosetta_code_list_of/1 is used by [[Rosetta_Code/Rank_languages_by_popularity]]
<syntaxhighlight lang="erlang">
-module( find_unimplemented_tasks ).
-include_lib( "xmerl/include/xmerl.hrl" ).
Line 589 ⟶ 1,180:
xml_8211( 1052 ) -> $\s;
xml_8211( Character ) -> Character.
</syntaxhighlight>
{{out}}
<pre>
Line 611 ⟶ 1,202:
=={{header|Go}}==
XML, stepping through the elements.
<
import (
Line 684 ⟶ 1,275:
continueAt = req(taskQuery+"&cmcontinue="+continueAt, printUnImp)
}
}</
=={{header|Haskell}}==
{{libheader|HTTP XML}} from [http://hackage.haskell.org/packages/hackage.html HackageDB]
<
import Network.HTTP
import Network.URI
Line 715 ⟶ 1,306:
xml = onlyElems $ parseXML allTasks
allxx = concatMap (map (fromJust.findAttr (unqual "title")). filterElementsName (== unqual "cm")) xml
mapM_ putStrLn $ sort $ allxx \\ langxx</
With only standard libraries
<
import Data.Text (splitOn, pack, unpack)
import Data.List
Line 732 ⟶ 1,323:
implTasks <- getTasks $ "http://rosettacode.org/mw/api.php?action=query&list=categorymembers&cmtitle=Category:" ++ lang ++ "&format=json&cmlimit=500"
allTasks <- getTasks "http://rosettacode.org/mw/api.php?action=query&list=categorymembers&cmtitle=Category:Programming_Tasks&format=json&cmlimit=500"
mapM_ putStrLn $ allTasks \\ implTasks</
=={{header|Icon}} and {{header|Unicon}}==
Line 738 ⟶ 1,329:
The following code only works in Unicon.
<
$define RCTASK "http://rosettacode.org/mw/index.php?action=raw&title="
$define RCUA "User-Agent: Unicon Rosetta 0.1"
Line 814 ⟶ 1,405:
close(page)
return text
end</
Sample output (abridged):
Line 840 ⟶ 1,431:
=={{header|J}}==
'''Solution:'''
<
findUnimpTasks=: ('Programming_Tasks' -.&getCategoryMembers ,&'/Omit') ([ #~ -.@e.) getCategoryMembers
Line 859 ⟶ 1,450:
uri=. url ,'?', buildqry urlencode y
catmbrs=. qrycont=. ''
whilst. #qrycont=. ,getCMcontquery jsondat do.
jsondat=. '-sL' gethttp uri , qrycont
catmbrs=. catmbrs, parseTitles jsondat
end.
catmbrs
)</
Note that gethttp currently requires the '-sL' to follow redirects.
'''Example Usage:'''
<
┌────────────────┬────────────────────────┬──────────────────────────────────┬──────────────┐
│15 puzzle solver│Active Directory/Connect│Active Directory/Search for a user│Atomic updates│
└────────────────┴────────────────────────┴──────────────────────────────────┴──────────────┘</syntaxhighlight>
=={{header|JavaScript}}==
Line 878 ⟶ 1,471:
For the narrower context of a browser in which the 'not implemented' page has been fetched for a particular language, we can however, evaluate an XPath expression in JavaScript to generate an array of titles for the unimplemented tasks.
<
var xr = document.evaluate(
strXPath,
Line 900 ⟶ 1,493:
})(
'//*[@id="mw-content-text"]/div[2]/table/tbody/tr/td/ul/li/a'
);</
Output begins with:
Line 932 ⟶ 1,525:
Find limit of recursion
...</pre>
=={{header|jq}}==
This script illustrates how jq interoperates with other command-line tools. It was tested in October, 2022
using both the C and Go implementations of jq.
The only pre-requisites other than bash are curl and jq, which is called at least five times.
<pre>
#!/bin/bash
# October 8, 2022
# https://rosettacode.org/w/index.php?title=Rosetta_Code/Find_unimplemented_tasks
# Syntax: $0 [--markdown] CATEGORY
# Fetch the Category:Programming_Tasks and Category:$category pages,
# then compute the differences in the lists of titles.
# If --markdown is specified, then some markdown suitable for RosettaCode.org is added.
BN=$(basename "$0")
JQ=jq
function die { echo "$BN: $@" >&2 ; exit 1 ; }
baseuri="https://rosettacode.org/w/api.php?action=query&list=categorymembers&cmtitle=Category:"
if [ "$1" = "--markdown" ] ; then
markdown="--argjson markdown true"
shift
else
markdown="--arg markdown false"
fi
category="$1"
test -z "$category" && die "Syntax: $0 [--markdown] CATEGORY"
for id in $category Programming_Tasks; do
id=/tmp/rosettacode.$id.titles.json
test -s "$id" && rm "$id"
done
function getall {
local cat="$1"
local cmcontinue="$2"
local tmpfile="/tmp/rosettacode.$cat.json.tmp"
# cmlimit=500 is the max allowed so use paging
curl -Ss "${baseuri}${cat}&format=json&cmlimit=500${cmcontinue}" > "$tmpfile"
if [ ! -s "$tmpfile" ] ; then return ; fi
$JQ '.query.categorymembers[].title' "$tmpfile" >> /tmp/rosettacode.$cat.titles.json
cmcontinue=$($JQ -r '.continue | if . then .cmcontinue else null end' "$tmpfile" )
if [ -z "$cmcontinue" -o "$cmcontinue" = "null" ] ; then return ; fi
echo $BN: fetching continuation page for $cat ...
getall "$cat" "&cmcontinue=$cmcontinue"
}
getall $category
getall Programming_Tasks
for id in $category Programming_Tasks; do
id=/tmp/rosettacode.$id.titles.json
test -s "$id" || die "unable to find $id"
done
$JQ -r -n $markdown --slurpfile tasks /tmp/rosettacode.Programming_Tasks.titles.json \
--slurpfile cat /tmp/rosettacode.$category.titles.json '
def mark: if $markdown then "* [[\(gsub(" ";"_"))|\(.)]]" else . end;
($tasks - $cat)[] | mark '
</pre>
=={{header|Julia}}==
<
const baseuri = "http://www.rosettacode.org/
const enduri = "&cmlimit=500&format=json"
queries(x) = baseuri * HTTP.Strings.escapehtml(x) * enduri
Line 967 ⟶ 1,629:
showunimp("Julia")
showunimp("C++")
</
<pre>
Unimplemented in Julia:
Line 1,092 ⟶ 1,754:
{{libheader|lua-requests}}
<
local lang = arg[1]
Line 1,153 ⟶ 1,815:
for _, t in ipairs(open_tasks) do
io.write(string.format(' %s\n', t))
end</
{{out}}
<pre>
Line 1,164 ⟶ 1,826:
=={{header|Maple}}==
<
lan := "Maple":
x := URL:-Get(cat("http://rosettacode.org/wiki/Reports:Tasks_not_implemented_in_", StringTools:-SubstituteAll(lan, " ", "_")), output = content):
Line 1,172 ⟶ 1,834:
for problem in x do
printf("%s\n", StringTools:-SubstituteAll(StringTools:-Decode(StringTools:-StringSplit(problem, "\" title=")[1], 'percent'), "_", " "));
end do:</
{{Out|Output}}
<pre>#10:09 AM 10/05/2018
Line 1,194 ⟶ 1,856:
=={{header|Mathematica}}/{{header|Wolfram Language}}==
Two implementations are considered, the first will use the API to get all the programming tasks, then the ones implemented for a certain language, and take the difference. The other will use the Tasks not implemented page and strip the html.
<
ImportAll[lang_String] :=
Module[{data, continue, cmcontinue, extra, xml, next},
Line 1,214 ⟶ 1,876:
Cases[Flatten[data], HoldPattern["title" -> x_] :> x, \[Infinity]]
]
Complement[ImportAll["Programming_Tasks"], ImportAll["Mathematica"]]</
which outputs a list of items not implemented:
{{out}}
<pre>{Abstract type,Active Directory/Connect,Active Directory/Search for a user,Address of a variable,<<139>>,Write to Windows event log,Xiaolin Wu's line algorithm,Zeckendorf arithmetic}</pre>
Another method is by getting the Tasks not implemented page:
<
html = Import[url, "XMLObject"];
pos = Position[html, XMLElement["div", {"class" -> "mw-content-ltr", "dir" -> "ltr", "lang" -> "en"}, ___]];
Line 1,231 ⟶ 1,893:
newb = data[[All, 1]];
data = Hyperlink @@@ data;
data // Column</
{{out}}
<pre>Append a record to the end of a text file
Line 1,242 ⟶ 1,904:
=={{header|Nim}}==
<
Line 1,248 ⟶ 1,910:
var
name = "http://www.rosettacode.org/
cmcontinue = ""
client = newHttpClient()
Line 1,258 ⟶ 1,920:
cmcontinue.setLen(0)
for node in x.findAll("
let u = node.attr("cmcontinue")
if u.len != 0: cmcontinue = u.encodeUrl()
Line 1,276 ⟶ 1,938:
for task in alltasks:
if task notin langTasks:
echo " ", task</
{{out}}
Line 1,293 ⟶ 1,955:
By parsing XML and using an XPath-like mechanism:
<
[HTTPClient] = {Link ['x-ozlib://mesaros/net/HTTPClient.ozf']}
[XMLParser] = {Link ['x-oz://system/xml/Parser.ozf']}
Line 1,419 ⟶ 2,081:
in
%% show tasks not implemented in Oz
{ForAll {FindUnimplementedTasks "Oz"} System.showInfo}</
=={{header|Perl}}==
<
my $ua = LWP::UserAgent->new;
Line 1,432 ⟶ 2,094:
sub tasks {
my($category) = shift;
my $fmt = 'http://www.rosettacode.org/
'action=query&generator=categorymembers&gcmtitle=Category:%s&gcmlimit=500&format=json&rawcontinue=';
my @tasks;
Line 1,445 ⟶ 2,107:
my %language = map {$_, 1} tasks shift || 'perl';
$language{$_} or print "$_\n" foreach tasks('Programming_Tasks'), tasks('Draft_Programming_Tasks');</
'''See also:''' [[User:ImplSearchBot/Code]]
Line 1,454 ⟶ 2,116:
{{libheader|Phix/libcurl}}
{{trans|Go}}
<!--<
<span style="color: #000080;font-style:italic;">-- demo\rosetta\Find_unimplemented_tasks.exw</span>
<span style="color: #008080;">without</span> <span style="color: #008080;">js</span> <span style="color: #000080;font-style:italic;">-- (libcurl, file i/o, peek, progress..)</span>
<span style="color: #008080;">constant</span> <span style="color: #000000;">language</span> <span style="color: #0000FF;">=</span> <span style="color: #008000;">"Phix"</span><span style="color: #0000FF;">,</span>
<span style="color: #000080;font-style:italic;">-- language = "Go",
Line 1,568 ⟶ 2,231:
<span style="color: #008080;">end</span> <span style="color: #008080;">procedure</span>
<span style="color: #000000;">main</span><span style="color: #0000FF;">()</span>
<!--</
{{out}}
<pre>
Line 1,580 ⟶ 2,243:
=={{header|PicoLisp}}==
<
(de rosettaCategory (Cat)
Line 1,603 ⟶ 2,266:
(diff
(rosettaCategory "Programming_Tasks")
(rosettaCategory Task) ) )</
=={{header|PowerShell}}==
I don't think this script follows the spirit of the task, but it works.
<syntaxhighlight lang="powershell">
function Find-UnimplementedTask
{
Line 1,628 ⟶ 2,291:
Select-String -Pattern "[^0-9A-Z]$" -CaseSensitive)
}
</syntaxhighlight>
<syntaxhighlight lang="powershell">
$tasks = Find-UnimplementedTask -Language PowerShell
$tasks[0..5],".`n.`n.",$tasks[-6..-1]
Write-Host "`nTotal unimplemented Tasks: $($tasks.Count)"
</syntaxhighlight>
{{Out}}
<pre>
Line 1,658 ⟶ 2,321:
=={{header|Python}}==
==={{libheader|mwclient}}===
<
Given the name of a language on Rosetta Code,
finds all tasks which are not implemented in that language.
Line 1,690 ⟶ 2,353:
tasks = unimplemented_tasks('Python', url=URL, api_path=API_PATH)
print(*tasks, sep='\n')
</syntaxhighlight>
==={{libheader|Requests}}===
<
Given the name of a language on Rosetta Code,
finds all tasks which are not implemented in that language.
Line 1,751 ⟶ 2,414:
request_params=REQUEST_PARAMETERS)
print(*tasks, sep='\n')
</syntaxhighlight>
==={{libheader|urllib}}===
====Python 2.x====
<
import urllib, sys
Line 1,780 ⟶ 2,443:
for i in [i for i in alltasks if i not in lang]:
print i</
====Python 3.x====
<syntaxhighlight lang="python">
#Aamrun, 3rd February 2023
import xml.dom.minidom
import sys, urllib.parse, urllib.request
def findrc(category):
name = "http://www.rosettacode.org/w/api.php?action=query&list=categorymembers&cmtitle=Category:%s&cmlimit=500&format=xml" % urllib.parse.quote(category)
cmcontinue, titles = '', []
while True:
u = urllib.request.urlopen(name + cmcontinue)
xmldata = u.read()
u.close()
x = xml.dom.minidom.parseString(xmldata)
titles += [i.getAttribute("title") for i in x.getElementsByTagName("cm")]
cmcontinue = list(filter( None,
(urllib.parse.quote(i.getAttribute("cmcontinue"))
for i in x.getElementsByTagName("categorymembers")) ))
if cmcontinue:
cmcontinue = '&cmcontinue=' + cmcontinue[0]
else:
break
return titles
alltasks = findrc("Programming_Tasks")
lang = findrc(sys.argv[1])
for i in [i for i in alltasks if i not in lang]:
print(i)
</syntaxhighlight>
===Page info generator===
{{libheader|requests}}
This example finds and displays unimplemented tasks, draft tasks and omitted tasks.
<syntaxhighlight lang="python">
import logging
from typing import Iterable
from typing import NamedTuple
from typing import Set
import requests
from requests.adapters import HTTPAdapter
from requests.adapters import Retry
logging.basicConfig(level=logging.DEBUG)
URL = "https://rosettacode.org/w/api.php"
CM_QUERY = {
"action": "query",
"generator": "categorymembers",
"format": "json",
"formatversion": "2",
"prop": "info",
"inprop": "url|touched",
"gcmlimit": 500,
}
class PageInfo(NamedTuple):
pageid: int
ns: int
title: str
contentmodel: str
pagelanguage: str
pagelanguagehtmlcode: str
pagelanguagedir: str
touched: str
lastrevid: int
length: int
fullurl: str
editurl: str
canonicalurl: str
def get_session() -> requests.Session:
"""Setup a requests.Session with retries."""
retry_strategy = Retry(
total=5,
status_forcelist=[429, 500, 502, 503, 504],
allowed_methods=["HEAD", "GET", "OPTIONS"],
)
adapter = HTTPAdapter(max_retries=retry_strategy)
session = requests.Session()
session.mount("https://", adapter)
session.mount("http://", adapter)
return session
def category_members(category: str, url: str = URL) -> Iterable[PageInfo]:
params = {**CM_QUERY, "gcmtitle": category}
session = get_session()
response = session.get(url, params=params)
response.raise_for_status()
data = response.json()
for page in data["query"]["pages"]:
yield PageInfo(**{k: v for k, v in page.items() if k in PageInfo._fields})
_continue = data.get("continue", {}).get("gcmcontinue")
while _continue:
params["continue"] = data["continue"]["continue"]
params["gcmcontinue"] = _continue
response = session.get(url, params=params)
response.raise_for_status()
data = response.json()
for page in data["query"]["pages"]:
yield PageInfo(**{k: v for k, v in page.items() if k in PageInfo._fields})
_continue = data.get("continue", {}).get("gcmcontinue")
def lang_tasks(language: str) -> Set[PageInfo]:
return set(category_members(f"Category:{language}"))
def omitted_tasks(language: str) -> Set[PageInfo]:
return set(category_members(f"Category:{language}/Omit"))
def unimplemented_tasks(lang_tasks: Set[PageInfo], omitted: Set[PageInfo]) -> Set[str]:
tasks = set(category_members("Category:Programming Tasks"))
return tasks.difference(lang_tasks).difference(omitted)
def unimplemented_draft_tasks(
lang_tasks: Set[PageInfo], omitted: Set[PageInfo]
) -> Set[str]:
tasks = set(category_members("Category:Draft Programming Tasks"))
return tasks.difference(lang_tasks).difference(omitted)
def display(title: str, pages: Iterable[PageInfo]) -> None:
print(title)
for page in pages:
print(" ", page.title, page.canonicalurl)
print("")
if __name__ == "__main__":
lang = lang_tasks("Python")
omitted = omitted_tasks("Python")
display("Programming Tasks", unimplemented_tasks(lang, omitted))
display("Draft Programming Tasks", unimplemented_draft_tasks(lang, omitted))
display("Omitted Tasks", omitted)
</syntaxhighlight>
=={{header|R}}==
{{libheader|XML (R)}}
<
find.unimplemented.tasks <- function(lang="R"){
PT <- xmlInternalTreeParse( paste("http://www.rosettacode.org/w/api.php?action=query&list=categorymembers&cmtitle=Category:Programming_Tasks&cmlimit=500&format=xml",sep="") )
Line 1,799 ⟶ 2,616:
find.unimplemented.tasks(lang="Python")
langs <- c("R","python","perl")
sapply(langs, find.unimplemented.tasks) # fetching data for multiple languages</
=={{header|Racket}}==
<syntaxhighlight lang="racket">
#lang racket
Line 1,830 ⟶ 2,647:
(show-unimplemented 'Racket) ; see all of the Racket entries
</syntaxhighlight>
=={{header|Raku}}==
(formerly Perl 6)
{{works with|Rakudo|2018.04.1}}
<syntaxhighlight lang="raku"
use URI::Escape;
use JSON::Fast;
Line 1,843 ⟶ 2,660:
my $client = HTTP::UserAgent.new;
my $url = '
my @total;
Line 1,852 ⟶ 2,669:
say "Unimplemented tasks in $lang:";
.say for @unimplemented;
say "{+@unimplemented} unimplemented tasks";
sub get-cat ($category) {
Line 1,878 ⟶ 2,697:
}
sub uri-query-string (*%fields) { %fields.map({ "{.key}={uri-escape .value}" }).join("&") }</
{{out}} ''As of Sept. 2, 2022''
<pre>Unimplemented tasks in Raku:
3d turtle graphics
15 puzzle game in 3D
Addition-chain exponentiation
Audio alarm
Audio frequency generator
Audio overlap loop
Binary coded decimal
Black box
Blackjack strategy
Boids
Catmull–Clark subdivision surface
Chess player
CLI-based maze-game
Compare sorting algorithms' performance
Compiler/AST interpreter
Compiler/Preprocessor
Compiler/syntax analyzer
Create an executable for a program in an interpreted language
Cross compilation
Cycles of a permutation
Diophantine linear system solving
Dominoes
Elevator simulation
Execute Computer/Zero
Free polyominoes enumeration
Generalised floating point multiplication
Hexapawn
Honeycombs
IRC gateway
Morpion solitaire
Number triplets game
OLE automation
OpenGL pixel shader
P-Adic square roots
Play recorded sounds
Red black tree sort
Remote agent/Agent interface
Remote agent/Agent logic
Remote agent/Simulation
Simple turtle graphics
Solve a Rubik's cube
Solving coin problems
Sorting algorithms/Tree sort on a linked list
Tamagotchi emulator
Tetris
Ukkonen’s suffix tree construction
Unicode polynomial equation
Uno (card game)
Use a REST API
Waveform analysis/Top and tail
Weather routing
WebGL rotating F
52 unimplemented tasks</pre>
=={{header|Ring}}==
<
# Project: Rosetta Code/Find unimplemented tasks
Line 1,941 ⟶ 2,815:
end
return sum
</syntaxhighlight>
Output:
<pre>
Line 1,974 ⟶ 2,848:
Uses the <code>RosettaCode</code> module from [[Count programming examples#Ruby]]
<
require 'time'
Line 2,020 ⟶ 2,894:
]
end
</syntaxhighlight>
Output for Ruby
Line 2,079 ⟶ 2,953:
Find tasks not implemented.
Select Language from DropDown and click [GO] or [Exit].
<
a$ = httpGet$("http://rosettacode.org/wiki/Category:Programming_Languages")
a$ = word$(a$,2,"mw-subcategories")
Line 2,121 ⟶ 2,995:
print "Total unImplemented Tasks:";c
[exit]
end</
<table border=1>
<tr></tr>
Line 2,135 ⟶ 3,009:
=={{header|Rust}}==
<
use std::collections::{BTreeMap, HashSet};
Line 2,277 ⟶ 3,151:
}
}
</syntaxhighlight>
{{out}}
<pre style="height: 32ex; overflow: scroll">
Line 2,635 ⟶ 3,509:
"com.softwaremill.sttp"%%"json4s"%"1.5.11")
<
import com.softwaremill.sttp.json4s._
import com.softwaremill.sttp.quick._
Line 2,662 ⟶ 3,536:
.foldRight(Set.empty[Task])((acc: Set[Task], ele: Set[Task]) => acc -- ele)
</syntaxhighlight>
=={{header|Tcl}}==
Line 2,670 ⟶ 3,544:
{{tcllib|json}}{{tcllib|struct::set}}
<
package require http
package require json
Line 2,768 ⟶ 3,642:
foreach lang {Perl Python Ruby Tcl} {
get_unimplemented $lang
}</
=={{header|VBScript}}==
The program creates a dictionary with all tasks then adds the draft tasks to it then checks the language page and removes the tasks listed as implemented. At the end it prints a tab separed list of names and urls, ready to be cut and pasted in any spreadsheet. Changing the constant lang allows to check for other languages. Don't forget to run it with CScript!!
<syntaxhighlight lang="vb">
Set http= CreateObject("WinHttp.WinHttpRequest.5.1")
Set oDic = WScript.CreateObject("scripting.dictionary")
start="https://rosettacode.org"
Const lang="VBScript"
Dim oHF
gettaskslist "about:/wiki/Category:Programming_Tasks" ,True
print odic.Count
gettaskslist "about:/wiki/Category:Draft_Programming_Tasks",True
print "total tasks " & odic.Count
gettaskslist "about:/wiki/Category:"&lang,False
print "total tasks not in " & lang & " " &odic.Count & vbcrlf
For Each d In odic.keys
print d &vbTab & Replace(odic(d),"about:", start)
next
WScript.Quit(1)
Sub print(s):
On Error Resume Next
WScript.stdout.WriteLine (s)
If err= &h80070006& Then WScript.echo " Please run this script with CScript": WScript.quit
End Sub
Function getpage(name)
Set oHF=Nothing
Set oHF = CreateObject("HTMLFILE")
http.open "GET",name,False ''synchronous!
http.send
oHF.write "<html><body></body></html>"
oHF.body.innerHTML = http.responsetext
Set getpage=Nothing
End Function
Sub gettaskslist(b,build)
nextpage=b
While nextpage <>""
nextpage=Replace(nextpage,"about:", start)
WScript.Echo nextpage
getpage(nextpage)
Set xtoc = oHF.getElementbyId("mw-pages")
nextpage=""
For Each ch In xtoc.children
If ch.innertext= "next page" Then
nextpage=ch.attributes("href").value
': WScript.Echo nextpage
ElseIf ch.attributes("class").value="mw-content-ltr" Then
Set ytoc=ch.children(0)
'WScript.Echo ytoc.attributes("class").value '"mw-category mw-category-columns"
Exit For
End If
Next
For Each ch1 In ytoc.children 'mw-category-group
'WScript.Echo ">" &ch1.children(0).innertext &"<"
For Each ch2 In ch1.children(1).children '"mw_category_group".ul
Set ch=ch2.children(0)
If build Then
odic.Add ch.innertext , ch.attributes("href").value
else
if odic.exists(ch.innertext) then odic.Remove ch.innertext
End if
'WScript.Echo ch.innertext , ch.attributes("href").value
Next
Next
Wend
End Sub
</syntaxhighlight>
{{out}}
<small>
<pre>
15 puzzle solver https://rosettacode.org/wiki/15_puzzle_solver
2048 https://rosettacode.org/wiki/2048
21 game https://rosettacode.org/wiki/21_game
24 game https://rosettacode.org/wiki/24_game
24 game/Solve https://rosettacode.org/wiki/24_game/Solve
4-rings or 4-squares puzzle https://rosettacode.org/wiki/4-rings_or_4-squares_puzzle
9 billion names of God the integer https://rosettacode.org/wiki/9_billion_names_of_God_the_integer
Abbreviations, easy https://rosettacode.org/wiki/Abbreviations,_easy
.....
</pre>
</small>
=={{header|Wren}}==
Line 2,774 ⟶ 3,735:
{{libheader|Wren-pattern}}
An embedded program so we can use the libcurl library.
<syntaxhighlight lang="wren">/* Rosetta_Code_Find_unimplemented_tasks.wren */
import "./pattern" for Pattern
Line 2,815 ⟶ 3,776:
var findTasks = Fn.new { |category|
var url = "https://www.rosettacode.org/
var cmcontinue = ""
var tasks = []
Line 2,843 ⟶ 3,804:
for (task in tasks2) {
if (!langTasks.contains(task)) System.print(" " + task)
}</
<br>
which we embed in the following C program, build and run.
<
#include <stdio.h>
Line 3,020 ⟶ 3,981:
WrenVM* vm = wrenNewVM(&config);
const char* module = "main";
const char* fileName = "
char *script = readFile(fileName);
WrenInterpretResult result = wrenInterpret(vm, module, script);
Line 3,036 ⟶ 3,997:
free(script);
return 0;
}</
{{out}}
<pre>
Unimplemented 'full' tasks in Wren:
Unimplemented 'draft' tasks in Wren:
Continued fraction convergents
</pre>
=={{header|zkl}}==
Uses shared libraries YAJL and cURL.
<
fcn getTasks(language){
Line 3,096 ⟶ 4,029:
}
allTasks:=getTasks.future("Programming_Tasks"); // thread</
<
tasks:=getTasks(language);
langTasks:=Dictionary(); tasks.pump(Void,langTasks.add.fp1(Void));
Line 3,103 ⟶ 4,036:
println("Found %d unimplemented tasks for %s:"
.fmt(unimplementedTasks.len(1),language));
unimplementedTasks.pump(Console.println);</
{{out}}
<pre>
|