Anonymous user
Simple database: Difference between revisions
m
→{{header|J}}: improve accuracy of data in database.
m (→{{header|J}}) |
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
$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
$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-
│2012-02-
│2012-02-
│2012-02-
│2012-02-
│2012-02-
│2012-02-
│2012-02-
│2012-02-
│2012-02-
└───────────────────────┴──────────┴──────────┴─────────────────┴──────────┴───────┴─────────────────┴─────────────────────────────┘
$ $D display all entries
┌───────────────────────┬──────────┬──────────┬─────────────────┬──────────┬───────┬─────────────────┬─────────────────────────────┐
│time │name │expression│algebraic │rank │valence│example │explanation │
│2012-02-
│2012-02-
│2012-02-
│2012-02-
│2012-02-
│2012-02-
│2012-02-
│2012-02-
│2012-02-
│2012-02-
└───────────────────────┴──────────┴──────────┴─────────────────┴──────────┴───────┴─────────────────┴─────────────────────────────┘
$ cat dataflow
'2012-02-
'2012-02-
'2012-02-
'2012-02-
'2012-02-
'2012-02-
'2012-02-
'2012-02-
'2012-02-
'2012-02-
'2012-02-
$ </lang>
|