« first day (274 days earlier)      last day (2380 days later) » 

9:54 AM
October British APL Association meeting is on Friday 27th at The Hoop And Grapes in London. For information go to http://groups.google.com/group/baa-london/topics
 
 
4 hours later…
1:27 PM
Hello everyone! @Adám, could you give me some insight here? I'm trying to make a conditional on a tacit function, is that possible? Doing f←condition:'true'⋄'false' doesn't work and I don't know any other way.
Also, is it possible to make a tacit function recursive using like a Dfn?
 
1:48 PM
@J.Salle Not directly, but say you want to add 2 when the argument is less than 10. You can write (2×10>⊢)+⊢.
@J.Salle Also remember that you can embed small dfns inside a larger tacit function (as one of the functions).
@J.Salle The only way would be to use and its name, but I would strongly discourage that.
 
@Adám okay, these are helpful already. Any way to iterate over a variable without using :For? I'm trying to solve this challenge. I have a function that checks whether 0 belongs to argument in base-x but I need to iterate that base x until the condition is false. I don't think I can do it tacitly, can I?
my function currently is 0∘∊(c⊥⍣¯1⊢) where c is the current base
 
@J.Salle You should be able to do it with the Power Operator. {do something}⍣{until true ⍺}
 
@Adám Ooooooh, okay! I'll try that
 
@J.Salle So, since you want to change the base, you should do something like {formula to get next base to try}⍣{0∊⍺⊥⍣¯1⊢input number}initial base to try
 
2:19 PM
@Adám okay so I got f←{⍵+1}⍣{~0∊⍺⊥⍣¯1⊢⎕} but that would require the user to type the input multiple times until it reaches the right base (and you'd need to call f 2 every time)
 
@J.Salle Try 1+⍣{~0∊⍺⊥⍣¯1⊢n}2⊣n←⎕
 
@Adám it kinda works, but you need to type the input then call the function. Do you think I could post it as 1+⍣{~0∊⍺⊥⍣¯1⊢n}2⊣n←⎕ and on the "try it" link make it g←1+⍣{~0∊⍺⊥⍣¯1⊢n}2⊣n←⎕ ⋄ g?
 
2:47 PM
About to watch the latest webinar from @dyalogapl - Code Golf Competition Discussion and Results... 11am/4pm EDT/UK
 
@Adám oh okay, it's good to know how it works with TIO. I was banging my head against my desk trying to make it work on TryAPL
 
@J.Salle You can't use and for input or output on TryAPL.
 
@Adám Yeah I figured it was that raising the invalid symbol
 
@J.Salle I have to start the Webinar now.
 
2:54 PM
@Adám Okay, have fun with it! You guys are gonna rock.
 
3:46 PM
If you can't join our webinar today you can still catch up with the results from the APL CodeGolf Tournament here https://www.dyalog.com/news/121/420/Results-of-Code-Golf-Tournament.htm
Behind the scenes at Dyalog HQ - Adam live in action running the code golf #dyalog #webinar
 
Ven
3:57 PM
I know how much these lights hurt the eyes. Thank you @Adám for doing this!
 
@Ven You're very welcome. It was fun.
 
Ven
@dyalogapl Should probably mention that you need a certain amount of rep in StackExchange in order to chat there.
Ah, that's a true downside
 
4:15 PM
@ngn Congratulations on winning!
 
ngn
@Adám thanks!
having looked at Francesco's and Stefano's solutions - I won by a very small margin
if Francesco had thought of replacing f/ A g B with A f.g B to remove the parens, we would be equal
in problem BarChart
 
@ngn Yes. But you still at least matched everyone. Michelle's MonadicKey solution, {↑∪⍵⍺⍺¨⍸¨⍵=⊂⍵}, is invalid.
 
ngn
so my "red herrings" for diverting attention away from BarChart might have actually helped :)
 
{0}⌸1 2 should give 0 0, but hers gives ,0 because the results are not unique.
@ngn If you call that "help". How about let the best golfer win?
 
ngn
I mean helped me win :)
The best golfer is the one with the fewest chars, right? :)
There is no rule that says psyops are not allowed.
 
4:27 PM
What did you win? I recall Adam asked about prize ideas in TNB some time back.
 
ngn
@Adám Isn't that a Michele with a single "l"?
 
@ngn It is indeed. Sorry, @Michele!
 
ngn
likely a "he"
 
@ngn Yes, you're right. Michele is an Italian male name, Michelle is a French female name. The family name Billon threw me off by looking French to me.
 
ngn
(assuming Italian origin)
Anyway, I would agree that that solution is not valid.
It's clever, though, and if I'd have thought about it, of course I would have used it as a third red herring :)
 
4:43 PM
@Adám can I define a niladic {dfns}?
Even if I don't reference ⍺ or ⍵ the function still expects at least one argument.
 
@Pavel what's the function?
 
@J.Salle Let's say {3}
 
@Pavel If so, you don't need the braces, you can just do f←3
Then when you call f it returns 3
 
ngn
@Pavel I can answer that: no
@J.Salle f←3 is not the same as f←{3}
 
@J.Salle Ok let's say it's a function with sideeffects, like {⎕←3⋄3}
 
4:48 PM
@ngn it's not, but f←{3} doesn't work at all, does it?
 
ngn
@J.Salle why not?
 
It works, but you have to call it with f 0
 
ngn
@J.Salle it's a dfn that always returns 3
 
Or any other dummy argument
 
ngn
@Pavel correct
dfns per se are not monadic or dyadic
 
4:49 PM
@ngn I thought you'd need to reference an argument for it to work
 
ngn
they are applied monadicly or dyadicly
 
Does this work?
∇ f
    3
∇
 
ngn
@Pavel yes, except you probably want to return the 3
∇r←f
r←3
 
ngn
@Pavel that's because f itself prints the 3
 
4:53 PM
Oh.
 
ngn
I know... I hate tradfns :)
 
It errors in ngn-apl and those are incredibly unhelpful error messages.
 
ngn
ngn/apl doesn't support tradfns - obviously per my previous comment :)
 
@Pavel the Dyalog APL debugger is better
 
ngn
There's an unfortunate collision between dfn syntax and tradfn syntax - ∇
"∇" is the first char from the header line of tradfn
it also closes a tradfn
but in a dfn "∇" means "recur" - call the dfn you are in
 
4:57 PM
Ah. So ngn gets confused and dies horribly.
 
@ngn that's probably hard to fix, isn't it?
 
ngn
my interpreter isn't very good at error reporting, I admit
it sucks at performance, and it doesn't even have half the features of Dyalog
 
@ngn pfff who needs error reporting anyways? That's for developers, we're golfers
 
ngn
it's good for one thing: it taught me APL :)
 
it runs in a browser, which is nice.
Although, Ride
 
ngn
5:00 PM
@J.Salle Right, why would anyone ever put errors in their code? :)
 
@ngn that'd be silly now wouldn't it? :p
 
ngn
RIDE (for "Remote IDE") also runs in a browser, but it's disguised as a desktop app
it uses Electron, which is Chromium integrated with node.js
 
@ngn No no, there's a proper web app.
 
ngn
@Pavel What do you mean?
 
You can have Ride in a regular browser tab
@ngn Images aren't working for me right now, but I think this is a screenshot of Ride in Chrome: i.stack.imgur.com/pJnDL.png
 
5:05 PM
@Pavel that's an image called ImageNotFound.png
rofl
 
@J.Salle Fixed
 
@Pavel yup, that's it. That's a pretty UI, even.
Better than the desktop app for sure
 
ngn
@Pavel Yeah, I don't mind infinities :)
@Pavel There were once plans for making the interpreter act as a server and serve RIDE to a normal browser, but I haven't been in touch with Dyalog for almost a year and I don't know much
 
@J.Salle That's the prerelease version of Ride that Adam has.
The version we can use is ugly af
 
@Pavel my point exactly.
 
5:08 PM
No I mean the version of Ride that we get is uglier than the desktop app.
 
Oh really?
I thought the desktop app was RIDE
 
Nope
That's a Dyalog session, Ride needs to connect to an existing Dyalog session.
 
Ooooooh, I see.
 
Notice how Adam has both Ride and the desktop app open at the same time in the screenshot.
Ride is connecting to the session in the deskktop app.
 
5:11 PM
Yeah, I noticed. I thought you just needed it to be open so you could use it in the browser.
Which is technically true but they're 2 different programs.
 
It doesn't have to be open on your computer, it can be open anywhere that Ride can connect to.
So you could theoretically have an incredibly insecure version of TryApl running Ride.
 
@Pavel incredibly being the keyword here, hahahahah
That'd be literally a front door for code injection
 
Oh well, GTG (battery dead)
 
@Pavel RiP battery, you've served well. Cya bro o/
 
ngn
@Pavel sorry for your power loss
 
ngn
5:33 PM
regarding _ugly_: you can choose from several kinds of ugliness (colour schemes) in the preferences
regarding _insecure_: I don't think RIDE's threat model is quite the same as TryAPL's; in the video I linked to Morten shows how SSL can be used for confidentiality (no eavesdropping) and possibly authentication (only allow the owners of such-and-such client certs to log in), but once you're in, there is no fine-grained permission mechanism to let you evaluate only expressions that don't access the filesystem, start external processes, etc
 
6:11 PM
@Pavel We are actually planning on allowing customers to pay for APL time running the interpreter on AWS and serving RIDE to the customer's browser. Since the customer will have a dedicated virtual computer by Amazon, there is no risk.
 
@Adám That sounds like something that's intresting enough for me to consider using but not pay for. Unless a company gives its employees chromebooks for some reason, it seems simpler to just download Dyalog.
 
@Pavel I think it is intended for corporate customers. E.g. this gives the ability to work on the same project from any device.
@Pavel I also assume that a local APL (or anything) will always give a better experience than a remote one.
 
6:26 PM
Yeah, same.
 
 
2 hours later…
8:18 PM
@J.Salle Yeah, good idea.
 
Hahahahah
 
@J.Salle What exactly do you mean by "iterate over a list"? Apply a function to each element of a list?
 
@Adám That too, but what I was trying to do was computing the deltas of each element of a list so that 1 2 4 8 would return 1 1 2 4 (not sure if the first 1 should be there though)
I've tried using but didn't get too far with it
 
@J.Salle To apply f to each scalar in an array, just do . To insert the function f between the scalars (last axis) use 2 f/. Between the major cells (first axis); 2 f⌿. For vectors, / and are the same.
The 2 is makes an f-reduction over each window of size 2.
 
@Adám what about applying the function over two elements of a vector?
 
8:26 PM
@J.Salle That's 2 f/ vector. Remember that all arrays are treated the same in APL.
 
@Adám I see, but that seems to apply it monadically. When I do 2 -/ 1 2 4 8 I get ¯1 ¯2 ¯4. I wanted to get 2-1 4-2 8-4 (which obviously is 1 2 4)
 
@J.Salle That isn't monadically, but rather in the order of occurrence: 2 -/ 1 2 4 8 gives (1-2) (2-4) (4-8). You can reverse the sub-arrays before applying the reductions by using a negative window length, ¯2 -/, or you can reverse the function; 2 -⍨/.
 
@Adám Oooooooh, I see it now. I thought it was monadically because it's the same result I was getting earlier
 
@J.Salle In the case of - you can of course also just invert the result. ¯2-/⊢ and 2-⍨/⊢ and -2/⊢ are equally good solutions to the CMC.
 
@Adám Nice, seems good.
 
8:36 PM
@J.Salle Actually, in all of those, you can replace with too, and also with any other identity function.
 
I liked how that really convoluted answer I gave to the other challenge became ∪⊢(/⍨)=
@Adám using would require user input though wouldn't it?
 
@J.Salle Yes, so that would be a tradfn body. Still valid.
@J.Salle Now, can you golf it down to only 3 bytes?
 
@Adám I can most certainly try
Well I found another 4 byter with 2-/⌽
 
@J.Salle That gives you the result in the wrong order, no?
 
Maybe, I only tested with 1 2 3 4 5
Yeah it does
 
8:43 PM
@J.Salle Well, that's a bad test case, as all deltas are 1.
 
@Adám yup, I was lazy hahahah
I'm trying to find a way to make ¯2 with one byte
but I don't think that's it
 
@J.Salle No. I'll give you a hint: You have a "wasted" byte with as it doesn't do anything.
 
@Adám well yeah but I can't just not put it there because the function asks for a right argument
So I'd still need something to replace it, no?
 
@J.Salle True, but you can replace it with another function which allows you to save a byte somewhere else.
 
@Adám Well, 2-/- also works, but it's still 4 bytes
 
8:52 PM
@J.Salle That's it! All the others were 5 bytes.
 
@Adám oh yeah
lol
 
@J.Salle I made a mistake, I meant 4, not 3.
 
@Adám Hahahah no problem
 
@Adám nice webinar. just finished watching
@Ven 20 rep ain't that much
 
Yeah, I'm gonna go home now and watch the Webinar \o/
See ya, everyone! o/
 
8:57 PM
@Uriel I'm happy you enjoyed it.
Take care everyone. My wife just came home, so I'll have to go.
 

« first day (274 days earlier)      last day (2380 days later) »