Another easier solution is:
#@gui :Internal Expression-XY=choice{0,"func_1(v)","func_1(a)+func_2(b)","func_1(func_b(v)+c?v)"}
Another easier solution is:
#@gui :Internal Expression-XY=choice{0,"func_1(v)","func_1(a)+func_2(b)","func_1(func_b(v)+c?v)"}
Is there a way to sort images by dimensions? I am attempting to find the common divisors for n-set of numbers.
Here’s my code so far:
rep_find_divisors_numbers:
$=pos
if !$# error ("\$\#">0)==F fi
n=0
($*) int. abs. num_of_repeat:=iv#-1?$#:1 rm.
repeat $num_of_repeat {
number:=int(abs(${pos{$>+1}}))
if !$number continue fi
n+=1
(0)
eval "
const n=$number;
i=0;
for(i=1,sqr(i)<n,++i,
n%i==0?da_push(#-1,i);
);
i-int(n/i)==1?--i;
while(i>=1,
n%i==0?da_push(#-1,n/i);
--i;
);
resize(#-1,1,da_size(#-1),1,1,0);
"
}
if $n==1 u {crop(#-1)} rm.
elif $n>1
l[-$n--1] {
}
else
u 0
fi
Short answer, yes, I believe so, but not time to think about it and explain. Have fun investigating. 
I’m okay with brief ideas. Any other solution to my goal?
Could you elaborate what you want to do exactly? I.e., input → likely steps → output
Okay, here’s what I want to do.
Step #1 - Find the common divisors of each numbers. (This is already done.)
256 => 1,2,4,8,16,32,64,128,256
100 => 1,2,4,5,10,20,25,50,100
136 => 1,2,4,8,17,34,68,136
Step #2 - Find all the numbers that exist in all set of common divisors
set (all numbers that exist in all set) => 1,2,4
Quick search yields Common Divisors of Two Numbers - GeeksforGeeks.
I read that, but the solution outputs just 1 number. So, I went with a more convoluted approach.
Sorry, you are right, it stops at how many are between the two numbers and not what they are among multiple numbers.
At the bottom of the page, there are author credits and a line:
Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.
Maybe you could contact this person for elaboration. If this person has an idea, they could update the article.
I think I would have better luck finding how to convert it to dynamic array solution, but my solution seem acceptable too. A slight slower, but it’ll work.
Yeah, I feel like there is a trick somewhere. I haven’t tried your method yet. It is way too late into the night for that. I should really sleep. Too little these days.
I’ll just post this test code, but I find it too long and I know it can be shorted. But, for the purpose of finding inputs where resize isn’t needed to fit square of size n, it’s fine by me.
$ gmic rep_find_divisors_numbers 50,500,25,100 echo ${}
Output: 1,5,25
rep_find_divisors_numbers:
$=pos
if !$# error ("\$\#">0)==F fi
n=0
($*)
(0)
eval[-2] >"x?(
nv=int(abs(i));
found=0;
repeat(da_size(#-1),p,
if(nv==i[#-1,p],
found=1;
break();
);
);
if(!found,da_push(#-1,nv););
):(
da_push(#-1,int(abs(i)));
);
end(resize(#-1,1,da_size(#-1),1,1,0););"
list:=crop(#-1) rm[-2,-1]
repeat narg($list) {
number:=([$list])[$>]
if !$number continue fi
n+=1
(0)
eval "
const n=$number;
i=0;
for(i=1,sqr(i)<n,++i,
n%i==0?da_push(#-1,i);
);
i-int(n/i)==1?--i;
while(i>=1,
n%i==0?da_push(#-1,n/i);
--i;
);
da_remove(#-1,0);
resize(#-1,1,da_size(#-1),1,1,0);
"
}
if $n==1 u {i#-1} rm.
elif $n>1
l[-$n--1] {
use_zero_mode=0
eval "
list_length=vector(#$!,0);
repeat($!,p,
list_length[p]=h#p;
);
list_length;"
list=[${}]
min_val:=min(${})
min_pos:=find($list,$min_val,0,1)
move[$min_pos] $n
repeat $n-1 {
(0)
eval "
const max_val=iM#-2;
for(n=0,n<h#-3,++n,
if(i(#-3,1,n)>max_val,break(););
);
n+1;"
eval[-2] >"
begin(
act_resize=0;
vals=crop(#-3,0,0,0,0,1,"${}",1,1);
);
if(find(vals,i,0,1)!=-1,
da_push(#-1,i);
act_resize=1;
);
end(
if(act_resize,resize(#-1,1,da_size(#-1),1,1,0););
);"
if i#-1 rm[-3,-2]
else break fi
}
if i#-1 u 1,{crop(#-1)}
else u 1 fi
rm
}
else
u 0
fi
See example of usage here:
Maybe sort_list can help ?
I am figuring out what to do with dct, trying to understand it. I found these diagrams (below).
Observations:
0
Questions:


Can’t help much there, but if Joan was here, she could answer this. She worked with dct.
Joan tears space-time.
I want to mend it. 
If it is what I suspect, I want to do the following: for each Xij, do something with Xij based on Ek.
For example, increase values about (i.e., more positive or negative around) Ek avg instead of about 0 by:
I am not good at looping or using the math interpreter. What is an effective way to do #1?
To do that, I must be afraid to tell you that you need to use a string builder akin to rep_diffusion_limited_aggregation, and said string will be used as code for math evaluator. There’s another way to do this and to avoid that, and that is using for loop, and then adding values using n+=v, then divide by the length of diagonal.
Which one do you think will be easier? If speed is what matters, string builder will be the fastest approach. If ease of coding is what matters, the for loop is the best approach.
What you just said went over my head. At the moment, I am aiming for comprehension, so effectiveness and efficiency are not necessary. I am also not in a good head space, due to insomnia and other issues, to do anything great. I need people’s help.
I just noticed a pattern k = i+j that could help us determine which indexes to collect and process. That would work for the top triangle of the image or block. For the bottom, we could flip it over the xy axis, do the same thing and flip it back.
Edit: I will ping @garagecoder who has historically helped me through this kind of stuff.
If you’re still working on it next week, I may be of assistance then 
For now, I can’t get close to doing anything with g’mic sadly!
Here’s your solution:
#@cli rep_dct_sample:
#@cli : This is a code sample for afre at discuss.pixls.us
rep_dct_sample:
(0,7,4,5,3;\
4,0,10,8,8;\
0,6,9,7,9;\
2,3,8,7,8;\
7,6,3,1,6)
eval "
const dct_size=5;
const max_dct_ind=dct_size-1;
const ek_arr_size=(max_dct_ind<<1)-1;
ek_arr=vector(#ek_arr_size,0);
for(p=1,p<dct_size,++p,
ind=p-1;
length=p+1;
px=0;
py=p;
repeat(length,
ek_arr[ind]+=j(#-1,px,py,0);
++px;
--py;
);
ek_arr[ind]/=length;
);
if(ek_arr_size>1,
--p;
for(q=1,q<dct_size,++q,
++ind;
--length;
px=q;
py=p;
repeat(length,
ek_arr[ind]+=j(#-1,px,py,0);
++px;
--py;
);
ek_arr[ind]/=length;
);
);
print(ek_arr);"
Tip: You can also use:
"
const ek_arr_size=(max_dct_ind<<1)-1;
"
For proof of result:
ek_arr = [5.5,1.3333333333333333,5.75,6,7.25,6.333333333333333,4.5]
ek[0] = avg(7,4) = 5.5
ek[1] = avg(0,0,4) = 1.3333....
ek[2] = avg(2,6,10,5) = 5.75
ek[3] = avg(7,3,9,8,3) = 6
ek[4] = avg(6,8,7,8) = 7.25
...