Re: [Jprogramming] insert column into tables

2015-07-21 Thread Strale
mple: > > > > > > > >'-' 3 ins 'hello' > > > > hel-lo > > > > > > > > It also does: > > > > column 2 ins"1 table > > > > --T-T-T-┐ > > > > │0│1│0│2│ > > > > +-+-+-+-+ > >

Re: [Jprogramming] insert column into tables

2015-07-21 Thread R.E. Boss
-+-+-+ > > > │3│4│0│5│ > > > +-+-+-+-+ > > > │6│7│0│8│ > > > L-+-+-+-- > > > > > > Ben > > > > > > > > > > > > From: programming-boun...@forums.jsoft

Re: [Jprogramming] insert column into tables

2015-07-21 Thread Linda Alvord
Alvord Sent: Monday, July 20, 2015 4:23 PM To: programm...@jsonceftware.com Subject: Re: [Jprogramming] insert column into tables It doesn't have to be hard! You are progressingj well. Here's where you are so far. Take pme ste[ at a to,e frm right to left an it will make good sense

Re: [Jprogramming] insert column into tables

2015-07-20 Thread Don Guinn
t=.i.3 3 0 3 1 2{"1 t,.10 11 12 0 10 1 2 3 11 4 5 6 12 7 8 -- For information about J forums see http://www.jsoftware.com/forums.htm

Re: [Jprogramming] insert column into tables

2015-07-20 Thread Strale
> │0│1│0│2│ > ├─┼─┼─┼─┤ > │3│4│0│5│ > ├─┼─┼─┼─┤ > │6│7│0│8│ > └─┴─┴─┴─┘ > > Linda > > -Original Message- > From: programming-boun...@forums.jsoftware.com [mailto: > programming-boun...@forums.jsoftware.com] On Behalf Of Kip Murray > Sent: Monday, July 20, 201

Re: [Jprogramming] insert column into tables

2015-07-20 Thread Linda Alvord
─┴─┴─┴─┘ Linda -Original Message- From: programming-boun...@forums.jsoftware.com [mailto:programming-boun...@forums.jsoftware.com] On Behalf Of Kip Murray Sent: Monday, July 20, 2015 9:18 AM To: programm...@jsoftware.com Subject: Re: [Jprogramming] insert column into tables Following

Re: [Jprogramming] insert column into tables

2015-07-20 Thread R.E. Boss
jsoftware.com [mailto:programming- > boun...@forums.jsoftware.com] On Behalf Of R.E. Boss > Sent: maandag 20 juli 2015 18:19 > To: programm...@jsoftware.com > Subject: Re: [Jprogramming] insert column into tables > > I would prefer > >'-' 3 (1 :(':';'(x,y)

Re: [Jprogramming] insert column into tables

2015-07-20 Thread Jose Mario Quintana
Hi Paolo, Some answers to your question included the idiom (&.|:). This idiom is very useful when working with tables (matrices). Why? Because, given the design of J, often operations in terms of rows, as opposed to columns, are easier to write and (&.|:) allows to port quickly a solution for r

Re: [Jprogramming] insert column into tables

2015-07-20 Thread R.E. Boss
te - CITG > Sent: maandag 20 juli 2015 14:55 > To: programm...@jsoftware.com > Subject: Re: [Jprogramming] insert column into tables > > From a discussion a while ago I kept the following: > > NB. insert new items into an array - behaves like amend. > ins =: 1 : (':'

Re: [Jprogramming] insert column into tables

2015-07-20 Thread 'Pascal Jasmin' via Programming
Message - From: Ben Gorte - CITG To: "programm...@jsoftware.com" Cc: Sent: Monday, July 20, 2015 8:54 AM Subject: Re: [Jprogramming] insert column into tables From a discussion a while ago I kept the following: NB. insert new items into an array - behaves like amend. ins =: 1 : (':&#x

Re: [Jprogramming] insert column into tables

2015-07-20 Thread Kip Murray
Following up on Raul's "use transpose" idea: tbl 0 1 2 3 4 5 6 7 8 insertcol =: 1 : '({. , m , }.)&.|:' 2 (0 0 0 insertcol) tbl 0 1 0 2 3 4 0 5 6 7 0 8 --Kip Murray On Monday, July 20, 2015, Raul Miller wrote: > The classic "insertion" method for J is to use {. for the part before > t

Re: [Jprogramming] insert column into tables

2015-07-20 Thread Raul Miller
When this happens it's often worth spending a few minutes looking them up and trying some simple examples so you can see how they work for the kind of data you're working with. Thanks, -- Raul On Mon, Jul 20, 2015 at 8:54 AM, Strale wrote: > Hi Dan > > > this is getting me really scared :) >

Re: [Jprogramming] insert column into tables

2015-07-20 Thread Raul Miller
The classic "insertion" method for J is to use {. for the part before the insertion and }. for the part after the insertion. An example of this might be: table =: 3 3 $ <"0 i.9 column =: 3 1$ (<,'0') column ((2{."1]),.[,.2}."1]) table But it also might be simpler to use transpose: co

Re: [Jprogramming] insert column into tables

2015-07-20 Thread Devon McCormick
I should have provided some explanation of the version I offered. The first part executed - the rightmost part - generalizes the Boolean expansion vector Henry had hard-coded in his examples: (0) 2}1$~>:{:$table > 1 1 0 1 This is handy because it helps generalize the defined verb to work in

Re: [Jprogramming] insert column into tables

2015-07-20 Thread Ben Gorte - CITG
┬─┐ │0│1│0│2│ ├─┼─┼─┼─┤ │3│4│0│5│ ├─┼─┼─┼─┤ │6│7│0│8│ └─┴─┴─┴─┘ Ben From: programming-boun...@forums.jsoftware.com [programming-boun...@forums.jsoftware.com] on behalf of Strale [str...@gmail.com] Sent: Monday, July 20, 2015 14:11 To: programm...@jso

Re: [Jprogramming] insert column into tables

2015-07-20 Thread Strale
Hi Dan this is getting me really scared :) there are even symbols I do not know Thanks On Mon, Jul 20, 2015 at 2:46 PM, Strale wrote: > Hi Henry > > Quite hard for a beginner like me > but the one with complex number looks easier to read and remember > > Thanks > Paolo > > On Mon, Jul 20, 201

Re: [Jprogramming] insert column into tables

2015-07-20 Thread Strale
Hi Henry Quite hard for a beginner like me but the one with complex number looks easier to read and remember Thanks Paolo On Mon, Jul 20, 2015 at 2:35 PM, Henry Rich wrote: > These work. All are ugly but I don't know of a better way. > >column (,2)}"1 (1 1 0 1) #^:_1"1 table > >column

Re: [Jprogramming] insert column into tables

2015-07-20 Thread Devon McCormick
Slightly generalized from Henry's examples - the ugly can be hidden under a cover: insertColBefore=: 4 : '(>0{y) (,>1{y)}"1 x#^:_1"1~(0) (>1{y)}1$~>:{:$x' >table insertColBefore column;2 > +-+-+-+-+ > |0|1|0|2| > +-+-+-+-+ > |3|4|0|5| > +-+-+-+-+ > |6|7|0|8| > +-+-+-+-+ On Mon, Jul 20, 2

Re: [Jprogramming] insert column into tables

2015-07-20 Thread Henry Rich
These work. All are ugly but I don't know of a better way. column (,2)}"1 (1 1 0 1) #^:_1"1 table column ( Hello I am trying to combine Tables togethers for example I would like to insert column before the column 2 of the table [table =. 3 3 $ <"0 i.9 ┌─┬─┬─┐ │0│1│2│ ├─┼─┼─┤ │

[Jprogramming] insert column into tables

2015-07-20 Thread Strale
Hello I am trying to combine Tables togethers for example I would like to insert column before the column 2 of the table [table =. 3 3 $ <"0 i.9 ┌─┬─┬─┐ │0│1│2│ ├─┼─┼─┤ │3│4│5│ ├─┼─┼─┤ │6│7│8│ └─┴─┴─┘ [column =. 3 1$ (<,'0') ┌─┐ │0│ ├─┤ │0│ ├─┤ │0│ └─┘ the solution I ha