« first day (1845 days earlier)      last day (814 days later) » 

12:13 AM
when writing examples, should i assume the veiwer is using ⎕IO 0 or 1? currently i'm stating "with ⎕io 0:" at the top, but i could make it 1
 
The default is 1, but it is good practice to specify.
 
12:53 AM
ok done with my first page! I did mostly examples for the page "assignment", and it was pretty fun. not much, but it's honest work :D
https://aplwiki.com/wiki/Assignment
 
1:30 AM
@BrianBED Thanks. I've polished it a bit. Still needs treatment of selective assignment, function assignment, examples of global vs local assignments in tradfns and dfns, including discussion of the issues in dfns, more external links, etc. but it is indeed a good start.
 
1:46 AM
¯\_(ツ)_/¯ I try
ah i like how pretty you made it look :D
 
 
1 hour later…
2:52 AM
has anyone here made an attempt at using CoSy?
@rak1507 wait till you see CoSy docs
 
 
3 hours later…
6:14 AM
 
 
2 hours later…
8:35 AM
@RGS @xpqz Did you ever look into serving a non-default font for the code in Jupyter Books? People are complaining about rendering issues with that would be solved if you served a proper font.
 
I’ve tried, but have been unable to work out how to do it, as I’m unable to test.
 
I thought you could inject custom CSS.
 
8:51 AM
@xpqz Looks like this would do it.
@xpqz I think the flow will be easier to understand if the "We can model as:" has reversed left arguments and does ⌽×\⌽
Maybe even revise everything from the beginning to do ⌽×\⌽ throughout, i.e. ⌽×\⌽(2⍴10),1 etc.
And again, ×\⌽1 1 1 is wrong. It should be ⌽×\⌽1 1 1
And harmonise ⌽×\1,⌽1↓0 0 0 to ⌽×\⌽1↓0 0 0,1
@xpqz MathJax mess-up after "Compare this to making cash change: there’s nothing larger than a"
 
9:06 AM
@Adám Sure. That’s the first attempt I had. But no css I add through that route seems to do it.
 
@xpqz Could you observe that the CSS was injected?
Hm, now I look at maybe the formulation ⌽×\⌽1,⍨1↓ is best, as it puts all transformation on the left, keeping the base on the right?
 
how do i join two vectors column wise, for example:
1 2 3 <command> 4 5 6
---
1 2 3
4 5 6
 
@Adám Several folk around the web seem to confirm it’s hard or impractical. My css skills aren’t sufficient, I fear.
 
@PyGamer0 ↑(1 2 3)(4 5 6) or ⍉1 2 3,⍪4 5 6 or 1 2 3,[0.5]4 5 6 assuming ⎕IO←1
 
ok thanks
 
9:10 AM
@xpqz If you can get any CSS injected, then we can do it. I can help with the CSS.
 
@PyGamer0 i came up with (assuming lengths of ⍵ and ⍺ are same): {2(≢⍵)⍴⍺,⍵}
 
@PyGamer0 At that point, {↑⍺⍵} or ↑⍤,⍥⊂ is easier.
 
oh
 
I'm lobbying for ⍪⍥< to do this.
 
9:14 AM
Is the book built with that?
 
uh so how do i do a 2×2 sliding window over a matrix?
 
RGS
@Adám I started trying, haven't given up yet.
 
2 3 4
4 5 6
-------
2 3 | 3 4
4 5 | 5 6
 
@PyGamer0 ⋄ {⊂⍵}⌺2 2 ⊢ 2 3⍴2 3 4 4 5 6
 
@Adám
┌───┬───┐
│2 3│3 4│
│4 5│5 6│
└───┴───┘
 
9:17 AM
thanks
 
@RGS @xpqz Adding tt,code,kbd,samp,pre,.output.text_html span{font-family:codefont!important} to custom.css seems to do the trick.
@xpqz Under complex numbers, u v←4j6 1j2 should say (u v)←4j6 1j2
 
RGS
9:42 AM
@Adám That seems to assume codefont refers to something else..?
 
@RGS Yeah, look at learnapl's custom.css:
@font-face {
  font-family: 'codefont';
  src: local('DejaVu Sans Mono'),
       local('APL385 Unicode'),
       local('SImPL'),
       url(aplwiki.com/images/7/75/DejaVuSansMono.ttf) format('truetype');
}
 
RGS
That's what I thought of doing, yeah :D
Well, for MDAPL, should I not use APL385 by default?
I.e. reorder the locals and add a url to APL385?
 
Sure.
 
RGS
Do you know if APL Wiki also hosts the APL385 font?
 
⋄1 2 3{r←{⊂-/×⌿⍉⍵}⌺2 2⊢↑(4⍴1⌽⊢)¨⍺⍵⋄¯1↓r÷⊃⌽r}4 5 6
 
9:44 AM
@PyGamer0 Response looks like a 0-by-0 matrix.
 
why
 
@RGS (CC: @xpqz) I would host the font file in the same repo; otherwise it constitutes XSS.
 
RGS
Right.
 
@PyGamer0 You drop one row from the matrix 1 3⍴1.333333333 1.166666667 1
 
hm
⋄1 2 3{r←{⊂-/×⌿⍉⍵}⌺2 2⊢↑(4⍴1⌽⊢)¨⍺⍵⋄¯1↓3⍴r÷⊃⌽r}4 5 6
 
9:46 AM
@PyGamer0 1.333333333 1.166666667
 
oh
 
You can use , instead of 3⍴
Or alternatively, use 2⍴ instead of ¯1↓3⍴
 
oh yeah
 
⋄ 1 2 3{2(↑÷↓),{⊂-/×⌿⍉⍵}⌺2 2⊢↑(4⍴1⌽⊢)¨⍺ ⍵}4 5 6
 
@Adám 1.333333333 1.166666667
 
9:50 AM
@PyGamer0 Btw, {⊂-/×⌿⍉⍵} is just {-/×/⍵} no?
 
@Adám does the drop the last one and divides the rest by that and takes the first 2 of that?
@Adám yes
 
@PyGamer0 No, it divides the 2-take by the 2-drop.
 
so it drops the first 2
ah it makes sense now
 
Since X(f g h)Y is (X f Y)g(X h Y)
@PyGamer0 Which ⎕IO do you use?
 
0
 
9:54 AM
Then 2(↑÷⌷), or 2(↑÷⊃), would actually be better.
… because it doesn't rely on APL's quirky treatment of 1-element arrays as scalars.
 
how do i get both diagonals
example:
1 2
3 4
---
1 4
2 3
 
@PyGamer0 The in ⊢↑(4⍴1⌽⊢)¨⍺ ⍵ is unnecessary. The rest can be written as 4⍴⍤1⊢1⌽↑⍺⍵ or m,⊣/m←1⌽↑⍺⍵
@PyGamer0 Always of a 2-by-2 matrix?
 
yes
 
⋄ 0 1⊖⍉2 2⍴⍳4
 
@Adám
1 4
2 3
 
10:01 AM
oh
finally i made it
⍝ Homework solver X
⍝ Solves linear equations in 2 variables
solve ← {2(↑÷⊃),{-/×/0 1⊖⍉⍵}⌺2 2⊢4⍴⍤1⊢1⌽↑⍺⍵}
 
 
@Adám ?
 
Can you give an example of a homework problem that your solve solves?
 
hmm wrong
 
@PyGamer0 0.4285714286 1
 
10:06 AM
What is the homework task here?
 
@Adám wait
 
Note that
2x+3y=4
4x+5y=6
can be solved with
⋄ 4 6⌹2 2⍴2 3 4 5
 
@Adám ¯1 2
 
meaning x=-1, y=2
 
10:11 AM
@PyGamer0 solve←{(-⊢/¨⍺⍵)⌹↑2↑¨⍺⍵}
Don't get me wrong: This doesn't diminish your accomplishment — well done!
 
10:33 AM
@Adám ok, I’ll try that this afternoon hopefully. Many thanks
 
so dyadic is matrix divide?
 
Yes.
 
so ⌹⍣¯1 will be matrix multiplication ?
 
Well, there's +.× for that.
Dyadic is +.×⍣¯1⍨
 
⋄5(⊢⍣¯1)3
 
10:44 AM
@PyGamer0 3
 
⊢⍣¯1 is
 
why not ?
 
That's not what ⍣¯1 means. f⍣¯1⊢Y means "find my a Z such that f Z gives Y
X f⍣¯1⊢Y is just X∘f⍣¯1⊢Y
 
oh
 
So 5(⊢⍣¯1)3 means "find me a Z such that 5∘⊢Z gives 3, which only holds for Z←3
@Ashy Hi there. Interested in APL?
 
10:57 AM
hi @Adám mostly interested in J but APL too yeah
 
Nice. Welcome to the Orchard then. How much experience do you have with J (and APL)?
 
I've been playing around with j for the past year or so and a small amount of APL from some of the papers and videos
 
OK, cool. People here are always happy to help if there's anything.
 
cool, I might ask the odd golfing question or two as I work through the code.golf problems :)
 
Have you seen this?
36
Q: Tips for golfing in J

GarethGolfScript gets its own way far too often and I feel that a repository of handy hints for golfing in J might help in the fight against the evil empire. What tips do you have for making this already terse language shorter? For those wanting to learn J, the obvious place to begin is the jsoftware ...

 
11:03 AM
yeah i've read through that a little, seems like a really good reference
oh i've been listening to the array cast since it started too, great stuff from you and the crew
it's by far my favourite podcast
 
@rak1507 just to make sure. do you need the middle parenthesis? i removed them just to test and it still seems to work, tho i wanna make sure there aren't edgecases
wait sorry i'm stupid. it returned error, i just didn't notice :|
 
@BrianBED Yeah, ⎕NEW needs an argument consisting of (one or) two elements. The first has to be ⊂class where class can be a ref or a charvec. The second (if present) has to be a (scalar or) vector of name-value pairs.
 
 
1 hour later…
RGS
12:45 PM
@xpqz the font saga has come to a close. See my custom.css file for the CSS I'm using to style the book with APL385 (thanks Adám!). To check it is working, you can visit, for example, this link.
In order to serve the font(s) from the repo, all you have to do is make sure the .ttf files are in the _static folder. E.g., my APL385.ttf file can be seen here.
 
@RGS You can use local before serving.
 
@RGS Ha, I just deployed the cultivations book with something eerily similar :)
I'll pinch the APL385 font.
 
RGS
@Adám I have no idea what that means 🙃
@xpqz You can use whatever font you want :P I'm just saying I used the APL385.
 
@RGS local('APL385 Unicode'), first, so the client can use a local copy if it exists, rather than making another request to the server.
 
It's the nicest one.
 
RGS
12:48 PM
@Adám Oh, I get it.
 
@RGS Now, for the phone-number-rendering saga.....
 
RGS
@xpqz I'm not done with that :)
(Sadly,) I have been prioritising other things.
 
1:02 PM
@RGS How is this for a MDAPL logo (for the Jupyter Book, left side, above the title)?
In context:
 
looks good
 
Feels modern/fresh enough, while being a direct derivative of the original cover:
 
1:22 PM
How about using one of the newer glyphs introduced since the original was published, to emphasise the point?
 
Actually interesting. The topmost block in the original illustration has (or ?) instead of
I suppose it was replaced last-minute by someone noticing that that wasn't a Dyalog APL glyph.
 
Over, power and selfie :)
All the diaresis favourites
 
and are covered in the original MDAPL.
 
2:22 PM
Ok I made sure to be as formal as possible and asked nicely :D
crossed fingers
 
 
3 hours later…
5:21 PM
@Adám I'm getting different relative performances on the word count approaches from Lesson 30. Within expected tolerances, or did something get optimised?
      cmpx '≢''[^,]+''⎕S 3⊢t' 's(≢≠⊆⊢)t' 's{+/0 1⍷⍺=⍵,⍺}t'⊣ s←',' ⊣ ⎕←≢t←',XY'[/⍨?1e6⍴3]

2001020

┌→─────────────────────────────────────────────────────────────────────────┐
↓  ≢'[^,]+'⎕S 3⊢t  → 1.3E¯1 |   0% ⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕│
│  s(≢≠⊆⊢)t        → 1.4E¯2 | -90% ⎕⎕⎕⎕                                    │
│  s{+/0 1⍷⍺=⍵,⍺}t → 2.8E¯2 | -79% ⎕⎕⎕⎕⎕⎕⎕⎕⎕                               │
└──────────────────────────────────────────────────────────────────────────┘
(or is it my 18.1 beta?)
 
5:44 PM
      'cmpx'⎕cy'dfns'
      cmpx '≢''[^,]+''⎕S 3⊢t' 's(≢≠⊆⊢)t' 's{+/0 1⍷⍺=⍵,⍺}t'⊣ s←',' ⊣ ⎕←≢t←',XY'[/⍨?1e6⍴3]
1999578
  ≢'[^,]+'⎕S 3⊢t  → 5.1E¯2 |   0% ⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕
  s(≢≠⊆⊢)t        → 7.4E¯3 | -86% ⎕⎕⎕⎕⎕⎕
  s{+/0 1⍷⍺=⍵,⍺}t → 1.7E¯2 | -67% ⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕
that's my results and i use the normal release
 
Interesting. The expectation was that the last one would be the faster.
 
I think was slowed down after a bug was found in 18.0's optimisations.
 
the first one is obviously going to be slow and the third one doesn't seem that much more efficient
i imagine ≠⊆⊢ would be fast because it appears in the code relatively often.
 
Why isn't 1⊥2</⊣=,⍨ on the list?
 
seems to be the fastest
 
5:54 PM
@Adám Not got to that bit yet...
 
@xpqz I didn't look at the lesson. Glad to discover that my mind didn't change since then.
 
I have a script containing `⊃⊢/2⎕NQ#'GetCommandLineArgs'`

And when I run "mapl -script run.apl ⍳5" from the cli it outputs â³5. What's the issue here (I want ⍳5, obviously)
 
@Adám I think this breaks the flow of the lesson though -- the solution was billed as the 'next level up' from ≢≠⊆⊢.
I can reformulate it a smidge.
 
Ah. 'UTF-8' ⎕UCS ⎕UCS ⊃⊢/2⎕NQ#'GetCommandLineArgs' works
 
6:13 PM
Btw, Curtis Jones has started speaking about his APL usage at apl.wiki/APL_Campfire
 
 
2 hours later…
8:39 PM
0
Q: Idiomatic graphs in APL

Adam NathanAPL is great for array type problems but I'm curious as to how best work with graphs in APL. I'm playing around with leet questions, for example question 662. Maximum Width of Binary Tree, the exercise works with Node objects with a value/left/right pointer style, however the test-case uses a bas...

 

« first day (1845 days earlier)      last day (814 days later) »