aplcart | A novel approach to finding your way in APL | Learning library
kandi X-RAY | aplcart Summary
kandi X-RAY | aplcart Summary
APLcart is a searchable collection of over two thousand short APL phrases intended for both beginners and professionals, with content provided by the community. Knowledge of basic APL syntax is a prerequisite. Note that Internet Explorer is not supported. APLcart can also be used for exercising your APL skills.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of aplcart
aplcart Key Features
aplcart Examples and Code Snippets
Community Discussions
Trending Discussions on aplcart
QUESTION
What's the idiomatic way to implement longest common prefix in APL? In Aaron Hsu's thesis, footer page number 76, it is said:
the idiom
+.=
computes the length of the common prefix shared by two paths
This works in the case we are interested in the paper, since we are guaranteed that two paths, once they stop matching, will not have any more matches. However, this assumption does not hold in general. By way of examples:
...ANSWER
Answered 2020-Mar-07 at 09:09Q1. +/∧\=⌿↑a b
↑
is mix. it arranges the two strings (left-aligned) in a 2-row matrix, padding the shorter one with spaces
=⌿
compares the two chars in each column. it produces a boolean vector (of 0s and 1s)
∧\
is "and-scan". it preserves the leading sequence of 1s and turns all other 1s to 0s
+/
sum
note that if the longer string can have trailing spaces, this might give wrong results
Q2. you could use take (n↑
) and drop (n↓
) to cut out the relevant slice of the boolean vector from Q1
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install aplcart
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page