Search found 143 matches

by Adam|Dyalog
Mon Jul 29, 2024 8:05 am
Forum: Language
Topic: Combining Take and Drop on a matrix for efficiency?
Replies: 15
Views: 35831

Re: Combining Take and Drop on a matrix for efficiency?

↑ extended to be Outfix can do more than such idioms would allow. For example, (⊂4 ¯1)↑'Racecar' would give 'Racer', but more importantly, the extension of ↓ to Infix would allow ⌺ to work on small arguments: {∊⍕¨'('⍺'↓'⍵' → '(⍺↓⍵)')'}⌺5⍳5 (2↓0 0 1 2 3 → 1 2 3) (1↓0 1 2 3 4 → 1 2 3 4) (0↓1 2 3 4 5 → ...
by Adam|Dyalog
Sun Jul 28, 2024 7:04 am
Forum: Language
Topic: Combining Take and Drop on a matrix for efficiency?
Replies: 15
Views: 35831

Re: Combining Take and Drop on a matrix for efficiency?

I've long been contemplating extending Take and Drop to also be Outfix and Infix functions (what you're computing here is an infix). It would work by allowing every scalar in the traditional left argument to also be a two-element vector of a non-negative and non-positive number. This way, we can ...
by Adam|Dyalog
Sun Jul 14, 2024 9:02 am
Forum: APL Chat
Topic: Fast Fourier transform in APL
Replies: 4
Views: 14214

Re: Fast Fourier transform in APL

You can also use the fastest fourier transformation in the world, available through a library: https://github.com/dyalog/math?tab=read ... le#fourier
by Adam|Dyalog
Sun Jun 30, 2024 8:21 am
Forum: Language
Topic: Problem Defining 'Program Function Key'
Replies: 3
Views: 13481

Re: Problem Defining 'Program Function Key'

Does your keyboard have an Fn key? If so, then it might also have Fn-lock functionalty, often accesed via Fn+Esc or a dedicated key. It is usually labelled "FnLock" or "ⒻLock" or similar. When active, it swaps meaning so that plain F-keys are shortcut keys to applications, multimedia, and other f ...
by Adam|Dyalog
Sun Jun 09, 2024 8:42 am
Forum: APL Chat
Topic: ⎕NA domain Error
Replies: 3
Views: 13246

Re: ⎕NA domain Error

ray wrote:I was surprised by this Domain Error, but got round it easily, so it is not an actual problem for me.
You don't detail how you go around it, but I imagine that this will work:
'ps'#.⎕NA'Winmm.dll|mciSendStringW <0t >0t i U'
by Adam|Dyalog
Thu May 02, 2024 11:18 am
Forum: APL Chat
Topic: Help with complex numbers wanted
Replies: 7
Views: 26308

Re: Help with complex numbers wanted

Maybe I'm missing something here, but for this specific case (doubling the imaginary part), the following would seem sufficient and fairly efficient: ⎕←vec←0J220+⍳5 1J220 2J220 3J220 4J220 5J220 (+⍨-9∘○) vec 1J440 2J440 3J440 4J440 5J440 {⍵+⍵-9○⍵} vec ⍝ if you don't want tacit 1J440 2J440 3J440 4J440 ...
by Adam|Dyalog
Sun Apr 21, 2024 2:52 pm
Forum: APL Chat
Topic: Idea: Allow Next/Previous shortcuts within the Find dialog
Replies: 6
Views: 21331

Re: Idea: Allow Next/Previous shortcuts within the Find dial

I also frequently search the session.

The current Find dialog is entirely a subset of the Find/Replace dialog which can be brought up everywhere with RP. Any improvements done to the Finddialog should happen to the Find/Replace dialog too.
by Adam|Dyalog
Sun Apr 21, 2024 2:11 pm
Forum: APL Chat
Topic: Idea: Allow Next/Previous shortcuts within the Find dialog
Replies: 6
Views: 21331

Re: Idea: Allow Next/Previous shortcuts within the Find dial

Not really, but FT does the trick if you don't have additional subwindows like TreeView open.

Since the current Find dialog is entirely a subset of the Find/Replace dialog, I propose repurposing SC to jump to/from the QuickSearch and removing the Find dialog altogether.
by Adam|Dyalog
Mon Apr 15, 2024 6:23 am
Forum: Language
Topic: Calling all Dfnistas!
Replies: 6
Views: 21523

Re: Calling all Dfnistas!

∇∇ is especially useful when normalising or iterating operands, most commonly with array operands, but it can also happen with function operands: The right operand of Rank (⍤) is normalised to ⌽3⍴⌽ so one could imagine an implementation of Rank or a similar operator containing the guard 2≥≢⍵⍵:⍺(⍺⍺∇∇( ...
by Adam|Dyalog
Mon Mar 11, 2024 1:06 pm
Forum: APL Chat
Topic: Optional output for debugging
Replies: 6
Views: 22139

Re: Optional output for debugging

If you use ⍞← instead of ⎕ then you can simply compress the output away: x←42 debug←0 ⍞←debug/'Value x is',x,⎕UCS 10 debug←1 ⍞←debug/'Value x is',x,⎕UCS 10 If you do this often, then consider defining a helper function: Val←{debug/'Value ',⍵,', is',(⍎⍵),⎕UCS 10} debug←0 ⍞←Val'x' debug←1 ⍞←Val'x' Valu ...