« first day (1962 days earlier)      last day (678 days later) » 

3:00 PM
Welcome to APL Quest 2014-9! Today's quest is Going Ballistic:
> Write a dfn which calculates the distance (in meters) a projectile travels given an initial velocity in meters per second and a trajectory in degrees.
 
{9.8÷⍨(⍺*2)×1○2×○⍵÷180}
 
{9.8÷⍨(⍺*2)×1○2×○1×⍵÷180}
 
 
@xpqz nice one :)
 
@Richard Huh, why ?
 
3:02 PM
@Adám didn't think of ommiting it
 
Ok, now without circle.
 
Fun way to avoid using parens: {9.8÷⍨⍺ ⍺×.×1○2×○⍵÷180} (only works on scalars, though)
 
@Adám please explain
 
@Adám hideous!
 
Wait, is it actually correct?
No, it isn't, it just happens to pass the listed cases!
{9.8÷⍨⍺×⍺×1○2×○⍵÷180} works, though.
{9.8÷⍨⍺×⍺×1○○⍵÷90} is nice.
 
3:08 PM
You want a solution without ○? So no sin/cos/pi?
 
Go for it.
Sin←{-/⍵(*÷∘!⊢)¯1+2×⍳9}
 
what's that, taylor expansion or something?
 
Yes.
 
Reading it now. Something like this: x-x^3/6+x^5/120-x^7/5040+x^9/362880-x^11/39916800 ….
(sorry for the non APL notation)
 
pi←4×-/÷¯1+2×⍳1e4
@xpqz Is pi←0j¯1×⍟¯1 allowed?
 
3:20 PM
Is APL using tables to calculate Pi and Sin?
 
Pi doesn't need computation, as one can simply store the two floats (64 and 128 bits).
I think sin is built into processors these days.
 
a yes, I just meant Sin/cos
 
4
A: How are sin and cos implemented hardware wise?

Jon HannaThe answer to a related, but different question here talks of how FPUs perform such instructions: Once you've reduced your argument, most chips use a CORDIC algorithm to compute the sines and cosines. You may hear people say that computers use Taylor series. That sounds reasonable, but it's n...

 
I have no further questions for this problem, actualy
 
@xpqz {9.8÷⍨⍺×⍺×-/(⍵÷90÷0j¯1×⍟¯1)(*÷∘!⊢)¯1+2×⍳9}
 
3:29 PM
:)
 
Nice.
 
But yeah, this one wasn't the most interesting, being plain translation of formulas to APL. These days, we try to avoid such tasks in the competition.
 
The next one is also not very complicated. Could you raise the bar a little bit?
 
Bit more scope in the next to stretch your tacit muscles
 
@Richard Well, I like to stick to the problems as stated, but when the event happens, you're free to suggest expansions on it, like xpqz just did with this.
 
3:32 PM
@xpqz I'll will give that a try, thanks!
 
It'll be the 2014 finale! Amazing that we can keep this up. Now I just need to go record the videos from last and this week…
 
@Adám Yes I agree, was just a question for my own good
 
@Richard It starts like this: 100×
 
@xpqz :)
 
@Adám it's shaping up to be a valuable teaching resource I think
 
3:34 PM
I almost finished one of the difficult problems of the now running competition. Just some small polishing
@xpqz Yes, I am really appreciating it
 
@xpqz YAABBSK?
 
probably cause i am dumb and did copy the formula properly
 
@PyGamer0 Forgot conversion from degrees?
 
o_o
yeah
 
@Adám nah, the vids are just fine...
 
3:36 PM
lol
 
Amazing, you understood the initialism!
 
@Adám there
 
Eventually
 
@PyGamer0 The precision on the last one looks awful.
 
3:51 PM
@Adám Can I find documentation somewhere about simple graphical output? Like plotting points, lines or graphs? Or might it be something for a video tutorial?
Probably it is system dependend or not?
 
SharpPlot is cross-platform.
@Richard here.
 
Thanks.
 
APL Wiki list of merchandise. Feel free to add any entries you know of.
 
4:50 PM
@Adám Hi @Adám, thanks for the greeting. Yes, I am interested in APL... in fact, I started learning it this week. :)
 
Oh wow. Can I be of any help with that? How are you studying?
 
Oh thanks so much for the offer. I'm working on (and submitting) the competition problems... I'm kind of reluctant to ask for help, because I want to be able to say I didn't have to ask for help! (ego)
I almost asked for help a couple of times, but the act of formulating the question suggested an avenue for exploration that showed the way...
the selfie-socratic method :)
 
@pamphlet Admirable, but how can you solve the competition problems without learning how the language works?
 
Oh I'm definitely learning! I've been using lots of the great resources out there... I should say that APL Cultivations is fantastic
I should also acknowledge that I'm a seasoned q developer, so I'm kind of halfway there already...
 
Oh, I see.
I'd be interesting in your experience of coming to APL, with your Q background.
 
5:00 PM
Yes, it's interesting... I keep reaching for things that I can't find... but never sure if it's because they're not there, or I just don't know how to express them
 
Are you aware of aplcart.info?
 
And I'm finally starting to wrap my head around rank vs depth
@Adám I am, yes. Sometimes I find what I want there, and then have to spend an hour convincing myself I understand why it works
 
;-)
 
Is there any documentation about the parsing rules? I often find bits here and there (e.g. operators parse long-left in the operators section), but is there any sort of how-to for parsing arbitrary apl expressions?
(not that there's that many rules, I'm sure)...
just kind of looking for long-right, operators long-left, and to spot a train ... all in the same place :)
 
Jan 1, 2021 at 14:34, by Adám
@xpqz I think the table of binding strengths fully defines the grammar (assuming you know which symbols are in which class). See also this
 
5:07 PM
awesome, i'll check those out. thanks
 
 
6 hours later…
10:44 PM
@Adám I had this: (9.8÷⍨(*∘2⊣)×1○(○4)×360÷⍨⊢)
 

« first day (1962 days earlier)      last day (678 days later) »