Re: [Jprogramming] Partitions

2017-10-19 Thread Linda Alvord
Here is a different comb verb and I removed 1+ from he end of par3.   load 'stats'   comb 4 : 0 k=. i.>:d=. y-x z=. (d$ ,&.>/\. >:&.> z end. ; z par =: 2 (}. i.)&.>/\"1 0: ,. (comb&.<:) ,. ] comb2=: 13 :'(x=+/"1 #:i.2^y) ([:|.[:I.#) #:i.2^y' par2 =: 2 (}. i.)&.>/\"1 0: ,. (comb2&.<:) ,. ]

Re: [Jprogramming] Partitions

2017-10-19 Thread 'Skip Cave' via Programming
Mike, I wasn't very thorough in my definition of the original problem. I thought that the example I gave was enough to clarify the requirements, but looking back, more definition would have been good. The original problem I posted was to develop a dyadic verb that would take y objects and show al

Re: [Jprogramming] Trains: past, present and ...

2017-10-19 Thread Raul Miller
When I try to execute your script, I get: |value error: a2 | (a0=.`'')(a1=.(@:[)((<'&')`)(`:6))(a2=.(`(<(":0);_))(`:6))((`'')(((@:[)(&`))(`:6)))((`_)(`:6))av=.((ar'a0')`)(`(ar'a1'))(`( ar'a2'))(`:6) |[-3] /users/rauldmiller/j64-805-user/temp/2.ijs 9!:14'' j805/j64/darwin/beta-9/commercial

[Jprogramming] Trains: past, present and ...

2017-10-19 Thread Jose Mario Quintana
There were many adverb and conjunction producing trains during a period which Henry has referred as the Golden Age. Some were available as early as 1993 [0] and several more afterward [1]. A few of those adverb producing trains (all of them bidents) survived [2] (using nv to denote noun or verb),

Re: [Jprogramming] Partitions

2017-10-19 Thread 'Mike Day' via Programming
Skip,  in your actual Quora Problem,  why not include other triads, such as 1 1 24,  2 3 4 etc;   or, otherwise,  why include both 2 4 3 and 4 2 3 ? Anyway,  this is (quite) short and brutish but not too nasty to solve your Quora problem for quite small numbers and numbers of factors:    |: 24

Re: [Jprogramming] Partitions

2017-10-19 Thread Lippu Esa
Very nice! Esa -Original Message- From: Programming [mailto:programming-boun...@forums.jsoftware.com] On Behalf Of Raul Miller Sent: Friday, October 20, 2017 12:24 AM To: Programming forum Subject: Re: [Jprogramming] Partitions Here's a faster way of computing bell numbers: Bell=:

Re: [Jprogramming] Partitions

2017-10-19 Thread Raul Miller
Here's a faster way of computing bell numbers: Bell=: {:@(+/\@(,~{:)@]^:[ 1:) Bell 8 21147 timespacex 'Bell 8' 6e_6 2048 Thanks, -- Raul On Thu, Oct 19, 2017 at 5:11 PM, Lippu Esa wrote: > I used par2 to generate bell numbers ( > https://en.wikipedia.org/wiki/Bell_number ) from 1 u

Re: [Jprogramming] Partitions

2017-10-19 Thread Lippu Esa
I used par2 to generate bell numbers ( https://en.wikipedia.org/wiki/Bell_number ) from 1 up : bell=.+/@(>:@i.#@par2"0]) bell"0 >:i.7 1 2 5 15 52 203 877 but it becomes slow very quickly ts 'bell 8' 17.82442772 2509478016 But of course there are formulas for that. Esa -Original Messa

Re: [Jprogramming] load'plot'

2017-10-19 Thread 'Bo Jacoby' via Programming
Thank yos. Raul's suggestion did not work for me, but Louis' suggestion:did work.    install'all' Updating server catalog... Must run from jconsole    load'pacman'    'install' jpkg 'search' jpkg 'plot'    load'plot' /Bo. Den 22:24 torsdag den 19. oktober 2017 skrev Louis de Forcrand :

Re: [Jprogramming] Partitions

2017-10-19 Thread Lippu Esa
Cool. If we relax the requirement that the order of the items is preserved we get more solutions (my clumsy solution): par2=: 4 : 0 a=.(y#x) #: i. x^y sort ~.((x=#@~."1 a)#a) mailto:programming-boun...@forums.jsoftware.com] On Behalf Of Henry Rich Sent: Thursday, October 19, 2017 5:20 PM To: pr

Re: [Jprogramming] Partitions

2017-10-19 Thread Erling Hellenäs
Hi all! The idea here is to take all combinations of the possible number of elements in a bucket and the number of buckets, and then select the bucket combinations with the correct number of elements.    par=: 4 : '(1,.2o)#o=.((x$v)#:i.v^x){1+i.v=.1+y-x)<;.1[1+i.y'    2 par 3 ┌───┬───┐ │1  │

Re: [Jprogramming] load'plot'

2017-10-19 Thread Louis de Forcrand
Otherwise if you just want the plot package I believe the following works: load ‘pacman’ ‘install’ jpkg ‘search’ jpkg ‘plot’ You could make sure that ‘search’ jpkg ‘plot’ brings up only one result. Louis > On 19 Oct 2017, at 20:02, Raul Miller wrote: > > I think I would try: > > install'al

Re: [Jprogramming] Partitions

2017-10-19 Thread Erling Hellenäs
Yes. Sorry. Thanks. /Erling On 2017-10-19 19:47, Raul Miller wrote: Most people will not have a C:/Users/erling/ directory. Presumably, though, you are referring to x!y which counts x combinations of y. http://www.jsoftware.com/help/dictionary/d410.htm That's not quite what Skip was asking fo

Re: [Jprogramming] load'plot'

2017-10-19 Thread Raul Miller
I think I would try: install'all' load'plot' Thanks, -- Raul On Thu, Oct 19, 2017 at 2:01 PM, 'Bo Jacoby' via Programming wrote: > What to do?Thanks. Bo. >load 'plot'not found: > c:/users/admin/downloads/j805_win32/j805/addons/graphics/plot/plot.ijs|file > name error: script| 0!

[Jprogramming] load'plot'

2017-10-19 Thread 'Bo Jacoby' via Programming
What to do?Thanks. Bo.     load 'plot'not found: c:/users/admin/downloads/j805_win32/j805/addons/graphics/plot/plot.ijs|file name error: script| 0!:0 y[4!:55<'y' JVERSIONEngine: j805/j32/windowsRelease-b: commercial/2017-04-20T13:26:01Library: 8.05.14Qt IDE: 1.5.4/5.6.2Platform: Win 32Install

Re: [Jprogramming] Partitions

2017-10-19 Thread Raul Miller
Most people will not have a C:/Users/erling/ directory. Presumably, though, you are referring to x!y which counts x combinations of y. http://www.jsoftware.com/help/dictionary/d410.htm That's not quite what Skip was asking for, but it can be relevant in an implementation. Thanks, -- Raul On

Re: [Jprogramming] Partitions

2017-10-19 Thread Erling Hellenäs
file:///C:/Users/erling/j64-806/addons/docs/help/dictionary/d410.htm /Erling On 2017-10-19 16:31, Linda Alvord wrote: We need your definition of comb. Linda Sent from AOL Mobile Mail On Thursday, October 19, 2017 Henry Rich wrote: par =: 2 (}. i.)&.>/\"1 0: ,. (comb&.<:) ,. ] Henry Rich On

Re: [Jprogramming] Partitions

2017-10-19 Thread Raul Miller
To define comb: require'stats' Thanks, -- Raul On Thu, Oct 19, 2017 at 10:31 AM, Linda Alvord wrote: > We need your definition of comb. > > Linda > > Sent from AOL Mobile Mail > > On Thursday, October 19, 2017 Henry Rich wrote: > par =: 2 (}. i.)&.>/\"1 0: ,. (comb&.<:) ,. ] Henry Rich

Re: [Jprogramming] Partitions

2017-10-19 Thread Raul Miller
Or, for more variations on comb: https://rosettacode.org/wiki/Combinations#J Thanks, -- Raul On Thu, Oct 19, 2017 at 11:51 AM, Raul Miller wrote: > To define comb: > >require'stats' > > Thanks, > > -- > Raul > > > On Thu, Oct 19, 2017 at 10:31 AM, Linda Alvord > wrote: >> We need your

Re: [Jprogramming] Partitions

2017-10-19 Thread 'Skip Cave' via Programming
​​ Henry, Nice! I was trying to solve a Quora problem that asks: What is total number of positive integer solutions for (x, y, z) such that xyz=24? I wanted to generalize the problem. So first w

Re: [Jprogramming] Partitions

2017-10-19 Thread Linda Alvord
We need your definition of comb. Linda Sent from AOL Mobile Mail On Thursday, October 19, 2017 Henry Rich wrote: par =: 2 (}. i.)&.>/\"1 0: ,. (comb&.<:) ,. ] Henry Rich On 10/19/2017 9:53 AM, 'Skip Cave' via Programming wrote: > Design a dyadic function 'par' that will partition y items in

Re: [Jprogramming] Partitions

2017-10-19 Thread Henry Rich
par =: 2 (}. i.)&.>/\"1 0: ,. (comb&.<:) ,. ] Henry Rich On 10/19/2017 9:53 AM, 'Skip Cave' via Programming wrote: Design a dyadic function 'par' that will partition y items into x partitions. For example: 3 par 5 ┌─┬─┬─┐ │0│1│2 3 4│ ├─┼─┼─┤ │0│1 2 │

[Jprogramming] Partitions

2017-10-19 Thread 'Skip Cave' via Programming
Design a dyadic function 'par' that will partition y items into x partitions. For example: 3 par 5 ┌─┬─┬─┐ │0│1│2 3 4│ ├─┼─┼─┤ │0│1 2 │3 4 │ ├─┼─┼─┤ │0│1 2 3│4│ ├─┼─┼─┤ │0 1 │2│3 4 │ ├─┼─┼─┤ │0 1 │2

Re: [Jprogramming] unicode

2017-10-19 Thread David Lambert
I had thought this was the end of story!    # a. 256    233 188 160 { a. 鼠 "If y is bytes, each byte is extended with high-order zeros to unicode precision." must be what happened to    u: 233 188 160 é¼ Thank you all. On 10/19/2017 08:00 AM, programming-requ...@forums.jsoftware.com wro

Re: [Jprogramming] unicode

2017-10-19 Thread Linda Alvord
J for kindergarten. b=:'♡♤♧◇' ]u32=:7 7$9&u: b ♡♤♧◇♡♤♧ ◇♡♤♧◇♡♤ ♧◇♡♤♧◇♡ ♤♧◇♡♤♧◇ ♡♤♧◇♡♤♧ ◇♡♤♧◇♡♤ ♧◇♡♤♧◇ Linda Sent from AOL Mobile Mail On Thursday, October 19, 2017 Linda Alvord wrote: It's better if l turn on  light. a=:'⚃⚃⚂come ⚄⚅' ]u16=:7&u: a ]u32=:9&u: a Linda Sent from AOL

Re: [Jprogramming] unicode

2017-10-19 Thread Linda Alvord
It's better if l turn on light. a=:'⚃⚃⚂come ⚄⚅' ]u16=:7&u: a ]u32=:9&u: a Linda Sent from AOL Mobile Mail On Thursday, October 19, 2017 Linda Alvord wrote: a=:'⚃⚃⚂come ,⚄⚄' ]u16=:7&u: a ]u32= :9&u: a Linda Sent from AOL Mobile Mail On Wednesday, October 18, 2017 bill lam wrote: For th

Re: [Jprogramming] unicode

2017-10-19 Thread Linda Alvord
a=:'⚃⚃⚂come ,⚄⚄' ]u16=:7&u: a ]u32= :9&u: a Linda Sent from AOL Mobile Mail On Wednesday, October 18, 2017 bill lam wrote: For this kind of operation, it should convert to utf16 or utf32 where each atom stands for one unicode codepoint NB. utf8 a=:'鼠牛虎兔龍蛇馬羊猴鸡狗豬' NB. utf16 u16=: 7&u: a NB. ut