In the case of = (self-classify), we have the advantage that the indices
are easily constructed. There is one 1 per column, located at (i.~ ~.) y.
indices =. (,. i.@#) (i.~ ~.) 20 ?@$ 5
This finds these row indices, and appends the column indices, which are
given simply by i. .
sparse =. 1 (<
It looks like the determinant conjunction . gives functions that are
explicitly rank 2:
-/ .* b. 0
2 _ _
This means we can't use a matrix of rank-1 polynomials as input without
redefining the conjunction ourselves.
Marshall
On Sun, Jun 10, 2012 at 10:05 PM, Raul Miller wrote:
> I am looking
Dyad (+/%#)\ is supported by special code (see
http://jsoftware.com/help/release/infixavg.htm). However, testing shows
that mean\ is not, so you'll want to use the expanded definition (or (mean\
f.), which also works).
The special code allows me to run a moving average on 5e7?@$10 using only
0.5G
Well, you can do this:
(3 :'({.y)&|@^/ }.y')"1 ]10 14 22,.5 7 11,.400 4000 4
5 7 11
I don't think there's anything that uses rank reasonably.
Marshall
On Thu, May 3, 2012 at 3:32 PM, Joe Groff wrote:
> Hi everyone. Verbs formed by (m&|@^) are implemented by modular
> exponentiation:
>
You're making a mistake in your treatment of functions. A function is not a
formula. It is an association of a value in the codomain to each value in
the domain, and if two functions have all of the same associations (which
forces them to have the same domain), then they are identical. Therefore >:
In an attempt to clarify things, here are the collected axioms for a
category:
A category is a collection of objects and a collection of arrows.
Each arrow has a source object and a destination object (which may be the
same object).
Each object has an identity arrow from itself to itself, which is
The problem is that the adverb is being evaluated at (+ Arg), rather than
waiting for a y argument. It appears that execution only waits if both u
and y are present, and 'u' doesn't count because it is a string and not a
variable. This looks like a bug to me.
A simple fix is to place a trivial ment
9:06 AM, Raul Miller wrote:
> On Mon, Apr 2, 2012 at 9:29 PM, Marshall Lochbaum
> wrote:
> > "The category of sets" means the category whose objects are sets and
> whose
> > arrows are functions. I suppose it's more precise to call it "the
> category
>
ment can't be the same as the identity for another, because they have
different endpoints.
Marshall
On Mon, Apr 2, 2012 at 9:12 PM, Raul Miller wrote:
> On Mon, Apr 2, 2012 at 6:30 PM, Marshall Lochbaum
> wrote:
> > A category is the collection of arrows AND objects. The object
consider three
or so objects at a time, and a few maps between them, so we only have to
shuffle category-theoretical axioms and not mess with set theory.
Marshall
On Mon, Apr 2, 2012 at 6:30 PM, Marshall Lochbaum wrote:
> A category is the collection of arrows AND objects. The objects al
arrows act enough like
functions to be useful.
Marshall
On Mon, Apr 2, 2012 at 5:30 PM, Raul Miller wrote:
> On Mon, Apr 2, 2012 at 4:35 PM, Marshall Lochbaum
> wrote:
> > A category is a formal thing, which means that it is literally composed
> of
> > "objects" an
A category is a formal thing, which means that it is literally composed of
"objects" and "arrows," and that these names, and the entities themselves,
mean nothing. We can think of a category as a set of objects, and for each
ordered pair of (not necessarily distinct) objects a set of arrows from th
Just to let everyone know, I've found the problem: in line 88 of pv.c,
there's a line using swapc that should only use swap in some cases. This
makes it so that
13 :'y+x'
+~
but it's an improvement for the present.
Marshall
On Tue, Mar 20, 2012 at 9:12 AM, Raul Miller wrote:
> On Tue, Mar 20
J in fact involves two types of functors: arrays as discussed, and
functions.
"Mapping" over functions is a bit harder to visualize, but it's helpful to
think of a function as a value that depends on its input. In this case,
when we apply a fork to two functions in order to refer to their values (o
No, it should be 1 0. Empty strings are allowed in the argument, as in
'12,,4,5' . '' signifies a single empty string, just like 'a' signifies a
single length-one string. The number of segments is equal to the number of
commas, plus one, in all cases.
Marshall
On Sat, Mar 24, 2012 at 11:26 PM, Bl
You're using a double quote " instead of an empty string '' (it's easier to
see in monospace).
Marshall
On Tue, Mar 13, 2012 at 3:56 PM, Devon McCormick wrote:
> Since the last two ASCII values differ, I suspect you're not entering
> the single quote twice at the end - or you could enter
> 'u
for the new jconsole support and does not
> apply to jgtk or jhs. Details like 32 vs 64 also nice to have.
>
> On Thu, Mar 1, 2012 at 3:45 PM, Devon McCormick
> wrote:
> > The 32-bit version still works under Windows 7.
> >
> > On Thu, Mar 1, 2012 at 3:27 PM, Marshall Lochba
Confirmed on Ubuntu. Oh no!
Marshall
On Thu, Mar 1, 2012 at 3:16 PM, William Szuch wrote:
> Using Windows 7
>
>
>
> load 'plot'
>
> plot i. 123
>
> |assertion failure: cairo_glcmds
>
> | 0~:gtkcr,gtkpl
>
>
>
> Regards
>
>
>
> Bill Szuch
>
>
>
>
>
>
>
> ---
You'll want the more general form of indexing, using boxes.
i.3 4
0 1 2 3
4 5 6 7
8 9 10 11
(<1 1) { i.3 4
5
_ (<1 1)} i.3 4
0 1 2 3
4 _ 6 7
8 9 10 11
A more complete description of selection is here:
http://www.jsoftware.com/help/jforc/more_verbs_for_boxes.htm#_Toc191734399
Mar
show =: 1 : '5!:5<''u'''
should serve your purposes. Execute as an adverb, i.e.
(+/%#) show
+/ % #
There are other formats, which you can find in the help section on foreigns
under 5!: .
Marshall
On Fri, Feb 17, 2012 at 1:57 PM, Edward Mokurai Cherlin <
moku...@sugarlabs.org> wrote:
> I had
; > pas 0 0;
> > > )
> > >
> > > run =: 3 :0
> > > wd TEST
> > > wd 'pshow'
> > > )
> > >
> > > test_g_paint =: 3 :0
> > > size =. _2 {. ". wd 'qformx'
> > > wd 'setxywhx g 0 0 ', ":size
> > > glclear ''
g_paint
> again, try this.
>
> run =: 3 :0
> wd TEST
> wd 'set edit *edit here'
> wd 'pshow'
> )
>
> test_g_paint =: 3 :0
> glclear ''
> glpixels 0 0 400 400,<.,(+/ 256&*) 256*400%~i.400
> )
>
> if it does not di
ng enough for use
in the implicit mapping model I described.
Marshall
On Sun, Feb 5, 2012 at 4:07 PM, Boyko Bantchev wrote:
> On 5 February 2012 20:04, Marshall Lochbaum wrote:
> > ...
> > I'm not sure what you mean about Haskell's "deriving" descriptor.
askell description. My intention was to formalize
the ideas in the paper, but since it's dynamically typed, the type
signatures don't accomplish much.
Marshall
On Sun, Feb 5, 2012 at 12:37 PM, Boyko Bantchev wrote:
> On 5 February 2012 06:28, Marshall Lochbaum wrote:
> > I've w
computations,
and in this situation array theory will come in handy.
Marshall
On Sun, Feb 5, 2012 at 11:14 AM, William Tanksley, Jr wrote:
> Marshall Lochbaum wrote:
> > I've written a paper which describes a way to replicate and extend J's
> > behavior with arrays
I've written a paper which describes a way to replicate and extend J's
behavior with arrays and forks as part of a single framework. I thought
this would be interesting to the J community since it elaborates on the
kind of thinking that drives J's powerful approach to function application.
https:/
; GL2ExtGlcmds=: 0
> in base.cfg to force it use cairo backend before testing.
>
> gl2 rgb colors seemed swapped, and it needs a wd'pshow' before running any
> gl2 commands.
>
> Also you may set the noun TileWM inside gtkwd to make a ptop a no-op so
> that it
> wil
On further probing, it looks like the problem is in glpixels, which is
causing all the windows to move slowly and sometimes hang. I'll see if I
can boil that down to a simple script.
Marshall
On Tue, Jan 31, 2012 at 7:20 PM, bill lam wrote:
> Втр, 31 Янв 2012, Marshall Lochbaum
I'm running Linux 32 bit with gtk3. So far the big problem is that using wd
commands immobilizes the jgtk window--I can type things in, but nothing
happens when I press enter until I close the window. This is really
hindering diagnostics.
glqwh returns the size of the window as set by J, not the c
Thanks for providing the link.
The property that I had missed was "fractionality:" that (1 < (|@- <.)) .
This would ensure that while doing the Euclidian algorithm, the magnitudes
of numbers always decrease. However, this is not a necessary condition for
the Euclidian algorithm to work. Another su
gt; Scientific Services
>
> Office of Environment and Heritage
>
> Department of Premier and Cabinet
>
> PO Box A290
>
> Sydney South
>
> NSW 1232
>
> T: +61 2 99 955 490
>
> E =: {~&:>`(i.&.:>)/
>
> E'.@aeghimnorstuvw
&g
6j0.6
0.6j0.6
Marshall
On Sun, Jan 22, 2012 at 2:59 PM, Marshall Lochbaum wrote:
> Well, there's a very simple fix for the problem we're seeing here. Here's
> the definition of the remainder function, from vz.c (you don't have to read
> the whole thing!)
>
> Z
bility
issues, this is definitely a fix that needs to be made.
Marshall
On Sun, Jan 22, 2012 at 2:36 PM, Marshall Lochbaum wrote:
> That isn't what complex | does, or what it should do, I think. However, it
> is a consistent extension of "mod" to the complex numbers--we are
' of the real part and leave the imaginary part
> untouched.
>f=:(|9&o.)+j.&(11&o.)&]
>7 f 73j73+i.6
> 3j73 4j73 5j73 6j73 0j73 1j73
> Perhaps this is not done by a complex '|' ?
>
>
>
>
> >
>
Well, I know complex floor was something Gene McDonnell was proud of,
> and I expect it's embedded in some applications. You'll need to produce
> a compelling argument for changing it.
>
> Henry Rich
>
> On 1/22/2012 12:38 PM, Marshall Lochbaum wrote:
> > I'm
kes sense or
that the current definitions are used in important code that would break
under this remodeling.
Marshall
On Sun, Jan 22, 2012 at 12:49 PM, Don Guinn wrote:
> The thing is that floor, ceiling, residue and antibase are related and all
> should be handled by the same rules, whatever
Jan 22, 2012 at 12:08 PM, Henry Rich wrote:
> As Don said, make sure you understand complex floor before you start
> coding.
>
> Henry Rich
>
> On 1/22/2012 11:38 AM, Marshall Lochbaum wrote:
> > The theory of moduli is based on the quotient group of the integers by a
>
The theory of moduli is based on the quotient group of the integers by a
subgroup. For instance, the integers (mod 2) are produced by taking all the
integers and identifying all the ones that are even, as well as all the
ones that are odd. Then we get a two-element group which we can preform
additi
The average below isn't tacit since it refers to the argument of the
function, x. It's true that J's [ and ] do similar things, but with
entirely different semantics: they are actually functions of one or two
arguments that return the appropriate argument. Perhaps it's not so evident
here, but in J
orum
> archive if you are interested.
>
> Вск, 08 Янв 2012, Marshall Lochbaum писал(а):
> > In J701, fork_jtask_[load'task' accomplishes this. fork is defined as
> > fork_jtask_ =: [: 2!:1 '(' , ')&' ,~ ]
> >
> > However, in J602 it is ju
In J701, fork_jtask_[load'task' accomplishes this. fork is defined as
fork_jtask_ =: [: 2!:1 '(' , ')&' ,~ ]
However, in J602 it is just an alias for 2!:1, so it's best to assign as
above in Unix if both J602 and J701 will be used.
Marshall
On Sun, Jan 8, 2012 at 10:46 PM, bill lam wrote:
> It
This never seemed intuitive to me either. I think it means that the indices
are run together, i.e. in an ordinary table you have indices given by
{@:(i.&.>)@:$
like
┌───┬───┬───┬───┐
│0 0│0 1│0 2│0 3│
├───┼───┼───┼───┤
│1 0│1 1│1 2│1 3│
├───┼───┼───┼───┤
│2 0│2 1│2 2│2 3│
└───┴───┴───┴───┘
And when
If you really want top-of-the-line performance, you'll have to go to a
sequential machine. Here's my solution, which leaves the leading and
trailing blanks in, then specifically deletes them.
I don't claim that these tests are universal; it's quite plausible that a
different mixture of blanks and w
$ accomplishes this quite nicely.
4 $ 1 2
1 2 1 2
2 5 $ 1 2
1 2 1 2 1
2 1 2 1 2
Note, however, that $ always applies to the items of its right argument;
behavior with a rank >1 right argument is confusing.
Marshall
On Fri, Dec 30, 2011 at 1:42 PM, Johann Hibschman wrote:
> Continuing my
Grouping of adjacent numbers is something that happens during word
formation: it's embedded into the sequential machine ;: (the dictionary
gives a rather opaque description of this). You should train yourself to do
the same, so that you parse "1!:1 1" as
;: '1!:1 1'
┌─┬──┬───┐
│1│!:│1 1│
└─┴──┴─
Actually I think the Java (which was in fact Java rather than C, although
you had no way of knowing) was "if (x>20) return 1; else return 0;". My
friend proposed this as a more readable version than ">&20" when I
suggested it. In any case, I stand by my rhetoric; the actual code is
irrelevant.
Mar
Well, I'm not tired of this stuff quite yet, so here goes:
Brainfuck and APL/J/K get compared a lot on account of being "obfuscated."
This is a bit unfair. The correct terms are, respectively, "contorted" and
"terse."
There is one thing that the two languages share: they are each an attempt
to ge
A more obvious way is to use (c { b,.a) . The key is to realize that saying
(if c then a else b) is just selection: if c is 0, we pick b, and if c is
1, we pick a. So we rephrase as (c { b,a), and J's implicit rank allows us
to do (c { b,.a) for vector c, a, and b.
That said, (c} b,:a) is faster,
ation.
Marshall
On Fri, Dec 16, 2011 at 8:20 AM, Don Guinn wrote:
> I don't understand what you mean by a right and left inverse to +/ .
>
> On Thu, Dec 15, 2011 at 7:52 AM, Marshall Lochbaum >wrote:
>
> > Yes, except there are an infinite number of choices. In that sense, it
s impractical in actual problem solving. A similar
> thing occurs with circular functions.
>
> 1 o.0.5+0,o.2
> 0.479426 0.479426
>
> And that is why many proofs restrict functions to be single valued.
>
> On Wed, Dec 14, 2011 at 9:18 PM, Marshall Lochbaum >wrote:
&
Rule 30 (i.e. replace (1 3 5 6 e.~) with ((8{.|.#:30) {~)) generally looks
the best, because it's chaotic. Rule 110 (same, but with 110) is
interesting because it's Turing complete.
Marshall
On Thu, Dec 15, 2011 at 7:00 AM, Zsbán Ambrus wrote:
> The following code runs a one-dimensional cellula
antibase2 has an inverse only for nonnegative numbers, given by #.
twoscomplement's inverse is [:#. (* _1^0=i.@#)"1
signwithbits has inverse #.
Marshall
On Wed, Dec 14, 2011 at 11:10 PM, Kip Murray wrote:
> Thank you, Raul. May we have inverses?
>
> On 12/14/2011 9:13 AM, Raul Miller wrote:
>
So, this will probably just look like a lot of math, but I think it's what
you are trying to say:
We can consider the vector space over the real numbers consisting of all
infinite sequences of numbers with finitely many nonzero terms. So a member
of this space can be expressed as a finite list tha
Actually, I'm kind of surprised now that I didn't think of just reversing
the order of #: . A binary number is computed as a stack, with the most
significant digit being computed last but needed first to convert back to
an integer. Hence it makes the most sense to put the least significant
digit fi
gt; _1 1 1 0 1
>
> etc, depending on the length of the representation.
>
> Henry Rich
>
> On 12/12/2011 8:44 PM, Marshall Lochbaum wrote:
> > So something like this:
> > (-@(<&0) ,. #:) i:5
> > _1 0 1 1
> > _1 1 0 0
> > _1 1 0 1
> &g
ith current code except for the
> behavior of #: on negatives, which we agree is anomalous.
>
> And you can do |@:#: if you don't like the negative sign bit.
>
> Still differs from 2&#:, though.
>
> Henry Rich
>
> On 12/12/2011 7:44 PM, Marshall Lochbaum wrote:
> &g
I suppose my main objection to multiplying the entire base by a sign is
that it makes it more complicated to assess whether a number can be derived
from your version of antibase, and thus can be compared directly with
another via -: . Specifically, your version requires that a number either
consist
Henry Rich wrote:
> I like your leading-digit-negative idea better too. Rather than
> prepending a leading _1, you could just change the high-order 1 to _1 .
>
> Henry Rich
>
> On 12/12/2011 5:57 PM, Marshall Lochbaum wrote:
> > Those are some very good arguments.
d, [subtract] two tens, and [subtract] three units".
> > Though this is subjective, it does allow one to reason about negative
> > numbers in a straightforward and expected way:
> >
> > _123 + 456
> >333
> > _1 _2 _3 + 4 5 6
> >
The problem with this is that we would prefer not to use negative numbers
in antibase, since they can violate uniqueness of base representation.
There's really no solution to this--my recommendation is to just never feed
negative numbers to #: . However, an option that minimizes negative numbers
(a
On second thought, you could make a parser that applies the function to
formal parameters x and y, and checks whether the results are the same,
which should work for functions as simple as yours. Stay tuned--I might
actually write this.
Marshall
2011/11/10 Marshall Lochbaum
> Look at the c
Look at the code and scratch your head. J doesn't have that kind of power.
Marshall
2011/11/10 Linda Alvord
> a=: 0 : 0
> a is a
> b is not a
> c is a or not a
> )
> a
> a is a
> b is not a
> c is a or not a
>
> b=: <;._2 a
> b
> ---T--T---┐
> │a is a│b is not a│
about
> nouns, so that would be a few examples of general noun arguments.
>
>
>
> On Wed, Nov 9, 2011 at 7:06 PM, Marshall Lochbaum
> wrote:
> > That's what 1!:1 and 1!:2 are for. You should learn the first few of J's
> > file foreigns; they are listed h
shall.
>
> If I want to take a noun like 'all' which is just a list of text strings.
> and save it as a standard text file 'all.txt' in a specific folder on my
> system, how would you do that?
>
> Skip
>
> On Wed, Nov 9, 2011 at 8:34 PM, Marshall Lochbau
(nl 0) lists all the nouns in boxed form, and 7!:5 gives the memory used by
a noun in boxed form, so
7!:5 nl 0
gives you a nice list of all the memory being used.
To save and recover a noun using a file, you can use the inverses (5!:5)
and ". (". is a strict left inverse of 3 :'5!:5<''y''', at
J provides a primitive for the unbox/ravel combo which doesn't introduce
the fill. It's ; (raze, the semicolon).
Marshall
On Wed, Nov 9, 2011 at 7:46 PM, Ric Sherlock wrote:
> I think this should show any log.gz file in c:\test4 or any sub-directory
> of it:
> dirtree 'c:\test4\log.gz'
>
> On
I think actually
shell&.> zipth <@,"1 lp
is needed, since lp has rank 2. Or, if you're into less boxing and
(slightly) less maintainable code,
zipth <@shell@,"1 lp
Marshall
On Wed, Nov 9, 2011 at 6:08 PM, Ric Sherlock wrote:
> you need:
> shell &.> zipth&, &.> lp
>
> Just for clarity t
It's either a string file name on the left and a 2-dimension array of rgb
values (ie. 256#.(red, green, blue)) one the right, or vice-versa. Do
whichever one doesn't give you a domain error.
Marshall
On Tue, Nov 8, 2011 at 11:39 AM, David Vaughan wrote:
> Thanks, I never realised all that stuff
If we look at the block matrices, what we want is a matrix product on
these, but with the operations of matrix addition and multiplication
instead of the regular + and * . Thus, we can replace + and * in +/ .* with
the corresponding +&.> and +/ .*&.> for boxed matrices, so
mp =. +/ .*
blockm
Here's an example:
xs =. 'a';'b';'c'
join =: #@[ }. [:;,L:0
'' join xs
abc
' ' join xs
a b c
Keep in mind that J strings are arrays of characters. There are no special
functions for strings, because there's never a reason to restrict the
domain of an array function to strings.
Marshal
* has rank 0 already, so it isn't necessary. The definition of / is that it
applies the verb with rank (left rank),_ . Essentially, this means that it
loops through all the items of x, then for each of those, all the items of
y, where an "item" is an item with the left rank of the verb. If you try
To clarify, your problem isn't part of the execution of $ . It occurs
during the word formation step, which is when vectors are formed. J knows
that numerics side-by-side form a list, so it will do that for you, but
with names, it doesn't even now the part of speech, so it can't. Also note
that acc
Erase will work on an unboxed list of words, as well as boxed words. If you
give it a string, ;: will split it into words, and if you give it a box, ;:
will fail and because of the ::] it will fall back on ] as a default, which
does nothing before feeding the argument to 4!:55.
Marshall
On Mon, O
It's naturally grouped from left to right, so what you have is
]`(a.{~32&+@:(a.&i.)) @. (>&64 *. <&91) @: (a.&i.) 'A'
which first converts 'A' to a number, then applies all of the rest on the
number. Thus (a.&i.) (numeric) gives #a. , giving you your index error after
adding 32 and selecting
You can use &.: and simply make the verb rank 0 (which is the rank of >),
and then expand that to an expression using @: . However, &.> is an idiom
that is really useful (it's the analogue of "_1 for arrays of boxes), so
your code will be shorter and clearer if you learn to use it.
I =: ([:/:":) &
I don't think anything will keep me from calling it an "array with rank
greater than 2."
Marshall
On Sun, Oct 23, 2011 at 10:10 PM, Henry Rich wrote:
> 'cube' was suggested. Raul objected that a cube should have all axes of
> equal length.
>
> 'cuboid' has been used in Ye Dic (in the descripti
I would describe one as compositions and the other as array combinators (or
array operators). In a Factor-like notation, the first (and also forks)
would be dataflow combinators, although that applies just as easily to the
second. The distinction between these two fits into a larger distinction
bet
While that is an important property, your argument is a lot like saying that
an empty list cannot be counted as a list because all other lists have a
first element. Admittedly, scalars are very different from other arrays, but
it's essential that we still be able to consider them as arrays because
A more general solution is {.^:(#@$) , which will strip all the dimensions
off the array.
Marshall
On Thu, Oct 20, 2011 at 7:34 AM, Raul Miller wrote:
> {. gets the first item from an array.
>
> You might be wanting lim=. {.,y (which will always have lim be a rank 0
> array).
>
> But I do not
.@googlemail.com> wrote:
> Ignore the domain error thing that was just one of my usual careless
> mistakes.
>
> But even so, the result is not right.
>
> (i.<.-:<:4) p 4
> 1r120
> (>:i.<.-:<:4) p 4
> 1r20
>
> On 19 Oct 2011, at 17:03, Marshall
bability of taking more b's than r's is the probability of
> taking 3 b's = %24 plus the probability of taking 2 b's and 1 r = 24%~1+2+3
> which gives 7r24. Though I'm not actually sure my idea for the general case
> is totally correct.
>
> On 19 Oct 2011, at 15
The correct way is to compute all the terms in the expression and then
multiply them together. Something like
n* > *&.>/ >:@i.&.> n->:i.k
However, the expressions you gave will return length errors, since (>:i.n-2)
is patently not the same length as (>:i.n-1). What exactly are you trying to
comp
You can just use rotate with rank:
(|."0 1~ i.@#) 3 4#1 0
1 1 1 0 0 0 0
1 1 0 0 0 0 1
1 0 0 0 0 1 1
0 0 0 0 1 1 1
0 0 0 1 1 1 0
0 0 1 1 1 0 0
0 1 1 1 0 0 0
Also, if you wanted a solution using power, you could do
1&|.^:(<@#) 3 4#1 0
1 1 1 0 0 0 0
1 1 0 0 0 0 1
1 0 0 0 0 1 1
0 0 0 0 1 1 1
0
J's E. implements Boyer-Moore, which makes it much faster than a standard
search. You could implement a standard search using sequential machines
(well, if you don't mind a transition table that grows with the size of the
label to find), but I'm fairly sure it's impossible to implement Boyer-Moore
In general, lazy lists and lazy-style programming are not well-supported in
J. Even if you have a good representation of a lazy list, it won't work with
J's array-processing style. The main reason J is so fast is that it performs
each operation all at once, allowing for highly optimized operations
It just says that if each permutation (of axes) in P gives the identity on
A, then any composition of those permutations also gives the identity.
Marshall
On Mon, Oct 10, 2011 at 4:49 PM, Brian Schott wrote:
> I enjoyed the Essay and went on to view the embedded Essay here which
> was fascinatin
A simple solution is just to keep all the exports in a separate file and
look at that when you want to find the names you defined globally.
I suppose you could also do a regex search for '_z_ *=[\.:]' .
Marshall
On Sun, Oct 9, 2011 at 1:28 PM, Ian Clark wrote:
> It's not the top-level call that
$i.10 is a 1-element list, while #i.10 is a scalar. You can determine this
by looking at the shape:
$ $i.10
1
$ #i.10
#@$ $i.10
1
#@$ #i.10
0
A scalar is defined as having zero dimensions, that is, the shape is an
empty list. One important thing to know is that $ always returns a lis
anti-aliased, but resize_image from image3.ijs in the image3
> addon subsamples.
> Best, Cliff
>
> On 10/3/2011 10:52 PM, Marshall Lochbaum wrote:
> > Does anyone know of a good J implementation of anti-aliased rescaling for
> > bitmaps? My first attempt has been sl
J couldn't find 'view_m.ijs', so you'll need to give it more information.
load '~addons/media/image3/view_m.ijs'
worked for me (on Unix; if you have Windows replace slashes with
backslashes). If that doesn't work, find the file and paste in the full
path.
Marshall
On Wed, Oct 5, 2011 at 11:42
I strongly recommend the section in J for C Programmers that deals with
rank:
http://www.jsoftware.com/help/jforc/loopless_code_i_verbs_have_r.htm#_Toc191734331
for the definitions of verbs, see J's vocabulary page (f1 from a J window).
Marshall
On Wed, Oct 5, 2011 at 8:29 PM, olivier SAINT-EVE
Does anyone know of a good J implementation of anti-aliased rescaling for
bitmaps? My first attempt has been sloppy and really slow. The more
important part of the algorithm is downsampling--to increase the size I'll
probably just end up using nearest-neighbor.
Marshall
---
There's a distinction between the algorithm and the implementation:
Using for. instead of rank is an implementation detail--it can slow you
down, but the asymptotic time remains the same. It's quite possible that the
performance of comb could be improved by using tacit code.
The difference here i
Well, if you really need it, here's a tacit version that should work:
nlmonad =: [: cutopen_z_`(4!:1)@.(1 4 8 e.~ 3!:0) ((0 1 2 3"_)^:(0=#))
nldyad =: (4 :0 nlmonad)
nms=.y
if. #t=. x -. ' ' do.
'n s'=. '~*' e. t
t=. t -. '~*'
b=. t&E. &> nms
if. s do. b=. +./"1 b
else. b=. {."1 b
Step 1 is a problem. You never want to define global variables x and y . In
fact, if you inspect the code for nl, you will find the line
nms=. (4!:1 y) -. ;: 'x y x. y.'
which specifically removes instances of x and y, as well as x. and y. .
That's because nl is an explicit verb, so x and y are ove
On Fri, Sep 23, 2011 at 10:36 PM, Roger Hui wrote:
> Marshall, I am curious: which of the following
> two statements do you think is better?
>
> Apply +/ on prefixes of suffixes
> +/ on prefixes of suffixes
>
> p.s. I showed your solution at the Minnowbrook
> conference here
A better representation is
((e.>)~/ ;)
I didn't consider that the items inside the boxes of y could be boxed.
Marshall
On Fri, Sep 23, 2011 at 3:13 PM, Raul Miller wrote:
> On Fri, Sep 23, 2011 at 3:06 PM, Marshall Lochbaum
> wrote:
> > It's equivalent to (e.&
It's equivalent to (e.&>~/ ;) :
e. 2 3 4;3 4 5;1 2
1 1 1 1 1 0 0 1
0 1 1 1 1 1 0 0
1 0 0 0 0 0 1 1
(e.&>~/ ;) 2 3 4;3 4 5;1 2
1 1 1 1 1 0 0 1
0 1 1 1 1 1 0 0
1 0 0 0 0 0 1 1
So, it tells you which boxes (vertical axis) contain each element of the
raze (horizontal axis).
Marshall
On Fri, S
There's obviously some sort of effect with floating-point rounding going on.
Try this one out:
r=:1e12+0.5-~1e6?@$0
plot 0 128 128; '(1e12-~mean@:(r&+))"0'
r is a random distribution around 1e12, and here we plot the difference
between the mean and 1e12 against the amount we added to r. It
; <@:(+/\)\. p:i.4
2 5 10 17 3 8 15 5 12 7
applies +/ on prefixes of suffixes.
Marshall
On Fri, Sep 16, 2011 at 12:59 PM, Roger Hui wrote:
> Multiple applications of the infix x +/\ y does the trick.
>
> f=: >:@i.@# +/\&.> <
> f 2 3 5 7
> ┌───┬──┬─┬──┐
> │2 3 5 7│5 8 12│10
1 - 100 of 278 matches
Mail list logo