« first day (2043 days earlier)      last day (908 days later) » 

01:47
0
Q: Alexa skill changing color or image dinamically

Rafael Santos RodriguesI'm if it's a dumby question I'm new developing Alexa skill and using APL. I'm trying to create a game in Python, when the skill starts it's generate a list of colors. Somebody know if it's possible to change the background color from Alexa dynamically showing every color that generated? Or even ...

 
2 hours later…
04:08
Please approve edit ↑
 
5 hours later…
09:30
If you could revisit the design choices around / and , would you make be reduce(first) and / be compress, or the other way around?
09:42
Slashes are tricky, ideally you want both last axis/first axis versions (imo) as they're convenient and more mnemonic than ⍤¯1.

There are two ideal forms of reduce, insert & fold which apply f between the elements (depth-1 sub-arrays) and major cells (rank-1 sub-arrays).

One could also want to supply an initial element to fold as a left argument (instead of n-wise reduction), and avoid identity elements.

Providing foldl is also an option.

All in all, you're looking at 8/9 different operators...
⋄ _←{⍺,'-',⍵} ⋄ ⍕'reduce' 'insert' 'scanl' 'scanr'∘._'first' 'last'∘._'left' 'right'
@Adám
 reduce-first-left  reduce-first-right
 reduce-last-left   reduce-last-right

 insert-first-left  insert-first-right
 insert-last-left   insert-last-right

 scanl-first-left   scanl-first-right
 scanl-last-left    scanl-last-right

 scanr-first-left   scanr-first-right
 scanr-last-left    scanr-last-right
@xpqz How free are we? Pre-Unicode?
/ reduce-last
⌿ reduce-first
\ scan-last
⍀ scan-first
⫽ replicate-last
ᚌ replicate-first
⑊ expand-last
⑊̵ expand-first
 
1 hour later…
11:13
I think BQN does the best it can here. I'm only unsure about the lack of n-wise reduce
I think Windows is fine for the general case, but pair-wise stuff can be greatly optimised… Hence K's ':
Yep
Ideally, it should also be able to take a start value.
Those double-slashy symbols, what are they?
I sometimes find myself wanting to do f/x and apply f to x if x is a singleton, I wonder if some null start value could allow that
11:29
@xpqz ⎕←⎕UCS¨'⫽' 'ᚌ' '⑊' '⑊̵'
@Adám
┌─────┬────┬────┬────────┐
│11005│5772│9290│9290 821│
└─────┴────┴────┴────────┘
 
1 hour later…
12:41
@awagga what if monadic f gives different means than dyadic f?
That's the behaviour I want. A "null" value here refers to a literal which yet resembles cap in J, (n f g) should give f⍤g and n f/x would return f x.
Essentially a value which takes the space of a literal but doesn't propagate during application
it would break the clarity, requires knowing the value of x to know which definition been used.
This is a quality of f/ not the null
At least, if you consider f/1 2 different to f/1 currently. It's not, but f/1 is viewed as a no-op
it is better to get 1.2 from ⌈/1.2 rather than get 1.2 rounded up to 2, I think
I agree, but sometimes you might require the latter behaviour, hence the optional null
12:51
I mean, I know you want something like (- 1) in lisp sometimes
well I think it is better if the unit value of a function can be changed
but I think -{⍺⍺/⍵,(⍺⍺/⍬)}2 3 4 would serve your purpose.
13:30
@awagga I don't think that should be /. It is _Apply←{×⎕NC'⍺':⊃⍺⍺/⍵ ⋄ ⍺⍺ ⍵} or maybe that should be ⍺⍺⊃⍵ at the end there.
I don't either. I've only found it useful for modelling forks
 
1 hour later…
14:57
A nice little challenge I found on the internet. Probably already known to you, but found it fun to puzzle it out.

The challenge is to write a series of expressions using the year (in this case 2021) to return each number from 0-100, meaning an expression per number. Each expression must contain the digits of the year in order and include no other digits. The digits from the year can be grouped together or separated using spaces, decimals or any functions or operators you wish to use, for example: 2021, 20+21, 2.021, 2 0 2 1.
To start it:
⋄⌊/ 2 0 2 1
@Richard 0
⋄⊢/2 0 2 1
@awagga 1
⋄⊃2 0 2 1
@awagga 2
15:00
⋄⌈/2 0 2 + 1
@Richard 3
⋄ 2 + 0 + 2 ⊣ 1
@awagga 4
⋄+/2 0 2 1
@awagga 5
15:02
⋄2×02+1
@Richard 6
⋄⌈20÷2+1
@Richard 7
I'll write mine in a gist to avoid flooding the orchard
well, it makes it nice interactive. But I will also put it in one post.
15:11
?2021 :-)
well.. 2022 seems a little bit difficult, or not?
maybe not cause monadic ×2 gives also 1
Unfortunately it is a bit too easy
 
3 hours later…
18:10
@Richard It is always possible for any year and any target integer, since you can do (≢⍨±≡+≡+≡+≡)m c d y
See also Dyalog's 2017 Code Golf Challenge.
@user1796887 Hi Kyn. If you want to participate here, please email [email protected]
 
2 hours later…
20:27
@Adám yes true… I’ll stick to our Quest.
@awagga yes, probably is indeed

« first day (2043 days earlier)      last day (908 days later) »