If elegant == short-tacit then Aai's way seems to be the best path to take.
Otherwise, `catalogue` presents some nice options, like:
(=/S:0 { ({:"1 A);({."1 B)) # (;S:1 { <"1&.>A;}."1 B)
On Mon, Oct 15, 2012 at 8:21 PM, Raul Miller wrote:
> Ok, thank you! I am going to blame my co
Cool. I'm sure it will come in handy at some stage.
--
For information about J forums see http://www.jsoftware.com/forums.htm
Usually a chinese character occupies twice the width of an ascii
character in fixed width fonts. You may add some logic to test for
a CJK characters (range 4E00–9FFF and 3400–4DBF)
http://en.wikipedia.org/wiki/CJK_Unified_Ideographs
to estimate the width if they all were ascii.
Втр, 16 Окт 2012
Ok, thank you! I am going to blame my confusion about {: vs. {. on my
browser font, where both : and . get only a single pixel per dot on my
laptop's screen. I can see the difference if I focus on it, but I
should have copied those phrases rather than retyping them.
That said... note that the as
Not sure how elegant this is but it seems to work:
({:"1 A) =/ {."1 B
0 1 0 0 1
1 0 0 1 0
0 0 1 0 0
(([:$])#:[:I.[:,]) ({:"1 A) =/ {."1 B
0 1
0 4
1 0
1 3
2 2
<"1 |:(([:$])#:[:I.[:,]) ({:"1 A) =/ {."1 B
+-+-+
|0 0 1 1 2|1 4 0 3 2|
+-+-+
ixs=. <"1 |:(([:$]
Sorry, by far from elegant:
;A <@((,"1}.)"1#~(=&{: |.)"1)"1 _ B
0 1 2 0 1 2 0 1
0 1 2 0 1 2 0 1
2 0 1 2 0 1 2 0
2 0 1 2 0 1 2 0
1 2 0 1 2 0 1 2
On 15-10-12 16:59, R.E. Boss wrote:
Given
['A B' =. 3|L:0<@i."(1)3 5,: 5 4
+-+---+
|0 1 2 0 1|0 1 2 0|
|2 0 1 2 0|1 2 0 1|
|1 2 0 1
NB. ({:"1 A) equals {."1 B
so not the leading column of A
Perhaps I should have added that ({:"1 A) =&~. {."1 B
or all not matching rows are deleted.
R.E. Boss
> -Oorspronkelijk bericht-
> Van: programming-boun...@forums.jsoftware.com
> [mailto:programming-boun...@forums.jsoftwar
Given your description, I would have expected a result like this:
0 1 2 0 1 1 2 0
0 1 2 0 1 1 2 0
2 0 1 2 0 0 1 2
1 2 0 1 2 2 0 1
1 2 0 1 2 2 0 1
I do not understand the result you proposed.
Also, you have not specified what happens for rows where the leading
column of A has a value which does
Given
['A B' =. 3|L:0<@i."(1)3 5,: 5 4
+-+---+
|0 1 2 0 1|0 1 2 0|
|2 0 1 2 0|1 2 0 1|
|1 2 0 1 2|2 0 1 2|
| |0 1 2 0|
| |1 2 0 1|
+-+---+
I want to stitch every row from A with all rows from B where ({:"1 A) equals
{."1 B and one of these columns is
It works, thanks.
The problem was that the FREE button did not react promptly
Great to have J on the iPad!
Jan.
On Sunday, October 14, 2012, Murray Eisenberg wrote:
>
> On Oct 14, 2012, at 12:22:08 +0200, Jan Jacobs
> >
> wrote:
>
> > I can locate jsoftware in AppStore but I am not able to insta
Thanks for the correction!. I forgot that (fg)y means y f gy . I was
thinking about the differences in the trees and wasn't paying attention to
the math.
Maybe that is what woke me up so early and so restless...
Linda
-Original Message-
From: programming-boun...@forums.jsoftware.com
11 matches
Mail list logo