Skip to content

Instantly share code, notes, and snippets.

@justin2004
Last active July 22, 2025 20:29
Show Gist options
  • Select an option

  • Save justin2004/b7b934f8d6f757c4c0748396cd002163 to your computer and use it in GitHub Desktop.

Select an option

Save justin2004/b7b934f8d6f757c4c0748396cd002163 to your computer and use it in GitHub Desktop.
bit mask over interior chars (of words)
# APL
v←'RAFT DATA PLATFORM'
f←1∘⌽⍤(0 0∘,)⍤(' '∘(3∧/≠))
f v
0 1 1 0 0 0 1 1 0 0 0 1 1 1 1 1 1 0
⍉v(,⍤0)f v
R A F T D A T A P L A T F O R M
0 1 1 0 0 0 1 1 0 0 0 1 1 1 1 1 1 0
# python
>>> s = "RAFT DATA PLATFORM"
>>> [int(0 < i < len(w)-1) for w in s.split() for i in range(len(w))]
[0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment