Skip to main content
Filter by
Sorted by
Tagged with
2 votes
1 answer
115 views

At the risk of asking a question with an obvious solution: if I have a function in J that takes two arguments and returns two arguments and I want to accumulate the answer's second argument and to use ...
Shmuel Greenberger's user avatar
3 votes
2 answers
164 views

Given a table with two columns: 1 2 3 4 2 1 1 2 I'm trying to understand how to produce a list of only the numbers which appear in both columns. E.g. 1, 1, 1, 2, 2, 2 in this example. I can see Nub ...
user avatar
2 votes
2 answers
154 views

I am a beginner learning J based on this book (2015 version). I was able to run all examples until this one from the calculus chapter: ^&3 d. 1 3&*@(^&2) I get this error locally: |...
hilberts_drinking_problem's user avatar
3 votes
2 answers
116 views

Perhaps there's no facility to do this in the J language, but when I write: succession =: monad define greg =. 1 2 3 tom =. {{ greg }} tom y ) and then call succession 'season 1', I get the ...
Pig's user avatar
  • 617
1 vote
1 answer
153 views

What's going on that makes this code work? It seems that using m in an anonymous verb (if that's what it's called) turns the verb into a postfix operator. 1 {{ 1 + m }} 2 If I replace the m with y ...
Pig's user avatar
  • 617
3 votes
2 answers
105 views

I am a relatively new programmer in J-Lang and recently discovered its efficacy in Code Golfing, where it excels in scoring. I am currently working on a coding problem that involves printing all prime ...
user21524036's user avatar
5 votes
1 answer
181 views

Given the following list of boxed lists of differing lengths… ┌──────────────┬───────────┬─────┬───┐ │0 2 3 4 7 9 11│9 7 4 3 2 1│1 2 3│3 1│ └──────────────┴───────────┴─────┴───┘ How can I create a ...
Gregory Higley's user avatar
1 vote
3 answers
262 views

I am trying to come up with a verb that will take a string as input and printa character uppercase if it is a vowel i.e. (aeiou) or lowercase if it is a consonant. s=:'authority' t=:<&>s │a│...
user3234709's user avatar
0 votes
1 answer
117 views

I'm trying to do the 4th Advent of Code problem using J, and I've ran into lots of problems, but now I have a code that looks like this: fn =. < 'D:/PyCharm/AOC/output4.txt' data =. freads fn ...
Oqueo34's user avatar
2 votes
1 answer
224 views

Suppose I have a boxed array like; ┌─┬─┬─┐ │1│2│3│ └─┴─┴─┘ how do I covert it to a normal array such as 1 2 3?
M4X_'s user avatar
  • 583
2 votes
1 answer
94 views

Suppose I have an array of strings "31,793.1" "29,798.6" "30,455.7" "29,700.9" How do I replace , with nothing to give me "31793.1" "29798.6"...
M4X_'s user avatar
  • 583
6 votes
2 answers
245 views

In the paper "Combinatory Logic and Combinators in Array Languages" they give a solution in APL: vec ← 1 1 0 1 1 1 0 0 0 1 ⍝ split (partition) on zeroes ⊆⍨vec ┌───┬─────┬─┐ ...
madeofmistake's user avatar
2 votes
1 answer
118 views

If x were a boxed string, I expect x=<'ABC' to compare the >x to 'ABC' to see if they are equal, but the following example shows that this is not the case. The J vocabulary document doesn't say ...
Recuerdos de la Alhambra's user avatar
3 votes
1 answer
142 views

I am getting an unexpected value error when I use a name to pass a verb as the argument to an adverb. The adverb (integer binary search with predicate u and bounds x): bsearch=: adverb define r=. y ...
Rik Renich's user avatar
  • 1,126
1 vote
1 answer
160 views

I know how to reshape a list into a table. But how do I turn a table into a list or uni- dimensional array. my_list=:3 4 $i.12 0 1 2 3 4 5 6 7 8 9 10 11 And is it better to perform operations on ...
user3234709's user avatar
3 votes
2 answers
133 views

Let's assume I have a following tensor t: ]m=: 100 + 4 4 $ i.16 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 ]t=: (m ,: m+100) , m+200 100 101 102 103 104 105 106 107 108 109 ...
paweljakubas's user avatar
3 votes
1 answer
185 views

I'm trying to find the 4-neighbors of all 1's in a matrix of 0's and 1's using the J programming language. I have a method worked out, but am trying to find a method that is more compact. To ...
N Matteson's user avatar
2 votes
0 answers
116 views

In python's repl, _ holds the value of the last operation. Where is the value of the last operation saved in the j repl?
honestSalami's user avatar
2 votes
1 answer
108 views

Let's assume we have a vector and matrix like below: r =: 100 + 5 5 $ i.25 r 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 v =: 100 + 5 $...
paweljakubas's user avatar
3 votes
2 answers
119 views

Very new to J. I love it but still far from fluent in it. I have managed to hit an issue and I don't know why it is happening. If somebody could please explain why this is occuring I could learn more ...
jc52766's user avatar
  • 181
3 votes
1 answer
146 views

I'm trying to understand the solution for day 1 part 2: https://code.jsoftware.com/wiki/Essays/Advent_Of_Code#Part_2 PART2=: >: _1 i.~ +/\ 1 _1 mp '()'=/read'input' I feel like I understand most ...
madeofmistake's user avatar
2 votes
1 answer
104 views

I've got two ways to amend a subarray in J but I don't like either of them. (Imagine selecting a rectangle in a paint program and applying some arbitrary operation to that rectangle in place.) t =. ...
tangentstorm's user avatar
  • 7,375
4 votes
4 answers
124 views

When using J console ijconsole I get only results up to some. For example, ijconsole -js "a=. 3 3 5 6 " "echo 200 $ a" "exit''" 3 3 5 6 3 3 5 6 3 3 5 6 3 3 5 6 3 3 5 6 ...
paweljakubas's user avatar
4 votes
3 answers
1k views

Conor Hoekstra recently solved a Leetcode problem in APL https://youtu.be/QtvvQ7MdwKY The problem is to take the first x words from a character string y In J, using &. (Under) and ;: (Words) I can ...
bob's user avatar
  • 4,342
3 votes
1 answer
91 views

In J, how do you idiomatically amend an array when you have: substitution0 multipleIndices0 ... substitutionN multipleIndicesN (not to be confused with: substitution0 multipartIndex0 ... ...
dukereg's user avatar
  • 732

1
2 3 4 5
9