On Wed, May 25, 2016 at 4:34 PM, Henry Rich wrote:
> We would like a benchmark that uses scalar code heavily. This is the kind
> of application that you might say is 'not good for J'. We'd like to make J
> better on those applications. If you have some old FORTRAN-style code
> written in J, we'd
/rosettacode.org/wiki/Tonelli-Shanks_algorithm#J
>> http://rosettacode.org/wiki/Superpermutation_minimisation#J
>>
>> I will look at timing those, and you can look into finding more like them.
>>
>> Henry Rich
>>
>>
>>
>> On 5/25/2016 5:08 PM
A related problem is, what should you do about something like this?
example=: ((3 :0) (2 :0) (3 :0))"1
NB. rightmost verb
a:
)
NB. conjunction
u+v
)
NB. leftmost verb
1 2 3+4 5
)
example3=:example2=:example1=:example
13!:0]1
example3 ''
|length error:
gt; http://rosettacode.org/wiki/Levenshtein_distance#J(24% on 1000-byte strings)
>
> That might be enough to call a test suite, but if you find others I'll check
> them too.
>
> Henry Rich
>
>
>
>
>
>
>
>
> On 5/26/2016 8:19 AM, Raul Miller wrote:
>&
You probably meant (or +/-.b 0s) for your parenthetical comment.
--
Raul
On Sun, May 29, 2016 at 6:25 PM, Roger Hui wrote:
> What you should be looking at are combinations instead of permutations,
> because what you are computing are all the different ways of choosing +/b
> 1s (or +/~b 0s) f
Or, going directly from start to finish:
aa0=. '4-Apr-1930';'5-Apr-1930';'6-Apr-1930'
10&{.@isotimestamp@getdate each aa0
┌──┬──┬──┐
│1930-04-04│1930-04-05│1930-04-06│
└──┴──┴──┘
For a little more insight into the grammar, you might want
Or, there's a general pattern leading in the direction of (the
incredibly useful) linear algebra:
A=:(;:'b c') (0 0;2 2)}3 3$a:
*/"1 a: = A
0 1 0
a: */ .= A
0 1 0
--
Raul
On Wed, Jun 1, 2016 at 8:48 AM, Don Guinn wrote:
> I'm not sure just how = goes about comparing boxed da
Compare these two error cases:
3 :''0
|domain error
| 3 :''0
3 :'''example''13!:8]9'0
|example
| 'example'13!:8]9
In the first error, the error message is followed by the line
containing the error.
If I understand your proposal, I think you would have the second
example l
nt is not an integer'(13!:8)123
>>
>> NB. f1 gives an error message.
>>
>> NB. The second line shows the statement containing (13!:8) in f1, the top
>> of the stack.
>>
>>
>> 3+f2 'text'
>>
>> the argument is not an integer
You have seen the "Studio..." option under Help?
The labs, in particular, have some good stuff.
Don't be afraid to ask, though, if something doesn't seem to work
right - there's been quite a lot of version drift since some of that
was originally written.
Thanks,
--
Raul
On Mon, Jun 6, 2016 a
your video tutorials worked great on my Win 10 and Linux box
> without issue, and the behavior of the popus and buttons was as expected;
> no surprises. I would have replied inline, but I did not know how to reply
> when the list was being sent as a daily digest. Good work!
>
> Rob
>
Best I can think of is something like this:
mergeMask=: [: ;@(+/\@(0 1&E.) <@(* ~:/\)/. ]) 0, 2 =/\ ]
mergeRow=: (-.@] # [ (+/@:{~ <:,:])`(<:@])`[} I.@]) mergeMask
Hopefully that makes sense?
Thanks,
--
Raul
On Tue, Jun 7, 2016 at 5:15 PM, Ric Sherlock wrote:
> I'm looking for a J-like appr
27;t handle is the empty arg (which I didn't put in my
> spec!).
>
>mergeRow i.0
>
> |length error: mergeRow
>
> | mergeRow i.0
>
>
> A quick fix:
> mergeRow=: ((-.@] # [ (+/@:{~ <:,:])`(<:@])`[} I.@]) mergeMask) :: ((i.0)"_)
>
>$mergeRow i.
That string would not happen in this game - the numbers are always
integer powers of 2. However, the result should be 6 6.
Marshall's mergerow =: ((*>:) #~ _1|.-.@]) [:>/\.&.|. 0,~ 2 =/\ ]
gets it right.
Thanks,
--
Raul
On Wed, Jun 8, 2016 at 12:55 AM, Don Guinn wrote:
> Given a string 6 3 3
Did you mean something like this?
(<.0.8*1+i.25) 10./."1] 3#,:5# i.5
0 0 0 0 1 1 1 1 12 2 2 2 23 3 3 3 34 4 4 4 4
0 0 0 0 1 1 1 1 12 2 2 2 23 3 3 3 34 4 4 4 4
0 0 0 0 1 1 1 1 12 2 2 2 23 3 3 3 34 4 4 4 4
Except, that doesn't get you those leading zeros for the '01' column,
so maybe instead i
; But I am confused as well about the request for a shape 3 5 5 of what
>> appears as a shape 3 45 literal matrix. I do have '01' in mine though. :-)
>>
>> Cheers, bob
>>
>>> On Jun 8, 2016, at 10:29 AM, Raul Miller wrote:
>>>
>>>
> > 0 0 0 0 01 1 1
>> 1 12 2 2 2 23 3 3 3 34 4 4 4 4 > > 0 0 0 0 01 1 1 1 12 2 2 2 23 3 3 3 34 4 4
>> 4 4 > > 0 0 0 0 01 1 1 1 12 2 2 2 23 3 3 3 34 4 4 4 4 > > But a strange
>> thing to want to build. > > On 6/8/2016 1:37 PM, robert therriault wrote:
t;> Wed, Jun 8,
>> 2016 at 5:31 PM, 'Bo Jacoby' via Programming >>
>> wrote: > Thanks everyone! > This: >0 2 1|:3 >> 5 5$i.5 > > produces what
>> I wanted. > The result is however destroyed in the >> process of emailin
Sounds good to me.
I updated the page.
--
Raul
On Mon, Jun 13, 2016 at 12:32 PM, Martin Kreuzer wrote:
> Hi all -
>
> While browsing the J NuVoc page I accidentally stumbled upon this example:
>
> URL: http://code.jsoftware.com/wiki/Vocabulary/ampdotco
>
> Under "Common Uses / 2. Compute stand
There is something wrong with how your email client quotes my email,
or how my email system sends them to you, so I am going to trim quotes
and reply inline here.
On Tue, Jun 14, 2016 at 12:34 PM, Martin Kreuzer wrote:
> Your next to last sentence reads, I quote,
> "Put differently, we do not nee
There might be a more elegant approach.
That said, this (generating all permutations) is an exponential growth
algorithm, and your addition does not make that aspect any worse.
So, personally, I would not worry about it.
Still, it would be nice to find another approach.
Thanks,
--
Raul
On W
I tried this, and I noticed some differences from the implementation
at https://gabrielecirulli.github.io/2048/
Probably the most significant is that in the original if you have:
2
2
2
And you select the "up" direction, the result is:
4
2
Where currently your J implementation gives:
2
4
Ther
bout the merging behaviour. I think I must have mis-read the
> spec on Rosetta code. I've fixed it there and on Github now. Will be fixed
> in the next release.
>
> Using arrow keys would be nice - I'm investigating to see if I can make
> that happen.
>
> Cheers,
>
>
On a tangential note, there are faster ways of doing this.
If you are not comfortable with the math, yourself, you might use oeis
with some example values and find https://oeis.org/A000330 which
suggests F=: 3 :'y*(1+y)*(1+2*y)%6'
Is that an adequate solution?
F i.10
0 1 5 14 30 55 91 140 204
I need to do a better job of proofreading my messages.
In this case I should have said "that implementation uses floating
point" or something like that.
Sorry about that,
--
Raul
On Thu, Jun 23, 2016 at 12:23 PM, Raul Miller wrote:
> On a tangential note, there are faster ways
4900
> (according to Gardner). - Jud McCranie
> <https://oeis.org/wiki/User:Jud_McCranie>, Mar 19 2001, Mar 22 2007 [This
> is a result from Watson. - Charles R Greathouse IV
> <https://oeis.org/wiki/User:Charles_R_Greathouse_IV>, Jun 21 2013]
> Amazing fact!
>
> O
s
p
o
i
l
e
r
s
p
a
c
e
.
.
.
.
.
.
.
.
.
.
f=: [ /: <:@] {"1 [
Or, if you prefer:
f=: dyad def 'x /: (y-1) { |:x'
Thanks,
--
Raul
On Sun, Jun 26, 2016 at 8:50 PM, Linda A Alvord wrote:
> Design a function f, so D f 3 will arrange the rows in order from small to
> lar
> Let me know if this still isn't clear. Linda
>
> -Original Message-
> From: Programming [mailto:programming-boun...@forums.jsoftware.com] On Behalf
> Of Raul Miller
> Sent: Sunday, June 26, 2016 9:04 PM
> To: Programming forum
> Subject: Re: [Jprogramming]
I was looking at
http://math.stackexchange.com/questions/1294800/average-distance-between-two-randomly-chosen-points-in-unit-square-without-calc
and I was wondering how one might perform this calculation in J.
It is, of course, fairly straightforward to approximate:
(+/ %#)+/&.:*:@:(-/)?2 2 1e
> integrals. I doubt it's possible. And it only gets worse for a cube etc, cus
> you'll have a triple integral etc.
>
> Regards
>
> On Tue, 7/5/16, Raul Miller wrote:
>
> Subject: [Jprogramming] Average di
I should probably do a better job of modeling this problem.
So, here's an approximate solution which I think models the integration process:
F=: (2*#) * */@:-. * +/&.:*:
prob=:dyad define
NB. x: number of samples for each dimension
NB. y: number of dimensions
dz=. %x-1
(dz^y)*+/^:_ F"1 >
dimensions which will be treated further in later
steps.
Or, if that's not viable (and it might not be), then I need some other
divide&conqueror approach for this problem.
Any hints (even if someone could remind me of a relevant technique's
name), that would help.
Thanks,
--
Raul
http://www.jsoftware.com/help/release/random.htm#scode
Thanks,
--
Raul
On Thu, Jul 7, 2016 at 8:37 AM, Martin Kreuzer wrote:
> Hi all -
>
> Approximating Pi using the Monte Carlo method (circle enscribed in unit
> square) came up with
>
>pia=. 13 : '(4 * y %~ +/ 1 >: +/ *: <: +: ? (2,y) $
Only for this example.
I can construct other examples where ?@ and ?@: give different results.
Do you see why?
Thanks,
--
Raul
On Thu, Jul 7, 2016 at 9:35 AM, 'Pascal Jasmin' via Programming
wrote:
> ? (2,y) $ 0 or u N v N
>
>
> is more formally equivalent to
>
>
> (2,y)?@:$ 0 or N u@:v
0 ?@$&>~ i.4
Does that help?
Thanks,
--
Raul
On Thu, Jul 7, 2016 at 10:06 AM, 'Pascal Jasmin' via Programming
wrote:
> I'd like to see an example.
>
>
>
>
> ----- Original Message -
> From: Raul Miller
> To: Programming forum
> S
(In case this is not obvious, I should note that you will need to add
a pair of parenthesis to that example before the actual difference
shows up.)
--
Raul
On Thu, Jul 7, 2016 at 11:23 AM, Raul Miller wrote:
>0 ?@$&>~ i.4
>
> Does that help?
>
> Thanks,
>
> -
I believe quadruple integration for the example of this thread would
require a different expression. If you want to buy me a mathematica
license, I might be inclined to install it on a machine and test this,
but for now, I just think it would look something like this:
Int[
Int[
Int[
Int[
7, 2016 at 11:32 AM, 'Pascal Jasmin' via Programming
wrote:
> you meant this:
>
> 0 ?@:($&>~) i.4
>
> don't actually understand why ?@ is different though.
>
>
>
> - Original Message -
> From: Raul Miller
> To: Programming forum
> Sent: T
le, once setup,
> from your main computer using vnc or ssh.
>
> On 07/07/2016 11:56 AM, programming-requ...@forums.jsoftware.com wrote:
>>
>> Date: Thu, 7 Jul 2016 11:40:57 -0400
>> From: Raul Miller
>> To: Programming forum
>> Subject: Re: [Jprogramming] Avera
Here is one approach:
Mn=: 13 :'y H.(-x+1e_7)2'"1
M=: 13 :'|:y Mn 1 2 3,&>/-i.1+y'
ms=. 13 : '(<:a),:%:a*(+:b)->:a[''a b''=.|:2%~/\"1 M y'
I'm not sure if that helps...
(I am also slightly dubious about that whole +1e_7 epsilon thing.)
--
Raul
On Thu, Jul 7, 2016 at 4:53 PM, 'Bo Jacoby' via
I need a routine which makes rotation matrices for a given angle.
For example, let's say that my angle is 0.05p1, I would be wanting
these two rotation matrices:
3 3$(2 1 o./ (,-)0.05p1) 0 4 1 3}&,=i.3
0.987688 0.156434 0
_0.156434 0.987688 0
00 1
and
3 3$(2 1 o./ (,-)0.0
)"0
>
> ptRot =: rx
> rlRot =: ry
> ywRot =: rz@:-
>
>ywRot 0.05p1
> 0.987688 _0.156434 0
> 0.156434 0.987688 0
>0 0 1
>ptRot 0.05p1
> 1 00
> 0 0.987688 0.156434
> 0 _0.156434 0.987688
>rlRot 0.05p1
> 0.987
4x4 is not a problem for me. It's trivial to ignore the extra
dimension. But euler angle conversion is a problem for me.
Specifically, though, https://en.wikipedia.org/wiki/Orbital_elements
and https://en.wikipedia.org/wiki/Orbital_state_vectors is where I am
trying to focus my attention.
Thanks,
I did not have any problem with your presentation in
http://jsoftware.com/pipermail/programming/2016-July/045440.html
(other than a mild reaction to the bulk of code you used for such a
simple concept).
But, since this topic provokes a lot of back and forth, I suppose it
won't hurt to go over it y
No, but you can make one.
For example:
x(((<<<_2){{.,@,.}.)[`u`v`w`...`])y
I hope this helps.
--
Raul
On Tue, Jul 12, 2016 at 8:38 AM, dahn oak wrote:
> Hello, is there any language cunstruction that is equivalent to:
>x u x v x w ... y
> where x and y are the arguments of the constr
ct? Easy enough to test:
10 + 10 - 10 * 10 % 20
15
I hope this helps,
--
Raul
On Tue, Jul 12, 2016 at 9:19 AM, dahn oak wrote:
> Thank you, Raul. It's quite complicated for understanding yet, but I
> appreciate it!
>
> Tue, 12 Jul 2016 09:04:01 -0400
> Raul Miller :
>&
>+`-`*/7 7 7 5
> _21
>
> You could wrap this in a function also to do the replication based on $gerund.
>
> foo
> 4 : ' r=:x/(($x),1)#y'
>
>(+`-`*) foo 7 5
> _21
>
> Regards Rob
>
>
>> On 12 Jul 2016, at 11:04 PM, Raul Miller wrote:
&
I am a little concerned about the stability of this approach.
I extracted your timing test from earlier, and then started playing
with normalization.
rand=: [: ? ] # 0"_
vv=. 1e6 3$ _1+2*rand 3e6
uu=. norm 1e6 3$ _1+2*rand 3e6
ww=. _1p1+2p1*rand 1e6
echo timespacex'rr=. vv qRot (uu;ww)'
echo time
(] {~ i.@#@] -. pi~) does not look right, to me. Instead, I think I'd
use something like:
dfe=: (] #~ #@[ = pi)&.|.
Or, perhaps:
co=: i:~ (] - {) /:@/:
ip=: #@[ ({. i.&(,.co) }.) [ i. ,
dfe=: (] #~ #@[ = ip)
--
Raul
On Mon, Jul 25, 2016 at 12:08 PM, 'Pascal Jasmin' via Programm
strikeb2 verb (simplified by Roger) [0],
>
> delfromend=. strikeb2~&.:|. f.
>
> PS. The verb strikeb2 can be rewritten tacitly as,
> strikeb2=. [ #~ (i.~ (] - {) /:@/:)@:[ >: ([ i.~ ~.@:]) { 0 ,~ #/.~@:]
>
> [0] [Jforum] Custom fit and set functions
> http://
Yes, of course there is. Starting with the obvious:
kludge=: '@:(o.@:(%&3))'Cloak@:('/.'Cloak@:(('`'Cloak@('&o.'Cloak)each )))
junk=: 4 :'kludge x y'
But I expect you will be asking for a tacit expression, instead of the
junk I am presenting here, and that's doable also - though I suspect
tha
Er... if I remember right, you are not talking about the J we can
download from jsoftware.com but your modified version?
Thanks,
--
Raul
On Sun, Aug 14, 2016 at 11:16 PM, Jose Mario Quintana
wrote:
> I forgot to emphasize, is better late than never, that fully fixed tacit
> (no compromises) c
))@:(<@:((0;1;0)&({::@:[)
> ))((`_)(`:6)))
>
> Why did you ask? Perhaps because some of my statements were
> misleading or unclear
> to you? Maybe you think I made a mistake (which definitely I am quite
> capable of making)?
>
>
> [0] [Jprogramming] T
cd is defined as part of the base system.
http://www.jsoftware.com/help/user/call_procedure.htm
chdir would be 1!:44 if it were defined.
http://www.jsoftware.com/help/dictionary/dx001.htm
I hope this helps,
--
Raul
On Tue, Aug 16, 2016 at 4:40 PM, Skip Cave wrote:
> Robert,
>
> Starting th
num files are, which is
>
>
> C:/Users/Skip/j64-804/projects/unum (where the utils.ijs file is located)
>
>
> So I tried:
>
>
> 1:!44 '~projects\unum'
>
> |syntax error
>
> | 1:!44'~projects\unum'
>
> Still no luck.
>
&g
Yes.
({.~ i:&'/');(4!:4 <'is_unum') { 4!:3''
gives the directory where unum's utils.ijs was loaded from. (And this
can even be done in that same script, after is_unum has been defined.)
That said, for the long run, it would probably be better to stuff this
in a variable and use it where neede
unums are lossy, by design. The losses were chosen to give plausible
results for certain equations involving zero.
Also, you can use JNFS"0 and SFJN"0 if you want to deal with vectors.
Or, maybe give those names...
Thanks,
--
Raul
On Wed, Aug 17, 2016 at 10:02 AM, Skip Cave wrote:
> Playing
Actually, J usually stores the number in whatever format it happens to
be storing it as.
However, when J displays the number, it routinely removes irrelevant
information.
Something similar happens when you enter numbers.
Thus:
2j0
2
datatype 2j0
integer
1j1 + 1j_1
2
datatype 1j1 + 1
the interval 0j0.5 and everything's ok.
> Unfortunately, not the mirror interval on the negative side.
>
>
> Skip
>
>
>
> Skip Cave
> Cave Consulting LLC
>
> On Thu, Aug 18, 2016 at 3:49 PM, Raul Miller
> wrote:
>
> > Actually, J usually stores th
> Skip
>
> Skip Cave
> Cave Consulting LLC
>
> On Thu, Aug 18, 2016 at 6:04 PM, Roger Hui
> wrote:
>
>>cmpx=: j.&0
>>
>>datatype cmpx 1 0
>> complex
>>datatype cmpx 3 4
>> complex
>>datatype cmpx 5.
Er... for something like this, I would probably start with one of Roger's
implementations from http://code.jsoftware.com/wiki/Essays/N_Queens_Problem
#;:queenst f. 1 :'5!:5<''u'''
42
Looks like yours is more concise though.
I hope this helps...
--
Raul
On Sat, Aug 20, 2016 at 6:49 PM, Lou
That is not a cycle.
(1+i.26) -. {."1 edges
8 19 24
--
Raul
On Thu, Aug 25, 2016 at 6:13 AM, R.E. Boss wrote:
> Given the edges in a graph which is a cycle, like
>edges
> 1 2
> 3 1
> 2 4
> 4 5
> 5 6
> 6 7
> 7 8
> 9 8
> 10 9
> 11 10
> 11 12
> 12 13
> 14 15
> 15 16
> 17
Best I can come up with is
{."1 ((] , -. {~ {.@I.@(-. +./"1@e. {:@]))^:(<:@#@[) ,:@{.) edges
1 3 17 18 18 20 20 21 22 14 15 16 23 26 25 13 12 11 11 10 9 7 6 5 4 2
Change {.@I. to {:@I. if you want things in the other order.
--
Raul
t some vertices and duplicates others.
>
>
> --------
> On Thu, 8/25/16, Raul Miller wrote:
>
> Subject: Re: [Jprogramming] determine the cycle
> To: "Programming forum"
> Date: Thursday, August 25, 2016, 9:07 PM
>
> Best I can come up with
> is
>
>
ot;1
> {:x'))^:(#@>@{:) ({.;}.) edges
> 1 2 4 5 6 7 8 9 10 11 12 13 24 25 26 23 16 15 14 22 21 20 19 18 17 3 1
>
>
> R.E. Boss
>
>
>> -Original Message-
>> From: Programming [mailto:programming-boun...@forums.jsoftware.com]
>> On Behalf
2016 at 5:50 PM, Louis de Forcrand wrote:
> I think the 2 at the beginning of your solution (1 _2_ 3 17 …) should be at
> the end.
>
> Cheers,
> Louis
>
>> On 25 Aug 2016, at 23:21, Raul Miller wrote:
>>
>> I am more than willing to believe that I have
--
Raul
On Fri, Aug 26, 2016 at 1:26 AM, R.E. Boss wrote:
> I share this talent: 2 is not adjacent to 3 was what I meant.
>
>
> R.E. Boss
>
>
>> -Original Message-
>> From: Programming [mailto:programming-boun...@forums.jsoftware.com]
>> On Be
Yes:
5^441 442
1.76105e308 _
Thanks,
--
Raul
On Fri, Aug 26, 2016 at 5:38 PM, Brian Schott wrote:
> Martin,
>
> Your examples of gm0 failing are not clear to me because you use random
> data.
> I tried the following nonrandom data, but a sort of random case where the
> number of data value
Actually, if we try your approach on -8 2 4 3 1 6 we get _8 _2 _1
instead of _8 _4 _3 _1.
Here's a brute force O(2^n) approach that I hacked up earlier - it
obviously only works on short lists:
increasing=: (-: /:~)@#~"1 #:@i.@^~&2@#
longestinc=: ] #~ [: (#~ ([: (= >./) +/"1)) #:@I.@increasing
W
Or, to generate the counting sequence of such numbers, see:
https://www.rosettacode.org/wiki/Look-and-say_sequence#J
Thanks,
--
Raul
On Fri, Sep 2, 2016 at 5:09 AM, Henry Rich wrote:
> See http://code.jsoftware.com/wiki/Essays/Advent_Of_Code#Part_1_10
>
> Henry Rich
>
>
> On 9/2/2016 12:42 A
> Subject: Re: [Jprogramming] Greatest Increasing Subsequence
>
> To: 'Mike Day' via Programming
>
>
>
> Same problem with my version, which was faster but equally wrong! Mike On
> 02/09/2016 14:57, Raul Miller wrote: > Actually, if we try your approach on
&g
lt;_) ; ]
>c=.[: > s {~ [: {.@\: #@>@s
>g=.}.@n ;~ {.@n ; s h {.@n
>n=.>@{:
>s=.>&{.
>h=.[: ; e&.>
>e=.<@[`([ ; [ , ])@.t
>t=.{:@[ < ]
>f 7 4 4 5 2 7 1 8 13 2 10 4 9 1 4 5 5 4 3 10 3 4 5 8 15 7 11 19
> 1 2 3 4 5
One thing I keep meaning to do, when i see stuff like this, is verify
that the various versions are giving the same results for the same
test arguments. (In the past, I have seen timing examples where we
were comparing timings on code that gave different results.)
I haven't done that here, yet, bu
4 17 20
>
> 4 5 9 13 14 17 20
>
> lisXR a
>
> 0 1 3 13 14 17 20
>
> lisEH a
>
> 0 1 3 13 14 17 20
>
>
> Cheers,
> Erling
>
>
>
> On 2016-09-09 16:02, Raul Miller wrote:
>>
>> 1=#~.(lisI; lisJ; lisM; lisL; lisEH) a
&g
I use the curl which is bundled in cygwin.
So far, it has worked fine with https.
That said, I am trying to remember if I had to install some certificates on
my machine for that to work.
You might try adding --insecure to your curl command line options and
seeing if that makes it work.
Thanks,
You might try these:
require'trace'
trace'+/"1''abc''=/''abcbdefbbcbaa'''
trace'(+/"1''abc''=/])''abcbdefbbcbaa'''
This does not show everything, but does take you through the parsing
process up to where the error happens in the second statement.
(Also, beware of email agents which chan
The easy way to make a tacit verb (and worth trying whenever you feel
"stuck") is to use 13 : (remember the space preceding the :).
13 :'+/"1''abc''=/''abcbdefbbcbaa'''
3 5 2"_
Of course, you probably wanted a verb argument instead of just having that
constant in there, so:
13 :'+/"1''abc'
The boxing is a measurable performance issue, since you wind up doing a lot
of boxed operations.
The reversing is not a measurable performance issue, since it only happens
twice and because the overall algorithm is does so much more work.
Both of these are "conciseness" issues, however. But if co
This is not a property of format, but a property of numbers.
These are numerically equivalent:
1
01
001
0001
1
01
001
0001
and so on...
If you are concerned with the textual distinction you should be
working with text and not numbers.
Thanks,
--
Raul
Or:
_5{.":1e9+1
1
_5{.":1e9+34
00034
_5{.":1e9+340
00340
_5{.":1e9+3400
03400
You can use extended precision if you need more than 18 digits...
FYI,
--
Raul
On Fri, Sep 23, 2016 at 5:13 PM, robert therriault
wrote:
> Working with Bjorn's suggestion, you could do this
>
>
Further note:
gethttp uses the instance of curl installed in addons/web/gethttp/bin/curl.exe
Currently, this is being built without libssl support, which is why
gethttp fails with https urls.
This probably should be fixed, given how prevalent https is becoming
(boosted by hostile activities on t
icial website,
> * https://curl.haxx.se/download.html
>
> Which one is the best for inclusion in J addons?
>
> Сб, 24 сен 2016, Raul Miller написал(а):
>> Further note:
>>
>> gethttp uses the instance of curl installed in
>> addons/web/gethttp/bin/curl.exe
>>
^: is induction, not recursion. You should use either $: or a named
routine if you want recursion.
Also, ^: is defined such that the left argument is constant and the
right argument is the result of the previous function evaluation. (Or,
initially, the initial right argument.)
Still, you can sort
never come back to the first. This has some obvious
advantages, especially when it's what you wanted in the first place.
Thanks,
--
Raul
On Tue, Sep 27, 2016 at 3:55 AM, Raul Miller wrote:
> ^: is induction, not recursion. You should use either $: or a named
> routine if you want
I am not Henry.
It looks like you already caught that, but ...
...just saying,
--
Raul
On Wed, Sep 28, 2016 at 6:58 AM, Erling Hellenäs
wrote:
> Hi all !
>
> My solution, sort version:
>
> NB. Erling
>
> ZigZagE=:([: /: ] (([: $ [) $ ]) [: (], [: |. [: }: }.) [: i. [) { ]
>
> NB. Mike
>
> st
To follow up on the message I sent off-list, here's some perspective
on how to construct an inductive implementation of remove-every-nth.
First, let's get a non-numeric list to remove every nth, from:
'abcdefghij'
abcdefghij
Second, if we are going to remove every third element, inductively,
On Sat, Oct 1, 2016 at 10:23 AM, Marshall Lochbaum wrote:
> J's arrays are immutable in normal use. When you write (2 (7}) a), J
> makes a new copy of (a), changes the value at index 2 to a 7, and
> returns that array, which is now unrelated to (a). There's no way to
> modify the original array us
Oops, it looks like Henry beat me to the punch, and that I had
overlooked his message.
Oh well, repetition can sometimes be a good thing.
Thanks,
--
Raul
On Sat, Oct 1, 2016 at 12:07 PM, Henry Rich wrote:
> Yep, that's how it works. Temporary results can be operated on in-place.
> Also name
I don't think that scalar languages vs. array languages is the issue, here.
Thanks,
--
Raul
On Sun, Oct 2, 2016 at 9:32 AM, Don Guinn wrote:
> Scalar languages have a need for non-mutable arrays. Array languages do
> not. As Bill said, all arrays in J are non-mutable. But names are not. As I
mory location
> are synonymous. So the issue of non-mutable arrays and non-mutable names
> are synonymous. In J they are not.
>
>
> On Oct 2, 2016 8:29 AM, "Raul Miller" wrote:
>
>> I don't think that scalar languages vs. array languages is the issue, here.
>&
bs don't look like they lend themselves to update in
> place anyway. But that's what the beta is for. To make sure that the update
> in place logic won't result in corrupted arrays.
>
> I'm not familiar with Forth. If it provides looping and updating in place
> even o
This has been bothering me. After sleeping on it, I think I know how
to articulate my concerns:
It seems unnecessary.
First, the error handling in this case could restore the shape of a to
its original value and that seems like it should be simple.
However, also, in hypothetical analogous cases
(a) trick, while clever, does not work in the implementation
> because (a =: 0) does not actually reduce the usecount of a until the
> sentence completes.
>
> Henry Rich
>
>
> On 10/3/2016 7:21 PM, Raul Miller wrote:
>>
>> This has been bothering me. After sleeping
they provide; I think the new changes have even higher bang for the buck.
>
> hr
>
>
>
> On 10/3/2016 9:50 PM, Raul Miller wrote:
>>
>> I mentioned (a=:0](a) because we seem to be talking about changing the
>> implementation.
>>
>> Specifically, if we a
uld be no way to restore (a).
>
> And in general, many in-place verbs may have executed before the error. The
> original (a) may be long gone.
>
> If you foresee this as a problem, you should execute 9!:53(0) to turn off
> early assignment.
>
> Henry Rich
>
> On 1
assert is based on 13!:8 http://www.jsoftware.com/help/dictionary/dx013.htm
assert. is documented at http://www.jsoftware.com/help/dictionary/cassert.htm
One significant difference is that you can turn off assert. after you
are done testing (if the performance cost becomes significant) using
9!:3
t; Since there's only one operation, if it fails a shouldn't be modified
>> should it?
>> If so, copying a at the beginning of a tacit verb containing more than one
>> in-place operation (IPO) should always be faster than the current
>> implementation, since copying wo
Probably not the right forum for this? Or, at least, this doesn't work
for me, in J.
Maybe chat would work.
--
Raul
On Thu, Oct 6, 2016 at 4:33 AM, Erling Hellenäs
wrote:
> Hi all !
>
> This test with an immutable list class shows how you can get a copy with one
> changed element in 12 micros
I'm not quite sure I understand what you are doing here.
Here's what I understand from your description:
You're looking for rows where a bit set in X has a bit set in Y, and
you want to split up X and Y into smaller pieces for your intermediate
result, and you want to use indices rather than bit
> I would describe the higher level operation as: select the rows of Y where
> X is 1. Then take the column-wise OR of them.
>
> However the real thing I'm interested in is generating the lookup tables
> which serve as an intermediate step in the higher level operation.
>
>
801 - 900 of 4839 matches
Mail list logo