« first day (1694 days earlier)      last day (1186 days later) » 

05:02
@Adám could there be a way to exit dfns that the local variables aren't cleaned up?
you want to define globals in a dfn?
no, I find a bug in link could be cause by that
I did a tracing and find dfns doesn't treat local variables very differently, and you can access them from outside if the function is executing.
I guess dfns just does some simple house keeping and there could be a flaw in the logic.
sure, worth an ask.
05:20
Hmm, I suppose error-guard should not be placed at the last line of dfns body?
 
3 hours later…
08:01
I have a question for people fluent with array programming languages, so I have a very strightforward problem that I need to fix. In ecommerce platform (something like Amazon) we got some duplicate product offers, it is illegal acording to platform rules.
I can export all offers to CSV file, and than I have columns, productID, EAN, SKU, catID, UnitsSold. I want to remove duplicated offers, so first I sort them by units sold so I won't remove best selling offers. I create data structure in Golang (struct) then I do double loop so I extract unique elements etc
Then I sort it by accounts and export 4 files with id of offers to remove
it took me around 150 lines of Golang, and I already did 50% of this with 4 lines of J
So my question is, is this very strightforward problem something that you can sit down and just write from your head if you are fluent with APL ?
Obviously there are some thinking involved etc. But this it is 1) remove quotes for all elements 2) sort them by column units sold 3) split them by account into 4 tables 4) find uniques from each table on columns EAN and Category ID 5) extract only offer IDs column 6) save thoose to 4 seperate files
For me it took more time to write thoose 4 lines in J and solve 50% than to write 150 lines of Golang and solve it completely
but I am extremely noob and everything still takes a long time for me. I am maybe 5% as productive in J as in Golang right now
I think it should be feasible to write a 100% solution in J
yes it is obvious
it is very array oriented problem, my go solution is very verbose
J has very good primitives and APL same for this type of problems
I just wonder If you know what you need to do, how easy it is to type it from your head, would it really be as fast as I think
or do you sit down at REPL for a long time and experiment and read verbs desriptions all the time
Still, I have never experienced processing very large datasets, so I would start with small example that can fitting into the screen, and start experiment it with the REPL
Then make the solution scalable to the suitable problem size
Sure, I did the same, I just got stuck all the time and I wonder how it would look like for someone good in APL
I would literally like to see how someone writes this on screen
whats the process you know
so, Dyalog has system function for processing CSV files, so the 1) can be solved fairly easy, 2) is just a grade 3) should be easy to be done even interactively 4) unique mask 5) select, which is a primitive 6) do some I/O, and that should be done
08:16
yes, exactly. APL solution maps to a natural language description and I wonder if someone could just type it out very quick
then maybe tweak for 10 minutes so it looks like it should cause first time is usually somewhat wrong
it is ok to try and get errors, that's the point of having an interactive REPL
in golang I also first edited .csv file with text editor to a very small problem that fits on screen, that used tons of print statements to debug and see each step
then I remove those prints in the end
08:39
@alwalo which part do you spend time most when came up with a solution in J? picking appropriate primitives? figuring out rank? fixing errors?
@LdBeth There shouldn't be, but that said, we've found bugs in the dfns implementation, so if you can repro such a situation, we're very interested.
@LdBeth It won't have an effect.
@alwalo Unlike APL, the rank concept in J could be considered more confusing. And the tacit programming style promoted in J isn't easy if you are not familiar with the lexical rules, binding strength, trains stuff.
@Adám I think I found one, it is related to calling with the error-guard, I'm working to minimize it.
@LdBeth 3) Key.
@alwalo Yeah, it sounds like a rather trivial one-liner.
Hmm, it is not even related to error guard.
09:05
@Adám I think I found exactly where goes wrong, how should I report it?
@LdBeth Email support@ and make sure to specify your exact Dyalog version (including build number, e.g. 18.0.12345).
I will reply some time later, sorry
@Prithubiswas Hi there, interested in APL?
@tjjfvi Want to know about APL?
09:37
@alwalo do you have a sample csv to try with?
 
2 hours later…
11:28
 ExecuteEach←{
     BBA←'BBA' ⍝ Test
     {0::0 ⋄ r←⍎⍵ ⋄ ~(⊃⎕NC'r')∊3 4}⍵:1 ⍝ test ⍵ to be an functional expression
     ⊂∇'{×⍵}1' ⍝ Enclose is needed to prevent tail recursion.
 }
run with something like ExecuteEach '[', and the local variables will leak :P
11:39
I find ever the error guard isn't needed to reproduce it
12:36
@LdBeth So you say that after running this, you have BBA defined globally?
12:47
@Adám Hmm, it seem has been fixed in versions newer than my current one
@LdBeth What is your current interpreter version?
18.0.38756, macOS
Hm, I have 18.0.40639, so a bit newer.
The one I just downloaded is 18.0.40684
and indeed it has been fixed
13:02
@rak1507 This is the file that I work it (there is no any private data here)
everything is inside quotes, I would first remove them
duplicates are for a given account_name, (sku is the same and category is the same) or (ean is the same and category is the same) or (sku is the same ean is the same and category is the same)
and output of this program should be 4 files, one for -Kylo-, one for electricmax, one for progadzety, one for kylopremium. They should only contain string of auction_id that need to be removed for each account
for example progadzety.txt, content:
5906749154750, 5860900000006, 5901130068364, 090159318453 ... and so on
so one of the first step would be to split data into 4 seperate tables on "account_name" column
cool thanks will look at it later
load 'tables/dsv'
path=. NB. filepath

csv=. (rplc&('"';'')) each }. ';' readdsv <path
acc_names=. 0{"1 csv
sel=. (#&csv) @ (=&acc_names) @ <

kylo =. sel '-Kylo-'         [ prog =. sel 'progadzety'
elec =. sel 'electricmax'    [ prem =. sel 'kylopremium'
this is some starter for this
@LdBeth you asked me what I find most difficult, chosing right verbs and figuring out ranks and nesting, depths etc
13:33
data←1↓(⎕CSV ⍠ 'Separator' ';')'foo.csv'
idx←⍒,↑data[;5]
data←data[idx;] ⍝ That finishes sort.
(ikylo iprogadzety ikylopremium ielectricmax)←{⊂⍵}⌸data[;1]
kylo←data[;ikylo]
electricmax←data[;ielectricmax]
⍝ ...
idx←⍒⊃⌽⌷⎕VFI,↑data[;5] for it is text
 
2 hours later…
15:13
prnt.sc/1sb8iug Is it just me?
@awagga no.
Alright, thanks
@awagga Should be up now.
Awesome :)
Does TryAPL.org have any form of ratelimiting? Currently using it for http requests but I don't want that to cause issues
No, it doesn't have throttling.
 
1 hour later…
16:27
@Adám is it still possible to hand in the cataloguing trial run stuff?
16:43
@11Kilobytes Yes, I'm still waiting :-)
17:24
@LdBeth Hm, I am not sure what does it do is this whole program ? I get some errors when I run it
INDEX ERROR and WS FULL
but I have not used dylog before this
 
6 hours later…
23:14
@Adám Lol, are you, like, a missionary?
A Dyalog's Witness? :P

« first day (1694 days earlier)      last day (1186 days later) »