« first day (1849 days earlier)      last day (795 days later) » 

1:37 AM
@LdBeth Hey, thanks! I wasn't able to test these, but thanks! I'll check that as soon as I be able to think after the workday hahaha
 
 
2 hours later…
3:34 AM
hey, is there is simpler way to do the following:
      ⎕←m←2 3 3 ⍴ ⍳ 18
 1  2  3
 4  5  6
 7  8  9

10 11 12
13 14 15
16 17 18

      ⍝ i basically want this from m
      (1⌷m) (2⌷m)
┌─────┬────────┐
│1 2 3│10 11 12│
│4 5 6│13 14 15│
│7 8 9│16 17 18│
└─────┴────────┘
      ⍝ and i arrived at this train
      (⍳∘≢(∘.⌷)⊂) m
┌─────┬────────┐
│1 2 3│10 11 12│
│4 5 6│13 14 15│
│7 8 9│16 17 18│
└─────┴────────┘
 
@justin2004
 1  2  3
 4  5  6
 7  8  9

10 11 12
13 14 15
16 17 18
 
i think i want the major cells of m in a vector. is that the correct way to phrase it?
oh, i don't need the parens. this works as well:
(⍳∘≢∘.⌷⊂) m
 
 
2 hours later…
5:45 AM
@justin2004 That's correctly phrased, and is written ⊂⍤¯1⊢m — although if you know m is a rank-3 array, you can also write ⊂⍤2⊢m
@user17921685 Hi Eggro, if you want to participate here, please email access@apl.chat
 
6:24 AM
@hyper-neutrino Can you give chat.stackexchange.com/users/540556/user17921685 access?
 
@Adám Do you guys still need help archiving for aplcart.info/pub?
 
@AviFS Yes we do. We've just been busy with all sorts of stuff, including finding out which fields we need populated in the grand library.
 
6:47 AM
@Adám What do you mean by the last bit?
Also, does that mean the opportunity’s still there to work on that for you guys?
 
@AviFS We're building unified db of "everything" including the video library. For that purpose, we've been working on the exact spec of db fields.
@AviFS If you want part of the cataloguing work, respond to the "Dyalog Internship: Cataloguing materials" email.
 
@Adám I still have that email! I wanted to check in.
@Adám A theory of everything!
 
 
2 hours later…
8:43 AM
im starting to write apl notation in math class lol
 
Nice. That's what Iverson wanted to begin with.
 
yea man... feels wierd
 
9:03 AM
I mean i like the usage of high minus for negative numbers, no need for parenthesis in math now. 1+(-1) → 1+¯1
 
@PyGamer0 Yeah, that is a very good feature. Note that TI-Basic also uses that, and the even languages like JS have issues with low minus: 10--2 vs 10- -2
 
 
2 hours later…
10:47 AM
I just wrote the below and felt pleased with myself. Any guesses what it does?
{(0j1⊥⍵)+(+,-,-∘+,⊢)2J1 1J2}
 
(+,-,-∘+,⊢) → (+,(-,(-∘+,⊢)))
⋄ -+ 3J4
 
@PyGamer0 ¯3J4
 
⋄ (+,-,-∘+,⊢)2J1 1J2
 
@PyGamer0 2J¯1 1J¯2 ¯2J¯1 ¯1J¯2 ¯2J1 ¯1J2 2J1 1J2
 
11:27 AM
how do i represent quaternions in APL? like either I use phase of a point to calculate angle of it reletive to the camera or i use tangent. phase is more elegent but idk how to use it for 3d space without quaternions
wait i think i might be able to use 3 planes of complex numbers... but if you guys have anything better please tell
 
 
1 hour later…
12:45 PM
@Adám done
 
@Adám thanks @Adám. i was going to suggest that be added to APLcart but i see it now. somehow i missed it.
 
1:06 PM
@user16897784 Hi Perigord. If you want to participate here, please email access@apl.chat
@user17921685 You should now have access, but you may need to reload the page. Since you're new to Stack Exchange chat, I highly recommend familiarising yourself with apl.wiki/APL_Orchard#Features
@hyper-neutrino Thank you. Good morning.
 
1:57 PM
0
Q: Issue with declaring multiline functions in APL

Perigord#!/usr/bin/dyalog -script ⍝ /usr/bin/dyalog is a symlink to /opt/mdyalog/18.0/64/unicode/mapl factors←{⎕ML ⎕IO←1 ⋄ ⍵{ ⍵,(⍺÷×/⍵)~1}∊⍵{(0=(⍵*⍳⌊⍵⍟⍺)|⍺)/⍵}¨⍬{nxt←⊃⍵ ⋄ msk←0≠nxt|⍵ ⋄ ∧/1↓msk:⍺,⍵ ⋄ (⍺,nxt)∇ msk/⍵}⍵{ (0=⍵|⍺)/⍵}2,(1+2×⍳⌊0.5×⍵*÷2),⍵} factors 20 Copied from https://dfns.dyalog.com/c_fact...

 
 
2 hours later…
RGS
3:57 PM
Reminder: In a couple of minutes there will be a webinar by Rich Park about data visualisation. You can watch the webinar on dyalog.tv.
 
 
2 hours later…
5:46 PM
Just did a quick script to filter some data from a HTML table with info that is not available through an API
I wonder if APL would be suitable for such a task
(I can easily get the HTML into Dyalog, but working through it without DOM APIs sounds painful)
 
@AndréLeria If the HTML is valid XHTML you should be able to use ⎕XML on it. Alternatively, if you're on Windows, you should be able to copy the table from a browser, then type a variable name, and select Action>Paste Object from the menu, giving you a matrix you can use APL on.
 
I tried ⎕XML but unfortunately HTML5 is not valid XML at times
It contains unclosed <img> tags which are perfectly valid HTML5 but XML will complain about
 
Maybe you can either use some simple regex to make it valid, or find an HTML→XHTML converter somewhere?
 
Hmmm that could help
I still don't know how easy it'd be without querySelectorAll which I used quite a bit in the script
// sorry for ill formatted JS; this takes and formats records from brazilians in a given table
[].slice.apply(
    document.querySelectorAll('#primary-leaderboard tbody tr')
  ).filter(tr => tr.querySelector('[data-original-title=Brazil]'))
  .map(tr => [].slice.apply(tr.querySelectorAll('td:nth-child(1), .username, td:nth-child(3)')))
  .map(pairs => pairs.map(it => it.innerText.padStart(4, '#0')).join(': '))
  .join("\n")
querySelector and innerText are quite useful and I believe there wouldn't be an easy replacement for them in APL
Well, I could do some regex for innerText I guess
 
It is easy to filter ⎕XML's result first by id being primary-leaderboard and then find all sub elements of those that are tbodys and then find all trs in those. And innerText (assuming no tags there) is its own column.
 
5:58 PM
Well, there is only 1 tbody, it's only in the selector so I don't get trs from the thead
There are tags where I use innerText, some <small>s for formatting
I know ⎕XML brings attributes in a separate column in its result, so I can see how I'd be able to filter by ID or data-original-title
I guess the same could be said for the second use of querySelectorAll since picking indexes and/or comparing from the value of class shouldn't be hard
 
Exactly.
 
Well, I guess the only issue then is having the HTML become valid XML
 
Yup. Here is the beginning of the output from ⎕XML for a random table off APL Wiki:
┌─┬─────┬─────────────────────────┬───────────────────────────────────────────────────────────────────────────────────────────┬─┐
│0│table│                         │┌─────┬─────────┐                                                                          │3│
│ │     │                         ││class│wikitable│                                                                          │ │
│ │     │                         │└─────┴─────────┘                                                                          │ │
(you may need to zoom out a bit to avoid lines wrapping awkwardly)
 
I'll still need to tinker a bit to understand the first column, but I believe it's some sort of index?
 
It is the element nesting depth.
 
6:06 PM
Ok, simple enough
 
So any depth 3 element (td) is a child of the nearest depth 2 element (tr) above it.
 
I'll toy with it a little
Thanks
 
6:29 PM
@AndréLeria nope (trust me, I've been through the pain :P)
unless you use regex which is fine but not a 'proper' solution
 
I believe it
 
Since Dyalog APL has namespaces, it should be possible to represent a DOM node (or the entire DOM). The question is just how to serialise it in a way that can be communicated over to APL.
 
@AndréLeria This sounds like a very good use for Abacus. You can represent an HTML structure into a virtual APL DOM structure, and directly get the contents of that table as an APL matrix.

Check out https://github.com/the-carlisle-group/Abacus/wiki/Tables
 
That... sounds interesting
 
  DOM ← H.HTML2DOM HTML
  (H.BodyCells DOM).Content
If HTML is a string of HTML, the Content of the body cells will be an APL matrix of the table
 
6:34 PM
@JoshD ooh, cool
 
There are also functions for getting and setting the Inner and Outer HTML
 
maybe I was wrong!
 
That does sound cool. Even so, I still want myHTMLREnderer.document.body.…
 
It has covers that deals with ⎕XML for you, and represents the HTML DOM as a hierarchy of namespaces
 
is that performant?
 
6:39 PM
For most web pages, I don't think you will run into any performance issues this way. It's probably not the most performant, but it's still fast enough. I haven't played around it with as much, but @PaulMansour may have a better answer.
@Adám so would you want every DOM element to be exposed as HTML Renderer properties?
 
Well, nested namespaces, like we do with .NET — where I think we build the symbol table dynamically, for performance.
 
This is actually one of the reasons I wanna toy with the idea of implementing a WASM APL variant. Giving it access to the browser's DOM API should be a tad easier than recreating half the DOM API
 
Trying to keep that in Sync with the document is a tricky problem. Also the nice thing with Abacus is it doesn't lock you into to certain properties for an element. You can just assign those values and if it's valid it will render. No need to recreate all those properties by hand
 
@AndréLeria Maybe easier to have ngn/apl get access to the DOM?
 
@Adám Stop with the ideas that make sense and take away all the fun
And well, I believe ngn/apl will eventually be outdated?
Sure, I could fork it
But learning WASM is one of my long term goals, and so is implementing a programming language interpreter
 
6:52 PM
I always wonder what the performance benefits would be if we have APL compile straight to WASM, and short-circuit JavaScript. Although a LOT of money has been spent on optimizing JavaScript
 
I know calling the DOM API from WASM is currently slower than just calling it from JS. I don't know for how long that'll be but I don't believe it's a priority
But I think having the APL interpreter on the WASM side would still be faster than just doing it in JS, since exchanging numeric arrays should be what WASM is good at
 
ngn/k isn't apl but it is an array language with wasm
 
I've heard of K
And KAPL IIRC has something I find really interesting
Lazy evaluation
Put lazy evaluation in APL and I can't think of a reason to have guards in the language
 
The other thing about Abacus is that it's designed to make your callbacks happen in APL. So no need to have JS do the computations.
 
@AndréLeria do you mean KAP? it's not related to K
 
7:01 PM
Perhaps
And I'm aware
 
OMG YESSS!!! @Adám I ACTUALLY GOT "ray tracing" WORKING! (in 2d BUT STILL!) :D
by that i mean, a 2d area where a camera is on the plane and has eyes that display as 1 dimmension :)
 
Hey that's nice
I still consider using APL in some way when I go back to studying Love2D
 
7:23 PM
huh interesting. I wonder if i should just go all the way and make a game engine for APL... :o
 

« first day (1849 days earlier)      last day (795 days later) »