« first day (1344 days earlier)      last day (1305 days later) » 

5:51 AM
Hello!
I made a one-time pad function:
⋄{⎕←⎕A[x←?⍨⍴⍵]⋄⎕A[26|(⎕A⍳⍵)+x]}'HELLO'
 
@Razetime Illegal code
 
6:03 AM
@Razetime ⋄ {⎕A[⍉x,⍪26|(⎕A⍳⍵)+x←?⍨⍴⍵]}'HELLO'
 
@Adám
DECBA
LJONP
 
@Razetime ⋄ {⎕A[↑x(26|(⎕A⍳⍵)+x←?⍨⍴⍵)]}'HELLO' (alternative using nested arrays)
 
@Adám
EABCD
MFNOS
 
6:15 AM
@Razetime Unicode version: ⋄enc←{p←?(2*16)⍨¨⍵⋄(⎕ucs p)(⎕ucs p+⎕ucs⍵)}, and then can ⋄⊢(p c)←enc 'helló'. Dec is pretty simple: ⋄dec←{⎕ucs(⎕ucs⍵)-⎕ucs⍺}. then ⋄p dec c
 
@Moonchild
Illegal code
VALUE ERROR
Illegal code
VALUE ERROR
 
d'oh. ⎕ucs, I guess?
 
@Moonchild No, ⎕UCS is permitted.
@DyalogAPL I don't quite see what the issue is. It works for me using DSE.
 
@Adám it seems to be a problem with word splitting. Dyalog interprets ⎕ucs⍵ as two separate symbols, but DSE interprets it as only one, which isn't on the valid tokens list
 
⋄{⎕ucs⍵}65
 
6:20 AM
@Adám Illegal code
 
⋄{⎕ucs ⍵}65
 
@Adám A
 
@Adám nice, it removes the ⎕←
@Moonchild yes, but the question only asks for encryption of letters
so ucs would make it longer
 
@Moonchild Yes, that appears to be it, but strangely, it does work on the new Try APL based on DSE.
 
@Adám odd. Maybe another unix oddity? I can replicate it locally, but don't have a windows box handy
@Razetime Fair enough. What question is that?
 
6:23 AM
15
Q: Implement a One-Time Pad

PhiNotPiBackground A one-time pad is a form of encryption that has been proven impossible to crack if used properly. Encryption is performed by taking a plaintext (comprised of only letters A-Z) and generating a random string on the same length (also only letters). This string acts as the key. Each cha...

 
@Moonchild No, it runs on Linux, and the language should be the same anyway.
I'll have to step through it, but first kids need to be preped for school…
 
 
1 hour later…
7:25 AM
Hey I'm back
I got the encryption and decryption functions down.
But the full porgram I tried is giving me an error.
 
@Razetime you can't use : outside of dfns
 
7:42 AM
oh
 
CMP: In the new array notation, should x ← 10 ⋄ c ← ( a: x ← 20 ) ⋄ x give 20 (like in JavaScript) or should it give 10, that is, the expression for a member of an object is done in a temporary scope.
 
It works! Try it online!
Thanks a lot @dzaima
 
@Razetime No need to brace inner expressions: Try it online!
 
oh
thats amazing
it's at 53 bytes now
 
maybe you can combine some duplicated code?
 
7:55 AM
hmm
I tried assigning ⎕A
but that adds a byte
⎕A[⍉x,⍪26|(⎕A⍳w)+x←26?⍨⍴w←⍞] is it possible to shorten this with ⊢?
(⎕A[⍉x,⍪26|(⎕A⍳⊢)+x←26?⍨⍴⊢])⍞
 
@Razetime Remember that is a 100% normal function, equivalent to {⍵}
 
oh
 
You can certainly move ⎕A[] outside.
 
ah instead of assigning it
-4
 
I get INDEX ERROR sometimes.
 
8:05 AM
probably missing ⎕IO←0
this should be fine
This was fun, I'll post it now
 
@Razetime Wait, I think I have an idea.
 
@Adám sure go on
 
@Razetime Move out 26| too.
 
Try it online! yep it works
never thought of doing it after tabling.
 
RGS
@Razetime the "encrypt" returns key and enrypted message, is that it?
 
8:14 AM
yes
and decrypt takes message and key and returns the original
 
RGS
cool
 
 
2 hours later…
RGS
10:23 AM
@xpqz is it you that usually uses RIDE?
 
@RGS that would be me, yes
Finally managed to complete AoC 2018 (now 2015-2018 completed): nbviewer.jupyter.org/github/xpqz/AoCDyalog/blob/master/…
Some hard nuts to crack there.
 
RGS
@xpqz let me ask you a question: do you usually save functions in files?
I was taking RIDE for a spin and editing functions and fixing them seems similar to the windows terp. but then saving a dfn/tradfn to a file... I don't think there's a menu item for that :P
 
bin←{(32⍴2)⊤⍵} you would be probably be better off using ⍣¯1 here
 
@RGS I've used ]Link to 'save' stuff to files. But the experience is somewhat lacking if used to the model presented by other editors.
 
RGS
@xpqz alright, I see
@xpqz +← 1
 
10:33 AM
Most of the time I write APL in a jupyter notebook. If I need to use the debugger, I fire up RIDE and cut & paste what I need into it.
 
RGS
I see, thanks
:D
 
I'd love to see a VS Code plugin for Dyalog that simply allowed me to save my work in a single file and allow me to run the debugger through its interface,
 
RGS
@xpqz maybe the plugin mentioned here might evolve into that?
 
I guess that may eventually be possible as Dyalog's moving closer to allowing files to be run as scripts.
 
RGS
btw @JamesHeslip do you have any idea about whether that plugin supports 18.0 out of the box? Assuming I have 18.0 on my machine?
 
10:39 AM
I tried it ages ago, but couldn't figure how to run my code on a Mac due to its strange installation.
@JamesHeslip did you guys build it?
 
 
1 hour later…
11:45 AM
@RGS I've not tried it with 18.0. I last used it when it was being developed (a long time ago...) It was worked on primarily by Gil Athoraya (github.com/OptimaSystems/vscode-apl-language-client) but I don't think it's being actively worked on.
 
RGS
hm ok, just wondering :)
 
12:42 PM
@xpqz That should be simple from 19.0 when we have proper script support.
 
Yeah. I can see that's the direction of travel which makes me happy.
 
 
2 hours later…
2:54 PM
<jibanes> o
 
3:34 PM
jibanes: Uh, hi?
 
 
1 hour later…
4:37 PM
In the JavaScript BQN old interpreter (tenuous link to this channel), what is v in this line? github.com/mlochbaum/BQN/blob/…
In the JS console, get1([[10,20,30], 1]) returns 20, which matches the i[0][i[1]]; part of the linked line. Where does the anonymous function involving v come into it
 
@TessellatingHeckler (v=>(assert(v!==null),v))(…) is an immediately called lambda; All it does is check that the isn't null, and in that case, returns it
 
@dzaima ohhh, so simple!
thanks
 
5:22 PM
PS C:\> run (&$arr 0,0,25 3) (&$arr @(1) 1) @(@(&$arr 0,1,0,0  4))
1
that's the first bit of BQN compiled bytecode which has gone through it and produced the right answer!
 
\o/
 
RGS
5:39 PM
@Razetime are you not allowed to inline assignments in Dyalog Extended? I tried doing it with one of your answers to the ellipse circumference
 
@RGS Extended messes with it - 4-h← is expanded to 4 Minus h← which then breaks for semi-obvious reasons
 
 
2 hours later…
RGS
7:30 PM
Ah I understand, sort of :) thanks!
 

« first day (1344 days earlier)      last day (1305 days later) »