« first day (618 days earlier)      last day (2037 days later) » 

1:52 AM
matrix methods are still new to me and I'm struggling to get this going
⎕←4 4⍴1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1
 
@nathanrogers
1 0 0 0
0 1 0 0
0 0 1 0
0 0 0 1
 
I'm assuming an identity matrix is the place to start? but I don't know what operations to use next
 
A slightly more elegant identity matrix
⎕←∘.=/⍳¨4 4
 
@Quintec
┌───────┐
│1 0 0 0│
│0 1 0 0│
│0 0 1 0│
│0 0 0 1│
└───────┘
 
row, col: integers from 1-4. 1 where row and col are equal
⎕←⊃∘.=/⍳¨4 4
 
2:04 AM
@Quintec
1 0 0 0
0 1 0 0
0 0 1 0
0 0 0 1
 
If you want it declosed
From here - simply take each 4x4 chunk and dot product it with the identity, right?
Here's a neat operator
⎕←({⊂⍵}⌺4 4)5 5⍴⍳25
 
@Quintec
┌──────────┬───────────┬───────────┬──────────┐
│0  0  0  0│ 0  0  0  0│ 0  0  0  0│ 0  0  0 0│
│0  1  2  3│ 1  2  3  4│ 2  3  4  5│ 3  4  5 0│
│0  6  7  8│ 6  7  8  9│ 7  8  9 10│ 8  9 10 0│
│0 11 12 13│11 12 13 14│12 13 14 15│13 14 15 0│
├──────────┼───────────┼───────────┼──────────┤
│0  1  2  3│ 1  2  3  4│ 2  3  4  5│ 3  4  5 0│
│0  6  7  8│ 6  7  8  9│ 7  8  9 10│ 8  9 10 0│
│0 11 12 13│11 12 13 14│12 13 14 15│13 14 15 0│
│0 16 17 18│16 17 18 19│17 18 19 20│18 19 20 0│
├──────────┼───────────┼───────────┼──────────┤
 
⌺: stencil. @nathanrogers
(Of course, do it for all directions)
 
I was using 4×/ along with ⍉⌽ to rotate 4×/
but the diagonal I don't get
 
What do you mean
⎕←(⊃∘.=/⍳¨4 4) × (4 4⍴⍳16)
 
2:16 AM
@Quintec
1 0  0  0
0 6  0  0
0 0 11  0
0 0  0 16
 
And maximum from there
 
iterating a 4 4 over a 20 20?
I don't understand how that works
 
@nathanrogers You mean the stencil operator?
 
um, i don't know what I mean. i don't know the words in apl for what I want to do
 
⎕← (⊃∘.=/⍳¨4 4) ר (({⊂⍵}⌺4 4)5 5⍴⍳25)
 
2:21 AM
@Quintec
┌──────────┬───────────┬───────────┬──────────┐
│0  0  0  0│0 0 0 0    │0 0 0 0    │0 0 0 0   │
│0  1  2  3│0 0 0 0    │0 0 0 0    │0 0 0 0   │
│0  6  7  8│0 0 0 0    │0 0 0 0    │0 0 0 0   │
│0 11 12 13│0 0 0 0    │0 0 0 0    │0 0 0 0   │
├──────────┼───────────┼───────────┼──────────┤
│0 0 0 0   │ 1  2  3  4│0 0 0 0    │0 0 0 0   │
│0 0 0 0   │ 6  7  8  9│0 0 0 0    │0 0 0 0   │
│0 0 0 0   │11 12 13 14│0 0 0 0    │0 0 0 0   │
│0 0 0 0   │16 17 18 19│0 0 0 0    │0 0 0 0   │
├──────────┼───────────┼───────────┼──────────┤
 
That is not what I wanted - whoops
⎕← (∘.=/⍳¨4 4) ר (({⊂⍵}⌺4 4)5 5⍴⍳25)
 
@Quintec
┌──────────┬──────────┬──────────┬──────────┐
│0 0 0  0  │0 0 0  0  │0 0 0  0  │0 0  0 0  │
│0 1 0  0  │0 2 0  0  │0 3 0  0  │0 4  0 0  │
│0 0 7  0  │0 0 8  0  │0 0 9  0  │0 0 10 0  │
│0 0 0 13  │0 0 0 14  │0 0 0 15  │0 0  0 0  │
├──────────┼──────────┼──────────┼──────────┤
│0 0  0  0 │1 0  0  0 │2 0  0  0 │3 0  0 0  │
│0 6  0  0 │0 7  0  0 │0 8  0  0 │0 9  0 0  │
│0 0 12  0 │0 0 13  0 │0 0 14  0 │0 0 15 0  │
│0 0  0 18 │0 0  0 19 │0 0  0 20 │0 0  0 0  │
├──────────┼──────────┼──────────┼──────────┤
 
@nathanrogers does this help at all?
 
its a lot to take in, I'll check it out
 
I am multiplying each 4 by 4 chunk inside a larger array by the diagonal matrix
5 5⍴⍳25 is the integers 1-25 in a square
({⊂⍵}⌺4 4 is the stencil magic - partitions it into 4 by 4 squares.
ר is multiplying each of the squares by...
(∘.=/⍳¨4 4) , which is the diagonal matrix that you made earlier.
 
 
10 hours later…
12:14 PM
@Quintec I'd suggest ∘.=⍨⍳4 as that doesn't repeat the 4 and clearly doesn't work for >2 dimensions
 
1:08 PM
APL wizards, I call upon thee for assistance
trying to implement this formula and failing miserably
The answer for ⍺=0 and ⍵=1 should be 0.0, 0.7934567085261071, but my current implementation doesn't seem to work properly
0{(+/⍺⍵z)÷⍨(⍺+.5×z){⍺+⍵,(⍺-⍵)}×/.5*⍨¨z,(×/⍺⍵÷(⍺+⍵))+4÷⍨z←3.8416}1 is my current function (not golfed yet, just trying to make it print the right answers first)
btw this fn has z equal to the formula's
 
@J.Sallé Which symbols are and . And what are the values for the other symbols?
 
@H.PWiz oh yeah, is ns, is nf
 
What are n and z?
 
my z is the function's
@H.PWiz total number of attemps and confidence level
z is set, n is nf+ns
:47044723 no, since my z is already z². So root(z²×...) = z×root(...)
 
That formula is horribly hard to read
gray on black
 
1:16 PM
@Quintec really? mine renders black on white background
 
The parens are wrong in {⍺+⍵,(⍺-⍵)}. It could also be the train: (+,-)
instead of ×/.5*⍨¨z,, I would suggest .5*⍨z×
 
@H.PWiz yay that solved it actually
just need to shave all the useless parens' off
 
Are you golfing?
 
yes
got 0{(+/⍺⍵z)÷⍨(⍺+.5×z){⍺(-,+)⍵}.5*⍨z×(×/⍺⍵÷⍺+⍵)+4÷⍨z←3.8416}1
 
{⍺ f ⍵} is always equivalent to f
 
1:22 PM
@J.Sallé {⍺(-,+)⍵}(-,+) ಠ_ಠ
 
yeah yeah I was getting there >.>
trust me >.>
 
×/⍺⍵÷⍺+⍵⍺×⍵÷⍺+⍵
(⍺+.5×z)(⍺+z÷2)
 
I've no idea why that .5× was still there
I think I was trying something else after that
 
1:43 PM
×/⍺⍵÷⍺+⍵ is wrong because ÷⍺+⍵ gets used twice in the multiplication. So you have 1/n^2 n_s n_f
Of course, you can't see this with ⍺=0
 
@H.PWiz ah, I see
 
 
1 hour later…
2:57 PM
Im struggling with this euler bit. Either the solutions I'm coming up with aren't efficient enough to solve the problem, or I can't even solve a base case in APL.

With that in mind, what should I read, where should I go and what should I do to learn APL better? Euler is kicking my ass
 
@nathanrogers What material have you already gone through?
 
most of the tutorial
 
@nathanrogers Which tutorial?
 
um... the only one I know about 1 sec
 
@nathanrogers Oh. OK. How about this chat room's lessons?
 
3:02 PM
:O
 
@nathanrogers And Mastering Dyalog APL
 
there's lessons? IN the chatroom?
 
@nathanrogers I conducted weekly 90 min lessons the entire last winter.
 
how I find those?
 
@nathanrogers I just linked them :-)
 
3:03 PM
mastering dyalog apl?
OH
I didn't see
nvm
 
@nathanrogers You could also go through this Jupyer notebook based course.
@nathanrogers If you go to the Learn tab of TryAPL, you will find some higher level explorations (Conway's Game of Life, Depth First Search, and Sudoku Solver) which may be of interest too.
 
ngn
@nathanrogers Dzaima did tell you about them:
Sep 5 at 19:45, by dzaima
@Quintec Either the lessons here or the learn tabs stuff at TryAPL
 
I'm in a place where beginner is way too beginner, and advanced is way too advanced
 
@ngn Those are different people
 
@ngn Quintec ≠ nathan rogers :p
 
3:07 PM
I'm in this ethereal delirious state between "so what do I do with it?" and "why doesn't it work?"
 
ngn
oh, sorry, I got confused
 
@nathanrogers Then try solving (not necessarily golfed) some code golfs or CMCs and ask people in here for hints when you get stuck.
 
golfs? cmcs?
 
@nathanrogers Oh, you're not a PPCGer. Sorry about that.
 
no, I don't have a problem somewhat golfing, i just think something should work and it doesnt. I can solve up to about problems 13 in euler, but others I haven't the slightest how to solve because my solutions take too long
idk what that means
 
3:11 PM
Still undecided about attending #Dyalog18 in Belfast? A list of presentations with summaries is now available at https://www.dyalog.com/user-meetings/dyalog18/presentations.htm
 
@nathanrogers PPCG is a StackExchange for Programming Puzzles and Code Golf. You can use it as a source of small, well-defined problems to hone your APL skills. And you'll often find explained APL solutions to the posed problems too. CMCs are simple Chat Mini Challenges in PPCG's main chat room. You can find CMCs by searching for "CMC".
 
ngn
3:24 PM
Oct 1 at 15:09, by ngn
@J.Sallé in ngn/k you may need to put function compositions in parens, due to me being too lazy to fix my parser bugs; for instance in your last oK answer like this
@J.Sallé ^ fyi, no longer necessary
 
@ngn fixed? Nice!
 
@ngn oh thank you for reminding me to fix the same exact problem for my APL :P
 
ngn
@dzaima haha :) do you have ppcg answers in it?
 
@ngn no, it's not on TIO nor anything. I'm back working on it since yesterday though, with the inspiration to make a calculator++-ish thing for it (which currently works beautifully, though using the worst code I've written)
 
@dzaima it's not bad code if it works™
 
3:31 PM
@J.Sallé ...wouldn't say that. What it does is convert java 10s vars to full types using error logs from failed compilations, so it could break with any change to the source :p
 
LOL that's a first
 
ngn
@dzaima a mobile app? nice :) i wish i had the skill to do that
@J.Sallé hm... if it's bad code, it's hard to reason about, so you can never be sure that it really works
 
@ngn hahahah yeah yeah, that seems fair
 
I'm attending Iverson College this year. Interesting news: Arthur Whitney is working on K7. It has a full prototype system (like APL). Arthur dislikes the heavy overloading of ASCII symbols and is exploring Unicode symbols. Morten Kromberg says Arthur is beginning to realise that having both depth and rank is an advantage (though that isn't making it into K7). Are we coming full circle?
 
ngn
in some cases "it works" may be more important than "good code" - if making it demoable early helps you get more funding :)
 
3:45 PM
Lots of important K and Q/kdb+ people are attending. I can forward questions if anyone wants insider info.
 
ngn
@Adám is that a joke?
 
@ngn Nope, 100% serious. I heard the Unicode part from two core implementors at Kx.
 
@Adám I think the most important question I could ask is: is this happening next year as well? and if so, can I come? :p
 
@J.Sallé It is by invitation only. ⍨
 
Sad >.>
 
3:52 PM
@J.Sallé I really wish the Dyalog User Meetings weren't so darn expensive to attend.
 
@Adám well yeah that would be awesome. I still intend to go to one some day, though, hopefully next year if possible.
I'll have graduated by then and will probably be earning some more money
 
The APL community needs a better online presence. It is quite vibrant offline, but spread thin over the world.
 
We should invite everyone to join ppcg hahahahahahah
 
@dzaima while at that, I.. made a b←10 20 ⋄ a b,a b(←,+)3 4 return 3 4 3 4 13 24
 
I visited a major customer last week and was surprised by how certain they seemed on the future of APL. They want to support developments that can benefit the community in general. APL is in the very core of their main product.
@dzaima !
@J.Sallé I am trying. I advertise SE and this room in my webinars and appropriate presentations.
 
3:58 PM
@dzaima (though I suppose a b←10 20 ⋄ a b,a b{⊢⍺←⍵⋄⍺+⍵}3 4 worked before too)
 
@Adám which is already great, btw.
 
@J.Sallé Maybe we could have a special student discount and/or an ability to participate while arranging one's own accommodations (think AirBnB) and provisions (local supermarkets) so one can attend with not much more than the travel expense.
 
@Adám would also be great. Personally though, my main problem is that pounds are worth much, much more than our currency here, which is why I need to save some extra money
 
4:15 PM
ok maybe trains & atops with is a bad idea. (g←←f←←←←←) makes my head hurt
 
@dzaima syntax error on my brain
 
@dzaima They are imho if isn't a regular function (at least for array assignments). If worked with quoted names, that would be fine.
 
@Adám now i have to implement quoted names.. ಠ_ಠ
 
@dzaima J and SAX allow them. However, how do you disambiguate the second statement in name←'var1' ⋄ name←42. One idea is to let (name)←42 mean var1←42.
The idea is that () forces evaluates, kind of like (a←10) displays its result.
 
@Adám and out of curiosity, what would name←42 return if name←'var1' and (name)←42 == var1←42?
 
4:23 PM
@J.Sallé A shy 42 (after assigning 42 to name)?
 
Sounds good. :p
 
@Adám oh didn't think of that. Then probably a different thing should be for that and ill just not have in trains, as it doesn't make much sense and abuses the implementation anyway.
 
@J.Sallé @dzaima If I was to start over on a new APL, I'd require names to be quoted, so that name←42 would mean 'var1'←42.
 
I see, I see
 
@Adám you mean it'd unquote always?
 
4:28 PM
@dzaima Yes. That would make a perfectly regular function (for arrays at least) and make it easy to assign programmatically.
And I think the added bother of typing quotes is worth it to remove yet another exception to regularity while adding utility. Also, remember that some languages require let before assignments — that's 4 extra characters, vs 2 here.
 
@Adám that let has a purpose though - to scope a variable (at least in JS), which can later be omitted
also 'avg'←+/÷≢ wouldn't assign +/÷≢ to avg, but just result in a train
 
@dzaima Some languages require let to disambiguate assignment and comparison. Also, local/global assignment should probably be two different functions, like in J.
@dzaima Of course. Function assignment may need a different syntax. It is quite fundamentally different anyway.
 
@Adám if I get around to it, my APL should have 2 assignment functions, but one for making a new variable in its scope (and shadowing others) and the other for setting to the latest scopes instance of the variable
 
Having quoted names also allows unambiguous modified assignments (although that does make assignment slightly irregular).
 
What about structural assignment?
 
4:38 PM
@H.PWiz Yeah, I've thought about that. Doesn't fit well with my quoting idea.
 

« first day (618 days earlier)      last day (2037 days later) »