: [Jprogramming] Submatrices
({. ,.&.> }.)"1@:((1 1,:2 1)&(<;._3)) a
Henry Rich
On 12/11/2019 6:43 PM, Nimp O wrote:
> Hello everyone,
>
>
> Given
> ]a=: 3 4 $ 1 1 1 _1 4 2 1 _1 9 3 1 1
>
>
> 1 1 1 _1
>
> 4 2 1 _1
>
> 9 3 1 1
>
> I wa
Hello everyone,
Given
]a=: 3 4 $ 1 1 1 _1 4 2 1 _1 9 3 1 1
1 1 1 _1
4 2 1 _1
9 3 1 1
I want to find the submatrices:
f a
┌───┬───┬┐
│1 1│1 1│1 _1│
│4 2│4 1│4 _1│
├───┼───┼┤
│4 2│4 1│4 _1│
│9 3│9 1│9 1│
└───┴───┴┘
I have a quite lengthy solution for this task.
I was wonderin
Interesting.
Also, checking the Requests page I see that support for assignment in tacit
expressions has already been suggested.
Another approach could be to make it less awkward to mix tacit and explicit.
In this regard, I really like the Fast Function Definition suggestion:
https://code.jsoft
>
> 2 $ ?@#
>
> As Henry said, to store an intermediate value in a verb's evaluation for use
> _after_ it's application, you must use an explicit verb, for example:
>
> ,~ @ (3 : 'a=: y') @ (?@#)
>
> Cheers,
> Louis
>
>> On 21 Nov 2019, at 03:2
Hello, simple question.
This behaviour surprised me.
(a,a=.?@#)'01234'
2 4
3 : 'a,a=.?@#y' '01234'
1 1
Why a is not equal to a in the first case? How can I save the roll as an
intermediate result in the tacit version?
Thanks.
--
Aug 1, 2019 at 5:01 PM Nimp O wrote:
> Perhaps this upper bound could be removed, at least for x:, since I believe
> the main use cases for tolerance on this verb would be bigger values, as
> illustrated in my earlier example.
> At least in this context, I can't see anythi
equal to 2^_34 . Historically, the upper bound on the
tolerance was chosen so that comparisons involving 32-bit integers are
exact (as if the tolerance is 0)."
FYI,
--
Raul
On Thu, Aug 1, 2019 at 9:33 AM Nimp O wrote:
>
> Hello everyone,
>
> What is the use of non-zero toler
Hello everyone,
What is the use of non-zero tolerance for the x: verb?
A little example:
a=:0.1667 0.8333 0.4286 0.
x:a
1667r1 8333r1 2143r5000 r1
In Mathematica:
In[1]:= Rationalize[{0.1667, 0.8333, 0.4286, 0.}]
Out[1]= {1667/1, 8333/1, 2143/5000, /100
My solution is based on the following recurrence formula of the generating
function: h(m,n) = h(m,n-m) + h(m-1, n-m).
Memoizing, as Roger pointed, helps a lot. The agenda is used to handle the edge
cases such as negative n or h(0,0) = 1.
h=:1:`0:`0:`(([h-~)+(<:@[h-~))`0: @.(#.@(,&*)) M.
7 h
."
> >
> > Do you mean that you want to replace matched digit sequences in that
> > text with some sort of representation of their offsets?
> >
> > Or are you intending something else?
> >
> > Thanks,
> >
> > --
> > Raul
>
I'm sorry, the pattern should be:
pat =: '\( (\d+)\,(\d+)\s+(\d+)\,(\d+)\s+\)'
From: Programming on behalf of Nimp
O
Sent: Thursday, April 11, 2019 1:01 PM
To: programm...@jsoftware.com
Subject: [Jprogramming] Regex merge with multiple groups
Hello everyone,
Here is a minimal working example of what I'm trying to accomplish:
load'regex'
pat =: '\( (\d)\,(\d)\s+(\d)\,(\d)\s+\)'
test=: 0 : 0
a
( 2,3
4,5 )
c
( 10,11
12,13 )
)
So using the regex pattern I was able to extract the numbers from this string.
Each
Hello everyone,
I think I have found a bug in 'convert/pjson'.
load 'convert/pjson'
dec_pjson_ '"\\f\\b"'
\ \
I believe double backslashes should be escaped first, as in:
dec_pjson_ '"\\f\\b"'
\f\b
I fixed the issue on my end by moving the double backslash to the first
substitution:
0639019,"answer_id":264298,"body_markdown":"Yes,
The problem is not in wget or curl. wget in centos doesn't have
the --compression option either.
Sat, 02 Mar 2019, Nimp O написал(а):
> Thank you bill,
>
> I tried piping the resulting binary stream
ll lam написал(а):
> > If you are using a recent enough version of wget, it should
> > automatically decompress data received.
> >
> > Sat, 02 Mar 2019, Nimp O написал(а):
> > > Hello everyone,
> > >
> > > For educational purposes I
support the above
mentioned option, not sure about the curl.exe in the addon.
Sat, 02 Mar 2019, bill lam написал(а):
> If you are using a recent enough version of wget, it should
> automatically decompress data received.
>
> Sat, 02 Mar 2019, Nimp O написал(а):
> > Hello everyone,
Hello everyone,
For educational purposes I'm trying to read a JSON response from the
StackOverflow API in J.
My current session is:
load'web/gethttp'
load'pjson'
api=:'http://api.stackexchange.com/2.2/answers/264298?order=desc&sort=activity&site=meta&filter=!.UDo6l2ikDi7iGlf'
gethttp api
�
fold"
Then
u~/ |.y
might be thought of as a "left fold".
Thanks,
--
Raul
On Wed, Nov 28, 2018 at 2:26 PM Nimp O wrote:
>
> Very interesting mathematical solution Mike.
>
> My initial idea to solve this type of sequence formula was using folds.
> The idea is to
Very interesting mathematical solution Mike.
My initial idea to solve this type of sequence formula was using folds.
The idea is to define a fold function g and fold it on a list of _1 and 1,
considering an initial value.
The result was:
g =. ]+2*[
4 ((g~/\.&.|.)@, ]$(_1 1)"_) 5
4 7 15 29
Another problem I see regarding editing lines:
Sometimes in jqt a have a bunch of results on my screen that I want to look. I
then proceed to do some incorrect calculation and I want to undo it (as in
erase the result).
The current way I do it is usig Ctrl-Z, but there are 2 problems:
1) It take
Here is my Euler 1 solution for reference. It is concise and I think it's
pretty easy to understand.
+/I.+./0=3 5 |/ i.1e3
233168
It's the same as:
sum(indices(any(zero?(remainder table
Another nice way to get a lot of digits from the golden ratio is using Newton's
Method.
In : http://www.jsoftware.com/jwiki/Essays/Newton%27s%20Method
N=: 1 : '- u % u d. 1'
correct50 =: '1.61803398874989484820458683436563811772030917980576'
0j50 ": (1 + ] - *:) N^:7 ] 1
1.6180339887498948482
And also..
(+ %:)/ 0,20$1
1.61803
> Date: Sun, 23 Feb 2014 20:11:11 +
> From: bojac...@yahoo.dk
> To: programm...@jsoftware.com
> Subject: Re: [Jprogramming] A Tale Without End
>
>{.>{:p. 1 1 _1
> 1.61803
s.htm
---
> From: k...@math.uh.edu
> Date: Sun, 23 Feb 2014 06:20:58 -0600
> To: programm...@jsoftware.com
> Subject: Re: [Jprogramming] A Tale Without End
>
> Very interesting, Linda. 1.61803 looks familiar, but I can't quite recognize
> it. No, it's not
>
> ^.5
> 1.60944
>
> --Kip Murray
>
> Se
24 matches
Mail list logo