« first day (1934 days earlier)      last day (143 days later) » 

 
2 hours later…
9:33 AM
@Adám @RikedyP do either of you know how to tell the jupyter kernel to not shrink images to tiny postage stamp size when using SharpPlot? Nic's examples from the Cultivation on plotting work just fine in a notebook -- apart from the fact that the generated plots are too small to see.
 
10:01 AM
@xpqz I suspect Jupyter uses a fixed size, and SharpPlot generates scalable SVGs. I suggest asking SharpPlot to create a "smaller" chart.
 
10:26 AM
Hmm. In e.g. matplotlib you can specify the size for the plot cell. You can apparently also do it in css via a %%html magic, but the dyalog kernel doesn't support magics.
Maybe I can render the images to file, and include them manually, but that seems a shame.
 
10:42 AM
Maybe we should support some magics. But yes, that does look suspect.
 
when the kernel is sus
 
Can SharpPlot render as png instead of svg?
 
10:55 AM
@xpqz Well, there's something called Png
 
11:37 AM
Could it be that the try apl is not working on the competition page (for 2014-5)?
Try apl page itself is working
 
(TryAPL and problems.tryapl.org are not actually connected other than by domain name.)
@Richard Wait, it seems that no response is given on any 2014 testing at all. Is that what you experience too?
 
11:53 AM
yes
I indeed also tried the other 2014 input fields
2013 however is working. And I am sure last week everything was working.
Maybe it is upsaid about my solution
 
No, every run is sandboxed.
 
12:11 PM
@Richard I found the issue. It is currently rebuilding and should be updated online soon. Thank you so much for the report!
 
 
3 hours later…
3:00 PM
Welcome to APL Quest 2014-5! Today's quest is Mirror Mirror:
> Write a dfn which returns a 1 if its character vector argument is a palindrome, 0 otherwise.
The spec is a bit ambiguous. It doesn't really define what to consider, but the examples seem to indicate that punctuation and spaces are to be ignored.
And while we don't need to worry about case, it probably won't matter for most solutions.
So, what have y'all got?
 
⎕A{(⊢≡⌽)⍵/⍨⍺∊⍨⍵}1⎕C
But failed to make it tacit
so is somewhere in between
 
ovs
(⌽≡⊢) ⎕A∩⍥⎕C⍨⊢
 
@Richard Not even a proper function, as you'd need 1⎕C⊢ or 1∘⎕C (or just ⎕C!)
@ovs Nice, but you can do ∩⍥⎕C∘⎕A
And (⌽≡⊢) can be written ≡∘⌽⍨
 
ah ok, seemed to work. Could you explain a little bit more?
 
It seemed to work because you used it inline with an argument, but you wouldn't be able to give it a name because 1⎕C isn't valid.
 
3:05 PM
@Adám got it!
 
@Richard Btw, filtering (/⍨) by membership () is the same as intersection () leading you to ovs's solution.
Anyone else? I'm having a hard time thinking of any other approaches to this.
I guess {≡∘⌽⍨⍵∩⎕A,⎕C⎕A} is slightly different. Maybe more performant?
 
I'm sure there's a few other interesting approaches, but I imagine they'll be more adhoc than usual
 
      ]runtime -c (≡∘⌽⍨∩⍥⎕C∘⎕A)t {≡∘⌽⍨⍵∩⎕A,⎕C⎕A}t

  (≡∘⌽⍨∩⍥⎕C∘⎕A)t   → 3.6E¯2 |   0% ⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕
  {≡∘⌽⍨⍵∩⎕A,⎕C⎕A}t → 3.1E¯2 | -15% ⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕
 
not much different indeed
 
I had {(⊢≡⊖)⍵/⍨⍵∊⎕C⎕A} - basically the same as everyone else
 
3:13 PM
@Richard The lookup vector is twice as big, but we save the case-folding of the (potentially large) input.
 
Is there a smart way without using ⎕A or ⎕C and also without listing all the alphabeth?
 
Well, you could make assumptions about which other characters can appear.
 
You could operate on ⎕UCS
 
Check if in range?
 
yes something like that. But without Quad at all?
 
3:17 PM
Interestingly, the performance difference doesn't seem to depend the argument's size:
      t←(70↑⎕A,⎕C⎕A,',.!?')[?1e5⍴70] ⋄ cmpx'(≡∘⌽⍨∩⍥⎕C∘⎕A)t' '{≡∘⌽⍨⍵∩⎕A,⎕C⎕A}t'
  (≡∘⌽⍨∩⍥⎕C∘⎕A)t   → 3.1E¯4 |   0% ⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕
  {≡∘⌽⍨⍵∩⎕A,⎕C⎕A}t → 2.5E¯4 | -18% ⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕
      t←(70↑⎕A,⎕C⎕A,',.!?')[?1e6⍴70] ⋄ cmpx'(≡∘⌽⍨∩⍥⎕C∘⎕A)t' '{≡∘⌽⍨⍵∩⎕A,⎕C⎕A}t'
  (≡∘⌽⍨∩⍥⎕C∘⎕A)t   → 3.1E¯3 |   0% ⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕
  {≡∘⌽⍨⍵∩⎕A,⎕C⎕A}t → 2.5E¯3 | -17% ⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕
      t←(70↑⎕A,⎕C⎕A,',.!?')[?1e7⍴70] ⋄ cmpx'(≡∘⌽⍨∩⍥⎕C∘⎕A)t' '{≡∘⌽⍨⍵∩⎕A,⎕C⎕A}t'
 
@Adám Yes, and ignore case
@Richard I doubt it
 
I asume ⎕ is only working on Dyalog?
 
There's nothing inherent about letters to distinguish them from other characters.
@Richard What do you mean?
 
Does ⎕A also work on APL2000 or other dyalects?
 
Not sure about APL2000 because their docs are secret, but it works in APLX (which distinguishes ⎕a).
No other dialects have ⎕C, though.
 
3:23 PM
I have no other suggestions
 
Working on a ⎕UCS-based one.
 
with ⍣?!
 
Nope.
 
{≡∘⌽⍨⍵∩t/⍨∨\'Aa'∊⍨t←⍵[⍋⍵]},
 
{≡∘⌽⍨32|⊢⍤/⍨∘((65∘≤∧≤∘90)∨(97∘≤∧≤∘122))⍨⎕UCS⍵}
 
3:26 PM
:)
 
Whoa:
      t←(70↑⎕A,⎕C⎕A,',.!?')[?1e6⍴70]
  {≡∘⌽⍨⍵∩⎕A,⎕C⎕A}t                                → 2.5E¯3 |   0% ⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕
  {≡∘⌽⍨32|⊢⍤/⍨∘((65∘≤∧≤∘90)∨(97∘≤∧≤∘122))⍨⎕UCS⍵}t → 7.5E¯4 | -70% ⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕
 
@awagga You are sorting the input and checking wether 'Aa' is in it?
 
ovs
{⍵/⍨2|'A[a{'⍸⍵} filters letters as well, but seems to be slower
 
Interestingly, the difference becomes smaller with bigger arguments:
1E5: −71%
1E6: −70%
1E7: −63%
1E8: −58%
@ovs Missing something?
 
@doug I didn't know about the Array Cast mention. Thanks!
 
ovs
3:31 PM
@Adám It doesn't do the palindrome checking, but that would be the same as in all other functions
 
@ovs It has two opening braces and one closing brace.
Oh, one is quoted. My bad.
 
ovs
One is in a string ;)
The next character after z
 
Right.
 
@Adám ISTR you had a bookmarklet for adding an APL char bar to Jupyter notebooks?
 
@awagga Care to explain?
@RomillyCocking Yup: abrudz.github.io/lb/apl
 
3:35 PM
@Richard I'm sorting the array, which uses the numeric values of ⎕UCS implicitly. I find the position of 'a' and assume the following elements will be apart of the alphabet. It's a different way of removing values like ',! 'essentially.
The 'A' is the same principle but for capital letters aswell.
This works because ',!' come before 'a' & 'A', but would fail on ']' for example. But those aren't apart of the test-cases
 
Right, I was about to say it fails on [AA
 
@awagga nice!
 
      t  ← 'a man, a plan, a canal, panama!'
      ∨\'Aa'∊⍨t←t[⍋t]
0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

      ⊂t[⍋t]
┌───────────────────────────────┐
│      !,,,aaaaaaaaaacllmmnnnnpp│
└───────────────────────────────┘
Better explanation than I can offer :)
 
got it now, thanks!
 
@Adám Thanks! happy bunny emoji
 
3:41 PM
@RomillyCocking That'd be ⎕←⎕UCS 128048
 
@Adám 🐰
 
An answer to every need :)
 
That's all then?
 
There is always more to uncover, but maybe for now ;)
 
no more ideas...
 
3:49 PM
Thank you all then. See you next week for Roll The Dice.
Also, I've been overly occupied this week, but I'll make last week's video soon.
 
4:22 PM
I've created a Jupyter notebook with a quick and dirty explanation of the APL version of my markdown converter rareschool.com/assets/html/convert-with-apl.html
If it looks OK I'll update the blog post to reference it.
 
4:55 PM
@RomillyCocking Maybe use a spell-checker? "whihc", "varaible"
@RomillyCocking Why not ≠⍀?
      t ⋄ ≠⍀t
0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1
0 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 0
 
 
5 hours later…
10:24 PM
Here's what I had {(⌽≡⊢)(⊢{⍵/⍺}∊∘(819⌶⎕A))819⌶⍵}
 

« first day (1934 days earlier)      last day (143 days later) »