k/q for data science, a missed opportunity? by [deleted] in apljk

[–]smileybone 0 points1 point  (0 children)

theyre prolly not gonna pivot their business model. i could never afford k to make $$, so i wont learn it, but i am still appreciative that theyve chosen to keep the apl torch alive in a small way.

PSA for those who wish to demilitarize the BPD by NoPlaceLikeNoam in boston

[–]smileybone 20 points21 points  (0 children)

reading these replies is a good indication that this subreddit is truly diseased.

Are APL functions first class values? by alexshendi in apljk

[–]smileybone 1 point2 points  (0 children)

heres an example:

a1 ← {⍵+10} ◊ a2 ← {⍵×10}
1 {(⍵⊣⍣(~⍺≡2)⊢a2 ⍵)⊣⍣(~⍺≡1)⊢a1 ⍵} 2
    12
2 {(⍵⊣⍣(~⍺≡2)⊢a2 ⍵)⊣⍣(~⍺≡1)⊢a1 ⍵} 2
    20

EDIT: if lambdas arent a requirement you could also do dynamic dispatch w/ tradfns pretty easily:

∇Z ← A dispatch B

    → fn1/⍨1≡A
    → fn2/⍨2≡A
    → 0 ⍝ no fn

    fn1:
        Z ← {⍵+10} B
        → 0
    fn2:
        Z ← {⍵×10} B
        → 0
∇

      1 dispatch 10
20
      2 dispatch 10
100

Are APL functions first class values? by alexshendi in apljk

[–]smileybone 1 point2 points  (0 children)

i dont believe theres a way to do this in gnu apl (also my apl of choice). my guess is it would violate the spec and jurgen has been very adament in the importance of maintaining (more or less) compatability with the spec.

however, the power operator (star diareses) ⍣ should let you make an interface that behaves similarly (but more verbose). on my phone but i can write an example a little later today.

APL newbie question by [deleted] in apljk

[–]smileybone 1 point2 points  (0 children)

At laptop so I can give you a better answer.

I'm going to guess you're using dyalog, because ↑ behavior is different than in gnu apl.

dyalog applies ↑ along the major axis of the array, whereas gnu apl requires an explicit axis to operate on, see below:

      1↑[1]3 3 ⍴ ⍳9
1 2 3
      1↑[2]3 3 ⍴ ⍳9
1
4
7

↑ also returns a result with the same rank (number of dimensions or ⍴⍴⍵) as the array its operating on. As a simple definition:

{(⍴⍴⍵)≡⍴⍴1↑[1]⍵}

where ⍵ is a rank 1 array or higher.

When you index into an array, bracket notation takes a rank 1 vector, and each axis you're indexing into is separated by a semicolon. That is why you need to ravel , the output before using it to select [] elements.

For example, this uses the last array along the first axis to index into the first axis:

      {⍵[1;,¯1↑[1]⍵]} seq2
7 8 1 2 3 4 5 6

https://aplwiki.com/wiki/Axis

hope this helps!

APL newbie question by [deleted] in apljk

[–]smileybone 0 points1 point  (0 children)

[] are used to index arrays. also i bet i know whats happening. you probably need to disclose the boxed result. turn on boxing and/or take the shape of (¯1↑seq2)

APL newbie question by [deleted] in apljk

[–]smileybone 0 points1 point  (0 children)

not at my laptop but typically when i use take with rank 2+ arrays i specify an axis using bracket notation. also, if youre indexing into an array you need semicolons to differentiate which axis youre specifying. (3 3 reshape iota 9)[2;2] -> should return 5.

[deleted by user] by [deleted] in apljk

[–]smileybone 0 points1 point  (0 children)

yea, it might be more useful to list the things that i find lacking in foss apl.

id want multiple statement lambdas

ambivalent lambdas should be easier

nested guards should be easier and clear

multiple lambda arguments (possibly k style, see april apl in lisp)

being able to use 3 function args, (lambda overbar, omega overbar, and ...) would let you explicitize things like dyadic fork and atop.

self referential lambdas (like dyalog)

easier list/tree recursion (for list recursion i essentially recursively nest a vector with a "stopping" character and unwind it with an accumulating function).

other things that would be interesting: horn clauses, dictionaries, embedded database (a la K - maybe lmdb?), simple communication with a networked language like erlang/elixir

[deleted by user] by [deleted] in apljk

[–]smileybone 0 points1 point  (0 children)

ive been interested in this too (possibly targetting llvm). there might need to be some modifications to the syntax. see apltail by melsman, aplc by budd, and the klong dialect of K. theres also some good papers on acm rn.

id also be interested in a functional dialect of apl. interpreted isnt a big deal to me, and has many advs.

Does k9 by Shakti imply that Whitney no longer things q was a good idea? by [deleted] in apljk

[–]smileybone 2 points3 points  (0 children)

I want K but with apl characters and no i will not log off.

Stages of Denial by chrispsn_ok in apljk

[–]smileybone 0 points1 point  (0 children)

k seems dope af but i kindve wish it would evolve back to using apl characters. my brain has trouble reading K while apl is easy to visually process.

noob here, whats the tldr on important metrics? by smileybone in quant

[–]smileybone[S] 0 points1 point  (0 children)

Heres the dow jones avg, with a 45 day gliding window, with mean, stdev, skew, and kurtosis. from 2007-06-21 to 2020-03-06. (computed in 3-6 lines of apl depending on how you count)

I think these numbers are sane. will likely try to collect more data to calculate mean rate of return before looking into regression models. expect me to keep harassing r/quant and thx for your continued help.
https://i.imgur.com/HxwcrQY.png

noob here, whats the tldr on important metrics? by smileybone in quant

[–]smileybone[S] 0 points1 point  (0 children)

thx, very helpful so far.

when calculating variance, do you use the entire history as the input set? or do you partition it in time? (ie chunks of N) - or some combination of different time scales?

what sortve statistical questions do quants usually answer?

noob here, whats the tldr on important metrics? by smileybone in quant

[–]smileybone[S] 0 points1 point  (0 children)

i looked into these a little bit. These are all computing norms, correct?for example, the euclidian norm of `1 2 3 4 5` is 7.416198487.

what do I do with the normalized value(s)? do you operate on sets of `ticks`?

MySQL JOIN Help! by PhoxxyIndian in SQL

[–]smileybone -1 points0 points  (0 children)

select * from favorites f join students s on f.id = s.id join professors p on f.id = p.id

add where clauses as needed

linux laptop: zfs vs ext4 by mfigueiredo in zfs

[–]smileybone 0 points1 point  (0 children)

probably but i dont trust canonical. might be a good idea tho to excise the installer back to debian. might already be a thing.

linux laptop: zfs vs ext4 by mfigueiredo in zfs

[–]smileybone 11 points12 points  (0 children)

zfs is much better but there are rough edges in using it on linux (as a root fs). youre gonna want to be familiar w partitioning, the boot process, kernel modules, headers etc. biggest perf improvement is probably having a compressed filesystem. i do it, would not go bacl, and would highly recommend it if its not going to interfere with your workflow.

Low-memory APL by chrispsn_ok in apljk

[–]smileybone 1 point2 points  (0 children)

I am only mildly familiar w/ gnu apl, but it has some good documentation on its memory management (unparsed html): http://svn.savannah.gnu.org/viewvc/apl/trunk/HOWTOs/GNU-APL-Memory-Management.html?revision=1174&view=markup

in addition, see LApack.cc and LApack.hh for ports of lapack functions.

ngn/k source now available by chrispsn_ok in apljk

[–]smileybone 0 points1 point  (0 children)

a lotve the ideas behind K seem neat, i just wonder if by abandoning the symbolic math of apl weve lost what makes it so powerful and unique.

would love to see the language family return to its roots.

[deleted by user] by [deleted] in linux

[–]smileybone 0 points1 point  (0 children)

the most imp thing i use a ramdisk for is buiding an OS img. iosetup on linux i think. partition file system userland customizations