« first day (1452 days earlier)      last day (1201 days later) » 

12:41 AM
damn it floating point!
As much as I think ⎕IO should be 0, it is quite convenient being able to do (≢⌷⊢)
I have too many 1-⍨≢⍵s in my code now
 
<moon-child> somebody here linked a list of all matching unicode delimiters (e.g. {} [] () «» etc.) a while ago; anybody still have that link?
 
1:14 AM
APL may be the best for arrays but it sucks for strings! would rather use python
 
1:52 AM
is there a function that lists contents of a namespace?
couldn't find anything on APLcart
 
<moon-child> one option (admittedly somewhat hackish): )cs yournamespace and then )vars / )fns / )ops / )classes / )obs
 
very minor graphical issue in ]html: the buttons at the top don't adjust their size so you get this
 
 
3 hours later…
5:03 AM
@rak1507 what kind of content are you looking for? ns.⎕nl -2 will give you the variables, ns.⎕nl -3 will give you the functions, -9 will give you objects (namespaces, etc). And you can specify finger granularity with decimals, check out the documentation for ⎕NL. You can even give it an array as an arg, so ns.⎕nl - ⍳10 is a common way to look at what the namespace contains
⎕JSON is also a new quick and nice way to view contents of simple namespaces (no functions)
⋄ns←⎕ns '' ⋄ ns.(x y z)←1 2 (⍳3) ⋄ ⎕JSON ns
 
@Josh D
Illegal code
VALUE ERROR
VALUE ERROR
 
oops, not quite sure how to make the bot print those multiple lines
@rak1507 a string is just an array of characters :). lol, I hear the complaints about strings in APL a lot, but I never had a string problem I couldn't solve in APL. Sure, when I first started, forgetting to ⊂ character arrays to make a "string" was a hiccup, but imo it fits nicely with the array/depth paradigm.
I had a thought the other day -- what if double quotes just automatically made characters inside a "string" so "abc" would equal ⊂'abc'
 
Didn't give it much thought though, seems like a waste with no real benefits
Oh wow, that seems like a much better use of the double quotes
are dictionary native structures in J ?
 
5:18 AM
<moon-child> no
<moon-child> (but they are in k, and symbols there have a similar role. Syntax is `foo instead of "foo")
 
Ah ok, ty
I'm just realizing the thought of single quotes for characters and double quotes for strings most definitely came from when I wrote C years ago.
Even though C doesn't really have "strings", still just arrays of characters with a null terminator.
 
<moon-child> well, it's also cultural. US uses ""; canada (where iverson comes from) uses ''
 
5:36 AM
Good point, didn't think of that
 
<moon-child> (personally I'm more inclined towards single quotes for use in prose, but I don't think strings are important enough in apl to use up such a visually distinct character)
 
 
5 hours later…
ngn
11:00 AM
@rak1507 ⊢⌿ not good enough?
 
11:22 AM
@JoshD year and a half ago. (I still think that having "…" be ,'…' just for single character charvecs is worth it, and the need for should be fixed in the builtins needing it (which isn't really an option for Dyalog, but that's not my problem))
 
 
2 hours later…
1:05 PM
@JoshD yeah, but interpolation is a pain
@ngn now that you say it, it's so obvious! thanks
 
1:59 PM
- 'Good mathematicians see analogies between theorems; great mathematicians see analogies between analogies.' (Banach)

This makes me think of the relationship between APL functions and operators :)
 
ngn
2:34 PM
@RomillyCocking do you know this one: what's a good anagram of "banach-tarski"? :)
 
 
1 hour later…
3:56 PM
this is probably more of a maths question than an APL question but does anyone know if there's a way to find the derivative of a function at a point iteratively? would be nice if there was some way to do ⍣≡ so it converges
ofc I can do something like {¯0.00001÷⍨-/⍺⍺¨0 0.00001 + ⍵} but for exponentials that will probably be off by a fair amount
{dx←1E¯20 ⋄ dx÷⍨-/⍺⍺¨⍵+dx,0} will probably do I guess
 
 
2 hours later…
5:34 PM
I'm playing with parsing JSON expression trees from JSON namespaces instead of JSON matrix, and the only way of working with it that currently jumps into my head involves recursion, and potentially very nested vectors. Does anybody here have any performance trivia / ballpark estimate off the top of your head - do you think this would be eventually worse than index-searching and exists-fn on simple arrays I have to do in the matrix approach?
ie. I haven't started to do much of anything yet and I'm already drowning in (⊂'foo'),∇¨e.children
 
5:58 PM
do you expect the function to be given analytically, e.g. as an apl expression/dfn? or is it a numeric vector?
for a vector there are finite differences, for an analytic function i don't think that works. it is not said that the derivative converges, if the interval gets smaller.
 
@ktye yeah a dfn probably
 
RGS
6:42 PM
@rak1507 Slightly better is mathspp.com/…
 
what is it with APLers and making incredibly useful pasting features!
thanks, I didn't think of that but now you say it, it is obvious
 
RGS
IIRC the formula I shared is of 2nd order, whereas the one you are using is just first order.
Of course, the formula is only of 2nd order IF the derivative exists :P otherwise the numerical results are bogus.
 
well yeah lol
 
RGS
@rak1507 by bogus I mean that they don't make sense mathematically, because they might still evaluate to a nice number. That is what I mean.
 
yeah, I know
 
RGS
6:45 PM
alright alright, mb.
 
try sin(1/x) for example
 
RGS
@ktye specifically at $x = 0$, otherwise there is nothing wrong with that function :)
 
@RGS fwiw you have a useless erroring g at the end of editor_mode(tex_area.value? 2 : 0);g which makes keyboard shortcuts not load
 
RGS
@dzaima THANKS
lol it is right there in the console. I did find weird the shortcuts not working XD
@dzaima btw thanks for dzaima/paste :)
 
:)
 
RGS
6:53 PM
@dzaima Hard-refresh and it's fixed. Thanks for that.
 
7:05 PM
<klg> for complex differentiable functions one can use something like {⍺←1E¯13⋄ ⍺÷⍨11○⍺⍺ ⍵+¯11○⍺}
 
RGS
klg I think I'm missing something... You only use the function ⍺⍺ once. Is your dfn supposed to approximate the derivative of ⍺⍺?
*The derivative of ⍺⍺ on point .
 
<klg> yes, derivate of ⍺⍺ at ⍵
 
RGS
@DyalogAPL How does your dfn do that? It looks like your dfn computes mathspp.com/…
 
<klg> you're missing the 11○
 
RGS
Yup you are right. So we are at mathspp.com/…
Correct?
 
7:14 PM
<klg> it's called complex step differentiation and is much more robust than finite differences with regard to choice of a step size; the drawback is requirement of the function being complex differentiable
<klg> yes, correct
 
RGS
If the formula is correct, this looks neat! Approximating a derivative without even having to compute a difference.
I wonder why I never came across this. This doesn't look that advanced.
 
8:11 PM
whoa, that is really interesting
 
 
1 hour later…
9:24 PM
@dzaima Fixed.
@Bubbler Fixed.
 
The 3270 font now supports APL and BQN out of the box!
Samples shown on my fonts page now.
 
9:50 PM
@xpqz ⎕FMT always returns a character matrix, and can format numbers in various ways ― og and it "evaluates" control chars. can only round and/or use exponential format while returning a non-nested character array of any rank.
@rak1507 Switch to ⎕FR←1287 and it'll give exactly 0.
@rak1507 What does that even mean? You could erase all names with ⎕EX⎕NL-⍳10 or simply save a clear workspace on top of the file.
 
Ah yeah that makes more sense
 
@rak1507 Not our fault. Simply how Windows draws its buttons on narrow windows. Happens to other applications too, if they allow making their window that narrow.
 
Ah
 
10:21 PM
I actually think APL's string interpolation makes a lot more sense / is simpler than learning the arbitrary insertion methods and syntax of other languages.

string ← 'On item ',i,' of ',max
And with this little idiom, it makes it even easier:
string ← ⊃,/ 'On item ' i ' of ' 'max'

Not to mention other solutions using ⎕R or @
If you're trying to do things like parametrized SQL expressions, the SQAPL interface does allow for bound variables in your statement.
 
I'd rather do f'<path d="M {W} C {X}, {Y}, {Z}" stroke="black" fill="transparent"/>' than '[WXYZ]'⎕R{⍕⍎⍵.Match}⊢'<path d="M W C X, Y, Z" stroke="black" fill="transparent"/>'
 
@JoshD it gets a bit more ugly when you're including numbers - 'On item ',(⍕i),' of ',⍕max
 
The whole thing is {W X Y Z←⍵ ⋄ '[WXYZ]'⎕R{⍕⍎⍵.Match}⊢'<path d="M W C X, Y, Z" stroke="black" fill="transparent"/>'}
if there's a nicer way to do this, please inform me
 
@dzaima oh wow, that's cool. Seems like this is a common idea that pops into our heads. There definitely seems to be untapped potential with double quotes
@dzaima that's true. but that's the tradeoff of allowing mixed arrays of different types. I think in development, it pays to know what variables are numeric and then adding the ⍕ should come naturally. If i find myself doing a lot of (⍕i) i'll just assign it as n←⍕i or something
 
I don't think that was the issue
 
10:28 PM
@rak1507 I guess {W X Y Z←⍕¨⍵ ⋄ '<path d="M ',W,' C ',X,', ',Y,', ',Z,'" stroke="black" fill="transparent"/>'}
 
W X Y and Z are numeric vectors
oops missed the ⍕¨
that's ok but not much better than the regex one imo, at least then it's clearer to me anyway
 
and to get rid of remembering commas
{W X Y Z←⍕¨⍵ ⋄⊃,/'<path d="M ' W ' C ' X ', 'Y', ' Z '" stroke="black" fill="transparent"/>'}
if you're doing this a lot, it might pay to make a simple utility function
interpolate ← {⊃,/⍕¨⍵}
interpolate 'path d="M 'W' C 'X', 'Y', 'Z' stroke="black" fill="transparent"/>'
you can probably even make the interpolate function smarter by using ⎕DR (or maybe even ⎕VFI) to only convert numeric variables to char
would have to benchmark the performances
 
10:48 PM
@JoshD seems Dyalog is smart enough to make on a character vector a no-op
 
yeah, i would imagine that is the case
another problem with string interpolation in other languages is now you have a new keyword/character to escape
which actually ties in with the discussion of double quotes. it's kind of nice not having that as a reserved character because it's used a lot in HTML. if that was included as a symbol, i guess that would make HTML string construction even more complicated because it would have to be escaped now
 
not necessarily? you could use 'text with a " in' fine right?
 
You guys might like these.
 
11:08 PM
I guess you're right, " in single quotes will be fine. But I'd imagine there would be some fallout somewhere. Maybe on things like expression executors now need to escape them.
 
@JoshD Yeah, this was discussed during the BAA open session Thursday. It is currently quite simple to determine if a particular character is "quoted away" or not. With a double-quote string (whether a normal vector, enclosed vector, or new type) it becomes a much more complex task. Not sure if that is a good argument against adding, but worth mentioning.
 
Nice Adam, there's your interpolation as other languages have it. I still think it's messier than using other solutions like dzaima's (e.g. you need to escape the backtic key now)
 
@Adám I saw them, if I was doing a lot of interpolation I might do that, but for one svg element it wasn't really worth it
 
I once used {(W X Z)←⍵ ⋄ ∊⍕⍤⍎¨@(∊∘'WXZ')'<path d="M W C X Y Z" stroke="black" fill="transparent"/>'} and found a bug in @
 
when i did this before, i used dyadic functions with this, so the left argument contained the literals, and the right contained the numeric values
and you insert the ⍕ of ⍵ between ⍺
just thought of doing it this way, maybe there are more efficient ways
⋄ 'var one = ' ';var two = ' ';'{v←⍕¨⍵ ⋄ ∊⍉↑⍺ v}1 2
 
11:19 PM
@Josh D
┌→────────────────────────┐
│var one = 1;var two = 2; │
└─────────────────────────┘
 
Nobody mentioned {W X Y Z←⍵ ⋄ ∊⍕¨'<path d="M 'W' C 'X', 'Y', 'Z'" stroke="black" fill="transparent"/>'}
 
right, super ravel (∊) is extremely helpful with this issue
 
lol, super ravel
 
It is unstoppable. It'd be nicer to have a single-level join than this overpowered thing.
 
ngn
11:40 PM
@RomillyCocking i forgot to reply to this one: ngn.bitbucket.io/k/…
 

« first day (1452 days earlier)      last day (1201 days later) »