« first day (1558 days earlier)      last day (1107 days later) » 

4:51 AM
can anyone explain to me what exactly the symbol mean in APL ? ⊂
From RIDE, it is enclose.. it close some box in a vector....
(⊂↓⍕(2 3⍴⍳10))⎕NPUT '/tmp/x1.x' is the code to write a matrix to a file, but I can not get my head around why I need to the Enclose symbol ⊂ here
 
5:25 AM
@Jonah this would probably benifit from direct output rather than outputting an array
 
6:06 AM
> the left-argument X is comprised of 1, 2 or 3 items which identify (content) (encoding) (newline) respectively.
Hence the vector is enclosed to indicate that it is the first item, the content to be written to the file.
 
6:29 AM
does anyone know it is possible to use shell command inside RIDE? ls /tmp => list file in tmp dir?
or run shell command inside RIDE?
it would be very powerful REPL.... combinate the power of APL and shell command in one editor
 
7:04 AM
Aplcart is helpful for this: aplcart.info/?q=Shell#
 
7:54 AM
@rak1507 You shouldn't use the TCPSocket object anyway. It is only retained for backwards compatibility. Use HttpCommand or Conga instead.
@elliptic00 While Razetime is right, do also know that you can list files directly in APL: aplcart.info?q=list%20files
 
 
4 hours later…
11:27 AM
@Adám Ok, might be worth adding some conga stuff to APLcart as tcpsocket was what came up when I searched for 'socket'. As for using conga, I found this docs.dyalog.com/16.0/Conga%20User%20Guide.pdf but in the client section it has no information about sending data.
 
@rak1507 You may want to look at the latest.
 
it's elsewhere in the guide, but it might be nice to at some point have some basic information that wasn't 98 pages
oh great, )load conga changes ⎕IO to 1
because why wouldn't loading a library interfere with global settings
 
it also, uh, clears the workspace, so
 
@rak1507 Ancient terminology. )load doesn't load a library in the modern sense. Use )copy for that.
 
sorry I was foolish enough to do what the user guide told me to do
 
11:33 AM
3.2 is pretty clear.
 
If you are experimenting with functionality before adding Conga to an application, then load the conga workspace:
)load conga
I would say 'experimenting with functionality' is what I'm doing right now
 
Even having ⎕IO←0 would be "an application". Lightweight ;-)
 
there is no other language where I go to the docs and it tells me to load a library in a way that completely screws with global state
 
Though I think I agree. We shouldn't really ever tell people to )load anything.
 
Alright, good
 
11:36 AM
In fact, )load could sensibly be considered deprecated other than for debugging deployed applications.
 
so deprecated it's number one in the latest version of a user guide :D
 
Nobody has gone out and declared that )load is deprecated. I'm just saying that it could be done.
But it is a good point. I'll try to take it up.
 
is it a coincidence that DRC could easily stand for democratic republic of the conga? lol
 
No, of course not.
 
oh, cool, making a socket makes it global
 
11:54 AM
tradfns automatically print things? so I have to use _← in dfns for no early return, but I have to do it in tradfns too to avoid spewing out information
 
@rak1507 In tradfns, you can also use {} to suppress output.
 
so in 'real' applications do they really do
{} Thing
{} another thing
{} more stuff
 
I find it rather rare that I need the side effect of something that gives a non-shy result
 
DRC.Clt, Wait, Send, and Close all do side effects and return values, the only value I might ever want is probably Wait
 
Ah, good point. They should probably be shy.
 
12:00 PM
@rak1507 so every invocation of those needs either _← or {} prepended? did anyone actually ever try using it?
 
@dzaima my thoughts exactly
 
I've written to my colleagues to ask why they are not.
 
12:50 PM
 histi←{
⍝ integer only histogram
⍝ ⍵ samples vector
⍝ assume maxint = 1000
     hist←1000⍴0
     N←⊃⍴⍵ ⍝ number of samples
     S←⍵ ⍝ samples

     ⍝ iterate N times
     _←({i←⍵
         s←S[i]
         hist[s]←hist[s]+1
         i+1
     }⍣N)1

     ⍝ remove zeros
     flt←hist>0
     h←flt/hist
     idx←flt/⍳⍴hist
     h,[0.5]idx
 }
histi 1 1 1 1 3 3 3
4 3
1 3
Hi guys, this does what I want, but...
just feels like I'm forcing it into Python
or worse ... C
 
there's a 10 7 character way to do your histi function :)
 
I'm sure :)
Something on APL cart?
 
there's one specific operator you need here. One APLcart entry for the search "histogram" uses it
(no clue why i'm trying to make this a puzzle)
 
I've looked at aplcart but 2 top most do "plotting", maybe I need to unpack them for what they actually do.
 
it's the second top one you want
 
12:59 PM
ok thanks I'll study it!
 
@dzaima there's a 6 character way
 
(but the real correct APLcart entry doesn't have "histogram" as a keyword)
@k1m190r if you just took its output, counted the number of s in each row, and output pairs of line number and count, you'd have your histi function
(but of course doing it the direct way is better)
@rak1507 oh right, my 10 and 7 were for dzaima/APL. Dyalog doesn't need the
 
ah
well, that's interesting, if you need a ↑ at the front my dyalog solution doesn't work as it'd then be (f g h)
 
oh yeah, mine's not actually a function
 
huh (oh, function, not train)
 
1:06 PM
@dzaima the key is the key? :) ⌸
 
@k1m190r yep!
 
thanks!
another one I'm forcing into C-like is
any pointers for the APLification are much appreciated
 
({i←⍵ ⋄ … ⋄ i+1}⍣n) x{i←⍵ ⋄ …}¨x+⍳n is one thing (give or take ⎕IO)
but i don't have a clue what that thing is so someone else is gonna have to decide if there's some more APLy way of doing it all
even better, s←… ⋄ ({i←⍵ ⋄ … ⋄ s[i]←val ⋄ i+1}⍣n) x ⋄ ss←{val}¨⍳⍵ (give or take starting elements)
oh, you're reading the previous state
so you need reduce+each, which isn't pretty
 
1:24 PM
yes the main bit that drove me to ⍣ is exactly that i need previous state
 
scanl might work
 
oki thanks a bunch!
 
so you'd have state←(⊃proposals) {curr←⍺ ⋄ i←⍵ ⋄ … ⋄ newState}scanl ⍳n (or maybe state←{…} scanl (1↑proposals),⍳n idk)
 
ok will try
also there is idiomatic way to drop/ignore return value, instead of "_←"?
 
@k1m190r nope
_← is as good as it gets
 
1:35 PM
oki
 
1:45 PM
@rak1507 Response from the main developer of Conga:
> When you call the function in the dll you are obliged to check the error code since the dll cannot signal error.

You could have an argument on Close, since it is difficult to determine a correct action to a non zero errorcode.

I am struggling to understand why you would have a shy result from Wait. Wait is the function to get the next “event”, making that shy it would signify that you are throwing events away without looking at it.
 
2:02 PM
Checking for errors: fair enough I guess...
Argument on close: not sure what that means, I guess error checking things again
Wait: if I know something I connect to is going to output something I don't care about, for example a header of some sort
Tbh the mistake to me is not that the results aren't shy, it's that tradfns automatically print all non-shy results, and dfns stop at the first returned value
 
and in a REPL you'd probably want the functions to print their results anyway
 
@rak1507 Yes, I am with you about both of those. Thursday, I argued that the new #! scripts should not implicitly print. I hope we can get that through, just like I got through that #! scripts shouldn't be affected by global state.
@dzaima Yes, the whole concept of shyness was a mistake.
 
if #! scripts didn't implicitly print that would be great
 
@Adám wait, there was ia a non-zero probability that #!… \n 1 would print 1?‽!
 
@dzaima If I hadn't stepped in, it would have been so, yes.
 
2:05 PM
oh god oh geez
 
has anyone at dyalog ever used a single other programming language before?
maybe similarly to how using APL can change the way you think about other languages, people at Dyalog should learn other languages to change the way they think about APL
 
I agree that we at Dyalog have a problem in that the APLers tend to have little experience with other languages and that the non-APLers have little experience with APL.
Hopefully, it is getting better as a new generation slowly takes over.
 
the way conga works with supplying a socket name as a string is completely insane as well
 
You'd want to pass an object?
 
wait (which should be called read), send, etc being methods of an object would make more sense to me
 
2:10 PM
IIRC, there are two ways to use Conga, one of them being an OO approach.
I think Wait is a standard name for action objects to "take their action".
 
receive/recv/read seem to be fairly standard for sockets across langs
 
2:47 PM
plotted my first binomial mcmc sampled histogram. very happy :). thanks for all the guidance guys.
 
3:02 PM
nice
 

« first day (1558 days earlier)      last day (1107 days later) »