Simple database: Difference between revisions

m
→‎{{header|J}}: improve accuracy of data in database.
m (→‎{{header|J}}: improve accuracy of data in database.)
Line 357:
Assume the j code is stored in file s . These bash commands, stored in file input , create a database using add .
<lang sh>D='jconsole s dataflow'
 
$D add name expression algebraic rank valence example explanation
$D add insert 'f/ y' 'insert f within y' infinite dyad 'sum=: +/' 'continued_fraction=:+`%/'
$D add fork '(f g h)y' 'g(f(y),h(y))' infinite monad 'average=: +/ % #' 'sum divided by tally'
$D add hook '(f g)y' 'f(y,g(y))' infinite monad '(/: 2&{"1)table' 'sort table by third column'
$D add hook 'x(f g)y' 'f(x,g(y))' infinite dyad 'display verb in s' 'a reflexive dyadic hook'
$D add fork 'x(f g h)y' 'g(f(x,y),h(x,y))' infinite monaddyad '2j1(+ * -)9 12' 'product of sum and difference'
$D add reflexive 'f~ y' 'f(y,y)' infinite monad '^~y' 'y raised to the power of y'
$D add passive 'x f~ y' 'f(y,x)' 'ranks of f' dyad '(%~ i.@:>:) 8x' '8 intervals from 0 to 1'
Line 410:
┌───────────────────────┬──────────┬──────────┬─────────────────┬──────────┬───────┬─────────────────┬─────────────────────────────┐
│time │name │expression│algebraic │rank │valence│example │explanation │
│2012-02-0708:2023:3645:5406.749│many539│many more!│ │ │ │ │ │ │
│2012-02-0708:2023:3645:5406.541│insert329│insert │f/ y │insert f within y│infinite │dyad │sum=: +/ │continued_fraction=:+`%/ │
│2012-02-0708:2023:3645:5406.612│hook400│hook │x(f g)y │f(x,g(y)) │infinite │dyad │display verb in s│a reflexive dyadic hook │
│2012-02-0708:2023:3645:5406.682│passive426│fork │x f~ y │x(f g h)y │f│g(f(x,y),h(x,y)) │infinite │dyad │2j1(+ * │ranks of f│dyad │(%~ i.@:>:-)9 8x12 │8 intervals from 0 to 1 │product of sum and difference│
│2012-02-0708:2023:3645:5406.727│atop 471│passive │x f@g~ y │f(g(y,x,y)) │rank of g │dyad│ranks of f│dyad │>@{. │(%~ i.@:>:) 8x │8 intervals from 0 to │(lisp) open the car 1
│2012-02-0708:2023:3645:5406.564│fork515│atop │(│x f @g h)y │g │f(fg(y)x,h(y)) │infinite │monad │rank │average=:of +/g %│dyad # │sum divided│>@{. │(lisp) open the bycar tally
│2012-02-0708:2023:3645:5406.589│hook353│fork │(f g h)y │f│g(f(y),gh(y)) │infinite │monad │/│average=: 2&{"1+/ % # │sum divided by tally │sort table by third column
│2012-02-0708:2023:3645:5406.635│fork376│hook │x(f g h)y │g │f(f(x,y),hg(x,y)) │infinite │monad │+ * - │infinite │monad │(/: 2&{"1)table │sort by third column │product of sum and difference│
│2012-02-0708:2023:3645:5406.660│reflexive448│reflexive │f~ y │f(y,y) │infinite │monad │^~y │y raised to the power of y │
│2012-02-0708:2023:3645:5406.705│atop493│atop │f@g y │f(g(y)) │rank of g │monad │*:@(+/) │square the sum │
└───────────────────────┴──────────┴──────────┴─────────────────┴──────────┴───────┴─────────────────┴─────────────────────────────┘
$ $D display all entries
┌───────────────────────┬──────────┬──────────┬─────────────────┬──────────┬───────┬─────────────────┬─────────────────────────────┐
│time │name │expression│algebraic │rank │valence│example │explanation │
│2012-02-0708:2023:3645:5406.541│insert329│insert │f/ y │insert f within y│infinite │dyad │sum=: +/ │continued_fraction=:+`%/ │
│2012-02-0708:2023:3645:5406.564│fork353│fork │(f g h)y │g(f(y),h(y)) │infinite │monad │average=: +/ % # │sum divided by tally │
│2012-02-0708:2023:3645:5406.589│hook376│hook │(f g)y │f(y,g(y)) │infinite │monad │(/: 2&{"1)table │sort by third column │sort table by third column
│2012-02-0708:2023:3645:5406.612│hook400│hook │x(f g)y │f(x,g(y)) │infinite │dyad │display verb in s│a reflexive dyadic hook │
│2012-02-0708:2023:3645:5406.635│fork426│fork │x(f g h)y │g(f(x,y),h(x,y)) │infinite │monad│dyad │2j1(+ * -)9 12 │product of sum and difference│
│2012-02-0708:2023:3645:5406.660│reflexive448│reflexive │f~ y │f(y,y) │infinite │monad │^~y │y raised to the power of y │
│2012-02-0708:2023:3645:5406.682│passive471│passive │x f~ y │f(y,x) │ranks of f│dyad │(%~ i.@:>:) 8x │8 intervals from 0 to 1 │
│2012-02-0708:2023:3645:5406.705│atop493│atop │f@g y │f(g(y)) │rank of g │monad │*:@(+/) │square the sum │
│2012-02-0708:2023:3645:5406.727│atop515│atop │x f@g y │f(g(x,y)) │rank of g │dyad │>@{. │(lisp) open the car │
│2012-02-0708:2023:3645:5406.749│many539│many more!│ │ │ │ │ │ │
└───────────────────────┴──────────┴──────────┴─────────────────┴──────────┴───────┴─────────────────┴─────────────────────────────┘
$ cat dataflow
'2012-02-0708:2023:3645:5406.512304';'name';'expression';'algebraic';'rank';'valence';'example';'explanation'
'2012-02-0708:2023:3645:5406.541329';'insert';'f/ y';'insert f within y';'infinite';'dyad';'sum=: +/';'continued_fraction=:+`%/'
'2012-02-0708:2023:3645:5406.564353';'fork';'(f g h)y';'g(f(y),h(y))';'infinite';'monad';'average=: +/ % #';'sum divided by tally'
'2012-02-0708:2023:3645:5406.589376';'hook';'(f g)y';'f(y,g(y))';'infinite';'monad';'(/: 2&{"1)table';'sort table by third column'
'2012-02-0708:2023:3645:5406.612400';'hook';'x(f g)y';'f(x,g(y))';'infinite';'dyad';'display verb in s';'a reflexive dyadic hook'
'2012-02-0708:2023:3645:5406.635426';'fork';'x(f g h)y';'g(f(x,y),h(x,y))';'infinite';'monaddyad';'2j1(+ * -)9 12';'product of sum and difference'
'2012-02-0708:2023:3645:5406.660448';'reflexive';'f~ y';'f(y,y)';'infinite';'monad';'^~y';'y raised to the power of y'
'2012-02-0708:2023:3645:5406.682471';'passive';'x f~ y';'f(y,x)';'ranks of f';'dyad';'(%~ i.@:>:) 8x';'8 intervals from 0 to 1'
'2012-02-0708:2023:3645:5406.705493';'atop';'f@g y';'f(g(y))';'rank of g';'monad';'*:@(+/)';'square the sum'
'2012-02-0708:2023:3645:5406.727515';'atop';'x f@g y';'f(g(x,y))';'rank of g';'dyad';'>@{.';'(lisp) open the car'
'2012-02-0708:2023:3645:5406.749539';'many more!'
$ </lang>
 
Anonymous user