How to resolve the algorithm Rosetta Code/Find unimplemented tasks step by step in the J programming language

Published on 12 May 2024 09:40 PM
#J

How to resolve the algorithm Rosetta Code/Find unimplemented tasks step by step in the J programming language

Table of Contents

Problem Statement

Given the name of a language on Rosetta Code, find all tasks which are not implemented in that language.

Note: Implementations should allow for fetching more data than can be returned in one request to Rosetta Code. 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

Let's start with the solution:

Step by Step solution about How to resolve the algorithm Rosetta Code/Find unimplemented tasks step by step in the J programming language

Source code in the j programming language

require 'strings web/gethttp'

findUnimpTasks=: ('Programming_Tasks' -.&getCategoryMembers ,&'/Omit') ([ #~ -.@e.) getCategoryMembers

getTagContents=: dyad define
  'starttag endtag'=. x
  ('\' -.~ endtag&taketo)&.>@(starttag&E. <@((#starttag)&}.);.1 ]) y
)

NB. RosettaCode Utilities
parseTitles=: ('"title":"';'"')&getTagContents
parseCMcontinue=:('"cmcontinue":"';'"')&getTagContents
getCMcontquery=: ('&cmcontinue=' , urlencode)^:(0 < #)@>@parseCMcontinue

getCategoryMembers=: monad define
  buildqry=. 'action=query&list=categorymembers&cmtitle=Category:' , ,&'&cmlimit=500&format=json'
  url=.'http://www.rosettacode.org/w/api.php'
  uri=. url ,'?', buildqry urlencode y
  catmbrs=. qrycont=. ''
  whilst. #qrycont=. ,getCMcontquery jsondat do.
    jsondat=. '-sL' gethttp uri , qrycont
    catmbrs=. catmbrs, parseTitles jsondat
  end.
  catmbrs
)


   4{. findUnimpTasks 'J'     NB. get first 4 unimplemented tasks for J
┌────────────────┬────────────────────────┬──────────────────────────────────┬──────────────┐
15 puzzle solver│Active Directory/Connect│Active Directory/Search for a user│Atomic updates│
└────────────────┴────────────────────────┴──────────────────────────────────┴──────────────┘


  

You may also check:How to resolve the algorithm Sudoku step by step in the Befunge programming language
You may also check:How to resolve the algorithm Singly-linked list/Element insertion step by step in the J programming language
You may also check:How to resolve the algorithm Execute a system command step by step in the Pike programming language
You may also check:How to resolve the algorithm FizzBuzz step by step in the Robotic programming language
You may also check:How to resolve the algorithm Element-wise operations step by step in the BBC BASIC programming language