Dataset Viewer
Auto-converted to Parquet Duplicate
repo
stringclasses
754 values
path
stringlengths
4
103
language
stringclasses
3 values
license_type
stringclasses
2 values
content
stringlengths
5
6.82M
found_at
stringlengths
27
27
johntiger1/rainbowlang
yolo.ijs
J
no_license
ace_modecolortm_scopeinterpreterstypeextensions
2026-08-12T08:13:25.890733Z
johntiger1/rainbowlang
yolo.ijs
J
no_license
ace_modecolortm_scopeinterpreterstypeextensions
2026-08-12T08:24:49.385994Z
johntiger1/rainbowlang
yolo.ijs
J
no_license
ace_modecolortm_scopeinterpreterstypeextensions
2026-08-12T08:28:35.032231Z
jsoftware/dev_lu
manifest.ijs
J
no_license
NB. lu manifest CAPTION=: 'LU implementation in J' DESCRIPTION=: 0 : 0 J LU code, called from 128!:10 ) VERSION=: '1.0.6' FILES=: 0 : 0 lu.ijs ) FOLDER=: 'dev/lu' RELEASE=: 'j902'
2026-08-12T08:31:21.621174Z
bhainesva/Advent-of-Code
1.ijs
J
no_license
F =: '/Users/bhaines/Downloads/input.txt' data =: 1!:1 < F n =: > ". each cutopen data +/<.(n%3)-2
2026-08-12T08:35:14.845292Z
jsoftware/graphics_print
manifest.ijs
J
no_license
NB. print manifest CAPTION=: 'print' DESCRIPTION=: 0 : 0 print text files ) VERSION=: '1.0.19' RELEASE=: '' FOLDER=: 'graphics/print' FILES=: 0 : 0 history.txt print.ijs printfns.txt )
2026-08-12T08:38:47.605681Z
Charlynux/advent-of-code-2022
src/day01.ijs
J
no_license
NB. sed 's/^$/0/g' day01.input > day01.input-fixed exampleinput =: readfile < '/Users/charles/git-repositories/advent-of-code-2022/datas/day01-example.input-fixed' input =: readfile < '/Users/charles/git-repositories/advent-of-code-2022/datas/day01.input-fixed' split_lines =: ;. _2 parse_numbers =: ". NB. Part 1 {: /...
2026-08-12T08:41:25.282030Z
Charlynux/advent-of-code-2022
src/day03.ijs
J
no_license
readfile =: 1!:1 writefile =: 1!:2 _6 <\ i.12 compartiment_size =: -@-:@# compartiment_size 'vJrwpWtwJgWrhcsFMMfFFhFp' NB. _12 _12 <\ 'vJrwpWtwJgWrhcsFMMfFFhFp' NB. Coupe en deux parties de 12 (<\~ compartiment_size) 'vJrwpWtwJgWrhcsFMMfFFhFp' 'vJrwpWtwJgWr' #~ 'vJrwpWtwJgWr' e. 'hcsFMMfFFhFp' NB. p 'hcsFMMfFFhFp...
2026-08-12T08:41:25.283032Z
Charlynux/advent-of-code-2022
src/day02.ijs
J
no_license
NB. --- Day 2: Rock Paper Scissors --- NB. Encrypted strategy guide NB. A X : Rock NB. B Y : Paper NB. C Z : Scissors NB. First column : Opponent NB. Scores NB. Rock : 1 NB. Paper : 2 NB. Scissors : 3 NB. + Lost : 0, Draw : 3, Win : 6 (<;._2'pid cid ecl eyr ') -. ({'pid') NB. cid ecl eyr draws =: < ;._2 'A X_B Y_C ...
2026-08-12T08:41:25.284034Z
soulplant/j
pandigital.ijs
J
no_license
ds2=: 3 : '(10&| , <.@(%&10))^:(i.nd y) y' ds3=: 3 : 0"0 r=.0$0 while. y do. r=.r,10|y y=.<.y%10 end. r ) ds4=: 3 : 0"0 10 | y <.@% (10 ^ i.-nd y) ) ds=: "."0@":"0 ds5=: (nd#10"_) #: ] pd=: [: (9 = #@~.) ds nd=: >:@<.@(10&^.) p=: (* 10 ^ nd) + ] cp=: x:@p/@:* NB. largest pandigital number that can be formed w...
2026-08-12T08:45:13.528493Z
soulplant/j
summarise.ijs
J
no_license
eg=: 5 10 S=: (#~ *@(+/)"1) @ (e.~ ({.,{:);._2 ])&(,&_) >:@i. S2=: 3 : '(#~ (0 ~: +/)"1) ((e.&(y,100)) ({.,{:);._2 ]) [n=. >:i.100' collatzv=: 3 : '<. (2|y)} 0 1 + 0.5 3 */y' cnv=: 3 : 0 NB. SL=. sequence length NB. Powers of 2 have SL = >:@(2&^.) NB. m stores a vectorised current step counter. When we adv...
2026-08-12T08:45:13.530490Z
soulplant/j
div.ijs
J
no_license
ts=: 6!:2 , 7!:2@] f=: (<.@%~ , |) 10&*@] NB. y is a two-element array 'a b' that represents 1%x as x * a + b%10. NB. y is a two-element array 'a b' that represents b%x as x * a + b%10. fn returns the next element of the sequence NB. call with integers x a b: x f (a,b) NB. returns c,d such that (a + b%x) = (c + d%x)%...
2026-08-12T08:45:13.530490Z
rubik/project-euler-j
solutions/005.ijs
J
no_license
echo *./ >:i.20 exit''
2026-08-12T08:46:18.425155Z
rubik/project-euler-j
solutions/019.ijs
J
no_license
NB. It's number of months in 100 years divided by number possible first days. NB. We are lucky enough (or, put it in another way, the probability of a right NB. answer if high enough) that that is the correct answer. echo <. 7 %~ 12 * 100 exit''
2026-08-12T08:46:18.427160Z
rubik/project-euler-j
solutions/046.ijs
J
no_license
NB. Table of sums (prime plus twice a square) t=:~., (+:*:>:i.1e3) +/ (p=:(i.&.(p:^:_1)) 1e4) NB. The rightmost part are odd composites up to 1e4 echo {. (#~-.@:(e.&t)"0) (2*i.5e3) -.~ (2+i.1e4) -. p exit''
2026-08-12T08:46:18.427160Z
rubik/project-euler-j
solutions/097.ijs
J
no_license
NB. This is kinda like cheating :) NB. The code (m&|@^) is a special[0], i.e. it gets optimized automatically. NB. In this case J can compute the remainder without even computing the whole NB. power. NB. NB. [0]: http://www.jsoftware.com/help/dictionary/special.htm echo >: m| 28433 * 2 (m&|@^) 7830457 [ m=:1e10 exit''
2026-08-12T08:46:18.428155Z
rubik/project-euler-j
solutions/016.ijs
J
no_license
echo +/"."0":2^1000x exit''
2026-08-12T08:46:18.428155Z
rubik/project-euler-j
solutions/102.ijs
J
no_license
NB. Sign of the origin with respect to two vertices sign=: 3 : 0 'x2 y2 x3 y3'=.y ((-x3)*(y2-y3)) - (x2-x3)*-y3 ) NB. Check if triangle contains the origin co=: 3 : 0 'x1 y1 x2 y2 x3 y3'=.y b1=.0>sign x1,y1,x2,y2 b2=.0>sign x2,y2,x3,y3 b3=.0>sign x3,y3,x1,y1 (b1=b2) *. (b2=b3) ) echo +/(co"1) 1000 6 $ "...
2026-08-12T08:46:18.428155Z
rubik/project-euler-j
solutions/010.ijs
J
no_license
NB. Here I make use of the "Under" conjunction &. NB. u &. v y <=> vi u v y NB. where vi is the obverse of v echo +/ (i.@x:)&.(p:^:_1) 2e6 exit''
2026-08-12T08:46:18.429155Z
rubik/project-euler-j
solutions/039.ijs
J
no_license
NB. An efficient algorithm to compute divisors of a number. It iterates only up NB. to the square root of n. div=: 3 : '/:~ (,y&%) }. (#~(=>.)) (]%[:i.(>:@>.@%:)) y' NB. The encode function transforms an array with repeated values in a NB. 2-dimensional array: NB. NB. v_i r_i NB. v_j r_j NB. .. NB. where v is a...
2026-08-12T08:46:18.429155Z
rubik/project-euler-j
solutions/004.ijs
J
no_license
NB. A is_pal function could be written as follows: NB. is_pal=:(-:|.)@":"0 NB. */ makes a multiplication table, ~. takes the nub of it (after , ravelled) echo >./(((-:|.)@":)"0#])~.,n*/n=:100+i.900 exit''
2026-08-12T08:46:18.429155Z
rubik/project-euler-j
solutions/036.ijs
J
no_license
NB. Identical to Roger Hui's solution! Uhh yaa echo +/ I. ((-:|.)@#: *. (-:|.)@":)"0 i.1e6 exit''
2026-08-12T08:46:18.430155Z
rubik/project-euler-j
solutions/053.ijs
J
no_license
echo +/ 1e6< , !/~ >:i.100 exit''
2026-08-12T08:46:18.430155Z
rubik/project-euler-j
solutions/028.ijs
J
no_license
sc=:(4*[:*:1+2*])-12*] echo -&3 +/ sc i.501 exit''
2026-08-12T08:46:18.430155Z
rubik/project-euler-j
solutions/042.ijs
J
no_license
wv=:[:+/([: -&64 a.&i.)"0 tw=: 3 : '(=>.) -: <: %: >: 8 * y' echo +/ >(tw@wv@-.&'"') each ',' cut 1!:1 <'words.txt' exit''
2026-08-12T08:46:18.431155Z
rubik/project-euler-j
solutions/099.ijs
J
no_license
NB. Instead of computing x^y, compute y ln x and compare the results. echo >: {. ((i.1000)\:(*^.)~/"1) 1000 2 $ ". (',';' ';LF;' ') rplc~ 1!:1<'base_exp.txt' exit''
2026-08-12T08:46:18.431155Z
rubik/project-euler-j
solutions/021.ijs
J
no_license
divs=: 3 : '/:~ (,y&%) }. (#~(=>.)) (]%[:i.(>:@>.@%:)) y' NB. Sum of the proper divisors for every number < 1e4. NB. Also, set to 0 if >1e4 (otherwise an index error is thrown on the next NB. line). d=:0 (I. 1e4< v) } v=:(-~+/@divs)"0 i.1e4 echo +/ (-.(#~(={&d)"0)) I. (=({&d@{&d))"0 i.1e4 exit''
2026-08-12T08:46:18.431155Z
rubik/project-euler-j
solutions/064.ijs
J
no_license
NB. J implementation (yes, first time I am forced to use imperative control NB. structures and... it sucks. I don't know if I'll be able to convert it to NB. tacit style... Anyway this is a translation from a Python script I wrote NB. some time ago. You can find it here: NB. https://gist.github.com/rubik/1454917 NB. ...
2026-08-12T08:46:18.431155Z
rubik/project-euler-j
solutions/067.ijs
J
no_license
cr=:2&(>./\) echo ". (LF;' + cr ')rplc~ (}.&.|.) 1!:1<'triangle.txt' exit''
2026-08-12T08:46:18.431155Z
rubik/project-euler-j
solutions/014.ijs
J
no_license
NB. So yeah, this cnv is taken from J Essays as well... (like other 2 NB. problems). I promise that as soon as I have time I'll rewrite it in my NB. style. collatzv=: 3 : '<. (2|y)} 0 1 + 0.5 3 */y' cnv=: 3 : 0 f=. 2^m=. i. <.@(2&^.)&.<: y m=. >:m C=. 0 ,~ m f} y{._1 j=.i=. 3 + i.@<.&.-: y-2 while. #i do. j=. c...
2026-08-12T08:46:18.432200Z
rubik/project-euler-j
solutions/007.ijs
J
no_license
echo p:10000 exit''
2026-08-12T08:46:18.432200Z
rubik/project-euler-j
solutions/069.ijs
J
no_license
NB. Unfortunately this one takes quite a while, ~4s on my machine NB. It can, however, be solved with pen and paper after making a couple of NB. observations. NB. NB. If n has factor 2, every multiple of 2 will not be relatively prime to n, NB. if n has factor 3, every multiple of 3 will not be relatively prime to n, N...
2026-08-12T08:46:18.432200Z
rubik/project-euler-j
solutions/040.ijs
J
no_license
NB. Naive and brute force solution echo */ "."0 (10^i.7) { ' ' -.~ ": i.187e3 exit''
2026-08-12T08:46:18.433200Z
rubik/project-euler-j
solutions/012.ijs
J
no_license
NB. Number of divisors nd=: 3 : '*/>:+/"1@=@q: y' tri=:-:@(*>:) echo {. tri@x:@>: I. >&500 nd"0 tri >:i.13000 exit''
2026-08-12T08:46:18.433200Z
rubik/project-euler-j
solutions/203.ijs
J
no_license
NB. At first I wrote a verb to compute the Pascal's triangle, which is shown NB. here: nr=: 3 : '2 +/\ (0, y, 0)' pa=: 3 : 'nr^:([:y&>1&{)^:a: (1 1)' NB. nr computes the next row based on the argument (which is the previous row). NB. pa computes y rows. NB. But then I realized that I could just used binomial coefficien...
2026-08-12T08:46:18.433200Z
rubik/project-euler-j
solutions/059.ijs
J
no_license
pile=: 4 : 'x #~ y= 3| i.#x' NB. Most common element mc=: 3 : '{:{. \:~ (#/.~y),.~.y' xor=:22 b. NB. Divide the encrypted message into 3 piles and look for the most common NB. character, which, in English, is a space. ASCII value of space is 32, so NB. it's easy to find the password ('god') c=:". LF -.~ (',';' ') rplc...
2026-08-12T08:46:18.433200Z
rubik/project-euler-j
solutions/020.ijs
J
no_license
echo +/"."0":!100x exit''
2026-08-12T08:46:18.434199Z
rubik/project-euler-j
solutions/055.ijs
J
no_license
r=:|.&.": NB. Pretty difficult to translate this one to tacit style. I'll have to ponder NB. it a bit. l=: 3 : 0 i=.0 while. i < 50 do. y=. x: (+r) y if. (=r) y do. 0 return. end. i=.>:i end. 1 ) echo +/ l"0 i.1e4 exit''
2026-08-12T08:46:18.434199Z
rubik/project-euler-j
solutions/089.ijs
J
no_license
NB. These two functions are taken from J's Wiki dfr=: 3 : 0 :. rfd i=. 'IVXLCDM' i. y d=. i{1 5 10 50 100 500 1000 +/d*_1^i<}.i,_1 ) r100 =. <;._1 ' C CC CCC CD D DC DCC DCCC CM' r10 =. <;._1 ' X XX XXX XL L LX LXX LXXX XC' r1 =. <;._1 ' I II III IV V VI VII VIII IX' R1000=: , r100 ,&.>/ r10 ,&.>/ r1 rfd=: 3...
2026-08-12T08:46:18.434199Z
rubik/project-euler-j
solutions/026.ijs
J
no_license
NB. Period length is the smallest i such that 10^i - 1 = 0 (mod y) cp=: 3 : 0 i=.>.10^.y while. y|<:10x^i do. i=.>:i end. i ) n=: 2 5 -.~ i.&.(p:^:_1) 1000 echo {. (\:cp"0) n exit''
2026-08-12T08:46:18.435199Z
rubik/project-euler-j
solutions/029.ijs
J
no_license
echo # ~. , ^/~ 2+i.99 exit''
2026-08-12T08:46:18.435199Z
rubik/project-euler-j
solutions/024.ijs
J
no_license
echo (1e6 - 1) A. '0123456789' exit''
2026-08-12T08:46:18.435199Z
rubik/project-euler-j
solutions/052.ijs
J
no_license
NB. Make a table, convert every number to string to sort it and back to NB. integer, then work on the rows ("1) to find out the one with numbers which NB. use the same digits. echo 1e5 + I. (*./@:(2&(=/\)))"1 (/:~&.":)"0 (1e5+i.5e4)*/(>:i.6) exit''
2026-08-12T08:46:18.435199Z
rubik/project-euler-j
solutions/006.ijs
J
no_license
echo (*:+/n)-+/*: n=:>:i.100 exit''
2026-08-12T08:46:18.436207Z
rubik/project-euler-j
solutions/022.ijs
J
no_license
NB. You could make it one line just by replacing names in the last line with NB. its content, but I felt it was too much :) names=:-.&' ' each <"1 /:~ > ',' cut -.&'"' 1!:1 <'names.txt' echo +/ */"1 (,.>:@i.@#) >(+/@:-&64@(a.&i.)) each names exit''
2026-08-12T08:46:18.436207Z
rubik/project-euler-j
solutions/063.ijs
J
no_license
NB. The table ^/~ 2+i.20x excludes all powers n^1, so I have to add back the NB. numbers 1-9 (which are 9), but 4, 8, and 9 are already included, as NB. 4 = 2^2, 8 = 2^3 and 9 = 3^2, so I only add 9 - 3 = 6. echo 6+ +/ g"0 ~., ^/~ 2+i.20x exit''
2026-08-12T08:46:18.436207Z
rubik/project-euler-j
solutions/001.ijs
J
no_license
NB. Alternative solution: NB. +/ I. +./ 0 = 3 5 |"0 1 i. 1000 NB. NB. Source: http://stackoverflow.com/questions/1555807/how-to-refactor-this-in-j echo +/~.(3*i.334),5*i.200 exit''
2026-08-12T08:46:18.437200Z
rubik/project-euler-j
solutions/243.ijs
J
no_license
NB. The solution must be a primorial or a number very close to it. NB. #10 is a solution while #9 is not. So the least solution must be #9 < #10. NB. For the solution to be minimal, just double until one is found. echo +:^:(15499r94744&<@x:@(5&p:%<:))^:_ */ p: i.9 exit''
2026-08-12T08:46:18.437200Z
rubik/project-euler-j
solutions/079.ijs
J
no_license
NB. This is way easier by hand. So this just extracts uniques and sorts them. echo /:~ ~. ". (1!:1 <'keylog.txt') rplc LF;' ' echo'Now just solve it by hand.' exit''
2026-08-12T08:46:18.437200Z
rubik/project-euler-j
solutions/035.ijs
J
no_license
NB. This sucks, but I'll improve it soon rot=: 3 : '(|.&(": y))"0 i. # ": y' circ=: 3 : '*./ 1 p: ". rot y' echo +/ circ"0 i.&.(p:^:_1) 1e6 exit''
2026-08-12T08:46:18.437200Z
rubik/project-euler-j
solutions/080.ijs
J
no_license
NB. This is a really useful one! sqrt=: 4 : '<.@%: y*10x^2*x' f=: 3 : '+/ "."0 ": 100 {. ": 120 sqrt y' echo +/ f"0 (-.*:) i.100 exit''
2026-08-12T08:46:18.438199Z
rubik/project-euler-j
solutions/101.ijs
J
no_license
lagrange=: ] +/ .* [ (] % p.~) 1 p.@;~&1\. [ u=:1 _1 1 _1 1 _1 1 _1 1 _1 1 d=:u p. >:i.11x fit=: 3 : 0 bops=.0 for_n. >:i.10 do. pol=.((>:@i.) lagrange ({.&y)) n if. n= +/ y= pol p. >:i.11 do. bops=.bops + pol p. >:n end. end. bops ) echo fit d exit''
2026-08-12T08:46:18.438199Z
rubik/project-euler-j
solutions/120.ijs
J
no_license
echo +/ a*(a+(2|(a=:3+i.998))-2) exit''
2026-08-12T08:46:18.438199Z
rubik/project-euler-j
solutions/015.ijs
J
no_license
NB. Compare the solution to an N * N grid to a Pascal triangle ;) echo (!+:)20 exit''
2026-08-12T08:46:18.438199Z
rubik/project-euler-j
solutions/048.ijs
J
no_license
echo |.10{.|.":+/(^x:)"0>:i.1000 exit''
2026-08-12T08:46:18.439202Z
rubik/project-euler-j
solutions/003.ijs
J
no_license
echo >./q:600851475143 exit''
2026-08-12T08:46:18.439202Z
rubik/project-euler-j
solutions/002.ijs
J
no_license
NB. fib is from J's wiki fib=: {. @ (2&x:) @ ((+%)/) @ (0 , $&1x) echo +/ (#~-.@(2&|)) fib"0 i.34 exit''
2026-08-12T08:46:18.439202Z
kxcontrib/cburke
jk/source/toq.ijs
J
no_license
NB. toq NB. NB. convert j data to q NB. ========================================================= NB. function, parameter list to Q ftoQ=: 3 : 0 NB. smoutput 'ftoQ';y msg=. toQ boxxopen y (2 ic 8 + #msg), msg ) NB. ========================================================= toQ=: 3 : 0 NB. smoutput 'toQ';y 'typ dat'=. ...
2026-08-12T08:46:54.693293Z
kxcontrib/cburke
jk/source/init.ijs
J
no_license
NB. init coclass 'cqclient' coinsert 'jsocket' NB. ========================================================= create=: 3 : 0 if. 1 = {.y do. makezfns'' end. EMPTY ) NB. ========================================================= destroy=: 3 : 0 disconnect'' codestroy'' )
2026-08-12T08:46:54.694293Z
kxcontrib/cburke
jk/source/dates.ijs
J
no_license
NB. dates NB. ========================================================= fix_date=: 3 : 0 if. 0 (e.,) '.' = 4 7 {"1 y do. 10;y return. end. msk=. y -:"1 JDATENULL val=. (-.msk) # dat=. _1 ". ' ' 4 7 }"1 y if. _1 (e.,) val do. 10;y return. end. if. 0 e. valdate val do. 10;y return. end. 14;JINTNULL (I.msk) } (todayno da...
2026-08-12T08:46:54.695293Z
kxcontrib/cburke
jk/source/methods.ijs
J
no_license
NB. methods NB. NB. all methods return a pair: NB. returncode (0=success) NB. result or throw message NB. NB. all methods wrapped in try/catcht NB. NB. close NB. cmd|cmdr|f|x NB. cmdraw NB. connect NB. disconnect NB. exec|execr|f|x NB. get|f|x NB. set NB. sub NB. NB. messages are ASYNC (no result), or SYNC (result)...
2026-08-12T08:46:54.695293Z
kxcontrib/cburke
jk/source/zfns.ijs
J
no_license
NB. zfns NB. NB. interactive cover functions, defined by makezfns: NB. ========================================================= view_z_=: 3 : 'view__locQ y' NB. ========================================================= ZFNS1=: 0 : 0 connect close cmd cmdr cmdrf cmdrx exec execr execrf execrx get getf getx sub ) NB....
2026-08-12T08:46:54.696295Z
kxcontrib/cburke
jk/source/defs.ijs
J
no_license
NB. defs ALPH0=: {.a. OK=: 0;EMPTY THROW=: '' TSDAY=: 864 * 10^11x KSHORTNULL=: <.-2^15 KFLOATNULL=: 0 0 0 0 0 0 248 255 { a. KREALNULL=: 0 0 192 255 { a. JINTNULL=: <.-2^31 JFLOATNULL=: __ JLONGNULL=: -2^63x JDATENULL=: 'nnnn.nn.nn' JDATETIMENULL=: 'nnnn.nn.nnTnn:nn:nn.nnn' JMINUTENULL=: 'nn:nn' JMONTHNULL=: 'nnnn....
2026-08-12T08:46:54.696295Z
End of preview. Expand in Data Studio

No dataset card yet

Downloads last month
19