To rotate a matrix by its axes separately one does
(=i.2)|.i.3 4
4 5 6 7
8 9 10 11
0 1 2 3
1 2 3 0
5 6 7 4
9 10 11 8
This works as expected.
However
(=i.2)|.2 i.3 4 5
|length error
| (=i.2)|.2 i.3 4 5
This is strange, since it should be equal to
(=i.2)|.2 i.3 4
Remarkably, if an extra _ is added everything works fine
(=i.2)|._2 i.3 4 5
5 6 7 8 9
10 11 12 13 14
15 16 17 18 19
0 1 2 3 4
1 2 3 4 0
6 7 8 9 5
11 12 13 14 10
16 17 18 19 15
25 26 27 28 29
30 31 32 33 34
35 36 37 38 39
20 21 22 23 24
21 22 23 24 20
26 27 28 29 25
31
On 9/13/07, R.E. Boss [EMAIL PROTECTED] wrote:
(=i.2)|.2 i.3 4 5
|length error
| (=i.2)|.2 i.3 4 5
...
What's wrong?
Looks like a bug. Replacing |. with a functionally equivalent
verb (such as |.]) works.
--
Raul
How many programmer would be interested to have a J Web Server account
with HTML/FTP/PHP/MySQL/SQLite/J 4/J 5 enabled ?
If there is enough, I could configure a server and take a fixed IP and a
business Plan from my Internet provider. Would be around 25$US/Month per
account if we have at least
can anyone point me to a good review/overview/critique on javascript.
i've heard it's not rubbish and i'd like to know more.
--
For information about J forums see http://www.jsoftware.com/forums.htm
http://en.wikipedia.org/wiki/Javascript
- Original Message -
From: Jack Andrews [EMAIL PROTECTED]
Date: Thursday, September 13, 2007 6:27
Subject: Re: [Jprogramming] J from a Web page
To: Programming forum programming@jsoftware.com
can anyone point me to a good
One of the best tutorials I've seen:
http://www.howtocreate.co.uk/tutorials/javascript/ .
After reading that, take a look at http://www.crockford.com/javascript/ .
On 9/13/07, Jack Andrews [EMAIL PROTECTED] wrote:
can anyone point me to a good review/overview/critique on javascript.
i've heard
On 9/12/07, Oleg Kobchenko [EMAIL PROTECTED] wrote:
--- Roger Hui [EMAIL PROTECTED] wrote:
It would be amusing to implement J in JavaScript.
From: Johannes Laire [EMAIL PROTECTED]
You can't run J in a browser, the only language suitable for
that is
JavaScript.
First I
Funny, I've thought about that as well. And I've seen a similar project
before, translating Perl6 to JavaScript. JavaScript is a pretty nice
language, I think that implementing at least a subset of J should be very
doable.
To get the whole implementation of J without having to work very hard :
The second expression should not have signalled error.
This bug has now been fixed for the next release.
Thank you for finding and reporting it.
- Original Message -
From: R.E. Boss [EMAIL PROTECTED]
Date: Wednesday, September 12, 2007 23:22
Subject: [Jprogramming] Rank of rotate
To:
Okay, bear with me - I'm 2 days into J programming...
I have a (large) dataset, A, which contains n columns, the first a number
in {1,2,...,m_1}, the
second a number in {1,2,...,m_2}, and so on. I then have a second dataset,
B, which contains
all the possible permutations. As a simple
On 9/13/07, Christopher Hansen [EMAIL PROTECTED] wrote:
Any suggestions would be much appreciated...
B=:,{1 2;1 2 3
A=:3 4 2 3 3 1 0{B
A-:1/B
0 0 0 1 0 0
0 0 0 0 1 0
0 0 1 0 0 0
0 0 0 1 0 0
0 0 0 1 0 0
0 1 0 0 0 0
1 0 0 0 0 0
--
Raul
Christopher,
There are several ways to get the result you want. I would probably use the
rank conjunction:
A =: .;._2 noun define
2 1
2 2
1 3
2 1
2 1
1 2
1 1
)
P.S. the expression you were describing is probably:
A *./ .= |:B
*./ .= is like +/ .* replacing addition with and, and
multiplication with equals.
FYI,
--
Raul
--
For information about J forums see
If B really are all possible permutations then
it is better to convert A from a base (m_1,m_2,...,m_n)
number into a single integer, and then compare
integers. e.g.
] a=: _2]\ 2 1 2 2 1 3 2 1 2 1 1 2 1 1
2 1
2 2
1 3
2 1
2 1
1 2
1 1
(2 3 #. a-1)=/i.*/2 3
0 0 0 1 0 0
0 0 0 0 1 0
0 0 1 0 0 0
15 matches
Mail list logo