Re: [Jprogramming] Partitions

2017-10-27 Thread Erling Hellenäs
Hi all ! I wanted to make sure the algorithms worked and gave correct results, so I made a comparison. See below. Cheers, Erling Hellenäs -Project--- ts=: 6!:2 , 7!:2@]   NB. Time and space normalize=: 3 :0 NB. The idea here is to normalize the representation so that NB. the copie

Re: [Jprogramming] Partitions

2017-10-27 Thread Erling Hellenäs
PS. I took away the "removal of duplicates" in my normalize. Result was the same. DS. /Erling Den 2017-10-27 kl. 10:08, skrev Erling Hellenäs: Hi all ! I wanted to make sure the algorithms worked and gave correct results, so I made a comparison. See below. Cheers, Erling Hellenäs -P

Re: [Jprogramming] Partitions

2017-10-27 Thread 'Mike Day' via Programming
Sorry, I haven’t got a useful direct response for Raul’s comment on this. BUT, here are a couple of amendments which seem to greatly improve on Lippu Esa’s par2. The main improvement hangs on the observation that rows in a such as 000102 and 000201 (spaces removed) are essentially the same. This

Re: [Jprogramming] JHS Home Server

2017-10-27 Thread Brian Schott
Bill, Perhaps the following thread will help. http://www.jsoftware.com/pipermail/general/2017-September/037270.html On Fri, Oct 27, 2017 at 1:34 AM, William Szuch wrote: > I have setup a JHS server on a home computer (to learn some JHS/HTMl etc). > > I would like to be able to access the serve

Re: [Jprogramming] JHS Home Server

2017-10-27 Thread Eric Iverson
Assuming you can set up ssh between the machines, then an ssh tunnel connecting the client machine to the server through a tunnel to localhost on the server is your best best. It is more complicated to set up, but is convenient and secure once you have it. On Fri, Oct 27, 2017 at 1:34 AM, William

[Jprogramming] loading jforc.ijs

2017-10-27 Thread Tomas Celaya
Hello! I've been getting started with J recently and came across J for C Programmers. Noticing the mention of jforc.ijs led me to this file which is linked to from a few pages on the wiki. Unfortunately I can't seem to load the file with neither jqt on macOS (v 806) nor jconsole on a compile-fr

Re: [Jprogramming] loading jforc.ijs

2017-10-27 Thread robert therriault
Hi Tomas, If the issues is only the x. y. u. v. variables there is a foreign conjunction pair (9!:48 9!:49) that can be set to allow the use of that old style. http://www.jsoftware.com/help/dictionary/dx009.htm 9!:48 ''NB. dot names off 0 9!:49 [ 1 NB. set dot names to 1 9!:48

[Jprogramming] Euclidean Distance

2017-10-27 Thread 'Skip Cave' via Programming
In the 2014-11-11 NYCJUG meeting there was a discussion on Euclidean Distance. The verb 'dis' was used to demonstrate how to to calculate the Euclidean distance between two vectors. 0 0 dis 1 1 NB. Euclidean distance 1.41421 1 1,_1 _2,:3 4 NB. Tab

Re: [Jprogramming] Euclidean Distance

2017-10-27 Thread Raul Miller
The items that dis is expecting are rank 1 vectors. So it might make sense to include a rank 1 specification in its definition: dis =: 4 :'%:+/*:x-y'"1 Does that work for this example? 0 0 dis 1 1,_1 _2,:3 4 1.41421 2.23607 5 ... seems so ... Thanks, -- Raul On Fri, Oct 27, 2017 at 7

Re: [Jprogramming] Euclidean Distance

2017-10-27 Thread 'Skip Cave' via Programming
Raul, Yes, rank was the problem. It hit me while I was eating dinner but your solution was different than what I expected (they usually are): Raul: dis =.4 :'%:+/*:x-y' "1 (0 0, 2 _3 ,: _1 2) dis 1 1,_1 _2,:3 4 1.41421 3.16228 4.47214 0 0 dis 1 1,_1 _2,:3 4 1.41421 2.23607

Re: [Jprogramming] Euclidean Distance

2017-10-27 Thread 'Skip Cave' via Programming
As part of my NLP project, I need a way to plot 2D & 3D point cluster plots. Let's take the example in my previous email: (0 0, 2 _3 ,: _1 2) dis 1 1,_1 _2,:3 4 1.41421 3.16228 4.47214 In that distance calculation, their are 6 coordinate pairs, representing 6 points in x & y. The six points

Re: [Jprogramming] Euclidean Distance

2017-10-27 Thread Gilles Kirouac
   a=:(0 0, 2 _3 ,: _1 2)    a  0  0  2 _3 _1  2    ]b=:1 1,_1 _2,:3 4  1  1 _1 _2  3  4    a(4 :'+/ &.: *:x-y' "1)b    NB. Under since Square Root is obverse (inverse) of Square 1.41421 3.16228 4.47214    a((+/ &.: *:)@: -) "1 b NB. in a tacit way 1.41421 3.16228 4.47214    a([: (+/ &.: *:) -

Re: [Jprogramming] Partitions

2017-10-27 Thread Lippu Esa
Hi Mike, Thank you for the improvements. And thanks to Erling for comments and analysis. Esa -Original Message- From: Programming [mailto:[email protected]] On Behalf Of 'Mike Day' via Programming Sent: Friday, October 27, 2017 2:26 PM To: [email protected]

Re: [Jprogramming] Euclidean Distance

2017-10-27 Thread Lippu Esa
This is nice! You can easily make a distance table: (0 0, 2 _3 ,: _1 2) dis/ 1 1,_1 _2,:3 4 1.41421 2.23607 5 4.12311 3.16228 7.07107 2.23607 4 4.47214 and reflex: dis/~ 1 1,_1 _2,:3 4 0 3.60555 3.60555 3.60555 0 7.2111 3.60555 7.2111 0 The tacit version

Re: [Jprogramming] Euclidean Distance

2017-10-27 Thread Lippu Esa
Hi Gilles! Thank you for a thorough post. Sorry about my redundant message. I should have known better to read the thread completely before responding. This forum works so fast, thanks to all! Anyways, a good exercise for me. Esa -Original Message- From: Programming [mailto:programming

Re: [Jprogramming] Euclidean Distance

2017-10-27 Thread Raul Miller
Where do the docs show that you can do this? Hmm... I suppose one strong hint is at http://www.jsoftware.com/help/primer/rank_conjunction.htm where it shows the left argument to the rank conjunction being a verb. There are also books, like Henry Rich's J for C programmers which include related ex

Re: [Jprogramming] Euclidean Distance

2017-10-27 Thread Lippu Esa
Hi Skip For the tasks 1. and 2. you can write: require 'plot' ]a=.0 0, 2 _3, _1 2, 1 1,_1 _2,: 3 4 pd 'reset;type marker;color red' pd <"1|: 3{.a pd 'color blue' pd <"1|: 3}.a pd 'show' but I don't know how to plot points in 3D in J. I have done rotating only in 2D and played in 3D by rotating

Re: [Jprogramming] Euclidean Distance

2017-10-27 Thread Raul Miller
I had to study the plot docs, and experiment a little. The page http://code.jsoftware.com/wiki/Plot/Data is probably the most important to understand. For your item 1, something like this might work (change the pensize to change the size of the dots - the default size is too small for a graph with