Idiom recognition appears to really bear some resemblance to database query optimization. There, too, specific operator constellations — speaking of the relational algebra here — are mapped to specific physical execution plans. A good query optimizer comes with a whole library of such constellations that tend to occur again and again in typical query workloads.
I want to release 2nd android app in Play Market.
For release need apk file
Firstly, I go to Genereate Signed Bundle or APK, there I choice android.jks file from my 1st app and key alias.
I get message :
App bundle(s) generated successfully:
Module 'app': locate or analyze the app bundle.
Whe...
does anyone have a better 'fizzbuzz' than this, because it's an introductory programming thing people will occasionally ask me? {⊃,/⍵'Fizz' 'Buzz'[⍸(⍱/,⊢)0=3 5|⍵]}¨⍳15
fizzbuzz is basically: for the numbers 1 to something (usually 100), if the number is divisible by 3 print 'fizz', if it's divisible by 5 print 'buzz', if divisible by both print 'fizzbuzz' otherwise print the orginal number
FizzBuzz←{
primes←3 5
text←'Fizz' 'Buzz' 'FizzBuzz'
case←2⊥⊖0=primes∘.|⍵ ⍝ 0=nothing, 1=Fizz, 2=Buzz, 3=FizzBuzz
replace←⍸0≠case ⍝ Indices that need to be replaced
(text[case[replace]]@replace)⍵
}
also, i did not realize you could use replicate like that, but that makes sense! if it's a scalar on the left, it just replicates the array on the right as a whole, element-by-element?
@TorstenGrust @dogstar Why, there is a scalar on the right and a vector on the left. APL tends to pair that up by extending the scalar to the length of the vector.
also here's arcfide's fizzbuzz. though it doesn't use the traditional formatting, leaving spaces in places and uses alphabet chars, it generalizes to any amount of parts
@Adám would you consider this an idiomatic solution or a golf solution? something like {∨/d←0=3 5|⍵:⊃,/d/'Fizz' 'Buzz' ⋄ ⍵}¨ feels 'more correct' to me, but that ⊃,/ definitely feels gross
@dzaima oh that's amazing, i need to pick it apart
also, speaking of @arcfide, i noticed in a few of his talks he mentions the idea of 'machine sympathetic language' (notably in the 'does apl need a type system' talk). does anyone know of any talks or papers where that idea is elaborated on?
@TorstenGrust No, it is a dialectical difference. APL2 requires parentheses for multiple assignments, so leaving them out makes a strand instead (bad, since it prevents implementing modified assignment). Dyalog allows omitting them (also bad, since it creates a multiple vs modified assignment ambiguity).
I'd add a(b←)1 2 for modified assignment if that was allowed. It isn't, unfortunately. So to be safe, you can write a b∘⊢←1 2 or a(b⊢)←1 2 for modified assignment.
@dzaima Yes, me too. It is syntactically unambiguous, fairly clean to look at, and fits nicely with the other assignment disambiguations: a(b←1 2) vs (a b)←1 2 vs a(b←)1 2 vs a(b←1)2
@J.Sallé ∩ is intersection, it returns the elements of its left arg that appear in its right arg. So instead of finding the unique, we just take from the list where they only occur once each.