diff --git a/docs/ref/abs.md b/docs/ref/abs.md
index b89ab899..4a76d01c 100644
--- a/docs/ref/abs.md
+++ b/docs/ref/abs.md
@@ -1,34 +1,36 @@
---
title: abs – absolute value | Reference | kdb+ and q documentation
description: abs is a q keyword that returns the absolute value of its argument
-author: Stephen Taylor
+author: KX Systems, Inc., a subsidiary of KX Software Limited
---
# `abs`
-
-
-
_Absolute value_
```syntax
abs x abs[x]
```
-Where `x` is a numeric or temporal, returns
-the absolute value of `x`.
-Null is returned if `x` is null.
+Where `x` is a numeric, returns
+the absolute value of `x`.
+`x` is returned if `x` is null.
+`abs` also works with temporal values, where it operates on the underlying numeric (refer to the examples below).
```q
q)abs -1.0
1f
q)abs 10 -43 0N
10 43 0N
+q)abs 1999.01.01
+2000.12.31
+// if we convert these to longs, we can observe they're opposite
+q)"j"$1999.01.01 2000.12.31
+-365 365
```
`abs` is a [multithreaded primitive](../kb/mt-primitives.md).
-
-## :fontawesome-solid-sitemap: Implicit iteration
+## Implicit iteration
`abs` is an [atomic function](../basics/atomic.md).
@@ -40,7 +42,6 @@ q)abs(10;20 -30)
It applies to [dictionaries and tables](../basics/math.md#dictionaries-and-tables).
-
## Domain and range
```txt
@@ -51,8 +52,8 @@ range i . i h i j e f i . p m d z n u v t
Range: `ihjefpmdznuvt`
----
-:fontawesome-solid-book:
-[`signum`](signum.md)
+
+[`signum`](signum.md)
-:fontawesome-solid-book-open:
+
[Mathematics](../basics/math.md)
diff --git a/docs/ref/accumulators.md b/docs/ref/accumulators.md
index 08a3c5bd..f438337a 100644
--- a/docs/ref/accumulators.md
+++ b/docs/ref/accumulators.md
@@ -1,7 +1,7 @@
---
title: Accumulators – Reference – kdb+ and q documentation
description: An accumulator is an iterator that takes an applicable value as argument and derives a function that evaluates the value, first on its entire (first) argument, then on the results of successive evaluations.
-author: Stephen Taylor
+author: KX Systems, Inc., a subsidiary of KX Software Limited
keywords: adverb, converge, dictionary, do, iterator, fold, kdb+, keyword, map, map reduce, mnemonic, operator, over, q, scan, unary, value, while
---
# Accumulators
@@ -217,7 +217,7 @@ The function an accumulator derived from a binary value is [variadic](../basics/
Functions derived by Scan are uniform; functions derived by Over are aggregates.
The number of evaluations is the count of the right argument.
-
+
_Unary and binary application of f/_
@@ -308,7 +308,7 @@ q)m scan c / (m\)c
4 3 1 0 6 9
```
-:fontawesome-regular-hand-point-right:
+
[`over`, `scan`](over.md)
@@ -455,6 +455,6 @@ q){x+y*z}/[`foo;mt;mt]
`foo
```
-:fontawesome-solid-street-view:
+
_Q for Mortals_
[§6.7.6 Over (/) for Accumulation](/q4m3/6_Functions/#676-over-for-accumulation)
diff --git a/docs/ref/add.md b/docs/ref/add.md
index 05749ae2..13045520 100644
--- a/docs/ref/add.md
+++ b/docs/ref/add.md
@@ -5,12 +5,11 @@ keywords: add, kdb+, mathematics, plus, q, sum
---
# `+` Add
-
```syntax
x+y +[x;y]
```
-Where `x` and `y` are numerics or temporals, returns their
+Where `x` and `y` are numerics or temporals, returns their
sum.
```q
@@ -37,7 +36,6 @@ Add is generally faster than [Subtract](subtract.md).
`+` is a [multithreaded primitive](../kb/mt-primitives.md).
-
## Implicit iteration
Add is an [atomic function](../basics/atomic.md).
@@ -77,7 +75,6 @@ def| -42 10
ghi| 6 -12
```
-
## Range and domains
The following shows the resulting output type given the input type of `x` and `y`.
@@ -119,18 +116,16 @@ q)type 1i+55
-7h
```
-
----
-:fontawesome-solid-book:
+
[Subtract](subtract.md),
[`sum`](sum.md),
[`.Q.addmonths`](dotq.md#addmonths)
-:fontawesome-solid-book-open:
+
[Datatypes](../basics/datatypes.md),
[Mathematics](../basics/math.md)
-:fontawesome-solid-street-view:
+
_Q for Mortals_
[§4.9.2 Temporal Arithmetic](/q4m3/4_Operators/#492-temporal-arithmetic)
-
diff --git a/docs/ref/aj.md b/docs/ref/aj.md
index a9a9c0bc..976f1298 100644
--- a/docs/ref/aj.md
+++ b/docs/ref/aj.md
@@ -5,9 +5,6 @@ keywords: as-of, join, kdb+, q
---
# `aj`, `aj0`, `ajf`, `ajf0`
-
-
-
_As-of join_
```syntax
@@ -17,19 +14,19 @@ ajf [c; t1; t2]
ajf0[c; t1; t2]
```
-Where
+Where
-- `t1` is a table. Since 4.1t 2023.08.04 if `t1` is the name of a table, it is updated in place.
-- `t2` is a simple table
-- `c` is a symbol list of `n` column names, common to `t1` and `t2`, and of matching type
-- column `c[n]` is of a sortable type (typically time)
+- `t1` is a table or the name of a table as a symbol (since 4.1t 2023.08.04, in the latter case, the table is updated in place with the result)
+- `t2` is a simple table
+- `c` is a symbol vector of `n` column names, common to `t1` and `t2`, and of matching type
+- column `c``n` is of a sortable type (typically time)
returns a table with records from the left-join of `t1` and `t2`.
-In the join, columns `c[til n-1]` are matched for equality, and the last value of `c[n]` (most recent time) is taken.
+In the join, columns `c``0``...c``n-1` are matched for equality, and the last value of `c``n` (most recent time) is taken.
For each record in `t1`, the result has one record with the items in `t1`, and
-- if there are matching records in `t2`, the items of the last (in row order) matching record are appended to those of `t1`;
-- otherwise the remaining columns are null.
+- if there are matching records in `t2`, the items of the last (in row order) matching record are appended to those of `t1`;
+- otherwise the remaining columns are null.
```q
q)t:([]time:10:01:01 10:01:03 10:01:04;sym:`msft`ibm`ge;qty:100 200 150)
@@ -61,7 +58,6 @@ time sym qty px
!!! tip "There is no requirement for any of the join columns to be keys but the join is faster on keys."
-
## `aj`, `aj0`
`aj` and `aj0` return different times in their results:
@@ -71,10 +67,9 @@ aj boundary time from t1
aj0 actual time from t2
```
-
## `ajf`, `ajf0`
-Since V3.6 2018.05.18 `ajf` and `ajf0` behave as V2.8 `aj` and `aj0`, i.e. they fill from LHS if RHS is null. e.g.
+Since V3.6 2018.05.18 `ajf` and `ajf0` behave as V2.8 `aj` and `aj0`; they fill from `t1` if the corresponding value in `t2` is null. For example:
```q
q)t0:([]time:2#00:00:01;sym:`a`b;p:1 1;n:`r`s)
@@ -84,15 +79,12 @@ q)t0~ajf[`sym`time;t1;t2]
1b
```
-
## Performance
!!! warning "Order of search columns"
Ensure the first argument to `aj`, the columns to search on, is in the correct order, e.g. `` `sym`time``. Otherwise you’ll suffer a severe performance hit.
-If the resulting time value is to be from the quote (actual time) instead of the (boundary time) from trade, use `aj0` instead of `aj`.
-
`aj` should run at a million or two trade records per second; whether the tables are mapped or not is irrelevant. However, for speed:
medium | t2\[c1\] | t2\[c2…\] | example
@@ -100,16 +92,15 @@ medium | t2\[c1\] | t2\[c2…\] | example
memory | `g#` | sorted within c1 | `quote` has `` `g#sym`` and `time` sorted within `sym`
disk | `p#` | sorted within c1 | `quote` has `` `p#sym`` and `time` sorted within `sym`
-Departure from this incurs a severe performance penalty.
-
-Note that, on disk, the `g#` attribute does not help.
+Departure from this incurs a severe performance penalty.
-!!! warning "Select the virtual partition column only if you need it. It is fabricated on demand, which can be slow for large partitions."
+Note that on disk, the `g#` attribute does not help.
+!!! warning "Select the virtual partition column only if you need it. It is constructed on demand, which can be slow for large partitions."
## `select` from `t2`
-In memory, there is no need to select from `t2`. Irrespective of the number of records, use, e.g.:
+In memory, there is no need to select from `t2`. Irrespective of the number of records, use, for example:
```q
aj[`sym`time;select … from trade where …;quote]
@@ -122,9 +113,9 @@ aj[`sym`time;select … from trade where …;
select … from quote where …]
```
-In contrast, on disk you must map in your splay or day-at-a-time partitioned database:
+In contrast, on disk, you must map your splayed or partitioned database to memory first:
-Splay:
+Splayed:
```q
aj[`sym`time;select … from trade where …;select … from quote]
@@ -139,17 +130,16 @@ aj[`sym`time;select … from trade where …;
!!! warning "If further `where` constraints are used, the columns will be _copied_ instead of mapped into memory, slowing down the join."
-If you are using a database where an individual day’s data is spread over multiple partitions the on-disk `p#` will be lost when retrieving data with a constraint such as `…date=2011.08.05`.
+If you are using a database where an individual day’s data is spread over multiple partitions the on-disk `p#` will be lost when retrieving data with a constraint such as `…date=2011.08.05`.
In this case you will have to reduce the number of quotes retrieved by applying further constraints – or by re-applying the attribute.
-
----
-:fontawesome-solid-book:
-[`asof`](asof.md)
+
+[`asof`](asof.md)
-:fontawesome-solid-book-open:
+
[Joins](../basics/joins.md)
-:fontawesome-solid-street-view:
+
_Q for Mortals_
[§9.9.8 As-of Joins](/q4m3/9_Queries_q-sql/#998-as-of-joins)
diff --git a/docs/ref/all-any.md b/docs/ref/all-any.md
index 419a8f9a..8e91a52e 100644
--- a/docs/ref/all-any.md
+++ b/docs/ref/all-any.md
@@ -1,47 +1,35 @@
---
title: all, any – Reference – kdb+ and q documentation
description: all and any are q keywords that invoke aggregator functions for vectors of flags
-author: Stephen Taylor
+author: KX Systems, Inc., a subsidiary of KX Software Limited
---
# `all`, `any`
-
-
-
## `all`
-_Everything is true_
-
+_Is every item true?_
```syntax
all x all[x]
```
-Returns a boolean atom `0b`; or `1b` where `x` is
+Returns a boolean atom `1b` if `x` is
-- a list and all items are non-zero
-- a non-zero atom
-- an empty list
+- a list and all items are nonzero (this includes the empty list)
+- a nonzero atom;
-Applies to all datatypes except symbols and GUIDs.
-
-Where `x` is a table, `all` iterates over its columns and returns a dictionary.
+returns `0b` otherwise.
-```q
-q)all null ([] c1:`a`b`c; c2:0n 0n 0n; c3:10 0N 30)
-c1| 0
-c2| 1
-c3| 0
-```
+Applies to all datatypes except symbols and GUIDs.
-Strings are [cast](cast.md) to boolean.
+Strings are [cast](cast.md) to boolean; the only character that casts to zero is the [null character](https://en.wikipedia.org/wiki/Null_character "Wikipedia"), represented in q by the escape sequence `"\000"`. Note that this is _not_ the same as the character atom considered null by q, which is `" "`.
-`all` is an aggregate function.
+Where `x` is a table, `all` iterates over its columns and returns a dictionary.
```q
-q)all 1 2 3=1 2 4
+q)all 1 2 3 = 1 2 4
0b
-q)all 1 2 3=1 2 3
+q)all 1 2 3 = 1 2 3
1b
q)all "YNYN" / string casts to 1111b
1b
@@ -51,12 +39,20 @@ q)all 2000.01.01
0b
q)all 2000.01.02 2010.01.02
1b
-
-q)if[all x in y;....] / use in control structure
+q)all " \000"
+0b
+q)all null " \000"
+0b
+q)all ([] c1:1 2 3; c2:0n 0w -0w; c3:0 1 2f)
+c1| 1
+c2| 1
+c3| 0
```
+`all` is an aggregate function.
+
```txt
-domain: b g x h i j e f c s p m d z n u v t
+domain: B G X H I J E F C S P M D Z N U V T
range: b . b b b b b b b . b b b b b b b b
```
@@ -64,40 +60,48 @@ range: b . b b b b b b b . b b b b b b b b
## `any`
-_Something is true_
+_Is there a true item?_
```syntax
any x any[x]
```
-Returns a boolean atom `0b`; or `1b` where `x` is
+Returns a boolean atom `1b` if `x` is
-- a list with at least one non-zero item
-- a non-zero atom
+- a list with at least one nonzero item,
+- a nonzero atom;
-Applies to all datatypes except symbols and GUIDs.
-Strings are [cast](cast.md) to boolean.
+returns `0b` otherwise.
-`any` is an aggregate function.
+All other notes are the same as for `all` above.
```q
-q)any 1 2 3=10 20 4
+q)any 1 2 3 = 10 20 4
0b
-q)any 1 2 3=1 20 30
+q)any 1 2 3 = 1 20 30
1b
q)any "YNYN" / string casts to 1111b
1b
-q)any () / no non-zeros here
+q)any () / no nonzeros here
0b
+q)any " \000"
+1b
+q)any null " \000"
+1b
q)any 2000.01.01
0b
q)any 2000.01.01 2000.01.02
1b
-
-q)if[any x in y;....] / use in control structure
+q)any ([] c1:1 2 3; c2:0n 0w -0w; c3:000b)
+c1| 1
+c2| 1
+c3| 0
```
+
+`any` is an aggregate function.
+
```txt
-domain: b g x h i j e f c s p m d z n u v t
+domain: B G X H I J E F C S P M D Z N U V T
range: b . b b b b b b b . b b b b b b b b
```
@@ -105,12 +109,11 @@ range: b . b b b b b b b . b b b b b b b b
----
-:fontawesome-solid-book:
[Cast](cast.md),
[`&` `and`](lesser.md),
[`|` `or`](greater.md),
[`max`](max.md),
[`min`](min.md)
-:fontawesome-solid-book-open:
+
[Logic](../basics/by-topic.md#logic)
diff --git a/docs/ref/amend.md b/docs/ref/amend.md
index 7f8fd789..a499189d 100644
--- a/docs/ref/amend.md
+++ b/docs/ref/amend.md
@@ -45,7 +45,7 @@ and if `d` is a
See also binary and ternary forms of `.` and `@`
-:fontawesome-solid-book:
+
[Apply, Apply At, Index, Index At](apply.md)
@@ -307,12 +307,12 @@ type/attr error amending file test
```
----
-:fontawesome-solid-book:
+
[Apply, Apply At, Index, Index At](apply.md)
-:fontawesome-solid-street-view:
+
_Q for Mortals_
-[§6.8.3 General Form of Function Application](/q4m3/6_Functions/#683-general-form-of-function-application)
+[§6.8.3 General Form of Amend At and Amend](/q4m3/6_Functions/#683-general-form-of-function-application)
+ [m.SP module search path](#msp-module-search-path)
+
+**IPC** **Segmented database state**
**Debug/Profile** **Partitioned database state**
[bt backtrace](#bt-backtrace) [bv build vp](#bv-build-vp)
[prf0 code profiler](#prf0-code-profiler) [bvi build incremental vp](#bvi-build-incremental-vp)
@@ -62,7 +67,6 @@ _Tools_
[Xf create file](#xf-create-file)
-
Functions defined in `q.k` are loaded as part of the ‘bootstrap’ of kdb+. Some are exposed in the default namespace as the q language. Others are documented here as utility functions in the `.Q` [namespace](../basics/namespaces.md).
!!! warning "The `.Q` namespace is reserved for use by KX, as are all single-letter namespaces."
@@ -71,9 +75,10 @@ Functions defined in `q.k` are loaded as part of the ‘bootstrap’ of kdb+. So
In non-partitioned databases the partitioned database state variables remain undefined.
-
## `A` (upper-case alphabet)
+
## `a` (lower-case alphabet)
+
## `an` (all alphanumerics)
```syntax
@@ -93,7 +98,6 @@ q).Q.an
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789"
```
-
## `addmonths`
```syntax
@@ -114,13 +118,13 @@ q).Q.addmonths[2006.10.29;4]
2007.03.01
```
-:fontawesome-solid-book-open:
[Mathematics with temporals](../basics/math.md#mathematics-with-temporals)
-:fontawesome-solid-graduation-cap:
+
[How to handle temporal data in q](../kb/temporal-data.md)
[](){#addr-ip-address}
+
## `addr` (IP/host as int)
```syntax
@@ -132,6 +136,7 @@ Where `x` is a hostname or IP address as a symbol atom, returns the IP address a
The dotted-decimal string representation can be obtained from an integer using [`vs`](vs.md#integer-based-ip-address).
If the symbol represents a standard IPv4 dotted decimal notation, it returns the IP as integer without any DNS look-ups required.
+
```q
q).Q.addr`$"127.0.0.1"
2130706433i
@@ -143,7 +148,9 @@ When given a host name, the underlying operating system will govern how the look
q).Q.addr`localhost
2130706433i
```
+
If the host cannot be resolved, -1 will be returned
+
```q
q).Q.addr`blah
-1i
@@ -161,7 +168,7 @@ This configuration and look-up order can be different for each distribution. For
Return first entry found to match the provided IP.
-**MacOS**
+**macOS**
Returns first entry found when consulting the following:
@@ -177,10 +184,9 @@ These can be adjusted by system settings or policies, but typical order is:
* reverse dns
* optionally configured services, for example NetBIOS/LLMNR/WINS
-If multiple addresses available, it uses a [prefix policy table](https://learn.microsoft.com/en-us/troubleshoot/windows-server/networking/configure-ipv6-in-windows)
+If multiple addresses available, it uses a [prefix policy table](https://learn.microsoft.com/en-us/troubleshoot/windows-server/networking/configure-ipv6-in-windows)
and dynamically adjusts preference based on interface reachability and past success.
-:fontawesome-regular-hand-point-right:
[`.Q.host`](#host-ip-to-hostname) (IP to hostname), [`.z.h`](dotz.md#zh-host) (host), [`.z.a`](dotz.md#za-ip-address) (IP address), [`vs`](vs.md#byte-representation) (Byte representation)
## `atob` (b64 decode)
@@ -189,7 +195,7 @@ and dynamically adjusts preference based on interface reachability and past succ
.Q.atob x
```
-Decodes base64 data. Accepts char or byte vector, returns byte vector. Throws domain error if data not correctly padded.
+Decodes base64 data. Accepts char or byte vector, returns byte vector. Throws domain error if data is not correctly padded.
The following decodes a padded base64 value and [`casts`](cast.md) it to a char vector.
@@ -200,10 +206,8 @@ q)10h$.Q.atob "aGVsbG8="
Since 4.1 2025.11.25.
-:fontawesome-regular-hand-point-right:
[`.Q.btoa`](#btoa-b64-encode) (b64 encode)
-
## `b6` (bicameral-alphanums)
```syntax
@@ -219,7 +223,6 @@ q).Q.b6
Used for [binhex](#j10-encode-binhex) encoding and decoding.
-
## `bt` (backtrace)
```syntax
@@ -254,7 +257,6 @@ q)).Q.bt[]
The debugger itself occupies a stack frame, but its source is hidden. (Since V3.5 2017.03.15.)
-
## `btoa` (b64 encode)
```syntax
@@ -270,24 +272,21 @@ q).Q.btoa"Hello World!"
Since V3.6 2018.05.18.
-:fontawesome-regular-hand-point-right:
[`.Q.atob`](#atob-b64-decode) (b64 decode)
-
## `bv` (build vp)
-
```syntax
.Q.bv[]
.Q.bv[`]
```
-In partitioned DBs, construct the dictionary [`.Q.vp`](#vp-missing-partitions) of table schemas for tables with missing partitions. Optionally allow tables to be missing from partitions, by scanning partitions for missing tables and taking the tables’ prototypes from the last partition.
+In partitioned DBs, construct the dictionary [`.Q.vp`](#vp-missing-partitions) of table schemas for tables with missing partitions. Optionally allow tables to be missing from partitions, by scanning partitions for missing tables and taking the tables’ prototypes from the last partition.
After loading/re-loading from the filesystem, invoke `.Q.bv[]` to (re)populate `.Q.vt`/`.Q.vp`, which are used inside `.Q.p1` during the partitioned select `.Q.ps`.
(Since V2.8 2012.01.20, modified V3.0 2012.01.26)
-If your table exists at least in the latest partition (so there is a prototype for the schema), you could use `.Q.bv[]` to create empty tables on the fly at run-time without having to create those empties on disk.
+If your table exists at least in the latest partition (so there is a prototype for the schema), you could use `.Q.bv[]` to create empty tables on the fly at run-time without having to create those empties on disk.
``.Q.bv[`]`` (with argument) will use prototype from first partition instead of last. (Since V3.2 2014.08.22.)
@@ -312,12 +311,10 @@ tt| +`date`sym`time`num!(`date$();`sym$();`time$();`long$())
q)@[get;"select from tt";-2@]; / no error
```
-
## `bvi` (build incremental vp)
It offers the same functionality as [`.Q.bv`](#bv-build-vp), but scans only new partitions loaded in the hdb since the last time `.Q.bv` or `.Q.bvi` was run. Since v4.1 2024.09.13.
-
## `Cf` (create empty nested char file)
!!! warning "Deprecated"
@@ -330,7 +327,6 @@ It offers the same functionality as [`.Q.bv`](#bv-build-vp), but scans only new
A projection of [`.Q.Xf`](#xf-create-file): i.e. ``.Q.Xf[`char;]``
-
## `chk` (fill HDB)
```syntax
@@ -357,10 +353,8 @@ q).Q.chk[`:hdb]
check the process has write permissions for that filesystem.
-:fontawesome-solid-street-view:
_Q for Mortals_
-[§14.5.2 `.Q.chk`](/q4m3/14_Introduction_to_Kdb%2B/#1457-qchk)
-
+[§14.5.2 `.Q.chk`](/q4m3/14_Introduction_to_Kdb+/#1457-qchk)
## `cn` (count partitioned table)
@@ -370,7 +364,6 @@ _Q for Mortals_
Where `x` is a partitioned table, passed by value, returns its count. Populates [`.Q.pn`](#pn-partition-counts) cache.
-
## `D` (partitions)
```syntax
@@ -396,7 +389,6 @@ q).Q.P!.Q.D
:../segments/4| 2010.05.29 2010.05.30
```
-
## `dd` (join symbols)
```syntax
@@ -420,6 +412,7 @@ IBM N IBM.N
```
[](){#def-parse-options}
+
## `def` (command defaults)
_Default values and type checks for command-line arguments parsed with [`.Q.opt`](#opt-command-parameters)_
@@ -433,8 +426,9 @@ Where `x` is a dictionary of default parameter names and values, and `y` is the
Types are inferred from the default values provided, which must be an atom type.
```bash
-$ q -abc 123 -xyz 321
+q -abc 123 -xyz 321
```
+
```q
q).Q.def[`abc`xyz`efg!(1;2.;`a)].Q.opt .z.x
abc| 123
@@ -445,8 +439,9 @@ efg| `a
If a command-line value cannot be [converted to the data type](tok.md) of the default value, a [null](../basics/datatypes.md) is produced
```bash
-$ q -param1 11 -param2 2000.01.01 -param3 wrong
+q -param1 11 -param2 2000.01.01 -param3 wrong
```
+
```q
q).Q.def[`param1`param2`param3!(1;1999.01.01;23.1)].Q.opt .z.x
param1| 11
@@ -454,15 +449,15 @@ param2| 2000.01.01
param3| 0n
```
-:fontawesome-solid-hand-point-right:
[`.z.x`](dotz.md#zx-argv) (argv), [`.z.X`](dotz.md#zx-raw-command-line) (raw command line), [`.z.f`](dotz.md#zf-file) (file), [`.z.q`](dotz.md#zq-quiet-mode) (quiet mode), [`.Q.opt`](#opt-command-parameters) (command parameters), [`.Q.x`](#x-non-command-parameters) (non-command parameters)
-
## `dpft` (save table)
+
## `dpfts` (save table with symtable)
+
## `dpt` (save table unsorted)
-## `dpts` (save table unsorted with symtable)
+## `dpts` (save table unsorted with symtable)
```syntax
.Q.dpft[d;p;f;t]
@@ -473,11 +468,11 @@ param3| 0n
Where
-- `d` is a directory handle
-- `p` is a partition of a database
-- `f` a field of the table (required to be present in table since 4.1t 2021.09.03) named by `t` below
-- `t`, the name (as a symbol) of a simple table whose columns are vectors or compound lists
-- `s` is the handle of a symtable
+* `d` is a directory handle
+* `p` is a partition of a database
+* `f` a field of the table (required to be present in table since 4.1t 2021.09.03) named by `t` below
+* `t`, the name (as a symbol) of a simple table whose columns are vectors or compound lists
+* `s` is the handle of a symtable
saves `t` splayed to partition `p`.
@@ -525,7 +520,9 @@ table columns
-------------
t b
```
+
`.Q.dpfts` allows the enum domain to be specified. Since V3.6 (2018.04.13)
+
```q
q)show t:([]a:10?`a`b`c;b:10?10)
a b
@@ -546,7 +543,6 @@ q)mysym
`c`a`b
```
-
## `dsftg` (load process save)
```syntax
@@ -555,15 +551,14 @@ q)mysym
Where
-- `d` is `(dst;part;table)` where `table` has `M` rows
-- `s` is `(src;offset;length)`
-- `f` is fields as a symbol vector
-- `t` is `(types;widths)`
-- `g` is a unary post-processing function
+* `d` is `(dst;part;table)` where `table` has `M` rows
+* `s` is `(src;offset;length)`
+* `f` is fields as a symbol vector
+* `t` is `(types;widths)`
+* `g` is a unary post-processing function
loops `.Q.M&1000000` rows at a time.
-:fontawesome-solid-hand-point-right:
[`.Q.M`](#m-chunk-size) (chunk size)
For example, loading TAQ DVD:
@@ -578,6 +573,7 @@ q).Q.dsftg[d;s;f;t;g]
```
## `en` (enumerate varchar cols)
+
## `ens` (enumerate against domain)
```syntax
@@ -587,22 +583,23 @@ q).Q.dsftg[d;s;f;t;g]
Where
-- `dir` is a symbol handle to a folder or generic null ([`::`](identity.md#null))
-- `table` is a table
-- `name` is a symbol atom naming a sym file in `dir`
+* `dir` is a symbol handle to a folder or generic null ([`::`](identity.md#null))
+* `table` is a table
+* `name` is a symbol atom naming a sym file in `dir`
When `dir` is a symbol handle, the function
-- creates if necessary the folder `dir`
-- gets `sym` from `dir` if it exists
-- enumerates against in-memory `sym` using the symbols in `table`
-- writes `sym` to file in `dir`
-- returns `table` with columns enumerated (for `.Q.ens`, against `name`)
+* creates if necessary the folder `dir`
+* gets `sym` from `dir` if it exists
+* enumerates against in-memory `sym` using the symbols in `table`
+* writes `sym` to file in `dir`
+* returns `table` with columns enumerated (for `.Q.ens`, against `name`)
!!! warning "Locking ensures two processes do not write to the sym file at the same time"
The following example uses `.Q.en` to enumerate to both the in-memory and disk `sym` domain, while
saving the table output using [`set`](get.md#set):
+
```q
q)t1:([]col1:`a`b`c;col2:1 2 3)
q)`:/tmp/db/t1/ set .Q.en[`:/tmp/db;t1];
@@ -613,9 +610,11 @@ When `dir` is a symbol handle, the function
q)get `:/tmp/db/t1/col1 / col1 enumerated against sym domain
`sym$`a`b`c
```
- Providing a new or updated table against an existing `sym` domain will read the existing on-disk sym domain before updating.
- Both the in-memory and on-disk version are updated to reflect the new state. Continuing with the same example shows the
+
+ Providing a new or updated table against an existing `sym` domain will read the existing on-disk sym domain before updating.
+ Both the in-memory and on-disk version are updated to reflect the new state. Continuing with the same example shows the
existing `sym` domain being altered:
+
```q
q)t2:([]col1:`a`d`e;col2:1 2 3)
q)`:/tmp/db/t2/ set .Q.en[`:/tmp/db;t2]; / enumerate additional table against existing sym domain
@@ -627,8 +626,9 @@ When `dir` is a symbol handle, the function
When `dir` is a generic null (since 4.1 2025.01.17), the function
-- does not read/write/lock the `sym` file
-- enumerates against in-memory `sym` using the symbols in `table`, for example
+* does not read/write/lock the `sym` file
+* enumerates against in-memory `sym` using the symbols in `table`, for example
+
```q
q)t1:([]a:`a`b`c;b:1 2 3)
q).Q.en[::;t1];
@@ -650,29 +650,25 @@ q)([]sym:`mysym$`a`b`c)~.Q.ens[`:db;([]sym:`a`b`c);`mysym]
Tables splayed across a directory must be fully enumerated and not keyed. The solution is to enumerate columns of type varchar before saving the table splayed.
-:fontawesome-solid-book:
[`dsave`](dsave.md),
[Enum Extend](enum-extend.md),
[`save`](save.md)
-:fontawesome-solid-graduation-cap:
+
[Enumerating symbol columns in a table](../kb/splayed-tables.md#enumerating-symbol-columns)
-:fontawesome-solid-database:
+
[Splayed tables](../kb/splayed-tables.md)
-:fontawesome-regular-map:
-[Data-management techniques](../wp/data-management.md)
-
-:fontawesome-regular-map:
-[Working with sym files](../wp/symfiles.md#qen)
+
+[Working with sym files](../wp/symfiles.md#enumeration)
-:fontawesome-solid-street-view:
-_Q for Mortals_
-[§14.2.8 Working with sym files](/q4m3/14_Introduction_to_Kdb%2B/#1428-working-with-sym-files)
+_Q for Mortals_
+[§14.2.8 Working with sym files](/q4m3/14_Introduction_to_Kdb+/)
[](){#f-format}
+
## `f` (precision format)
```syntax
@@ -681,8 +677,8 @@ _Q for Mortals_
Where
-- `x` is an int atom
-- `y` is a numeric atom
+* `x` is an int atom
+* `y` is a numeric atom
returns `y` as a string formatted as a float to `x` decimal places.
@@ -707,12 +703,10 @@ q)10 xlog 0Wj-1
18.964889726830812
```
-:fontawesome-regular-hand-point-right:
[`.Q.fmt`](#fmt-precision-format) (precision format with length), [-27!(x;y)](../basics/internal.md#-27xy-ieee754-precision-format) (IEEE754 precision format)
-
:fontawesome-solid-book-open:
+
[`\P`](../basics/syscmds.md#p-precision) (precision)
-
## `fc` (parallel on cut)
```syntax
@@ -721,8 +715,8 @@ q)10 xlog 0Wj-1
Where
-- `x` is is a unary atomic function
-- `y` is a list
+* `x` is is a unary atomic function
+* `y` is a list
returns the result of evaluating `f vec` – using multiple threads if possible. (Since V2.6)
@@ -743,7 +737,6 @@ q)\t f peach vec
45
```
-
## `ff` (append columns)
```syntax
@@ -752,8 +745,8 @@ q)\t f peach vec
Where
-- `x` is table to modify
-- `y` is a table of columns to add to `x` and set to null
+* `x` is table to modify
+* `y` is a table of columns to add to `x` and set to null
returns `x`, with all new columns in `y`, with values in new columns set to null of the appropriate type.
@@ -789,8 +782,6 @@ q).Q.ff[src] enlist `sym`ratioA`ratioB!3#1
fgl 05:18:45.828 389.056 9342
```
-
-
## `fk` (foreign key)
```syntax
@@ -800,6 +791,7 @@ q).Q.ff[src] enlist `sym`ratioA`ratioB!3#1
Where `x` is a table column, returns `` ` `` if the column is not a foreign key or `` `tab`` if the column is a foreign key into `tab`.
[](){#fmt-format}
+
## `fmt` (precision format)
```syntax
@@ -808,8 +800,8 @@ Where `x` is a table column, returns `` ` `` if the column is not a foreign key
Where
-- `x` and `y` are integer atoms
-- `z` is a numeric atom
+* `x` and `y` are integer atoms
+* `z` is a numeric atom
returns `z` as a string of length `x`, formatted to `y` decimal places.
@@ -841,10 +833,12 @@ q)align fix[2]1.2 123 1.23445 -1234578.5522
"-1234578.55"
```
-Example: persist a table with float values to file as character strings of length 9, e.g. 34.3 to
+Example: persist a table with float values to file as character strings of length 9, e.g. 34.3 to
+
```q
" 34.3"
```
+
Keep as much precision as possible, i.e. persist 343434.3576 as `"343434.36"`.
```q
@@ -854,14 +848,16 @@ q)fmt[9] each 34.4 343434.358
"343434.36"
```
-:fontawesome-regular-hand-point-right:
[`.Q.f`](#f-precision-format) (precision format), [-27!(x;y)](../basics/internal.md#-27xy-ieee754-precision-format) (IEEE754 precision format)
-
:fontawesome-solid-book-open:
+
[`\P`](../basics/syscmds.md#p-precision) (precision)
[](){#fpn-streaming-algorithm}
+
## `fpn` (pipe streaming)
+
[](){#fps-streaming-algorithm}
+
## `fps` (pipe streaming)
_[`.Q.fs`](#fs-file-streaming) for pipes_
@@ -873,22 +869,24 @@ _[`.Q.fs`](#fs-file-streaming) for pipes_
Where
-- `x` is a unary function
-- `y` is a filepath to a fifo (named pipe)
-- `z` is an integer
+* `x` is a unary function
+* `y` is a filepath to a fifo (named pipe)
+* `z` is an integer
(Since V3.4)
Reads `z`-sized lumps of complete `"\n"` delimited records from a pipe and applies a function to each record. This enables you to implement a streaming algorithm for various purposes such as converting a large compressed CSV file into an on-disk kdb+ database without holding the data in memory all at once or using disk space required for the uncompressed file.
-:fontawesome-solid-graduation-cap:
[Streaming data from named pipes](../kb/named-pipes.md#streaming)
!!! tip "`.Q.fps` is a projection of `.Q.fpn` with the chunk size set to 131000 bytes."
[](){#fs-streaming-algorithm}
+
## `fs` (file streaming)
+
[](){#fsn-streaming-algorithm}
+
## `fsn` (file streaming)
```syntax
@@ -898,9 +896,9 @@ Reads `z`-sized lumps of complete `"\n"` delimited records from a pipe and appli
Where
-- `x` is a unary function
-- `y` is a filepath
-- `z` is an integer
+* `x` is a unary function
+* `y` is a filepath
+* `z` is an integer
loops over file `y`, grabs `z`-sized lumps of complete `"\n"` delimited records, applies `x` to each record, and returns the size of the file as given by [`hcount`](hcount.md). This enables you to implement a streaming algorithm for various purposes such as converting a large CSV file into an on-disk kdb+ database without holding the data in memory all at once.
@@ -931,10 +929,8 @@ q).Q.fs[{0N!("SSSSSSID";",")0:x}]`:potamus.csv
120
```
-:fontawesome-solid-graduation-cap:
[Loading from large files](../kb/loading-from-large-files.md)
-
## `ft` (apply simple)
```syntax
@@ -943,8 +939,8 @@ q).Q.fs[{0N!("SSSSSSID";",")0:x}]`:potamus.csv
Where
-- `y` is a keyed table
-- `x` is a unary function `x[t]` in which `t` is a simple table
+* `y` is a keyed table
+* `x` is a unary function `x[t]` in which `t` is a simple table
returns a table with at least as many key columns as `t`.
@@ -984,7 +980,6 @@ s3| blake 30 paris
s4| clark 20 london
```
-
## `fu` (apply unique)
```syntax
@@ -993,8 +988,8 @@ s4| clark 20 london
Where `x` is a unary function and `y` is
-- a list, returns `x[y]` after evaluating `x` only on distinct items of `y`
-- not a list, returns `x[y]`
+* a list, returns `x[y]` after evaluating `x` only on distinct items of `y`
+* not a list, returns `x[y]`
```q
q)vec:100000 ? 30 / long vector with few different values
@@ -1014,7 +1009,6 @@ q)r1~r2
To explore this, study `.Q.fu[avg;] (4 3#12?100)10?4`.
-
## `gc` (garbage collect)
```syntax
@@ -1030,6 +1024,7 @@ When secondary threads are configured and `.Q.gc[]` is invoked in the main threa
If the call is instigated in a secondary thread, it affects that thread’s local heap only.
Example of garbage collection in the default `deferred` mode, using [`.Q.w[]`](#w-memory-stats) to view memory stats:
+
```q
q)a:til 10000000 / create an object that is ≥64MB
q).Q.w[] / view current heap size and how many bytes used of the heap (all objects plus previously allocated object)
@@ -1122,15 +1117,13 @@ If you have nested data, e.g. columns of char vectors, or much grouping, you may
Since V3.3 2015.08.23 (Linux only) unused pages in the heap are dropped from RSS during `.Q.gc[]`.
-Since 4.1t 2022.07.01, `.Q.gc[0]` can be used to perform a subset of operations performed by `.Q.gc[]` (i.e. only return unused blocks >= 64MB to os).
+Since 4.1t 2022.07.01, `.Q.gc[0]` can be used to perform a subset of operations performed by `.Q.gc[]` (i.e. only return unused blocks >= 64MB to os).
This has the advantage of running return faster than `.Q.gc[]`, but with the disadvantage of not defragmenting unused memory blocks of a smaller size (therefore may not free as much unused memory).
-:fontawesome-solid-hand-point-right:
-[`.Q.w`](#w-memory-stats) (memory stats),
-[`\g`](../basics/syscmds.md#g-garbage-collection-mode) (garbage collection mode),
+[`.Q.w`](#w-memory-stats) (memory stats),
+[`\g`](../basics/syscmds.md#g-garbage-collection-mode) (garbage collection mode),
[`\w`](../basics/syscmds.md#w-workspace) (workspace)
-
## `gz` (GZip)
```syntax
@@ -1141,14 +1134,14 @@ This has the advantage of running return faster than `.Q.gc[]`, but with the dis
Where
-- `cbv` is a char vector (or byte vector since 4.1t 2021.09.03,4.0 2021.10.01)
-- `cl` is compression level \[1-9\] as a long
+* `cbv` is a char vector (or byte vector since 4.1t 2021.09.03,4.0 2021.10.01)
+* `cl` is compression level \[1-9\] as a long
returns, for
-- the [general null](identity.md#null), a boolean atom as whether Zlib is loaded
-- `cbv`, the inflated (unzipped) vector
-- a 2-list, the deflated (zipped) vector
+* the [general null](identity.md#null), a boolean atom as whether Zlib is loaded
+* `cbv`, the inflated (unzipped) vector
+* a 2-list, the deflated (zipped) vector
since V4.0 2020.04.16.
@@ -1158,10 +1151,8 @@ q).Q.gz{0N!count x;x}[.Q.gz(9;10000#"helloworld")]
"helloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldhellow..
```
-:fontawesome-solid-hand-point-right:
[-18!x](../basics/internal.md#-18x-compress-bytes) (ipc compress bytes)
-
## `hdpf` (save tables)
```syntax
@@ -1174,7 +1165,6 @@ The function:
* clears in-memory tables
* sends reload message to HDB, by opening a temporary connection and sending [`\l .`](../basics/syscmds.md#l-load-file-or-directory)
-
## `hg` (HTTP get)
```syntax
@@ -1208,12 +1198,13 @@ environment variable | use
N.B. HTTPS is not supported across proxies which require `CONNECT`.
-Since 4.0 2019.10.22, gzip compression is supported. Requests include the HTTP header "Accept-Encoding: gzip".
+Since 4.0 2019.10.22, gzip compression is supported. Requests include the HTTP header "Accept-Encoding: gzip".
The server then decides whether to gzip the returned payload, which is uncompressed prior to .Q.hg returning.
-:fontawesome-solid-graduation-cap:[HTTP](../kb/http.md)
+[HTTP](../kb/http.md)
[](){#host-hostname}
+
## `host` (IP to hostname)
```syntax
@@ -1228,6 +1219,7 @@ q).Q.host 2130706433i
```
The operator [`$`](tok.md#ip-address) (tok) can be used to convert an IP address in dotted-decimal string representation to an integer
+
```q
q)"I"$"104.130.139.23"
1753385751i
@@ -1237,8 +1229,8 @@ q).Q.host "I"$"104.130.139.23"
Each underlying operating system deals with resolving a hostname to IP (and vice-versa) in different ways, reference [`.Q.addr`](#addr-iphost-as-int) for details.
-When the resolving leads to consulting a DNS server, the DNS server can also have rules on which IP (or the sort order of IPs) it can return when multiple IPs associated with one host.
-Therefore performing an IP lookup from a given hostname, then using the resuling IP to get its hostname, can return a different hostname.
+When the resolving leads to consulting a DNS server, the DNS server can also have rules on which IP (or the sort order of IPs) it can return when multiple IPs associated with one host.
+Therefore performing an IP lookup from a given hostname, then using the resuling IP to get its hostname, can return a different hostname.
For example:
```q
@@ -1246,30 +1238,35 @@ q).Q.host .Q.addr `$"www.yahoo.co.uk"
`a7de0457831fd11f7.awsglobalaccelerator.com / alternative hostname for IP
```
-When using `/etc/hosts` on MacOS/Linux, the order in which multiple hosts are associated with an IP will effect the value returned.
+When using `/etc/hosts` on macOS/Linux, the order in which multiple hosts are associated with an IP will effect the value returned.
For example, `/etc/hosts` with the entry
+
```bash
172.17.0.4 test1 test2
```
+
will cause 172.17.0.4 to be resolved to test1
+
```q
q).Q.host "I"$"172.17.0.4"
`test1
```
+
but `/etc/hosts` with the machine names in a different order
+
```bash
172.17.0.4 test2 test1
```
+
will cause 172.17.0.4 to be resolved to test2
+
```q
q).Q.host "I"$"172.17.0.4"
`test2
```
-:fontawesome-regular-hand-point-right:
[`.Q.addr`](#addr-iphost-as-int) (IP/host as int), [`.z.h`](dotz.md#zh-host) (host), [`.z.a`](dotz.md#za-ip-address) (IP address)
-
## `hp` (HTTP post)
```syntax
@@ -1278,9 +1275,9 @@ q).Q.host "I"$"172.17.0.4"
Where
-- `x` is a URL as a symbol handle or string (since V3.6 2018.02.10)
-- `y` is a MIME type as a string
-- `z` is the POST query as a string
+* `x` is a URL as a symbol handle or string (since V3.6 2018.02.10)
+* `y` is a MIME type as a string
+* `z` is the POST query as a string
Returns a string for the result of an HTTP[S] POST query.
(Since V3.4)
@@ -1292,8 +1289,7 @@ q).Q.hp["http://google.com";.h.ty`json]"my question"
"\n\n \n
+
+## `m.SP` (module search path)
+
+Contains a list of strings of paths where the module loader should search for modules.
+
+Search path
+
## `n` (nums)
+
## `nA` (alphanums)
```syntax
@@ -1619,7 +1624,6 @@ q).Q.nA
`.Q.nA` is used for [base-36](#j12-encode-base-36) encoding and decoding.
-
## `opt` (command parameters)
```syntax
@@ -1629,8 +1633,9 @@ q).Q.nA
Presents command-line arguments as a dictionary, using the output of [`.z.x`](dotz.md#zx-argv). Defaults can be added using [`.Q.def`](#def-command-defaults).
```bash
-$ q -param1 val1 -param2 val2
+q -param1 val1 -param2 val2
```
+
```q
q)params:.Q.opt .z.x
q)show params
@@ -1639,10 +1644,13 @@ param2| "val2"
q)params`param1
"val1"
```
+
Example of a command-line parameter with no value and a parameter with multiple values:
+
```bash
-$ q -param1 -param2 as asd -param3
+q -param1 -param2 as asd -param3
```
+
```q
q).Q.opt .z.x
param1| ()
@@ -1650,10 +1658,8 @@ param2| ("as";"asd")
param3| ()
```
-:fontawesome-solid-hand-point-right:
[`.z.x`](dotz.md#zx-argv) (argv), [`.z.X`](dotz.md#zx-raw-command-line) (raw command line), [`.z.f`](dotz.md#zf-file) (file), [`.z.q`](dotz.md#zq-quiet-mode) (quiet mode), [`.Q.def`](#def-command-defaults) (command defaults), [`.Q.x`](#x-non-command-parameters) (non-command parameters)
-
## `P` (segments)
```syntax
@@ -1667,7 +1673,6 @@ q).Q.P
`:../segments/1`:../segments/2`:../segments/3`:../segments/4
```
-
## `par` (get expected partition location)
```syntax
@@ -1676,8 +1681,8 @@ q).Q.P
Where
-- `dir` is a directory filepath
-- `part` is a date
+* `dir` is a directory filepath
+* `part` is a date
returns the expected location of `table`. (Sensitive to `par.txt`.)
@@ -1722,7 +1727,6 @@ q).Q.PV!.Q.PD
2010.05.31| :../segments/1
```
-
## `pd` (modified partition locations)
```syntax
@@ -1731,7 +1735,6 @@ q).Q.PV!.Q.PD
In partitioned DBs, [`.Q.PD`](#pd-partition-locations) as modified by [`.Q.view`](#view-subview).
-
## `pf` (partition field)
```syntax
@@ -1741,7 +1744,6 @@ In partitioned DBs, [`.Q.PD`](#pd-partition-locations) as modified by [`.Q.view`
In partitioned DBs, the partition field.
Possible values are `` `date`month`year`int``.
-
## `pn` (partition counts)
```syntax
@@ -1788,10 +1790,8 @@ q).Q.pv!flip .Q.pn
2010.01.02| 100
```
-:fontawesome-solid-graduation-cap:
[Table counts](../kb/partition.md#table-counts)
-
## `prf0` (code profiler)
```syntax
@@ -1811,14 +1811,17 @@ pos execution position (caret) within text
This process must be started from the same binary as the one running `.Q.prf0`, otherwise `binary mismatch` is signalled.
-Since 4.1t 2022.03.25, .Q.prf0 will not try to stop the process if passed a negative `pid`.
+Since 4.1t 2022.03.25, .Q.prf0 will not try to stop the process if passed a negative `pid`.
This should be used when a kdb+ process is already stopped under control of something other than `.Q.prf0` (for example, in a debugger or a native-code profiler).
A negative `pid` should not be used in a running process.
-:fontawesome-solid-graduation-cap:
-[Code profiler](../kb/profiler.md)
+[Code profiler](https://code.kx.com/q/kb/profiler/)
+
+## `rp` (resolve path)
+Given a file symbol, resolves any `::` prefix to the directory of the module currently being loaded. Outside a module, the prefix is simply removed.
+Module self-reference
## `pt` (partitioned tables)
@@ -1838,10 +1841,8 @@ A list of the values of the partition domain: the values corresponding to the sl
In partitioned DBs, [`.Q.PV`](#pv-partition-values) as modified by [`.Q.view`](#view-subview).
-:fontawesome-solid-street-view:
_Q for Mortals_
-[§14.5.3 `.Q.pv`](/q4m3/14_Introduction_to_Kdb%2B/#1453-qpv)
-
+[§14.5.3 `.Q.pv`](/q4m3/14_Introduction_to_Kdb+/)
## `PV` (partition values)
@@ -1866,7 +1867,6 @@ q).Q.PV
2010.05.26 2010.05.27 2010.05.28 2010.05.29 2010.05.30 2010.05.30 2010.05.31
```
-
## `qp` (is partitioned)
```syntax
@@ -1875,9 +1875,9 @@ q).Q.PV
Where `x`
-- is a partitioned table, returns `1b`
-- a splayed table, returns `0b`
-- anything else, returns 0
+* is a partitioned table, returns `1b`
+* a splayed table, returns `0b`
+* anything else, returns 0
```q
q)\
@@ -1894,7 +1894,6 @@ q).Q.qp C
0b
```
-
## `qt` (is table)
```syntax
@@ -1903,7 +1902,6 @@ q).Q.qp C
Where `x` is a table, returns `1b`, else `0b`.
-
## `res` (keywords)
```syntax
@@ -1917,10 +1915,8 @@ q).Q.res,key`.q
`abs`acos`asin`atan`avg`bin`binr`cor`cos`cov`delete`dev`div`do`enlist`exec`ex..
```
-:fontawesome-regular-hand-point-right:
[`.Q.id`](#id-sanitize) (sanitize)
-
## `s` (plain text)
```syntax
@@ -1936,7 +1932,6 @@ q).Q.s ([h:1 2 3] m: 4 5 6)
Occasionally useful for undoing _Studio for kdb+_ tabular formatting.
-
## `s1` (string representation)
```syntax
@@ -1945,11 +1940,9 @@ Occasionally useful for undoing _Studio for kdb+_ tabular formatting.
Returns a string representation of `x`.
-:fontawesome-solid-book:
[`show`](show.md),
[`string`](string.md)
-
## `sbt` (string backtrace)
```syntax
@@ -1960,10 +1953,8 @@ Where `x` is a [backtrace object](#trp-extend-trap-at) returns it as a string fo
Since V3.5 2017.03.15.
-:fontawesome-solid-book-open:
[Debugging](../basics/debug.md)
-
## `sha1` (SHA-1 encode)
```syntax
@@ -1979,7 +1970,6 @@ q).Q.sha1"Hello World!"
Since V3.6 2018.05.18.
-
## `t` (type letters)
```syntax
@@ -1995,8 +1985,6 @@ q).Q.t?"j" / longs have datatype 7
7
```
-
-
## `trp` (extend trap at)
```syntax
@@ -2005,14 +1993,14 @@ q).Q.t?"j" / longs have datatype 7
Where
-- `f` is a unary function
-- `x` is its argument
-- `g` is a binary function
+* `f` is a unary function
+* `x` is its argument
+* `g` is a binary function
extends [Trap At](apply.md#trap-at) (`@[f;x;g]`) to collect backtrace: `g` gets called with arguments:
-1. the error string
-2. the backtrace object
+1. the error string
+2. the backtrace object
You can format the backtrace object with [`.Q.sbt`](#sbt-string-backtrace).
@@ -2063,10 +2051,8 @@ q)1@(h"f `a")1; / output the backtrace string to stdout
Since V3.5 2017.03.15.
-:fontawesome-solid-book-open:
[Debugging](../basics/debug.md)
-
## `trpd` (extend trap)
```syntax
@@ -2075,15 +2061,15 @@ Since V3.5 2017.03.15.
Where
-- `f` is a function of rank
-- `x` is an atom or list of count with items in the domains of f
+* `f` is a function of rank
+* `x` is an atom or list of count with items in the domains of f
-- `g` is a binary function
+* `g` is a binary function
extends [Trap](apply.md#trap) (`.[f;x;g]`) to collect backtrace: `g` is called with arguments:
-1. the error string
-2. the backtrace object
+1. the error string
+2. the backtrace object
You can format the backtrace object with [`.Q.sbt`](#sbt-string-backtrace).
@@ -2106,10 +2092,8 @@ Use .Q.trp as a simpler form of .Q.trpd, for unary values.
Since 4.1 2024.03.12.
-:fontawesome-solid-book-open:
[Debugging](../basics/debug.md)
-
## `ts` (time and space)
_Apply, with time and space_
@@ -2120,8 +2104,8 @@ _Apply, with time and space_
Where `x` and `y` are valid arguments to [Apply](apply.md) returns a 2-item list:
-1. time and space as [`\ts`](../basics/syscmds.md#ts-time-and-space) would
-2. the result of `.[x;y]`
+1. time and space as [`\ts`](../basics/syscmds.md#ts-time-and-space) would
+2. the result of `.[x;y]`
```q
q)\ts .Q.hg `:http://www.google.com
@@ -2137,7 +2121,6 @@ q).Q.ts[+;2 3]
Since V3.6 2018.05.18.
-
## `ty` (type)
```syntax
@@ -2146,9 +2129,9 @@ Since V3.6 2018.05.18.
Where `x` is a list, returns the [type](../basics/datatypes.md) of `x` as a character code:
-- lower case for a vector
-- upper case for a list of uniform type
-- else blank
+* lower case for a vector
+* upper case for a list of uniform type
+* else blank
```q
q)t:([]a:3 4 5;b:"abc";c:(3;"xy";`ab);d:3 2#3 4 5;e:("abc";"de";"fg"))
@@ -2166,19 +2149,16 @@ q).Q.ty each t`a`b`c`d`e
If the argument is a table column, returns upper case for mappable/uniform lists of vectors.
-:fontawesome-solid-book:
[`meta`](meta.md)
-
## `u` (date based)
```syntax
.Q.u
```
-- In segmented DBs, returns `1b` if each partition is uniquely found in one segment. (E.g., true if segmenting is date-based, false if name-based.)
-- In partitioned DBs, returns `1b`.
-
+* In segmented DBs, returns `1b` if each partition is uniquely found in one segment. (E.g., true if segmenting is date-based, false if name-based.)
+* In partitioned DBs, returns `1b`.
## `V` (table to dict)
@@ -2188,13 +2168,11 @@ q).Q.ty each t`a`b`c`d`e
Where `x` is
-- a table, returns a dictionary of its column values.
-- a partitioned table, returns only the last partition (N.B. the partition field values themselves are not restricted to the last partition but include the whole range).
+* a table, returns a dictionary of its column values.
+* a partitioned table, returns only the last partition (N.B. the partition field values themselves are not restricted to the last partition but include the whole range).
-:fontawesome-solid-book:
[`meta`](meta.md)
-
## `v` (value)
```syntax
@@ -2203,10 +2181,9 @@ Where `x` is
Where `x` is
-- a filepath, returns the splayed table stored at `x`
-- any other symbol, returns the global named `x`
-- anything else, returns `x`
-
+* a filepath, returns the splayed table stored at `x`
+* any other symbol, returns the global named `x`
+* anything else, returns `x`
## `view` (subview)
@@ -2224,12 +2201,10 @@ Where `x` is a list of partition values that serves as a filter for all queries
Since 4.1t 2022.03.25,4.0 2023.05.26 this would signal an `invalid partition filter` error if partition value(s) resulted in no matches with [.Q.PV](#pv-partition-values).
-`.Q.view`, also used when loading an hdb, now utilizes threads to load .d files (column names) since 4.1t 2023.04.17.
+`.Q.view`, also used when loading an hdb, now utilizes threads to load .d files (column names) since 4.1t 2023.04.17.
-:fontawesome-solid-hand-point-right:
_Q for Mortals_
-[§14.5.8 `Q.view`](/q4m3/14_Introduction_to_Kdb+/#1458-qview)
-
+[§14.5.8 `Q.view`](/q4m3/14_Introduction_to_Kdb+/)
## `vp` (missing partitions)
@@ -2259,7 +2234,6 @@ tt| +`date`sym`time`num!(`date$();`sym$();`time$();`long$())
q)@[get;"select from tt";-2@]; / no error
```
-
## `w` (memory stats)
```syntax
@@ -2280,14 +2254,12 @@ syms| 577
symw| 25436
```
-:fontawesome-solid-hand-point-right:
[`.Q.gc`](#gc-garbage-collect) (garbage collect)
-:fontawesome-solid-book-open:
+
[Command-line parameter `-w`](../basics/cmdline.md#-w-workspace) (workspace memory limit)
-:fontawesome-solid-book-open:
-[System command `\w`](../basics/syscmds.md#w-workspace) (memory stats and workspace memory limit)
+[System command `\w`](../basics/syscmds.md#w-workspace) (memory stats and workspace memory limit)
## `Xf` (create file)
@@ -2301,8 +2273,8 @@ symw| 25436
Where
-- `x` is a mapped nested datatype as either an upper-case char atom, or as a short symbol (e.g. `` `char``)
-- `y` is a filepath
+* `x` is a mapped nested datatype as either an upper-case char atom, or as a short symbol (e.g. `` `char``)
+* `y` is a filepath
creates an empty nested-vector file at `y`.
@@ -2312,7 +2284,6 @@ q)type get`:emptyNestedCharVector
87h
```
-
## `x` (non-command parameters)
```syntax
@@ -2322,8 +2293,9 @@ q)type get`:emptyNestedCharVector
Set by [`.Q.opt`](#opt-command-parameters): a list of _non-command_ parameters from the command line, where _command parameters_ are prefixed by `-`.
```bash
-$ q taq.k path/to/source path/to/destn
+q taq.k path/to/source path/to/destn
```
+
```q
q)cla:.Q.opt .z.X /command-line arguments
q).Q.x
@@ -2332,5 +2304,4 @@ q).Q.x
"path/to/destn"
```
-:fontawesome-solid-hand-point-right:
[`.z.x`](dotz.md#zx-argv) (argv), [`.z.X`](dotz.md#zx-raw-command-line) (raw command line), [`.z.f`](dotz.md#zf-file) (file), [`.z.q`](dotz.md#zq-quiet-mode) (quiet mode), [`.Q.opt`](#opt-command-parameters) (command parameters), [`.Q.def`](#def-command-defaults) (command defaults)
diff --git a/docs/ref/dotz.md b/docs/ref/dotz.md
index 4c447317..fbd7630b 100644
--- a/docs/ref/dotz.md
+++ b/docs/ref/dotz.md
@@ -1,12 +1,11 @@
---
title: the .z namespace | Reference | kdb+ and q documentation
description: The .z namespace contains objects that return or set system information, and callbacks for IPC.
-author: Stephen Taylor
+last_updated: January 2026
+author: KX Systems, Inc., a subsidiary of KX Software Limited
keywords: callbacks, environment, kdb+, q
---
-# :fontawesome-regular-clock: The `.z` namespace
-
-
+# The `.z` namespace
_Environment and callbacks_
@@ -21,10 +20,12 @@ Environment Callbacks
[.z.K version](#zk-version) [.z.po open](#zpo-open)
[.z.k release date](#zk-release-date) [.z.pq qcon](#zpq-qcon)
[.z.l license](#zl-license) [.z.r blocked](#zr-blocked)
- [.z.o OS version](#zo-os-version) [.z.ps set](#zps-set)
- [.z.q quiet mode](#zq-quiet-mode) [.z.pw validate user](#zpw-validate-user)
- [.z.s self](#zs-self) [.z.ts timer](#zts-timer)
- [.z.u user ID](#zu-user-id) [.z.vs value set](#zvs-value-set)
+ [.z.M module namespace name](#zm-module-namespace-name) [.z.ps set](#zps-set)
+ [.z.m module namespace](#zm-module-namespace) [.z.pw validate user](#zpw-validate-user)
+ [.z.o OS version](#zo-os-version) [.z.ts timer](#zts-timer)
+ [.z.q quiet mode](#zq-quiet-mode) [.z.vs value set](#zvs-value-set)
+ [.z.s self](#zs-self)
+ [.z.u user ID](#zu-user-id)
[.z.X/x raw/parsed command line](#zx-raw-command-line)
Callbacks (HTTP)
Environment (Compression/Encryption) [.z.ac HTTP auth](#zac-http-auth)
@@ -56,17 +57,14 @@ The `.z` [namespace](../basics/namespaces.md) contains environment variables and
After they have been assigned, you can restore the default using [`\x`](../basics/syscmds.md#x-expunge) to delete the definition that was made.
-:fontawesome-solid-graduation-cap:
-[Callbacks](../kb/callbacks.md),
-[Using `.z`](../kb/using-dotz.md)
-
-:fontawesome-solid-street-view:
-_Q for Mortals:_
-[§11.6 Interprocess Communication](/q4m3/11_IO/#116-interprocess-communication)
-
-
+Prior to kdb+, `.z` was a pseudo-namespace that could not be retrieved or enumerated using the language features (such as ```key `.z``` or ```value `.z```). In kdb+, `.z` is a proper namespace that acts like all other namespaces.
+[Callbacks](../kb/callbacks.md)
+[Using `.z`](https://code.kx.com/q/kb/using-dotz/)
+
+_Q for Mortals:_
+[§11.8 Interprocess Communication](/q4m3/11_IO/#116-interprocess-communication)
## `.z.a` (IP address)
@@ -84,34 +82,40 @@ The return value depends on whether it is invoked in an IPC callback or not.
* **Not invoking in an IPC callback**
Returns the current IP address associated with the hostname.
This pre-populated value is equivalent to passing [`.z.h`](#zh-host) to [`.Q.addr`](dotq.md#host-ip-to-hostname) to find the IP address of the current host.
+
```q
q).z.a
-1408172030i
q).Q.addr .z.h
-1408172030i
```
+
* **Invoking in an IPC callback**
When invoked inside a `.z.p*` callback via a TCP/IP connection, it is the IP address of the client session, not the current session.
For example, connecting from a remote machine:
+
```q
q)h:hopen myhost:1234
q)h"\"i\"$0x0 vs .z.a"
192 168 65 1i
```
+
or from same machine:
+
```q
q)h:hopen 1234
q)h"\"i\"$0x0 vs .z.a"
127 0 0 1i
```
+
When invoked via a Unix Domain Socket, it is 0.
+
```q
q)h:hopen `:unix://1234
q)h".z.a"
0i
```
-:fontawesome-solid-hand-point-right:
[`.z.h`](#zh-host) (host), [`.Q.host`](dotq.md#host-ip-to-hostname) (IP to hostname)
## `.z.ac` (HTTP auth)
@@ -121,7 +125,7 @@ The return value depends on whether it is invoked in an IPC callback or not.
```
Lets you define custom code to authorize/authenticate an HTTP request.
-e.g. inspect HTTP headers representing oauth tokens, cookies, etc.
+e.g. inspect HTTP headers representing oauth tokens, cookies, etc.
Your custom code can then return different values based on what is discovered.
`.z.ac` is a unary function, whose single parameter is a two-element list providing the request text and header.
@@ -131,35 +135,46 @@ Your custom code can then return different values based on what is discovered.
The function should return a two-element list. The list of possible return values is:
* User not authorized/authenticated
+
```q
(0;"")
```
+
User not authorized. Client is sent default 401 HTTP unauthorized response.
An HTTP callback to handle the request will not be called.
+
* User authorized/authenticated
+
```q
(1;"username")
```
-The provided username is used to set [`.z.u`](#zu-user-id).
+
+The provided username is used to set [`.z.u`](#zu-user-id).
The relevant HTTP callback to handle this request will be allowed.
+
* User not authorized/authenticated (custom response)
+
```q
(2;"response text")
```
+
The custom response to be sent should be provided in the "response text" section.
The response text should be comprised of a valid HTTP response message, for example a 401 response with a customised message.
An HTTP callback to handle the original request is not called.
+
* Fallback to basic authentication
+
```q
(4;"")
```
-Fallback to [basic access authentication](https://en.wikipedia.org/wiki/Basic_access_authentication#Client_side), where the username/password are base64 decoded and processed via the [`-u`](../ba
-sics/cmdline.md#-u-usr-pwd-local)/[`-U`](../basics/cmdline.md#-u-usr-pwd) file and [`.z.pw`](#zpw-validate-user) (if defined).
+
+Fallback to [basic access authentication](https://en.wikipedia.org/wiki/Basic_access_authentication#Client_side), where the username/password are base64 decoded and processed via the [`-u`](../basics/cmdline.md#-u-usr-pwd-local)/[`-U`](../basics/cmdline.md#-u-usr-pwd) file and [`.z.pw`](#zpw-validate-user) (if defined).
If the user is not permitted, the client is sent a default 401 HTTP unauthorized response. Since V4.0 2021.07.12.
-:fontawesome-solid-graduation-cap:[HTTP](../kb/http.md)
+[HTTP](../kb/http.md)
[](){#zb-dependencies}
+
## `.z.b` (view dependencies)
The dependency dictionary.
@@ -172,12 +187,10 @@ x| `a`b
y| ,`a
```
-:fontawesome-solid-book-open:
[`\b`](../basics/syscmds.md#b-views) (views)
-:fontawesome-solid-graduation-cap:
-[Views](../learn/views.md)
+[Views](https://code.kx.com/q/learn/views/)
## `.z.bm` (msg validator)
@@ -189,9 +202,9 @@ Where `x` is a unary function.
kdb+ before V2.7 was sensitive to being fed malformed data structures, sometimes resulting in a crash, but now validates incoming IPC messages to check that data structures are well formed, reporting `'badmsg` and disconnecting senders of malformed data structures. The raw message is captured for analysis via the callback `.z.bm`. The sequence upon receiving such a message is
-1. calls `.z.bm` with a 2-item list: `(handle;msgBytes)`
-2. close the handle and call `.z.pc`
-3. signals `'badmsg`
+1. calls `.z.bm` with a 2-item list: `(handle;msgBytes)`
+2. close the handle and call `.z.pc`
+3. signals `'badmsg`
E.g. with the callback defined
@@ -201,22 +214,20 @@ q).z.bm:{`msg set (.z.p;x);}
after a bad msg has been received, the global var `msg` will contain the timestamp, the handle and the full message. Note that this check validates only the data structures, it cannot validate the data itself.
-
## `.z.c` (cores)
The number of physical cores.
-
## `.z.e` (TLS connection status)
TLS details used with the current connection handle.
Returns an empty dictionary if the connection is not TLS enabled.
-Displays information on the following
+Displays information on the following:
-* `CIPHER` is the name of cipher used for the connection
-* `PROTOCOL` is the name of the protocol used for the connection, for example `` `TLSv1.2 ``
-* `CERT` is the X509 certificate the peer presented. It is not present if the peer certificate was not provided.
+- `CIPHER` is the name of cipher used for the connection
+- `PROTOCOL` is the name of the protocol used for the connection, for example `` `TLSv1.2 ``
+- `CERT` is the X509 certificate the peer presented. It is not present if the peer certificate was not provided.
For example, the following connects to a server, then runs `.z.e` on the server to gain information on the TLS connection handle used by the client. Therefore `CERT` is the client certificate (peer of the server).
If [`SSL_VERIFY_CLIENT`](../kb/ssl.md#ssl_verify_client) is not enabled on the server, the client certificate is not requested by the server, and therefore would not be displayed.
@@ -228,8 +239,8 @@ CIPHER | `AES128-GCM-SHA256
PROTOCOL| `TLSv1.2
CERT | `SUBJECT`ISSUER`SERIALNUMBER`NOTVALIDBEFORE`NOTVALIDAFTER`VERIFIED`VERIFYERROR!("/C=US/ST=New York/L=Brooklyn/O=Example Brooklyn Company/CN=myname.com";"/C=US/ST=New York/L=Brooklyn/O=Example Brooklyn Company/CN=examplebrooklyn.com";,"1";"Jul 6 10:08:57 2021 GMT";"May 15 10:08:57 2031 GMT";1b;0)
```
-
The following shows the client sending a message to the server, which in turn sends `.z.e` to the client (using the current connection handle [`.z.w`](#zw-handle)), displaying the server certificate used by the client connection.
+
```q
q)h:hopen `:tcps://localhost:5000
q)h".z.w\".z.e\""
@@ -245,24 +256,20 @@ For example, the following implements the connection open callback ([`.z.po`](#z
.z.po:{show"SSL server connection info:";show .z.e;show"SSL client connection info:";show .z.w".z.e"}
```
-`.z.w".z.e"` is used to run .z.e on the client (via a [sync request](../basics/ipc.md#sync-request-get) over the connection provided by [`.z.w`](#zw-handle))
+`.z.w".z.e"` is used to run `.z.e` on the client (via a [sync request](../basics/ipc.md#sync-request-get) over the connection provided by [`.z.w`](#zw-handle))
Since V3.4 2016.05.16. `CERT` details of `VERIFIED`,`VERIFYERROR` available since 4.1t 2024.02.07.
-:fontawesome-solid-hand-point-right:
[`-26!` TLS settings](../basics/internal.md#-26x-ssl)
-
## `.z.ex` (failed primitive)
-In a [debugger](../basics/debug.md#debugger) session, `.z.ex` is set to the failed primitive.
+In a [debugger](../basics/debug.md) session, `.z.ex` is set to the failed primitive.
Since V3.5 2017.03.15.
-:fontawesome-solid-hand-point-right:
[`.z.ey`](#zey-argument-to-failed-primitive) (argument to failed primitive)
-
## `.z.exit` (action on exit)
```syntax
@@ -322,26 +329,22 @@ q))'`up
os>..
```
-:fontawesome-solid-hand-point-right:
[`.z.pc`](#zpc-close) (port close)
-:fontawesome-solid-book:
+
[`exit`](exit.md)
-:fontawesome-solid-book-open:
-[`\\` quit](../basics/syscmds.md#quit)
+[`\\` quit](../basics/syscmds.md#quit)
## `.z.ey` (argument to failed primitive)
-In a [debugger](../basics/debug.md#debugger) session, `.z.ey` is set to the argument to failed primitive.
+In a [debugger](../basics/debug.md) session, `.z.ey` is set to the argument to failed primitive.
Since V3.5 2017.03.15.
-:fontawesome-solid-hand-point-right:
[`.z.ex`](#zex-failed-primitive) (failed primitive)
-
## `.z.f` (file)
Name of the q script as a symbol.
@@ -352,10 +355,8 @@ q).z.f
`test.q
```
-:fontawesome-solid-hand-point-right:
[`.z.x`](#zx-argv) (argv)
-
## `.z.H` (active sockets)
Active sockets as a list (a low-cost method). Since v4.0 2020.06.01.
@@ -367,10 +368,8 @@ q).z.H~key .z.W
1b
```
-:fontawesome-solid-hand-point-right:
[`.z.W`](#zw-handles) (handles), [`.z.w`](#zw-handle) (handle), [`-38!`](../basics/internal.md#-38x-socket-table) (socket table)
-
## `.z.h` (host)
The host name as a symbol
@@ -380,28 +379,29 @@ q).z.h
`demo.kx.com
```
-If you require a fully qualified domain name, and the command returns a hostname only (with no domain name), this should be resolved by your system administrators.
+If you require a fully qualified domain name, and the command returns a hostname only (with no domain name), this should be resolved by your system administrators.
**Linux**
-On Linux this should return the same value as the shell command `hostname`.
+On Linux this should return the same value as the shell command `hostname`.
Linux stores the current hostname in `/proc/sys/kernel/hostname`. The operating system reads the hostname from `/etc/hostname`.
-**MacOS**
+**macOS**
-On MacOS this should return the same value as `sysctl kern.hostname` or `scutil --get HostName`.
+On macOS this should return the same value as `sysctl kern.hostname` or `scutil --get HostName`.
**Microsoft Windows**
-On Windows this should return the same value as `hostname` via cmd.exe or Powershell,
+On Windows this should return the same value as `hostname` via cmd.exe or Powershell,
which typically gets the hostname from the registry entry `HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ComputerName\ActiveComputerName`.
The `req query` command can be used to retrieve the current value.
+
```
reg query HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ComputerName\ActiveComputerName
```
+
The value can also be viewed and altered via the Control Panel.
-:fontawesome-solid-hand-point-right:
[`.z.a`](#za-ip-address) (IP address), [`.Q.addr`](dotq.md#addr-iphost-as-int) (IP/host as int)
## `.z.i` (PID)
@@ -413,7 +413,6 @@ q).z.i
23219
```
-
## `.z.K` (version)
The major version number, as a float, of the version of kdb+ being used.
@@ -426,10 +425,8 @@ q).z.k
2006.10.30
```
-:fontawesome-solid-hand-point-right:
[`.z.k`](#zk-release-date) (release date)
-
## `.z.k` (release date)
Date on which the version of kdb+ being used was released.
@@ -442,10 +439,8 @@ q)
This value is checked against `.Q.k` as part of the startup to make sure that the executable and the version of q.k being used are compatible.
-:fontawesome-solid-hand-point-right:
[`.z.K`](#zk-version) (version)
-
## `.z.l` (license)
License information as a list of strings; `()` for non-commercial 32-bit versions.
@@ -465,6 +460,51 @@ bannerText | "stephen@kx.com #59875"
`bannerText` is the custom text displayed at startup, and always contains the license number as the last token.
+## `.z.M` (module namespace name)
+
+While loading a module, `.z.M` contains the name of the local namespace of the module as a symbol. Furthermore, `.z.M` suffixed with any name returns that name joined to the module namespace name.
+
+```q
+// $QHOME/mod/foo/init.q
+f:{.z.M}
+g:{.z.M.f}
+export:([f;g])
+
+// user
+q).z.M
+`.
+q)foo:use`foo
+q)foo.f[]
+`.m.foo
+q)foo.g[]
+`.m.foo.f
+```
+
+## `.z.m` (module namespace)
+
+While loading a module, `.z.m` represents the local namespace of the module as a dictionary. Elements can be added, removed and retrieved just like with any dictionary. Functions retain the information about which namespace `.z.m` refers to, as opposed to it resolving to the current module at the point of invocation.
+
+```q
+// $QHOME/mod/foo/init.q
+// log:{-1 string[.z.P]," ",x} // doesn't work, since log is a reserved name
+.z.m.log:{-1 string[.z.P]," ",x}
+f:{x+1}
+// upd:{.z.m.log"updating";select f a from ([]a:1 2 3)} // would look for `f` in the user's namespace
+upd:{.z.m.log"updating";select .z.m.f a from ([]a:1 2 3)}
+export:([upd])
+
+// user
+q).z.m,:use`foo
+q).z.m
+upd| `.m.foo.export.upd[]
+q)upd[]
+2025.10.08D12:36:17.579634206 updating
+a
+-
+2
+3
+4
+```
## `.z.N` (local timespan)
@@ -476,10 +516,8 @@ q).z.N
0D23:30:10.827156000
```
-:fontawesome-solid-hand-point-right:
[`.z.n`](#zn-utc-timespan) (UTC timespan), [`.z.P`](#zp-local-timestamp) (local timestamp), [`.z.p`](#zp-utc-timestamp) (UTC timestamp), [`.z.Z`](#zz-local-datetime) (local datetime), [`.z.z`](#zz-utc-datetime) (UTC datetime)
-
## `.z.n` (UTC timespan)
System UTC time as timespan in nanoseconds.
@@ -494,7 +532,6 @@ q).z.n
Linux clock source returns a nanosecond precision timespan
-:fontawesome-solid-hand-point-right:
[`.z.n`](#zn-local-timespan) (local timespan), [`.z.P`](#zp-local-timestamp) (local timestamp), [`.z.p`](#zp-utc-timestamp) (UTC timestamp), [`.z.Z`](#zz-local-datetime) (local datetime), [`.z.z`](#zz-utc-datetime) (UTC datetime)
## `.z.o` (OS version)
@@ -520,7 +557,6 @@ Windows | **w32** | **w64**
Note this is the version of the kdb+ executable, NOT the OS itself.
You might run both 32-bit and 64-bit versions of kdb+ on the same machine to support older external interfaces.
-
## `.z.P` (local timestamp)
System localtime timestamp in nanoseconds.
@@ -531,10 +567,8 @@ q).z.P
2018.04.30D10:18:31.932126000
```
-:fontawesome-solid-hand-point-right:
[`.z.p`](#zp-utc-timestamp) (UTC timestamp), [`.z.N`](#zn-local-timespan) (local timespan), [`.z.n`](#zn-utc-timespan) (UTC timespan), [`.z.Z`](#zz-local-datetime) (local datetime), [`.z.z`](#zz-utc-datetime) (UTC datetime)
-
## `.z.p` (UTC timestamp)
UTC timestamp in nanoseconds.
@@ -548,7 +582,6 @@ q).z.p
Linux clock source returns a nanosecond precision timestamp
-:fontawesome-solid-hand-point-right:
[`.z.P`](#zp-local-timestamp) (local timestamp), [`.z.N`](#zn-local-timespan) (local timespan), [`.z.n`](#zn-utc-timespan) (UTC timespan), [`.z.Z`](#zz-local-datetime) (local datetime), [`.z.z`](#zz-utc-datetime) (UTC datetime)
## `.z.pc` (close)
@@ -564,8 +597,8 @@ As the connection has been closed by the time `f` is called there are strictly n
To allow you to clean up things like tables of users keyed by handle, the handle that _was_ being used is passed as a parameter to `.z.pc`
```q
-KDB+ 2.3 2007.03.27 Copyright (C) 1993-2007 Kx Systems
-l64/ 8cpu 16026MB simon ...
+kdb+ 5.0.20251113 2025.11.13 Copyright (C) 1993-2025 Kx Systems
+...
q).z.pc
'.z.pc
@@ -584,10 +617,8 @@ q)
!!! info "`.z.pc` is not called by `hclose`."
-:fontawesome-solid-hand-point-right:
[`.z.po`](#zpo-open) (port open)
-
## `.z.pd` (peach handles)
```syntax
@@ -596,8 +627,8 @@ q)
Where q has been [started with secondary processes for use in parallel processing](../basics/cmdline.md#-s-secondary-threads), `x` is
-- an int vector of handles to secondary processes
-- a function that returns a list of handles to those secondary processes
+* an int vector of handles to secondary processes
+* a function that returns a list of handles to those secondary processes
For evaluating the function passed to `peach` or `':`, kdb+ gets the handles to the secondary processes by calling [`.z.pd[]`](#zpd-peach-handles).
@@ -631,11 +662,8 @@ Note that (since V3.1) the worker processes are not started automatically by kdb
One-shot IPC requests can be used within `peach` instead.
-
-:fontawesome-solid-graduation-cap:
[Load balancing](../kb/load-balancing.md)
-
## `.z.pg` (get)
```syntax
@@ -648,10 +676,8 @@ Where `f` is a unary function, called with the object that is passed to the q se
The default behavior is equivalent to setting `.z.pg` to [`value`](value.md) and executes in the root context.
-:fontawesome-solid-hand-point-right:
[`.z.ps`](#zps-set) (set), [`-30!(x)`](../basics/internal.md#-30x-deferred-response) (deferred response)
-
## `.z.ph` (HTTP get)
```syntax
@@ -662,26 +688,24 @@ Where `f` is a unary function, it is evaluated when a synchronous HTTP request i
`.z.ph` is passed a single argument, a 2-item list `(requestText;requestHeaderAsDictionary)`:
-- `requestText` is parsed in `.z.ph` – detecting special cases like requests for CSV, XLS output – and the result is returned to the calling task.
-- `requestHeaderAsDictionary` contains a dictionary of [HTTP header](https://en.wikipedia.org/wiki/List_of_HTTP_header_fields) names and values as sent by the client. This can be used to return content optimized for particular browsers.
+* `requestText` is parsed in `.z.ph` – detecting special cases like requests for CSV, XLS output – and the result is returned to the calling task.
+* `requestHeaderAsDictionary` contains a dictionary of [HTTP header](https://en.wikipedia.org/wiki/List_of_HTTP_header_fields) names and values as sent by the client. This can be used to return content optimized for particular browsers.
The function returns a string representation of an HTTP response message e.g. [HTTP/1.1 response message format](https://en.wikipedia.org/wiki/HTTP#HTTP/1.1_response_messages).
Since V3.6 and V3.5 2019.11.13, the default implementation calls [`.h.val`](doth.md#hval-value) instead of [`value`](value.md), allowing users to interpose their own valuation code. It is called with `requestText` as the argument.
-:fontawesome-solid-hand-point-right:
[`.z.pp`](#zpp-http-post) (HTTP post), [`.z.pm`](#zpm-http-methods) (HTTP methods), [`.z.ac`](#zac-http-auth) (HTTP auth)
-:fontawesome-solid-book:
+
[`.h` namespace](doth.md)
-:fontawesome-solid-graduation-cap:
+
[HTTP](../kb/http.md)
-:fontawesome-solid-street-view:
-_Q for Mortals_
-[§11.7.1 HTTP Connections](/q4m3/11_IO/#1171-http-connections)
+_Q for Mortals_
+[§11.10.1 HTTP Connections](/q4m3/11_IO/#1171-http-connections)
## `.z.pi` (input)
@@ -691,7 +715,7 @@ _Q for Mortals_
Where `f` is a unary function, it is evaluated as the default handler for input.
-As this is called on every line of input it can be used to log all console input, or even to modify the output. For example, if you prefer the more compact [V2.3 way of formatting tables](../releases/ChangesIn2.4.md#zpi), you can reset the output handler.
+As this is called on every line of input it can be used to log all console input, or even to modify the output. For example, if you prefer the more compact [V2.3 way of formatting tables](https://code.kx.com/q/releases/ChangesIn2.4/#zpi), you can reset the output handler.
```q
q)aa:([]a:1 2 3;b:11 22 33)
@@ -713,8 +737,6 @@ To return to the default display, just delete your custom handler
q)\x .z.pi
```
-
-
## `.z.pm` (HTTP methods)
```syntax
@@ -723,10 +745,10 @@ q)\x .z.pi
Where f is a unary function, .z.pm is evaluated when the following HTTP request methods are received in the kdb+ session.
-- OPTIONS
-- PATCH (since V4.1t 2021.03.30)
-- PUT (since V4.1t 2021.03.30)
-- DELETE (since V4.1t 2021.03.30)
+* OPTIONS
+* PATCH (since V4.1t 2021.03.30)
+* PUT (since V4.1t 2021.03.30)
+* DELETE (since V4.1t 2021.03.30)
Each method is passed to `f` as a 3-item list e.g.
@@ -736,11 +758,9 @@ Each method is passed to `f` as a 3-item list e.g.
For the POST method use [.z.pp](#zpp-http-post), and for GET use [.z.ph](#zph-http-get).
-:fontawesome-solid-hand-point-right:
[`.z.ph`](#zph-http-get) (HTTP get), [`.z.pp`](#zpp-http-post) (HTTP post), [`.z.ac`](#zac-http-auth) (HTTP auth)
-:fontawesome-solid-graduation-cap:[HTTP](../kb/http.md)
-
+[HTTP](../kb/http.md)
## `.z.po` (open)
@@ -752,14 +772,12 @@ Where `f` is a unary function, `.z.po` is evaluated when a connection to a kdb+
Its argument is the handle and is typically used to build a dictionary of handles to session information like the value of `.z.a`, `.z.u`
-:fontawesome-solid-hand-point-right:
[`.z.pc`](#zpc-close) (port close),
[`.z.pw`](#zpw-validate-user) (validate user)
-:fontawesome-solid-street-view:
-_Q for Mortals_
-[§11.6 Interprocess Communication](/q4m3/11_IO/#116-interprocess-communication)
+_Q for Mortals_
+[§11.8 Interprocess Communication](/q4m3/11_IO/#116-interprocess-communication)
## `.z.pp` (HTTP post)
@@ -775,19 +793,17 @@ See [`.z.ph`](#zph-http-get) for details of the argument and return value.
Allows empty requests since 4.1t 2021.03.30 (previously signalled `length` error).
-:fontawesome-solid-hand-point-right:
[`.z.ph`](#zph-http-get) (HTTP get), [`.z.pm`](#zpm-http-methods) (HTTP methods), [`.z.ac`](#zac-http-auth) (HTTP auth)
-:fontawesome-solid-book:
+
[`.h` namespace](doth.md)
-:fontawesome-solid-graduation-cap:
+
[HTTP](../kb/http.md)
-:fontawesome-solid-street-view:
-_Q for Mortals_
-[§11.7.1 HTTP Connections](/q4m3/11_IO/#1171-http-connections)
+_Q for Mortals_
+[§11.10.1 HTTP Connections](/q4m3/11_IO/#1171-http-connections)
## `.z.pq` (qcon)
@@ -799,9 +815,7 @@ Remote connections using the ‘qcon’ text protocol are routed to `.z.pq`, whi
This allows a user to handle remote qcon connections (via `.z.pq`) without defining special handling for console processing (via `.z.pi`).
-:fontawesome-solid-graduation-cap:
-[Firewalling](../kb/firewalling.md) for locking down message handlers
-
+[Firewalling](https://code.kx.com/q/kb/firewalling) for locking down message handlers
## `.z.ps` (set)
@@ -825,10 +839,8 @@ q)0 "2+2"
4
```
-:fontawesome-solid-hand-point-right:
[`.z.pg`](#zpg-get) (get)
-
## `.z.pw` (validate user)
```syntax
@@ -845,34 +857,29 @@ If `.z.pw` returns `0b` the task attempting to establish the connection will get
The default definition is `{[user;pswd]1b}`
-:fontawesome-solid-hand-point-right:
[`.z.po`](#zpo-open) (port open)
-:fontawesome-solid-book:
-[Changes in 2.4](../releases/ChangesIn2.4.md#zpw)
+[Changes in 2.4](https://code.kx.com/q/releases/ChangesIn2.4/#zpw)
## `.z.q` (quiet mode)
`1b` if Quiet Mode is set, else `0b`.
-:fontawesome-solid-book-open:
[Command-line option `-q`](../basics/cmdline.md#-q-quiet-mode)
-
## `.z.r` (blocked)
A boolean, indicating whether an update in the current context would be blocked.
Returns `1b`
-- in `reval`
-- where the [`-b` command-line option](../basics/cmdline.md#-b-blocked) has been set
-- in a thread other than the main event thread
+* in `reval`
+* where the [`-b` command-line option](../basics/cmdline.md#-b-blocked) has been set
+* in a thread other than the main event thread
Since V4.1t 2021.04.16.
-
## `.z.s` (self)
A reference to the current function.
@@ -892,7 +899,6 @@ q)fact[5]
Note this is purely an example; there are other ways to achieve the same result.
-
## `.z.ts` (timer)
```syntax
@@ -916,10 +922,8 @@ q)2010.12.16D17:12:12.849442000
When kdb+ has completed executing a script passed as a command-line argument, and if there are no open sockets nor a console, kdb+ will exit. The timer alone is not enough to stop the process exiting – it must have an event source which is a file descriptor (socket, console, or some plugin registering a file descriptor and callback via the C API `sd1` function).
-:fontawesome-solid-book-open:
[`\t`](../basics/syscmds.md#t-timer)
-
## `.z.u` (user ID)
User ID, as a symbol, associated with the current handle.
@@ -931,10 +935,10 @@ q).z.u
For
-- handle 0 (console) returns the userid under which the process is running.
-- handles > 0 returns either:
- - on the server end of a connection, the userid as passed to `hopen` by the client
- - on the client end of a connection, the null symbol `` ` ``
+* handle 0 (console) returns the userid under which the process is running.
+* handles > 0 returns either:
+ * on the server end of a connection, the userid as passed to `hopen` by the client
+ * on the client end of a connection, the null symbol `` ` ``
```q
q).z.u / console is handle 0
@@ -948,7 +952,6 @@ q)h({.z.w".z.u"};::) / client side returns null symbol
`
```
-
## `.z.vs` (value set)
```syntax
@@ -957,7 +960,7 @@ q)h({.z.w".z.u"};::) / client side returns null symbol
Where `f` is a binary function, `.z.vs` is evaluated _after_ a value is set globally in the default namespace (e.g. `a`, `a.b`).
-For function `f[x;y]`, `x` is the symbol of the modified variable and `y` is the index.
+For function `f[x;y]`, `x` is the symbol of the modified variable and `y` is the index.
!!! detail "Applies only to globals in the default namespace"
@@ -975,13 +978,13 @@ q)m[1;1]:0
(`m;1 1;(1 2;3 0))
```
-
## `.z.W` (handles)
Dictionary of IPC handles with the number of bytes waiting in their output queues.
[`.z.H`](#zh-active-sockets) is a lower cost method if the size of the output queue is not required.
The following demonstrates a client connection which has created [async requests](../basics/ipc.md#async-message-set), causing pending data in its connection output queue.
+
```q
q)h:hopen ...
q)h
@@ -1005,6 +1008,7 @@ q)neg[h]({};til 1000000); neg[h]({};til 10); sum each .z.W
```
Querying known handles can also be performed using [`-38!`](../basics/internal.md#-38x-socket-table), which can be more performant than using `.z.W` to return the entire dataset of handles.
+
```q
q)h:hopen 5000
q)neg[h]"11+1111111";.z.W h
@@ -1013,13 +1017,11 @@ q)neg[h]"11+1111111";(-38!h)`m
24
```
-:fontawesome-solid-hand-point-right:
[`.z.H`](#zh-active-sockets) (active sockets), [`.z.w`](#zw-handle) (handle), [`-38!`](../basics/internal.md#-38x-socket-table) (socket table)
-
## `.z.w` (handle)
-The current connection handle. When called within the current session console, it will return 0i.
+The current connection handle. When called within the current session console, it will return `0i`.
```q
q).z.w
@@ -1029,10 +1031,8 @@ q).z.w
When called from code executing a client callback function due to a client request, for example [`.z.pg`](#zpg-get), it returns the handle of the client connection.
This can be used for performing tasks such as sending a [sync/async request](../basics/ipc.md#send-messages) to the client or recording the handle upon which a request should be later fulfilled.
-:fontawesome-solid-hand-point-right:
[`.z.H`](#zh-active-sockets) (active sockets), [`.z.W`](#zw-handles) (handles), [`-38!`](../basics/internal.md#-38x-socket-table) (socket table)
-
## `.z.wc` (websocket close)
```syntax
@@ -1041,8 +1041,8 @@ This can be used for performing tasks such as sending a [sync/async request](../
Where
-- `f` is a unary function
-- `h` is the handle to a websocket connection to a kdb+ session
+* `f` is a unary function
+* `h` is the handle to a websocket connection to a kdb+ session
`f[h]` is evaluated _after_ a websocket connection has been closed.
(Since V3.3t 2014.11.26.)
@@ -1051,12 +1051,10 @@ As the connection has been closed by the time `.z.wc` is called, there are stric
This allows you to clean up things like tables of users keyed by handle.
-:fontawesome-solid-hand-point-right:
[`.z.wo`](#zwo-websocket-open) (websocket open),
[`.z.ws`](#zws-websockets) (websockets),
[`.z.ac`](#zac-http-auth) (HTTP auth)
-
## `.z.wo` (websocket open)
```syntax
@@ -1065,20 +1063,18 @@ This allows you to clean up things like tables of users keyed by handle.
Where
-- `f` is a unary function
-- `h` is the handle to a websocket connection to a kdb+ session
+* `f` is a unary function
+* `h` is the handle to a websocket connection to a kdb+ session
`f[h]` is evaluated when the connection has been initialized, i.e. _after_ it has been validated against any `-u`/`-U` file and `.z.pw` checks.
(Since V3.3t 2014.11.26)
The handle argument is typically used by `f` to build a dictionary of handles to session information such as the value of `.z.a`, `.z.u`.
-:fontawesome-solid-hand-point-right:
[`.z.wc`](#zwc-websocket-close) (websocket close),
[`.z.ws`](#zws-websockets) (websockets),
[`.z.ac`](#zac-http-auth) (HTTP auth)
-
## `.z.ws` (websockets)
```syntax
@@ -1089,14 +1085,12 @@ Where `f` is a unary function, it is evaluated on a message arriving at a websoc
Sending a websocket message is limited to async messages only (sync is `'nyi`). A string will be sent as a text message; a byte vector as a binary message.
-:fontawesome-solid-hand-point-right:
[`.z.wo`](#zwo-websocket-open) (websocket open),
[`.z.wc`](#zwc-websocket-close) (websocket close),
[`.z.ac`](#zac-http-auth) (HTTP auth)
-:fontawesome-solid-graduation-cap:
-[WebSockets](../kb/websockets.md)
+[WebSockets](../kb/websockets.md)
## `.z.X` (raw command line)
@@ -1108,12 +1102,12 @@ Returns a list of strings of the raw, unfiltered command line with which kdb+ wa
(Since V3.3 2015.02.12)
```bash
-$ q somefile.q -customarg 42 -p localhost:17200
+q somefile.q -customarg 42 -p localhost:17200
```
```q
-KDB+ 3.4 2016.09.22 Copyright (C) 1993-2016 KX Systems
-m64/ 4()core 8192MB ...
+kdb+ 5.0.20251113 2025.11.13 Copyright (C) 1993-2025 Kx Systems
+...
q).z.X
,"q"
"somefile.q"
@@ -1123,10 +1117,8 @@ q).z.X
"localhost:17200"
```
-:fontawesome-solid-hand-point-right:
[`.z.x`](#zx-argv) (argv), [`.z.f`](#zf-file) (file), [`.z.q`](#zq-quiet-mode) (quiet mode), [`.Q.opt`](dotq.md#opt-command-parameters) (command parameters), [`.Q.def`](dotq.md#def-command-defaults) (command defaults), [`.Q.x`](dotq.md#x-non-command-parameters) (non-command parameters)
-
## `.z.x` (argv)
Command-line arguments as a list of strings
@@ -1142,10 +1134,8 @@ q).z.x
Command-line options can be converted to a dictionary using the convenient [`.Q.opt`](dotq.md#opt-command-parameters) function.
-:fontawesome-solid-hand-point-right:
[`.z.X`](#zx-raw-command-line) (raw command line), [`.z.f`](#zf-file) (file), [`.z.q`](#zq-quiet-mode) (quiet mode), [`.Q.opt`](dotq.md#opt-command-parameters) (command parameters), [`.Q.def`](dotq.md#def-command-defaults) (command defaults), [`.Q.x`](dotq.md#x-non-command-parameters) (non-command parameters)
-
## `.z.Z` (local datetime)
Local time as a datetime atom.
@@ -1159,7 +1149,6 @@ The offset from UTC is fetched from the OS: kdb+ does not have its own time-offs
Which avoids problems like [this](https://it.slashdot.org/story/07/02/25/2038217/software-bug-halts-f-22-flight).
-:fontawesome-solid-hand-point-right:
[`.z.z`](#zz-utc-datetime) (UTC datetime), [`.z.P`](#zp-local-timestamp) (local timestamp), [`.z.p`](#zp-utc-timestamp) (UTC timestamp), [`.z.N`](#zn-local-timespan) (local timespan), [`.z.n`](#zn-utc-timespan) (UTC timespan)
## `.z.z` (UTC datetime)
@@ -1170,12 +1159,11 @@ UTC time as a datetime atom.
q).z.z
2006.11.13T21:16:14.601
```
+
!!! detail "`z.z` calls `gettimeofday` and so has microsecond precision"
-:fontawesome-solid-hand-point-right:
[`.z.Z`](#zz-local-datetime) (local datetime), [`.z.P`](#zp-local-timestamp) (local timestamp), [`.z.p`](#zp-utc-timestamp) (UTC timestamp), [`.z.N`](#zn-local-timespan) (local timespan), [`.z.n`](#zn-utc-timespan) (UTC timespan)
-
[](){#zzd-zip-defaults}
## `.z.zd` (compression/encryption defaults)
@@ -1185,7 +1173,7 @@ q).z.z
.z.zd:dict
```
-Integers `lbs`, `alg`, and `lvl` are [compression parameters](../kb/file-compression.md#compression-parameters) and/or [encryption parameters](../kb/dare.md#encryption).
+Integers `lbs`, `alg`, and `lvl` are [compression parameters](../kb/file-compression.md) and/or [encryption parameters](../kb/dare.md#configuration).
They set default values for logical block size, compression/encryption algorithm and compression level that apply when saving to files.
Encryption available since 4.0 2019.12.12.
@@ -1227,8 +1215,8 @@ logicalBlockSize | 17i
zipLevel | 4i
```
-A dictionary can be assigned to `.z.zd`. The keys of the dictionary are either column names or the null symbol `` ` ``.
-The value of each entry is an integer vector: `lbs`, `alg`, and `lvl`.
+A dictionary can be assigned to `.z.zd`. The keys of the dictionary are either column names or the null symbol `` ` ``.
+The value of each entry is an integer vector: `lbs`, `alg`, and `lvl`.
The null symbol is used as a default for columns that do not match the other keys.
```q
@@ -1238,24 +1226,20 @@ a| 17 2 6
b| 17 2 6
q).z.zd:dict
```
+
Settings can be cleared using the [`\x`](../basics/syscmds.md#x-expunge) system command.
+
```q
q).z.zd:17 2 6 / set zip defaults
q)\x .z.zd / clear zip defaults
```
-:fontawesome-solid-hand-point-right:
[`-21!x`](../basics/internal.md#-21x-compressionencryption-stats) (compression/encryption stats), [`set`](get.md#set) (per file/dir compression)
-:fontawesome-solid-database:
[File compression](../kb/file-compression.md)
-:fontawesome-regular-map:
-[Compression in kdb+](../wp/compress/index.md)
-
-:fontawesome-solid-database:
-[Data at rest encryption (DARE)](../kb/dare.md)
+[Data at rest encryption (DARE)](../kb/dare.md)
## `.z.T` `.z.t` `.z.D` `.z.d` (time/date shortcuts)
@@ -1266,15 +1250,13 @@ Shorthand forms:
.z.t `time$.z.z .z.d `date$.z.z
```
-:fontawesome-solid-hand-point-right:
[`.z.Z`](#zz-local-datetime) (local datetime), [`.z.z`](#zz-utc-datetime) (UTC datetime)
-
---
-:fontawesome-solid-graduation-cap:
+
[Callbacks](../kb/callbacks.md),
-[Using `.z`](../kb/using-dotz.md)
+[Using `.z`](https://code.kx.com/q/kb/using-dotz/)
-:fontawesome-solid-street-view:
+
_Q for Mortals:_
-[§11.6 Interprocess Communication](/q4m3/11_IO/#116-interprocess-communication)
+[§11.8 Interprocess Communication](/q4m3/11_IO/#116-interprocess-communication)
diff --git a/docs/ref/drop.md b/docs/ref/drop.md
index a57711a4..8808d7e6 100644
--- a/docs/ref/drop.md
+++ b/docs/ref/drop.md
@@ -1,7 +1,7 @@
---
title: Drop – Reference – kdb+ and q documentation
description: Drop is a q operator that drops items from a list, entries from a dictionary or columns from a table.
-author: Stephen Taylor
+author: KX Systems, Inc., a subsidiary of KX Software Limited
keywords: cut, drop, kdb+, list,q
---
# `_` Drop
@@ -84,7 +84,7 @@ q)(`a`b`c!1 2 3) _ `a`b
'type
```
-:fontawesome-regular-hand-point-right:
+
_Q for Mortals_: [§5. Dictionaries](/q4m3/5_Dictionaries/#522-extracting-a-sub-dictionary)
!!! warning "Dropping dictionary entries with integer arguments"
diff --git a/docs/ref/dsave.md b/docs/ref/dsave.md
index d504a243..213c3eb6 100644
--- a/docs/ref/dsave.md
+++ b/docs/ref/dsave.md
@@ -1,24 +1,21 @@
---
title: dsave saves a list of tables | Reference | kdb+ and q documentation
description: dsave is a q keyword that saves global tables to disk as splayed, enumerated, indexed kdb+ tables.
-author: Stephen Taylor
+author: KX Systems, Inc., a subsidiary of KX Software Limited
keywords: enumerated, indexed, kdb+, q, splayed, table
---
-# :fontawesome-solid-database: `dsave`
+# `dsave`
_Write global tables to disk as splayed, enumerated, indexed kdb+ tables._
-
-
-
```syntax
x dsave y dsave[x;y]
```
Where
-- `x` is the _save path_ as a file symbol atom or vector
-- `y` is one or more table names as a symbol atom or vector
+- `x` is the _save path_ as a file symbol atom or vector
+- `y` is one or more table names as a symbol atom or vector
save the table/s and returns the list of table names.
(Since V3.2 2014.05.07.)
@@ -46,18 +43,7 @@ ask | f
bsize| j
asize| j
-q)type each flip t
-sym | 11
-price| 9
-size | 7
-q)type each flip q
-sym | 11
-bid | 9
-ask | 9
-bsize| 7
-asize| 7
-
-q)`:/tmp/db1 dsave`sym xasc'`t`q
+q)`:/tmp/db1 dsave `sym xasc/:`t`q
`t`q
q)\l /tmp/db1
@@ -75,17 +61,6 @@ bid | f
ask | f
bsize| j
asize| j
-
-q)type each flip t
-sym | 20
-price| 9
-size | 7
-q)type each flip q
-sym | 20
-bid | 9
-ask | 9
-bsize| 7
-asize| 7
```
In the following, the left argument is a list, of which the second item is a partition name.
@@ -94,33 +69,7 @@ In the following, the left argument is a list, of which the second item is a par
q)t:flip`sym`price`size!100?'(-10?`3;1.0;10)
q)q:flip`sym`bid`ask`bsize`asize!900?'(distinct t`sym;1.0;1.0;10;10)
-q)meta t
-c | t f a
------| -----
-sym | s
-price| f
-size | j
-q)meta q
-c | t f a
------| -----
-sym | s
-bid | f
-ask | f
-bsize| j
-asize| j
-
-q)type each flip t
-sym | 11
-price| 9
-size | 7
-q)type each flip q
-sym | 11
-bid | 9
-ask | 9
-bsize| 7
-asize| 7
-
-q)`:/tmp/db2`2015.01.01 dsave`sym xasc'`t`q
+q)`:/tmp/db2`2015.01.01 dsave `sym xasc/:`t`q
`t`q
q)\l /tmp/db2
@@ -143,13 +92,10 @@ asize| j
```
----
-:fontawesome-solid-book:
-[`set`](get.md#set),
-[`.Q.en`](dotq.md#en-enumerate-varchar-cols),
-[`.Q.dpft`](dotq.md#dpft-save-table),
-[`.Q.hdpf`](dotq.md#hdpf-save-tables)
-
-:fontawesome-solid-book-open:
-[File system](../basics/files.md)
+[`set`](get.md#set),
+[`.Q.en`](dotq.md#en-enumerate-varchar-cols),
+[`.Q.dpft`](dotq.md#dpft-save-table),
+[`.Q.hdpf`](dotq.md#hdpf-save-tables)
+[File system](../basics/files.md)
diff --git a/docs/ref/dynamic-load.md b/docs/ref/dynamic-load.md
index 3527002d..08fdb189 100644
--- a/docs/ref/dynamic-load.md
+++ b/docs/ref/dynamic-load.md
@@ -42,9 +42,9 @@ If using a relative path which does not resolve to reside under `$QHOME/os`, ens
Since 3.6 2018.08.24 loading shared libraries via 2: resolved to a canonical path prior to load via the OS. This caused issues for libs whose run-time path was relative to a sym-link.
From 4.1t 2024.01.11 it resolves to an absolute path only, without resolving sym-links.
-:fontawesome-solid-book-open:
+
[File system](../basics/files.md)
-:fontawesome-brands-superpowers:
-[Using C/C++ functions](../interfaces/using-c-functions.md)
+
+[Using C/C++ functions](../interfaces/c-client-for-q.md)
diff --git a/docs/ref/each.md b/docs/ref/each.md
index fc926929..0171038a 100644
--- a/docs/ref/each.md
+++ b/docs/ref/each.md
@@ -1,11 +1,10 @@
---
title: each, peach | Reference | kdb+ and q documentation
description: each and peach are q keywords, wrappers for the map iterators Each and Each Parallel.
-author: Stephen Taylor
+author: KX Systems, Inc., a subsidiary of KX Software Limited
---
# `each`, `peach`
-
_Iterate a unary_
```syntax
@@ -13,10 +12,10 @@ _Iterate a unary_
(vv)each x each[vv;x] (vv)peach x peach[vv;x]
```
-Where
+Where
-- `v1` is a unary [applicable value](../basics/glossary.md#applicable-value)
-- `vv` is a [variadic](../basics/variadic.md) applicable value
+- `v1` is a unary [applicable value](../basics/glossary.md#applicable-value)
+- `vv` is a [variadic](../basics/variadic.md) applicable value
applies `v1` or `vv` as a unary to each item of `x` and returns a result of the same length.
@@ -31,49 +30,45 @@ q)(+\)peach(2 3 4;(5 6;7 8);9 10 11 12)
9 19 30 42
```
-`each` and `peach` perform the same computation and return the same result.
+`each` and `peach` perform the same computation and return the same result.
-`peach` will divide the work between available secondary tasks.
+`peach` will divide the work between available secondary tasks.
!!! note "Changes since 4.1t 2024.01.04"
peach workload distribution methodology changed to dynamically redistribute workload and allow nested invocation. The limitations on nesting have been removed, so peach (and multi-threaded primitives) can be used inside peach. To facilitate this, round-robin scheduling has been removed. Even though the initial work is still distributed in the same manner as before for compatibility, the workload is dynamically redistributed if a thread finishes its share before the others.
-`each` is a wrapper for the [Each iterator](maps.md#each).
-`peach` is a wrapper for the [Each Parallel iterator](maps.md#each-parallel).
-It is good q style to use `each` and `peach` for unary values.
+`each` is a wrapper for the [Each iterator](maps.md#each).
+`peach` is a wrapper for the [Each Parallel iterator](maps.md#each-parallel).
+It is good q style to use `each` and `peach` for unary values.
-!!! warning "`each` is redundant with [atomic functions](../basics/atomic.md). (Common qbie mistake.)"
+!!! warning "`each` is redundant with [atomic functions](../basics/atomic.md)."
-:fontawesome-solid-book:
[Maps](maps.md) for uses of Each with binary and higher-rank values
-:fontawesome-solid-book:
+
[`.Q.fc` parallel on cut](dotq.md#fc-parallel-on-cut)
-:fontawesome-solid-book-open:
-[Parallel processing](../basics/peach.md)
+
+Parallel processing
-:fontawesome-solid-graduation-cap:
+
[Table counts in a partitioned database](../kb/partition.md#table-counts)
-:fontawesome-solid-street-view:
-_Q for Mortals_
-[A.68 `peach`](/q4m3/A_Built-in_Functions/#a68-peach)
+_Q for Mortals_
+[A.49 `peach`](/q4m3/A_Built-in_Functions/#a68-peach)
## Higher-rank values
-`peach` applies only unary values.
-For a values of rank ≥2, use [Apply](apply.md) to project `v` as a unary value.
+`peach` applies only unary values.
+For a values of rank ≥2, use [Apply](apply.md) to project `v` as a unary value.
-For example, suppose `m` is a 4-column matrix and each row has values for the arguments of `v4`. Then `.[v4;]peach m` will apply `v4` to each list of arguments.
+For example, suppose `m` is a 4-column matrix and each row has values for the arguments of `v4`. Then `.[v4;]peach m` will apply `v4` to each list of arguments.
Alternatively, suppose `t` is a table in which columns `b`, `c`, and `a` are arguments of `v3`. Then ``.[v3;]peach flip t `b`c`a`` will apply `v3` to the arguments in each row of `t`.
-
-
-## :fontawesome-solid-triangle-exclamation: Blocked within `peach`
+## Blocked within `peach`
```txt
hopen socket
@@ -85,7 +80,7 @@ load master decryption key (-36!)
And any **system command** which might cause a change of global state.
-Generally, do not use a **socket** within `peach`, unless it is encapsulated via [one-shot sync request](../ref/hopen.md#one-shot-request) or HTTP client request (TLS/SSL support added in 4.1t 2023.11.10). Erroneous socket usage is blocked and signals a `nosocket` error.
+Generally, do not use a **socket** within `peach`, unless it is encapsulated via [one-shot sync request](hopen.md#one-shot-request) or HTTP client request (TLS/SSL support added in 4.1t 2023.11.10). Erroneous socket usage is blocked and signals a `nosocket` error.
If you are careful to manage your **file handles/file access** so that there is no parallel use of the same handle (or file) across threads, then you can open and close files within `peach`.
diff --git a/docs/ref/ej.md b/docs/ref/ej.md
index 60b1dc98..47659810 100644
--- a/docs/ref/ej.md
+++ b/docs/ref/ej.md
@@ -44,11 +44,11 @@ IBM N 1000
MSFT CME 250
q)ej[`sym;s;t]
-sym ex MC price
+sym ex MC price
-----------------------
-IBM N 1000 0.7029677
-IBM N 1000 0.2608152
-MSFT CME 250 0.5433888
+IBM N 1000 0.7029677
+IBM N 1000 0.2608152
+MSFT CME 250 0.5433888
```
Duplicate column values are filled from `t2`.
@@ -67,10 +67,10 @@ k c v
```
---
-:fontawesome-solid-book-open:
+
[Joins](../basics/joins.md)
-:fontawesome-solid-street-view:
+
_Q for Mortals_
-[§9.9.5 Equi Join](/q4m3/9_Queries_q-sql/#995-equi-join-ej)
+[§9.9.5 Equi Join](/q4m3/9_Queries_q-sql/#995-equijoin-ej)
diff --git a/docs/ref/ema.md b/docs/ref/ema.md
index 3d22fd67..ff9a7963 100644
--- a/docs/ref/ema.md
+++ b/docs/ref/ema.md
@@ -38,9 +38,9 @@ q)(2%1+10)ema p
```
----
-:fontawesome-solid-book:
+
[`avg`, `avgs`, `mavg`, `wavg`](avg.md)
-:fontawesome-solid-book:
+
[Mathematics](../basics/math.md)
diff --git a/docs/ref/enkey.md b/docs/ref/enkey.md
index 9e21dec9..053562b8 100644
--- a/docs/ref/enkey.md
+++ b/docs/ref/enkey.md
@@ -1,7 +1,7 @@
---
title: Enkey, Unkey – Reference – kdb+ and q documentation
description: Enkey and Unkey are q operators that respectively convert a simple tableto a keyed table and vice-versa.
-author: Stephen Taylor
+author: KX Systems, Inc., a subsidiary of KX Software Limited
keywords: bang, enkey, kdb+, keyed table, q, table, Unkey
---
# `!` Enkey, Unkey
@@ -72,15 +72,15 @@ a b c
```
----
-:fontawesome-solid-book:
+
[`key`](key.md)
-:fontawesome-solid-book:
+
[`keys`](keys.md),
[`xkey`](keys.md#xkey)
-:fontawesome-solid-book:
+
[`!` bang](overloads.md#bang) overloads
-:fontawesome-solid-book-open:
+
[Tables](../kb/faq.md)
\ No newline at end of file
diff --git a/docs/ref/enum-extend.md b/docs/ref/enum-extend.md
index b9aec649..29246c83 100644
--- a/docs/ref/enum-extend.md
+++ b/docs/ref/enum-extend.md
@@ -1,7 +1,7 @@
---
title: Enum Extend | Reference | kdb+ and q documentation
description: Enum Extend is a q operator that extends an enumeration.
-author: Stephen Taylor
+author: KX Systems, Inc., a subsidiary of KX Software Limited
---
# `?` Enum Extend
@@ -96,20 +96,20 @@ kdb+ does not report an error if that lock call fails.
Enum Extend is a uniform function.
----
-:fontawesome-solid-book:
+
[Enumerate](enumerate.md),
[Enumeration](enumeration.md),
[`.Q.en` (enumerate varchar cols)](dotq.md#en-enumerate-varchar-cols),
[`?` query overloads](overloads.md#query)
-:fontawesome-solid-book-open:
+
[Enumerations](../basics/enumerations.md),
[File system](../basics/files.md)
-:fontawesome-solid-graduation-cap:
+
[Enumerating symbol columns in a table](../kb/splayed-tables.md#enumerating-symbol-columns)
-:fontawesome-solid-street-view:
+
_Q for Mortals_
[§7.5 Enumerations](/q4m3/7_Transforming_Data/#75-enumerations)
diff --git a/docs/ref/enumerate.md b/docs/ref/enumerate.md
index bf6062d7..698b06df 100644
--- a/docs/ref/enumerate.md
+++ b/docs/ref/enumerate.md
@@ -1,7 +1,7 @@
---
title: Enumerate | Reference | kdb+ and q documentation
description: Enumerate is a q operator that returns one list as an enumeration of another.
-author: Stephen Taylor
+author: KX Systems, Inc., a subsidiary of KX Software Limited
---
# `$` Enumerate
@@ -77,15 +77,15 @@ cast | item/s of `y` not in `d`
---
-:fontawesome-solid-book:
+
[Enum Extend](enum-extend.md),
[Enumeration](enumeration.md),
[`$` dollar](overloads.md#dollar)
-:fontawesome-solid-book-open:
+
[Enumerations](../basics/enumerations.md)
-:fontawesome-solid-street-view:
+
_Q for Mortals_
[§7.5 Enumerations](/q4m3/7_Transforming_Data/#75-enumerations) ,
-[§8.5 Foreign Keys and Virtual Columns](/q4m3/8_Tables/#84-foreign-keys-and-virtual-columns)
+[§8.5 Foreign Keys and Virtual Columns](/q4m3/8_Tables/#85-foreign-keys-and-virtual-columns)
diff --git a/docs/ref/enumeration.md b/docs/ref/enumeration.md
index 62ab37ce..f276182b 100644
--- a/docs/ref/enumeration.md
+++ b/docs/ref/enumeration.md
@@ -1,7 +1,7 @@
---
title: Enumeration | Reference | kdb+ and q documentation
description: Enumeration isd a q operator that returns an enumerated symbol list.
-author: Stephen Taylor
+author: KX Systems, Inc., a subsidiary of KX Software Limited
keywords: bang, enumerate, enumeration, list, kdb+, q
---
# `!` Enumeration
@@ -29,16 +29,16 @@ q)`x!1 2 3
```
---
-:fontawesome-solid-book:
+
[Enum Extend](enum-extend.md),
[Enumerate](enumerate.md),
[`!` bang](overloads.md#bang)
-:fontawesome-solid-book-open:
+
[Enumerations](../basics/enumerations.md)
-:fontawesome-solid-street-view:
+
_Q for Mortals_
[§7.5 Enumerations](/q4m3/7_Transforming_Data/#75-enumerations),
-[§8.5 Foreign Keys and Virtual Columns](/q4m3/8_Tables/#84-foreign-keys-and-virtual-columns)
+[§8.5 Foreign Keys and Virtual Columns](/q4m3/8_Tables/#85-foreign-keys-and-virtual-columns)
diff --git a/docs/ref/equal.md b/docs/ref/equal.md
index f7033dd4..c4ccaf29 100644
--- a/docs/ref/equal.md
+++ b/docs/ref/equal.md
@@ -1,7 +1,7 @@
---
title: Equal | Reference | kdb+ and q documentation
description: Equal is a q operator that flags where its arguments are equal.
-author: Stephen Taylor
+author: KX Systems, Inc., a subsidiary of KX Software Limited
keywords: equal, kdb+, q
---
# `=` Equal
@@ -23,11 +23,11 @@ q)(3;"a")=(2 3 4;"abc")
Equal is an atomic function.
---
-:fontawesome-solid-book:
+
[Not Equal `<>`](not-equal.md)
-:fontawesome-solid-book-open:
+
[Comparison](../basics/comparison.md)
-:fontawesome-solid-street-view:
-_Q for Mortals_: [§4.3.1 Equality = and Disequality <>](/q4m3/4_Operators/#431-equality-and-disequality)
+
+_Q for Mortals_: [§4.3.1 Equality = and Inequality <>](/q4m3/4_Operators/#431-equality-and-disequality)
diff --git a/docs/ref/eval.md b/docs/ref/eval.md
index 9a8f9efa..1cc858ea 100644
--- a/docs/ref/eval.md
+++ b/docs/ref/eval.md
@@ -1,7 +1,7 @@
---
title: eval, reval | Reference | kdb+ and q documentation
description: eval and reval are q keywords that evaluate parse trees.
-author: Stephen Taylor
+author: KX Systems, Inc., a subsidiary of KX Software Limited
---
# `eval`, `reval`
@@ -69,6 +69,6 @@ q)h"reval(hopen;enlist`:somefile)"
```
----
-:fontawesome-solid-graduation-cap:
+
[Table counts in a partitioned database](../kb/partition.md#table-counts)
diff --git a/docs/ref/except.md b/docs/ref/except.md
index 2dbd8f1e..09b1dca6 100644
--- a/docs/ref/except.md
+++ b/docs/ref/except.md
@@ -1,7 +1,7 @@
---
title: except – exclude items from a list | Reference | kdb+ and q documentation
description: except is a q keyword that excludes items from a list.
-author: Stephen Taylor
+author: KX Systems, Inc., a subsidiary of KX Software Limited
---
# `except`
@@ -27,16 +27,16 @@ q)1 2 3 4 1 3 except 2 3
1 4 1
```
-`except` uses [Find](find.md) to identify items of `x` in `y`.
+`except` uses [`in`](in.md) to identify items of `x` in `y`, which in turn uses [`find`](find.md).
----
-:fontawesome-solid-book:
+
[Find](find.md),
[`in`](in.md),
[`within`](within.md)
-:fontawesome-solid-book-open:
+
[Selection](../basics/by-topic.md#selection)
diff --git a/docs/ref/exec.md b/docs/ref/exec.md
index f9fcb5f8..1eec1ba3 100644
--- a/docs/ref/exec.md
+++ b/docs/ref/exec.md
@@ -1,7 +1,7 @@
---
title: exec keyword | Reference | kdb+ and q documentation
description: exec is a q keyword that returns selected rows and columns from a table. Exec is a q operator that does the same in functional SQL.
-author: Stephen Taylor
+author: KX Systems, Inc., a subsidiary of KX Software Limited
keywords: kdb+, q, table
---
# `exec`
@@ -13,7 +13,7 @@ _Return selected rows and columns from a table_
!!! info "`exec` is a qSQL query template and varies from regular q syntax."
For the Exec operator `?`, see
-:fontawesome-solid-book-open:
+
[Functional SQL](../basics/funsql.md)
@@ -26,7 +26,7 @@ Below, square brackets mark optional elements.
exec [distinct] _ps_ [by _pb_] from _texp_ [where _pw_]
-:fontawesome-solid-book-open:
+
[qSQL syntax](../basics/qsql.md)
@@ -163,15 +163,15 @@ see [qSQL](../basics/qsql.md#cond).
----
-:fontawesome-solid-book:
+
[`delete`](delete.md),
[`select`](select.md),
[`update`](update.md)
-:fontawesome-solid-book-open:
+
[qSQL](../basics/qsql.md),
[Functional SQL](../basics/funsql.md)
-:fontawesome-solid-street-view:
+
_Q for Mortals_
[§9.4 The `exec` Template](/q4m3/9_Queries_q-sql/#94-the-exec-template)
diff --git a/docs/ref/exit.md b/docs/ref/exit.md
index f2fbc85b..e69316ed 100644
--- a/docs/ref/exit.md
+++ b/docs/ref/exit.md
@@ -1,7 +1,7 @@
---
title: exit – Reference – kdb+ and q documentation
description: exit is a control word that terminates a kdb+ process with a specified exit code.
-author: Stephen Taylor
+author: KX Systems, Inc., a subsidiary of KX Software Limited
---
# `exit`
@@ -34,10 +34,10 @@ Exit is blocked during [`reval`](eval.md#reval) or with [`-u` on the command lin
----
-:fontawesome-solid-book:
+
[`.z.exit`](dotz.md#zexit-action-on-exit) (action on exit)
-:fontawesome-solid-book-open:
+
[Controlling evaluation](../basics/control.md),
[Debugging](../basics/debug.md)
diff --git a/docs/ref/exp.md b/docs/ref/exp.md
index 3da94cc5..a5cba6c1 100644
--- a/docs/ref/exp.md
+++ b/docs/ref/exp.md
@@ -1,15 +1,12 @@
---
title: exp, xexp – raise to a power | Reference | kdb+ and q documentation
description: exp and xexp are q keywords. exp raises e to the power of its argument; xexp raises its left argument to the power of its right.
-author: Stephen Taylor
+author: KX Systems, Inc., a subsidiary of KX Software Limited
---
# `exp`, `xexp`
_Raise to a power_
-
-
-
## `exp`
_Raise e to a power_
@@ -18,10 +15,10 @@ _Raise e to a power_
exp x exp[x]
```
-Where
+Where
-- `x` is numeric
-- $e$ is the base of natural logarithms
+- `x` is numeric
+- $e$ is the base of natural logarithms
returns as a float $e^x$, or null if `x` is null.
@@ -41,8 +38,7 @@ q)exp 00:00:00 00:00:12 12:00:00
`exp` is a [multithreaded primitive](../kb/mt-primitives.md).
-
-### :fontawesome-solid-sitemap: Implicit iteration
+### Implicit iteration
`exp` is an [atomic](../basics/atomic.md) function.
It applies to [dictionaries and tables](../basics/math.md#dictionaries-and-tables)
@@ -73,7 +69,6 @@ def| 7.58256e-10 148.4132
ghi| 20.08554 0.002478752
```
-
### Domain and range
```txt
@@ -95,8 +90,8 @@ x xexp y xexp[x;y]
Where `x` and `y` are numerics, returns as a float where `x` is
-- non-negative, xy
-- null or negative, `0n`
+- non-negative, xy
+- null or negative, `0n`
```q
q)2 xexp 8
@@ -109,8 +104,7 @@ q)1.5 xexp -4.2 0 0.1 0n 0w
0.1821448 1 1.04138 0n 0w
```
-
-!!! warning "The calculation is performed as `exp y * log x`."
+!!! warning "The calculation is performed as `exp y * log x`."
If `y` is integer, this is not identical to `prd y#x`.
@@ -126,7 +120,7 @@ q)1.5 xexp -4.2 0 0.1 0n 0w
`xexp` is a [multithreaded primitive](../kb/mt-primitives.md).
-### :fontawesome-solid-sitemap: Implicit iteration
+### Implicit iteration
`xexp` is an [atomic](../basics/atomic.md) function.
It applies to [dictionaries and keyed tables](../basics/math.md#dictionaries-and-tables)
@@ -150,7 +144,6 @@ def| 9.559907e-11 243
ghi| 27 0.001371742
```
-
### Domain and range
```txt
@@ -179,5 +172,5 @@ t | . . . . . . . . . . . . . . . . . .
Range: `f`
----
-:fontawesome-solid-book:
-[`log`, `xlog`](log.md)
+
+[`log`, `xlog`](log.md)
diff --git a/docs/ref/fby.md b/docs/ref/fby.md
index 01fe4838..9ae09579 100644
--- a/docs/ref/fby.md
+++ b/docs/ref/fby.md
@@ -1,7 +1,7 @@
---
title: fby – Reference – kdb+ and q documentation
description: fby is a q keyword that applies an aggregate function to groups.
-author: Stephen Taylor
+author: KX Systems, Inc., a subsidiary of KX Software Limited
keywords: fby, group, kdb+, q, query, qsql, sql
---
# `fby`
@@ -205,5 +205,5 @@ s4 p2 200 500
In V2.6 and below, `fby`’s behavior is undefined if the aggregation function returns a list; it usually signals an error from the k definition of `fby`. However, if the concatenation of all list results from the aggregation function results `raze` has the same length as the original vectors, a list of some form is returned, but the order of its items is not clearly defined.
---
-:fontawesome-solid-book-open:
+
[q-SQL](../basics/qsql.md)
diff --git a/docs/ref/file-binary.md b/docs/ref/file-binary.md
index bae947b5..97d046a3 100644
--- a/docs/ref/file-binary.md
+++ b/docs/ref/file-binary.md
@@ -1,16 +1,14 @@
---
title: File Binary | Reference | kdb+ and q documentation
description: File Binary is a q operator that reads or writes a binary file.
-author: Stephen Taylor
+author: KX Systems, Inc., a subsidiary of KX Software Limited
---
-# :fontawesome-solid-database: `1:` File Binary
-
-_Read and parse, or write bytes_
+# `1:` File Binary
+_Read and parse, or write bytes_
-> There are 10 types of people: those who use binary arithmetic and those who don’t.
-
+> There are 10 types of people: those who use binary arithmetic and those who don’t.
## Read Binary
@@ -18,14 +16,14 @@ _Read and parse, or write bytes_
x 1: y 1:[x;y]
```
-Where
+Where
-- `x` is a 2-item list (a string of [types](#column-types-and-widths) and an int vector of widths) of which the order determines whether the data is parsed as little-endian or big-endian
-- `y` is either a
- - file symbol to repeatedly read all available records (specified by `x`) from a file
- - 3-element list containing the file (symbol), offset (long), and length (long). Enables repeatedly reading all available records (specified by `x`) from a file, which stops after the given byte length, starting 'offset' bytes from the start of the file.
- - string
- - byte sequence
+- `x` is a 2-item list (a string of [types](#column-types-and-widths) and an int vector of widths) of which the order determines whether the data is parsed as little-endian or big-endian
+- `y` is either a
+ - file symbol to repeatedly read all available records (specified by `x`) from a file
+ - 3-element list containing the file (symbol), offset (long), and length (long). Enables repeatedly reading all available records (specified by `x`) from a file, which stops after the given byte length, starting 'offset' bytes from the start of the file.
+ - string
+ - byte sequence
returns the content of `y` as a matrix.
@@ -93,13 +91,13 @@ t time 4
(blank) skip
```
-:fontawesome-solid-street-view:
+
_Q for Mortals_
[§11.5.1 Fixed-Width Records](/q4m3/11_IO/#1151-fixed-width-records)
### Multithreaded Load
-Binary load can use multiple threads when kdb+ is running in [multithreaded mode](https://code.kx.com/q/basics/syscmds/#s-number-of-secondary-threads)
+Binary load can use multiple threads when kdb+ is running in [multithreaded mode](../basics/syscmds.md#s-number-of-secondary-threads)
Since 4.1t 2021.09.28.
@@ -112,13 +110,13 @@ x 1: y 1:[x;y]
Where
-- `x` is a [`filesymbol`](../basics/glossary.md#file-symbol) or (since 4.1t 2023.04.17) a 4 item list ([`filesymbol`](../basics/glossary.md#file-symbol), logical block size, compression algorithm and compression level) to write compressed data
-- `y` is data to write
+- `x` is a [`filesymbol`](../basics/glossary.md#file-symbol) or (since 4.1t 2023.04.17) a 4 item list ([`filesymbol`](../basics/glossary.md#file-symbol), logical block size, compression algorithm and compression level) to write compressed data
+- `y` is data to write
writes the raw bytes of `y` to [`filesymbol`](../basics/glossary.md#file-symbol) and returns it. If `filesymbol`
-- does not exist, it is created, with any required directories
-- exists, it is overwritten
+- does not exist, it is created, with any required directories
+- exists, it is overwritten
```q
q)`:hello 1: 0x68656c6c6f776f726c64
@@ -154,8 +152,8 @@ q)(`:file;17;2;9)1:100#0x0
```
----
-:fontawesome-solid-book:
+
[`0:` File Text](file-text.md)
-:fontawesome-solid-book-open:
+
[File system](../basics/files.md)
diff --git a/docs/ref/file-text.md b/docs/ref/file-text.md
index 1b1b84cf..4f47e1d5 100644
--- a/docs/ref/file-text.md
+++ b/docs/ref/file-text.md
@@ -1,16 +1,13 @@
---
title: File Text | Reference | kdb+ and q documentation
description: File Text is a q operator that reads or writes text files.
-author: Stephen Taylor
+author: KX Systems, Inc., a subsidiary of KX Software Limited
keywords: file, kdb+, q, read, text, write
---
# `0:` File Text
_Read or write text_
-
-
-
The File Text operator `0:` has five forms:
@@ -18,17 +15,16 @@ The File Text operator `0:` has five forms:
[Save Text](#save-text) write a list of strings to file
-[Load CSV](#load-csv) field-delimited string, list of strings, or file,
+[Load CSV](#load-csv) field-delimited string, list of strings, or file,
as a list or matrix
-[Load Fixed](#load-fixed) fixed-format list of strings, or file,
+[Load Fixed](#load-fixed) fixed-format list of strings, or file,
as a list or matrix
[Key-Value Pairs](#key-value-pairs) delimited string as key-value pairs
-
-## :fontawesome-solid-align-left: Prepare Text
+## Prepare Text
_Represent a table as a list of delimited strings_
@@ -36,12 +32,12 @@ _Represent a table as a list of delimited strings_
delimiter 0: t 0:[delimiter;t]
```
-Where
+Where
-- `delimiter` is a char atom
-- `t` is a table in which the columns are either vectors or lists of strings
+- `delimiter` is a char atom
+- `t` is a table in which the columns are either vectors or lists of strings
-returns a list of character strings containing text representations of the rows of `t` separated by `delimiter`.
+returns a list of character strings containing text representations of the rows of `t` separated by `delimiter`.
```q
q)csv 0: ([]a:1 2 3;b:`x`y`z)
@@ -136,12 +132,10 @@ q)csv 0:([]("foo\nbar";"baz"))
,`FiscalTag
```
-:fontawesome-solid-street-view:
_Q for Mortals_
[§11.4.3 Preparing Text](/q4m3/11_IO/#1143-preparing-text)
-
-## :fontawesome-solid-database: Save Text
+## Save Text
_Write a list of strings to file_
@@ -149,10 +143,10 @@ _Write a list of strings to file_
filesymbol 0: strings 0:[filesymbol;strings]
```
-Where
+Where
-- `filesymbol` is a file symbol
-- `strings` a list of character strings
+- `filesymbol` is a file symbol
+- `strings` a list of character strings
`strings` are saved as lines in the file. The result of [Prepare Text](#prepare-text) can be used as `strings`.
@@ -165,15 +159,12 @@ q)`:status.txt 0: string system "w"
If `filesymbol`
-- does not exist, it is created, with any missing containing directories
-- exists, it is overwritten
-
+- does not exist, it is created, with any missing containing directories
+- exists, it is overwritten
-:fontawesome-solid-book:
[`save`, `rsave`](save.md)
-
-## :fontawesome-solid-database: Load CSV
+## Load CSV
_Interpret a field-delimited string, list of strings, or file as a list or matrix_
@@ -182,21 +173,20 @@ _Interpret a field-delimited string, list of strings, or file as a list or matri
(types;delimiter;flag) 0: y 0:[(types;delimiter;flag);y]
```
-Where
+Where
-- `y` is one of the following:
- - string
- - list of strings
- - file symbol
- - 2-list (filesymbol;offset) where offset is a non-zero integer
- - 3-list (filesymbol;offset;length) where offset and length are non-zero integers
-- `types` is a string of [column type codes](#column-types-and-formats) in upper case
-- `delimiter` is a char atom or 1-item list
-- `flag` (optional, default `0`, since V3.4) is a long atom indicating whether line-returns may be embedded in strings: `0` or `1`
+- `y` is one of the following:
+ - string
+ - list of strings
+ - file symbol
+ - 2-list (filesymbol;offset) where offset is a non-zero integer
+ - 3-list (filesymbol;offset;length) where offset and length are non-zero integers
+- `types` is a string of [column type codes](#column-types-and-formats) in upper case
+- `delimiter` is a char atom or 1-item list
+- `flag` (optional, default `0`, since V3.4) is a long atom indicating whether line-returns may be embedded in strings: `0` or `1`
returns a vector, matrix, or table interpreted from the content of `y`.
-
### With column names
If `delimiter` is enlisted, the first row of the content of `y` is read as column names and the result is a table; otherwise the result is a list of values for each column.
@@ -214,7 +204,7 @@ q)("I*";",";1)0:("0,\"ab\nc\"";"1,\"def\"")
"ab\nc" "def"
```
-Where `y` is a string and `delimiter` an atom, returns a single list of the data split and parsed accordingly.
+Where `y` is a string and `delimiter` an atom, returns a single list of the data split and parsed accordingly.
```q
q)("DT";",")0:"20130315,185540686"
@@ -222,7 +212,6 @@ q)("DT";",")0:"20130315,185540686"
18:55:40.686
```
-
### Without column names
If the CSV file contains data but no column names:
@@ -252,7 +241,7 @@ table: flip `a`b`c!("ISI";",") 0:`data.csv
### Multithreaded Load
-CSV load (excluding embedded line return mode) can use multiple threads when kdb+ is running in [multithreaded mode](https://code.kx.com/q/basics/syscmds/#s-number-of-secondary-threads).
+CSV load (excluding embedded line return mode) can use multiple threads when kdb+ is running in [multithreaded mode](../basics/syscmds.md#s-number-of-secondary-threads).
```q
q)v:` sv 10000000#","0:10 10#til 100
@@ -261,8 +250,7 @@ q)system"s 10";(10#"J";",")0:v
Since 4.1t 2021.09.28.
-
-## :fontawesome-solid-database: Load Fixed
+## Load Fixed
_Interpret a fixed-format list of strings or file as a list or matrix_
@@ -270,15 +258,15 @@ _Interpret a fixed-format list of strings or file as a list or matrix_
(types; widths) 0: y 0:[(types;widths);y]
```
-Where
+Where
-- `y` is one of the following:
- - list of strings
- - file symbol
- - 2-list (filesymbol;offset) where offset is a non-zero integer
- - 3-list (filesymbol;offset;length) where offset and length are non-zero integers
-- `types` is a list of [column types](#column-types-and-formats) in upper case
-- `widths` is an int vector of field widths
+- `y` is one of the following:
+ - list of strings
+ - file symbol
+ - 2-list (filesymbol;offset) where offset is a non-zero integer
+ - 3-list (filesymbol;offset;length) where offset and length are non-zero integers
+- `types` is a list of [column types](#column-types-and-formats) in upper case
+- `widths` is an int vector of field widths
returns a vector or matrix interpreted from the content of `y`.
@@ -307,12 +295,11 @@ q)t:("IFC D";4 8 10 6 4) 0: `:/q/Fixed.txt
### Multithreaded Load
-Fixed width load can use multiple threads when kdb+ is running in [multithreaded mode](https://code.kx.com/q/basics/syscmds/#s-number-of-secondary-threads)
+Fixed width load can use multiple threads when kdb+ is running in [multithreaded mode](../basics/syscmds.md#s-number-of-secondary-threads)
Since 4.1t 2021.09.28.
-
-## :fontawesome-solid-book: Key-Value Pairs
+## Key-Value Pairs
_Interpret a delimited string as key-value pairs_
@@ -320,7 +307,7 @@ _Interpret a delimited string as key-value pairs_
x 0: string 0:[x;string]
```
-Where `x` is a 3- or 4-char string:
+Where `x` is a 3- or 4-char string:
```txt
key-type
@@ -329,7 +316,7 @@ field-separator
record-separator
```
-and `key-type` is `S` for symbol, `I` for integer, or `J` for long, returns a 2-row matrix of the keys and values.
+and `key-type` is `S` for symbol, `I` for integer, or `J` for long, returns a 2-row matrix of the keys and values.
```q
q)"S=;"0:"one=1;two=2;three=3"
@@ -358,18 +345,16 @@ The inclusion of an asterisk as the third character allows the delimiter charact
```q
q)0N!"I=*,"0:"5=\"hello,world\",6=1";
-(5 6i;("hello,world";,"1"))
+(5 6i;("hello,world";,"1"))q4m
q)0N!"J=*,"0:"5=\"hello,world\",6=1";
(5 6;("hello,world";,"1"))
q)0N!"S=*,"0:"a=\"hello,world\",b=1";
(`a`b;("hello,world";,"1"))
```
-:fontawesome-solid-street-view:
_Q for Mortals_
[§11.5.3 Key-Value Records](/q4m3/11_IO/#1153-key-value-records)
-
## Column types and formats
```txt
@@ -395,15 +380,14 @@ T time hh[:]mm[:]ss[[.]ddd]
* literal chars
```
-
----
-:fontawesome-solid-book:
-[`.j` namespace](../ref/dotj.md) for JSON
+
+[`.j` namespace](dotj.md) for JSON
-:fontawesome-solid-book-open:
-[Datatypes](../basics/datatypes.md),
+ q4m
+[Datatypes](../basics/datatypes.md),
[File system](../basics/files.md)
-:fontawesome-solid-street-view:
+
_Q for Mortals_
[§11.4.1 Reading and Writing Text Files](/q4m3/11_IO/#1141-reading-and-writing-text-files)
diff --git a/docs/ref/fill.md b/docs/ref/fill.md
index 45945061..f3bbedd3 100644
--- a/docs/ref/fill.md
+++ b/docs/ref/fill.md
@@ -1,7 +1,7 @@
---
title: Fill operator, fills keyword – replace nulls in a vector | Reference | kdb+ and q documentation
description: Fill is a q operator that replaces nulls in a vector. fills is a q keyword that replaces nulls in a vector with preceding non-nulls.
-author: Stephen Taylor
+author: KX Systems, Inc., a subsidiary of KX Software Limited
---
# `^` Fill, `fills`
@@ -98,7 +98,7 @@ q)type 5^0n 2 3i
The possible range of output types are `bcdefghijmnpstuvxz`.
-:fontawesome-solid-book:
+
[`^` Coalesce](coalesce.md) where `x` and `y` are keyed tables
diff --git a/docs/ref/find.md b/docs/ref/find.md
index 2bafe508..4c787c55 100644
--- a/docs/ref/find.md
+++ b/docs/ref/find.md
@@ -1,7 +1,7 @@
---
title: Find | Reference | kdb+ and q documentation
description: Find is a q operator that finds the first occurrence of an item in a list.
-author: Stephen Taylor
+author: KX Systems, Inc., a subsidiary of KX Software Limited
keywords: find, kdb+, q, query, search
---
# `?` Find
diff --git a/docs/ref/first.md b/docs/ref/first.md
index 857c6630..6f65205a 100644
--- a/docs/ref/first.md
+++ b/docs/ref/first.md
@@ -1,7 +1,7 @@
---
title: first, last – Reference – kdb+ and q documentation
description: first and last are q keywords that return respectively the first and last items from a list.
-author: Stephen Taylor
+author: KX Systems, Inc., a subsidiary of KX Software Limited
keywords: each, enlist, first, last kdb+, q, select
---
# `first`, `last`
@@ -81,5 +81,5 @@ q)last 42
```
----
-:fontawesome-solid-book-open:
+
[Selection](../basics/by-topic.md#selection)
diff --git a/docs/ref/fkeys.md b/docs/ref/fkeys.md
index da29ccb9..93c49fd3 100644
--- a/docs/ref/fkeys.md
+++ b/docs/ref/fkeys.md
@@ -1,7 +1,7 @@
---
title: fkeys – Reference – kdb+ and q documentation
description: fkeys is a q keyword that returns the foreign-key columns of a table.
-author: Stephen Taylor
+author: KX Systems, Inc., a subsidiary of KX Software Limited
keywords: column, foreign key, kdb+, q, table
---
# `fkeys`
@@ -31,5 +31,5 @@ c| f
```
---
-:fontawesome-solid-book-open:
+
[Metadata](../basics/metadata.md)
\ No newline at end of file
diff --git a/docs/ref/flip-splayed.md b/docs/ref/flip-splayed.md
index d20b06a4..c84ea634 100644
--- a/docs/ref/flip-splayed.md
+++ b/docs/ref/flip-splayed.md
@@ -1,7 +1,7 @@
---
title: Flip Splayed or Partitioned – Reference – kdb+ and q documentation
description: Flip Splayed or Partitioned is a q operator that returns the flip of a splayed orpartitioned table.
-author: Stephen Taylor
+author: KX Systems, Inc., a subsidiary of KX Software Limited
keywords: flip, flip splayed, kdb+, partitioned, q, splayed, table
---
# `!` Flip Splayed or Partitioned
@@ -89,5 +89,5 @@ q)select from flip enlist[`a]!`s
```
---
-:fontawesome-solid-book-open:
+
[Dictionaries & tables](../basics/dictsandtables.md)
\ No newline at end of file
diff --git a/docs/ref/flip.md b/docs/ref/flip.md
index 3bb81419..3e995b59 100644
--- a/docs/ref/flip.md
+++ b/docs/ref/flip.md
@@ -1,7 +1,7 @@
---
title: flip – transpose a matrix or column dictionary | Reference | kdb+ and q documentation
description: flip is a q keyword that transposes its argument.
-author: Stephen Taylor
+author: KX Systems, Inc., a subsidiary of KX Software Limited
---
# `flip`
diff --git a/docs/ref/floor.md b/docs/ref/floor.md
index 6ec43e24..6cdcdd33 100644
--- a/docs/ref/floor.md
+++ b/docs/ref/floor.md
@@ -4,17 +4,16 @@ description: floor is a q keyword that returns the greatest integer smaller than
author: Stephen taylor
keywords: floor, kdb+, math, mathematics, maximum, q
---
+
# `floor`
_Round down_
-
-
```syntax
floor x floor[x]
```
-Returns the greatest integer less than or equal to numeric `x`.
+Returns the greatest integer less than or equal to numeric `x`.
```q
q)floor -2.1 0 2.1
@@ -23,8 +22,7 @@ q)floor -2.1 0 2.1
`floor` is a [multithreaded primitive](../kb/mt-primitives.md).
-
-## :fontawesome-solid-sitemap: Implicit iteration
+## Implicit iteration
`floor` is an [atomic function](../basics/atomic.md).
@@ -49,12 +47,12 @@ domain: b g x h i j e f c s p m d z n u v t
range: . . . h i j j j c s . . . s . . . .
```
-## :fontawesome-solid-triangle-exclamation: Prior to V3.0
+## Prior to V3.0
-Prior to V3.0, `floor`
+Prior to V3.0, `floor`
-- used [comparison tolerance](../basics/precision.md#comparison-tolerance)
-- accepted datetime (Since V3.0, use `"d"$` instead.)
+- used [comparison tolerance](../basics/precision.md#comparison-tolerance)
+- accepted datetime (Since V3.0, use `"d"$` instead.)
```q
q)floor 2 - 10 xexp -12 -13
@@ -66,7 +64,6 @@ q)"d"$2009.10.03T13:08:00.222
2009.10.03
```
-
## Domain and range
```txt
@@ -76,10 +73,9 @@ range . . . h i j j j c s . . . . . . . .
Range: `hijcs`
-
----
-:fontawesome-solid-book:
-[`ceiling`](ceiling.md)
+
+[`ceiling`](ceiling.md)
-:fontawesome-solid-book-open:
+
[Mathematics](../basics/math.md)
diff --git a/docs/ref/get.md b/docs/ref/get.md
index e68a8839..e68ce5f9 100644
--- a/docs/ref/get.md
+++ b/docs/ref/get.md
@@ -1,15 +1,13 @@
---
title: get, set – Reference – kdb+ and q documentation
description: get and set are q keywords that read or set value of a variable or a kdb+ data file.
-author: Stephen Taylor
+author: KX Systems, Inc., a subsidiary of KX Software Limited
keywords: get, kdb+, q, set
---
-# :fontawesome-solid-database: `get`, `set`
-
-_Read or set the value of a variable or a kdb+ data file_
-
+# `get`, `set`
+_Read or set the value of a variable or a kdb+ data file_
## `get`
@@ -21,8 +19,8 @@ get x get[x]
Where `x` is
-- the name of a global variable as a symbol atom
-- a [file or folder](../basics/glossary.md#file-symbol) named as a symbol atom or vector
+- the name of a global variable as a symbol atom
+- a [file or folder](../basics/glossary.md#file-symbol) named as a symbol atom or vector
returns its value.
@@ -57,12 +55,9 @@ q)s:get`:SNewTrade/ / s has columns mapped on demand
-:fontawesome-solid-book:
[`eval`](eval.md),
[`value`](value.md)
-
-
## `set`
_Assign a value to a global variable
@@ -92,15 +87,15 @@ t table
y (any) any q object
```
-:fontawesome-solid-database:
[Compression parameters `alg`, `lbs`, and `lvl`](../kb/file-compression.md#compression-parameters)
-:fontawesome-solid-database:
-[Encryption parameters `alg` and `lbs`](../kb/dare.md#encryption)
+
+[Encryption parameters `alg` and `lbs`](../kb/dare.md#configuration)
[Compression/Encryption specification dictionary](#compressionencryption)
Examples:
+
```q
q)`a set 42 / set global variable
`a
@@ -138,24 +133,22 @@ q)(hcount`$":a0#")=hcount`$":a1#"
Since 4.1t 2023.09.29,4.0 2023.11.03 when writing anymap, empty vectors without attributes are deduplicated automatically (including enum vectors when the enum name is 'sym').
Since 4.1t 2021.06.04,4.0 2023.01.20 improved memory efficiency of writing nested data sourced from a type 77 (anymap) file, commonly encountered during compression of files. e.g.
+
```q
q)`:a set 500000 100#"abc";system"ts `:b set get`:a" / was 76584400 bytes, now 8390208.
```
-
### Splayed table
To splay a table `t` to directory `dir`
-- `dir` must be a filesymbol that ends with a `/`
-- `t` must have no primary keys
-- columns of `t` must be vectors or [compound lists](../basics/glossary.md#compound-list)
-- symbol columns in `t` must be fully enumerated
+- `dir` must be a filesymbol that ends with a `/`
+- `t` must have no primary keys
+- columns of `t` must be vectors or [compound lists](../basics/glossary.md#compound-list)
+- symbol columns in `t` must be fully enumerated
-:fontawesome-solid-database:
[Splayed tables](../kb/splayed-tables.md)
-
### Format
`set` saves the data in a binary format akin to tag+value, retaining the structure of the data in addition to its value.
@@ -173,6 +166,7 @@ q)read0 `:data/foo
These are `.h`, `.j`, `.Q`, `.q`, `.z`, and any other namespaces with single-character names.
[](){#compression}
+
### Compression/Encryption
For
@@ -182,7 +176,7 @@ For
(dir;lbs;alg;lvl) set t / splay t to dir, compressed and/or encrypted
```
-Arguments `lbs`, `alg`, and `lvl` are [compression parameters](../kb/file-compression.md#compression-parameters) and/or [encryption parameters](../kb/dare.md#encryption).
+Arguments `lbs`, `alg`, and `lvl` are [compression parameters](../kb/file-compression.md#compression-parameters) and/or [encryption parameters](../kb/dare.md#configuration).
Splay table `t` to directory `ztbl/` with gzip compression:
@@ -197,7 +191,7 @@ For
(dir;dic) set t / splay t to dir, compressed
```
-the keys of `dic` are either column names of `t` or the null symbol `` ` ``. The value of each entry is an integer vector: `lbs`, `alg`, and `lvl`.
+the keys of `dic` are either column names of `t` or the null symbol `` ` ``. The value of each entry is an integer vector: `lbs`, `alg`, and `lvl`.
Compression/encryption for unspecified columns is specified either by an entry for the null symbol (as below) or by [`.z.zd`](dotz.md#zzd-compressionencryption-defaults).
@@ -217,17 +211,11 @@ q)(`:ztbl/;dic) set t / splay table compressed
!!! warning "Compression may speed up or slow down the execution of `set`. The [performance impact](../kb/file-compression.md#performance) depends mainly on the data characteristics and the storage speed."
----
-:fontawesome-solid-database:
-[Database: tables in the filesystem](../database/index.md)
-
-:fontawesome-solid-book-open:
+
[File system](../basics/files.md)
-:fontawesome-solid-database:
+
[File compression](../kb/file-compression.md)
-:fontawesome-regular-map:
-[Compression in kdb+](../wp/compress/index.md)
-
-:fontawesome-solid-database:
+
[Data at rest encryption (DARE)](../kb/dare.md)
diff --git a/docs/ref/getenv.md b/docs/ref/getenv.md
index 008f5d36..dc101112 100644
--- a/docs/ref/getenv.md
+++ b/docs/ref/getenv.md
@@ -1,7 +1,7 @@
---
title: getenv, setenv – get and set environment variables | Reference | kdb+ and q documentation
description: getenv and setenv are q keywords that get or set an environment variable.
-author: Stephen Taylor
+author: KX Systems, Inc., a subsidiary of KX Software Limited
---
# `getenv`
@@ -54,8 +54,8 @@ q)\echo $RTMP
----
-:fontawesome-solid-book:
+
[`get`, `set`](get.md)
-:fontawesome-solid-book-open:
+
[Environment](../basics/by-topic.md#environment)
diff --git a/docs/ref/greater-than.md b/docs/ref/greater-than.md
index 9a0dab34..fb0e4710 100644
--- a/docs/ref/greater-than.md
+++ b/docs/ref/greater-than.md
@@ -1,13 +1,11 @@
---
title: Greater Than, At Least – Reference – kdb+ and q documentation
description: Greater Than and At Least are q operators that compare their arguments.
-author: Stephen Taylor
+author: KX Systems, Inc., a subsidiary of KX Software Limited
keywords: comparison, greater-than, greater-than-or-equal, kdb+, q
---
# `>` Greater Than
`>=` At Least
-
-
```syntax
x>y >[x;y]
x>=y >=[x;y]
@@ -35,8 +33,7 @@ q)0 1 >=/:\: 0 1
11b
```
-
-## :fontawesome-solid-sitemap: Implicit iteration
+## Implicit iteration
Greater Than and At Least are [atomic functions](../basics/atomic.md).
@@ -70,7 +67,6 @@ def| 0 0
ghi| 0 0
```
-
## Range and domain
```txt
@@ -98,10 +94,9 @@ t | b . b b b b b b b . b . . b b b b b
Range: `b`
-
----
-:fontawesome-solid-book:
+
[Less Than, Up To](less-than.md)
-:fontawesome-solid-book-open:
+
[Comparison](../basics/comparison.md)
diff --git a/docs/ref/greater.md b/docs/ref/greater.md
index 3295c2b6..e4353597 100644
--- a/docs/ref/greater.md
+++ b/docs/ref/greater.md
@@ -1,14 +1,12 @@
---
title: Greater, or | Reference | kdb+ and q documentation
description: Greater is a q operator that returns the greater of its arguments. or is a q keyword that performs a logical OR.
-author: Stephen Taylor
+author: KX Systems, Inc., a subsidiary of KX Software Limited
---
# `|` Greater, `or`
_Greater; logical OR_
-
-
```syntax
x|y |[x;y]
x or y or[x;y]
@@ -27,7 +25,6 @@ q)"sat"|"cow"
`|` is a [multithreaded primitive](../kb/mt-primitives.md).
-
## Flags
Where `x` and `y` are both [flags](../basics/glossary.md#flag), Greater is logical OR.
@@ -38,7 +35,6 @@ Where `x` and `y` are both [flags](../basics/glossary.md#flag), Greater is logic
There is no performance implication.
-
## Dictionaries and keyed tables
Where `x` and `y` are a pair of dictionaries or keyed tables the result is equivalent to upserting `y` into `x` where the values of `y` exceed those in `x`.
@@ -67,7 +63,6 @@ appl | 2015.03
goog | 2017.12
```
-
## Mixed types
Where `x` and `y` are of different types the greater of their underlying values is returned as the higher of the two types.
@@ -77,8 +72,7 @@ q)98|"a"
"b"
```
-
-## :fontawesome-solid-sitemap: Implicit iteration
+## Implicit iteration
Greater and `or` are [atomic functions](../basics/atomic.md).
@@ -117,7 +111,6 @@ def| 5 5
ghi| 5 5
```
-
## Domain and range
```txt
@@ -146,13 +139,13 @@ t | t . t t t t t t t . t . . t n t t t
Range: `bcdefhijmnptuvxz`
----
-:fontawesome-solid-book:
+
[`and`, `&`, Lesser](lesser.md), [`max`](max.md), [`min`](min.md)
-:fontawesome-solid-book-open:
+
[Comparison](../basics/comparison.md),
[Logic](../basics/by-topic.md#logic)
-:fontawesome-solid-street-view:
+
_Q for Mortals_
-[§4.5 Greater and Lesser](/q4m3/4_Operators/#45-greater-and-lesser-amp)
+[§4.5 Greater and Lesser](/q4m3/4_Operators/#45-greater-and-lesser)
diff --git a/docs/ref/group.md b/docs/ref/group.md
index ab9021db..248b7b4b 100644
--- a/docs/ref/group.md
+++ b/docs/ref/group.md
@@ -1,7 +1,7 @@
---
title: group | Reference | kdb+ and q documentation
description: group is a q keyword that returns a dictionary in which the keys are the distinct items of its argument, and the values the indexes where the distinct items occur.
-author: Stephen Taylor
+author: KX Systems, Inc., a subsidiary of KX Software Limited
---
# `group`
@@ -46,9 +46,9 @@ p| 8
----
-:fontawesome-solid-book:
+
[`ungroup`](ungroup.md),
[`xgroup`](xgroup.md)
-:fontawesome-solid-book:
+
[Sorting](../basics/by-topic.md#sort)
\ No newline at end of file
diff --git a/docs/ref/gtime.md b/docs/ref/gtime.md
index a999dc34..086bfc82 100644
--- a/docs/ref/gtime.md
+++ b/docs/ref/gtime.md
@@ -1,7 +1,7 @@
---
title: gtime, ltime – global and local time | Reference | kdb+ and q documentation
description: gtime and ltime are q keywords that return, respectively, global and local time.
-author: Stephen Taylor
+author: KX Systems, Inc., a subsidiary of KX Software Limited
---
# `gtime`, `ltime`
@@ -60,5 +60,5 @@ local [`.z.Z`](dotz.md#zz-local-datetime) [`.z.P`](dotz.md#zp-local-ti
----
-:fontawesome-solid-book-open:
+
[Environment](../basics/by-topic.md#environment)
\ No newline at end of file
diff --git a/docs/ref/hcount.md b/docs/ref/hcount.md
index 61ad256a..cf31a432 100644
--- a/docs/ref/hcount.md
+++ b/docs/ref/hcount.md
@@ -1,12 +1,10 @@
---
title: hcount returns file size | Reference | q and kdb+ documentation
description: Keyword hcount returns the size in bytes of a file
-author: Stephen Taylor
+author: KX Systems, Inc., a subsidiary of KX Software Limited
date: December 2019
---
-# :fontawesome-solid-database: `hcount`
-
-
+# `hcount`
_Size of a file in bytes_
@@ -14,7 +12,7 @@ _Size of a file in bytes_
hcount x hcount[x]
```
-Where `x` is a [file symbol](../basics/glossary.md#file-symbol),
+Where `x` is a [file symbol](../basics/glossary.md#file-symbol),
returns as a long the size of the file.
```q
@@ -25,11 +23,11 @@ q)hcount`:c:/q/test.txt
On a compressed/encrypted file returns the size of the original uncompressed/unencrypted file.
----
-:fontawesome-solid-book-open:
+
[File system](../basics/files.md)
-:fontawesome-solid-database:
+
[File compression](../kb/file-compression.md)
-:fontawesome-solid-database:
+
[Data at rest encryption (DARE)](../kb/dare.md)
diff --git a/docs/ref/hdel.md b/docs/ref/hdel.md
index 8f72162c..7bc2387b 100644
--- a/docs/ref/hdel.md
+++ b/docs/ref/hdel.md
@@ -1,11 +1,10 @@
---
title: hdel deletes a file or folder | reference | q and kdb+ documentation
description: Keyword hdel deletes a file or folder
-author: Stephen Taylor
+author: KX Systems, Inc., a subsidiary of KX Software Limited
date: December 2019
---
-# :fontawesome-solid-database: `hdel`
-
+# `hdel`
_Delete a file or folder_
@@ -44,5 +43,5 @@ q)nuke:visitNode[hdel]
!!! warning "Unlike Linux, Windows doesn’t allow one to overwrite files which are memory mapped, and it takes some mS after unmapping for that to become possible."
----
-:fontawesome-solid-book-open:
+
[File system](../basics/files.md)
diff --git a/docs/ref/hopen.md b/docs/ref/hopen.md
index d6a69b58..0fb8cad3 100644
--- a/docs/ref/hopen.md
+++ b/docs/ref/hopen.md
@@ -1,7 +1,7 @@
---
title: Connect and disconnect files and processes | Reference | kdb+ and q documentation
description: hopen and hclose are q keywords for connecting and disconnecting files and processes.
-author: Stephen Taylor
+author: KX Systems, Inc., a subsidiary of KX Software Limited
---
# `hopen`, `hclose`
@@ -102,7 +102,7 @@ SSL/TLS
: tcp with SSL/TLS encryption
: `` `:unixs://port ``
: unix domain socket with SSL/TLS encryption
-: :fontawesome-solid-graduation-cap: [SSL/TLS](../kb/ssl.md)
+: [SSL/TLS](../kb/ssl.md)
Fifo/named pipe
@@ -189,19 +189,19 @@ q)neg[h][];hclose h;
----
-:fontawesome-solid-book:
+
[`.Q.Xf`](dotq.md#xf-create-file) (create file)
-:fontawesome-solid-book-open:
+
[Communication handle](../basics/glossary.md#communication-handle),
[Connection handle](../basics/glossary.md#connection-handle),
[File system](../basics/files.md),
[Interprocess communication](../basics/ipc.md)
-:fontawesome-solid-graduation-cap:
+
[Named pipes](../kb/named-pipes.md),
[SSL/TLS](../kb/ssl.md)
-:fontawesome-solid-street-view:
+
_Q for Mortals_
-[§11.6.2 Opening a Connection Handle](/q4m3/11_IO/#1162-opening-a-connection-handle)
+[§11.8.2 Opening a Connection Handle](/q4m3/11_IO/#1162-opening-a-connection-handle)
diff --git a/docs/ref/hsym.md b/docs/ref/hsym.md
index 7b01fa76..7edec4c8 100644
--- a/docs/ref/hsym.md
+++ b/docs/ref/hsym.md
@@ -1,7 +1,7 @@
---
title: hsym converts symbol to file symbol | Reference | q and kdb+ documentation
description: Keyword hsym converts symbol/s to file- or process-symbol/s
-author: Stephen Taylor
+author: KX Systems, Inc., a subsidiary of KX Software Limited
date: December 2019
---
# `hsym`
@@ -30,9 +30,9 @@ q)hsym `abc`:def`::ghi
```
----
-:fontawesome-solid-book:
+
[`hopen`](hopen.md)
-:fontawesome-solid-book-open:
+
[File system](../basics/files.md),
[Interprocess communication](../basics/ipc.md)
\ No newline at end of file
diff --git a/docs/ref/identity.md b/docs/ref/identity.md
index e655fb04..c3b3aab8 100644
--- a/docs/ref/identity.md
+++ b/docs/ref/identity.md
@@ -1,7 +1,7 @@
---
title: Identity, Null | Reference | kdb+ and q documentation
description: Identity is a q operator that returns its argument unchanged. Null is a generic null value.
-author: Stephen Taylor
+author: KX Systems, Inc., a subsidiary of KX Software Limited
---
# Identity, Null
@@ -109,5 +109,5 @@ q)x,:`a / ok
----
-:fontawesome-solid-book:
+
[`null`](null.md)
\ No newline at end of file
diff --git a/docs/ref/if.md b/docs/ref/if.md
index fca5244d..2c92df6e 100644
--- a/docs/ref/if.md
+++ b/docs/ref/if.md
@@ -1,7 +1,7 @@
---
title: if control word | Reference | kdb+ and q documentation
description: if is a q control construct for conditional evaluation of one or more expressions.
-author: Stephen Taylor
+author: KX Systems, Inc., a subsidiary of KX Software Limited
keywords: condition, control, evaluate, kdb+, q
---
# `if`
@@ -57,15 +57,15 @@ Name scope within the brackets is the same as outside them.
!!! warning "Setting local variables using `if` can have [unintended consequences](../basics/function-notation.md#name-scope)."
----
-:fontawesome-solid-book:
+
[Cond](cond.md),
[`do`](do.md),
[`while`](while.md),
[Vector Conditional](vector-conditional.md)
-:fontawesome-solid-book-open:
+
[Controlling evaluation](../basics/control.md)
-:fontawesome-solid-street-view:
+
_Q for Mortals_
-[§10.1.4 `if`](/q4m3/10_Execution_Control/#1014-if)
+[§10.1.5 `if`](/q4m3/10_Execution_Control/#1014-if)
diff --git a/docs/ref/ij.md b/docs/ref/ij.md
index 5e01d7d0..9c92a225 100644
--- a/docs/ref/ij.md
+++ b/docs/ref/ij.md
@@ -1,7 +1,7 @@
---
title: ij, ijf – inner join | Reference | kdb+ and q documentation
description: ij and ijf are q keywords that perform inner joins.
-author: Stephen Taylor
+author: KX Systems, Inc., a subsidiary of KX Software Limited
keywords: ij, ijf, inner join, join, kdb+, q
---
# `ij`, `ijf`
@@ -91,10 +91,10 @@ k v s
Since 2016.02.17, the earlier version is available in all V3.4 and later versions as `ijf`.
---
-:fontawesome-solid-book-open:
+
[Joins](../basics/joins.md)
-:fontawesome-solid-street-view:
+
_Q for Mortals_
[§9.9.4 Ad Hoc Inner Join](/q4m3/9_Queries_q-sql/#994-ad-hoc-inner-join-ij)
diff --git a/docs/ref/in.md b/docs/ref/in.md
index 36a332be..bc9f7d1b 100644
--- a/docs/ref/in.md
+++ b/docs/ref/in.md
@@ -1,7 +1,7 @@
---
title: in | Reference | kdb+ and q documentation
description: in is a q keyword that flags whether its left argument is an item in its right argument.
-author: Stephen Taylor
+author: KX Systems, Inc., a subsidiary of KX Software Limited
date: November 2020
---
# `in`
@@ -80,7 +80,7 @@ p5| cam blue 12 paris
```
-## :fontawesome-solid-triangle-exclamation:{: style="color:red"} Mixed argument types
+## {: style="color:red"} Mixed argument types
Optimized support for atom or 1-list `y` allows a wider input type mix.
@@ -126,12 +126,12 @@ q)any ` ~/: (1 2;`)
----
-:fontawesome-solid-book:
+
[`except`](except.md),
[`inter`](inter.md),
[`within`](within.md),
[`union`](union.md)
-:fontawesome-solid-book-open:
+
[Search](../basics/by-topic.md#search)
diff --git a/docs/ref/index.md b/docs/ref/index.md
index 519eff3d..4254f01c 100644
--- a/docs/ref/index.md
+++ b/docs/ref/index.md
@@ -1,29 +1,30 @@
---
title: Reference card | kdb+ and q documentation
description: Quick reference for kdb+ and the q programming language
-author: Stephen Taylor
+author: KX Systems, Inc., a subsidiary of KX Software Limited
---
# Reference card
-
-
+!!! note
+ Want a quick and handy q reference resource? Download the q Cheat Sheet (PDF download){:target="_blank"}.
## Keywords
+
@@ -31,17 +32,17 @@ author: Stephen Taylor
### By category
+
--8<-- "docs/ref/kwdcat.txt"
-:fontawesome-solid-book:
[`.Q.id`](dotq.md#id-sanitize) (sanitize),
[`.Q.res`](dotq.md#res-keywords) (reserved words)
-
## Operators
+
@@ -80,10 +81,8 @@ author: Stephen Taylor
| `.: @: $: !: ?: +: -: *: %: =: ~: <: >: |: &: #: _: ^: ,:` | [Assign through operator](assign.md#assign-through-operator) |
-:fontawesome-solid-book:
[Overloaded glyphs](overloads.md)
-
## [Iterators](iterators.md)
@@ -96,30 +95,25 @@ author: Stephen Taylor
## [Execution control](../basics/control.md)
-[.[f;x;e] Trap](../ref/apply.md#trap) [: Return](../basics/function-notation.md#explicit-return) [do](../ref/do.md) [exit](../ref/exit.md) [\$[x;y;z] Cond](../ref/cond.md)
-[@[f;x;e] Trap-At](../ref/apply.md#trap) [' Signal](../ref/signal.md) [if](../ref/if.md) [while](../ref/while.md) [:[v;p1;r1;...] Pattern conditional](../basics/pattern.md#pattern-conditional)
+[.[f;x;e] Trap](apply.md#trap) [: Return](../basics/function-notation.md#explicit-return) [do](do.md) [exit](exit.md) [\$[x;y;z] Cond](cond.md)
+[@[f;x;e] Trap-At](apply.md#trap) [' Signal](signal.md) [if](if.md) [while](while.md) [:[v;p1;r1;...] Pattern conditional](../basics/pattern.md#pattern-conditional)
-:fontawesome-solid-book-open:
[Debugging](../basics/debug.md)
-
-
## Other
-[` pop stack](../basics/debug.md#debugging) [::](overloads.md#colon-colon) [identity](identity.md) [\x system cmd x](../basics/syscmds.md)
-[.](overloads.md#dot) [push stack](../basics/debug.md#debugging) [generic null](identity.md) [\\ abort](../basics/debug.md#abort)
+[` pop stack](../basics/debug.md) [::](overloads.md#colon-colon) [identity](identity.md) [\x system cmd x](../basics/syscmds.md)
+[.](overloads.md#dot) [push stack](../basics/debug.md) [generic null](identity.md) [\\ abort](../basics/debug.md)
[global amend](../basics/function-notation.md#name-scope) \\\\ quit q
- [set view](../learn/views.md) / comment
+ [set view](https://code.kx.com/q/learn/views/) / comment
() [precedence](../basics/syntax.md#precedence-and-order-of-evaluation) \[;\] [expn block](../basics/syntax.md#conditional-evaluation-and-control-statements) {} [lambda](../basics/function-notation.md) \` symbol
(;) [list](../basics/syntax.md#list-notation) [argt list](../basics/syntax.md#bracket-notation) ; separator \`: filepath
(\[\]..) [table](../basics/syntax.md#table-notation)
-
-
## [Attributes](../basics/syntax.md#attributes)
@@ -128,10 +122,8 @@ author: Stephen Taylor
**g** grouped **p** parted **s** sorted **u** unique
-:fontawesome-solid-book:
[Set Attribute](set-attribute.md)
-
## Command-line options and system commands
@@ -156,15 +148,13 @@ author: Stephen Taylor
| [`-r`](../basics/cmdline.md#-r-replicate) [`\r`](../basics/syscmds.md#r-replication-primary) | replicate | [`\\`](../basics/syscmds.md#quit) | quit |
-:fontawesome-solid-book:
-[`system`](../ref/system.md)
+[`system`](system.md)
-:fontawesome-solid-book-open:
+
[Command-line options](../basics/cmdline.md),
[System commands](../basics/syscmds.md),
[OS commands](../basics/syscmds.md#os-commands)
-
-
## `rsave`
@@ -120,17 +116,17 @@ rsave x rsave[x]
Where `x` is a table name as a symbol atom, saves the table, in binary format, splayed to a directory of the same name.
The table must be fully enumerated and not keyed.
-If the file
-
-- exists, it is overwritten
-- does not exist, it is created, with any required parent directories
+If the file
+- exists, it is overwritten
+- does not exist, it is created, with any required parent directories
### Limits
!!! tip "The usual and more general way of doing this is to use [`set`](get.md#set), which allows the target directory to be specified."
The following example uses the table `sp` created using the script [`sp.q`](https://raw.githubusercontent.com/KxSystems/kdb/master/sp.q)
+
```q
q)\l sp.q
q)rsave `sp / save splayed table
@@ -144,23 +140,20 @@ q)`:sp/ set sp / equivalent to rsave `sp
`:sp/
```
-
----
-:fontawesome-solid-book:
-[`set`](get.md#set),
+
+[`set`](get.md#set),
[`.h.tx`](doth.md#htx-filetypes),
-[`.Q.dpft`](dotq.md#chk-fill-hdb) (save table),
+[`.Q.dpft`](dotq.md#chk-fill-hdb) (save table),
[`.Q.Xf`](dotq.md#xf-create-file) (create file)
-:fontawesome-solid-book-open:
+
[File system](../basics/files.md)
-:fontawesome-solid-street-view:
-_Q for Mortals_
+
+_Q for Mortals_q4m
[§11.2 Save and Load on Tables](/q4m3/11_IO/#112-save-and-load-on-tables)
-:fontawesome-solid-street-view:
-_Q for Mortals_
-[§11.3 Splayed Tables](/q4m3/11_IO/#113-splayed-tables)
-
+_Q for Mortals_q4m
+[§11.3 Splayed Tables](/q4m3/11_IO/#113-splayed-tables)
diff --git a/docs/ref/select.md b/docs/ref/select.md
index ea6bfa5a..e705867d 100644
--- a/docs/ref/select.md
+++ b/docs/ref/select.md
@@ -1,7 +1,7 @@
---
title: select keyword, Select operator | Reference | kdb+ and q documentation
description: select and Select are (respectively) a q keyword and operator that select all or part of a table, possibly with new columns.
-author: Stephen Taylor
+author: KX Systems, Inc., a subsidiary of KX Software Limited
keywords: column, kdb+, q, qsql, query, select, sql, table
---
# `select`
@@ -15,7 +15,7 @@ _Select all or part of a table, possibly with new columns_
!!! info "`select` is a qSQL query template and varies from regular q syntax."
For the Select operator `?`, see
-:fontawesome-solid-book-open:
+
[Functional SQL](../basics/funsql.md)
@@ -36,7 +36,7 @@ _t~exp~_ Table expression
_p~w~_ Where phrase
-:fontawesome-solid-book-open:
+
[qSQL syntax](../basics/qsql.md)
@@ -152,7 +152,7 @@ Unlike in SQL, columns in the By phrase
- are included in the result and need not be specified in the Select phrase
- can include computed columns
-:fontawesome-solid-globe:
+
[The SQL `GROUP BY` statement](https://www.w3schools.com/sql/sql_groupby.asp)
The [`ungroup`](ungroup.md) keyword reverses the grouping, though the original order is lost.
@@ -214,15 +214,15 @@ see [qSQL](../basics/qsql.md#cond).
----
-:fontawesome-solid-book:
+
[`delete`](delete.md),
[`exec`](exec.md),
[`update`](update.md)
-:fontawesome-solid-book-open:
+
[qSQL](../basics/qsql.md),
[Functional SQL](../basics/funsql.md)
-:fontawesome-solid-street-view:
+
_Q for Mortals_
[§9.3 The `select` Template](/q4m3/9_Queries_q-sql/#93-the-select-template)
diff --git a/docs/ref/set-attribute.md b/docs/ref/set-attribute.md
index c985dcec..f9468f28 100644
--- a/docs/ref/set-attribute.md
+++ b/docs/ref/set-attribute.md
@@ -1,7 +1,7 @@
---
title: Set Attribute | Reference | kdb+ and q documentation
description: Set Attribute is a q operator that assigns an attribute to a list, dictionary or table.
-author: Stephen Taylor
+author: KX Systems, Inc., a subsidiary of KX Software Limited
keywords: attribute, grouped, kdb+, parted, q, sorted, unique,
---
# `#` Set Attribute
@@ -134,13 +134,12 @@ Setting attributes consumes resources and is likely to improve performance only
!!! warning "Applying an attribute to compressed data on disk decompresses it."
----
-:fontawesome-solid-book:
+
[`attr`](attr.md)
-:fontawesome-solid-book-open:
+
[Metadata](../basics/metadata.md)
-:fontawesome-solid-street-view:
-_Q for Mortals_
-[§8.8 Attributes](/q4m3/8_Tables/#88-attributes)
+_Q for Mortals_
+[§8.9 Attributes](/q4m3/8_Tables/#88-attributes)
diff --git a/docs/ref/show.md b/docs/ref/show.md
index 69b4fa16..54d843ad 100644
--- a/docs/ref/show.md
+++ b/docs/ref/show.md
@@ -1,7 +1,7 @@
---
title: show – Reference – kdb+ and q documentation
description: show is a q keyword that formats its argument and displays it at the console.
-author: Stephen Taylor
+author: KX Systems, Inc., a subsidiary of KX Software Limited
keywords: console, debug, develop, display, kdb+, q, tool
---
# `show`
@@ -36,8 +36,8 @@ q)a~(::)
```
-:fontawesome-solid-book:
+
[Display](display.md)
-:fontawesome-solid-book-open:
+
[Debugging](../basics/debug.md)
\ No newline at end of file
diff --git a/docs/ref/signal.md b/docs/ref/signal.md
index 0098261e..123d9a8f 100644
--- a/docs/ref/signal.md
+++ b/docs/ref/signal.md
@@ -1,7 +1,7 @@
---
title: Signal | Reference | kdb+ and q documentation
description: Signal is a q operator that signals an error.
-author: Stephen Taylor
+author: KX Systems, Inc., a subsidiary of KX Software Limited
---
# `'` Signal
@@ -24,7 +24,7 @@ q)0N!0;'`err;0N!1
!!! info "Signal is part of q syntax. It is not an operator and cannot be iterated or projected."
-:fontawesome-solid-book:
+
[`'` Quote overloads](overloads.md#quote)
The only way to detect a signal is to use [Trap](apply.md#trap).
@@ -108,7 +108,7 @@ q)f[]
^
q)g:{f[]}
q)g[]
-'bad
+'badq4m
[2] f:{'`bad}
^
[1] g:{f[]}
@@ -154,14 +154,14 @@ q))a
```
----
-:fontawesome-solid-book:
+
[Trap, Trap At](apply.md#trap)
-:fontawesome-solid-book-open:
+
[Controlling evaluation](../basics/control.md),
[Debugging](../basics/debug.md),
[Error handling](../basics/errors.md)
-:fontawesome-solid-street-view:
+
_Q for Mortals_
-[§10.1.7 Return and Signal](/q4m3/10_Execution_Control/#1017-return-and-signal)
+[§10.1.8 Return and Signal](/q4m3/10_Execution_Control/#1017-return-and-signal)
diff --git a/docs/ref/signum.md b/docs/ref/signum.md
index 59b5319f..5ce0bd46 100644
--- a/docs/ref/signum.md
+++ b/docs/ref/signum.md
@@ -1,22 +1,19 @@
---
title: signum – the sign of a number | Reference | kdb+ and q documentation
description: signum is a q keyword that returns 1, 0,or -1 according to the sign of its argument.
-author: Stephen Taylor
+author: KX Systems, Inc., a subsidiary of KX Software Limited
---
# `signum`
-
-
-
```syntax
signum x signum[x]
```
Where `x` (or its underlying value for temporals) is
-- null or negative, returns `-1i`
-- zero, returns `0i`
-- positive, returns `1i`
+- null or negative, returns `-1i`
+- zero, returns `0i`
+- positive, returns `1i`
```q
q)signum -2 0 1 3
@@ -37,8 +34,7 @@ select count i by signum deltas price from trade
`signum` is a [multithreaded primitive](../kb/mt-primitives.md).
-
-## :fontawesome-solid-sitemap: Implicit iteration
+## Implicit iteration
`signum` is an [atomic function](../basics/atomic.md).
@@ -68,7 +64,6 @@ def| -1 1
ghi| 1 -1
```
-
## Domain and range
```txt
@@ -79,8 +74,8 @@ range i . i i i i i i i . i i i i i i i i
Range: `i`
----
-:fontawesome-solid-book:
-[`abs`](abs.md)
+
+[`abs`](abs.md)
-:fontawesome-solid-book-open:
+
[Mathematics](../basics/math.md)
diff --git a/docs/ref/simple-exec.md b/docs/ref/simple-exec.md
index 06404049..b82b247a 100644
--- a/docs/ref/simple-exec.md
+++ b/docs/ref/simple-exec.md
@@ -1,7 +1,7 @@
---
title: Simple Exec – Reference – kdb+ and q documentation
description: Simple Exec is a q operator that is part of functional SQL.
-author: Stephen Taylor
+author: KX Systems, Inc., a subsidiary of KX Software Limited
keywords: functional sql, kdb+, q,sql
---
# `?` Simple Exec
diff --git a/docs/ref/sin.md b/docs/ref/sin.md
index 170f1e0b..8a61758c 100644
--- a/docs/ref/sin.md
+++ b/docs/ref/sin.md
@@ -1,22 +1,18 @@
---
title: sin, asin – sine and arcsine | Reference | kdb+ and q documentation
description: sin and asin are q keywords that return (respectively) the sin and arcsine of their argument.
-author: Stephen Taylor
+author: KX Systems, Inc., a subsidiary of KX Software Limited
---
# `sin`, `asin`
_Sine, arcsine_
-
-
-
-
```syntax
sin x sin[x]
asin x asin[x]
```
-Where `x` is a numeric, returns
+Where `x` is a numeric, returns
`sin`
: the [sine](https://en.wikipedia.org/wiki/Sine) of `x`, taken to be in radians. The result is between `-1` and `1`, or null if the argument is null or infinity.
@@ -37,8 +33,7 @@ q)asin 0.8 / arcsine
`sin` and `asin` are [multithreaded primitives](../kb/mt-primitives.md).
-
-## :fontawesome-solid-sitemap: Implicit iteration
+## Implicit iteration
`sin` and `asin` are [atomic functions](../basics/atomic.md).
@@ -65,9 +60,8 @@ range: f . f f f f f f f . f f f z f f f f
```
----
-:fontawesome-solid-book:
+
[`cos`, `acos`](cos.md)
-:fontawesome-solid-book-open:
-[Mathematics](../basics/math.md)
+[Mathematics](../basics/math.md)
diff --git a/docs/ref/sqrt.md b/docs/ref/sqrt.md
index be813a43..6effe205 100644
--- a/docs/ref/sqrt.md
+++ b/docs/ref/sqrt.md
@@ -1,13 +1,10 @@
---
title: sqrt – square root | Reference | kdb+ and q documentation
description: sqrt is a q keyword that returns the square root of its argument.
-author: Stephen Taylor
+author: KX Systems, Inc., a subsidiary of KX Software Limited
---
# `sqrt`
-
-
-
_Square root_
```syntax
@@ -16,10 +13,10 @@ sqrt x sqrt[x]
Returns as a float where `x` is numeric and
-- non-negative, the square root of `x`
-- negative or null, null
-- real or float infinity, `0w`
-- any other infinity, the square root of the largest value for the datatype
+- non-negative, the square root of `x`
+- negative or null, null
+- real or float infinity, `0w`
+- any other infinity, the square root of the largest value for the datatype
```q
q)sqrt -1 0n 0 25 50
@@ -37,8 +34,7 @@ q)sqrt 101b
`sqrt` is a [multithreaded primitive](../kb/mt-primitives.md).
-
-## :fontawesome-solid-sitemap: Implicit iteration
+## Implicit iteration
`sqrt` is an [atomic function](../basics/atomic.md).
@@ -78,11 +74,11 @@ range f . f f f f f f f . f f f z f f f f
Range: `fz`
----
-:fontawesome-solid-book:
-[`exp`](exp.md),
-[`log`](log.md),
-[`xexp`](exp.md#xexp),
-[`xlog`](log.md#xlog)
+
+[`exp`](exp.md),
+[`log`](log.md),
+[`xexp`](exp.md#xexp),
+[`xlog`](log.md#xlog)
-:fontawesome-solid-book-open:
+
[Mathematics](../basics/math.md)
diff --git a/docs/ref/ss.md b/docs/ref/ss.md
index af4a6ad8..edec7ead 100644
--- a/docs/ref/ss.md
+++ b/docs/ref/ss.md
@@ -1,7 +1,7 @@
---
title: ss, ssr – string search and replacement | Reference | kdb+ and q documentation
description: ss and ssr are q keywords that perform string search and replacement.
-author: Stephen Taylor
+author: KX Systems, Inc., a subsidiary of KX Software Limited
---
# `ss`, `ssr`
@@ -68,16 +68,16 @@ q)ssr[s;"t?r";upper] / replace matches by their uppercase
----
-:fontawesome-solid-book:
+
[`like`](like.md)
-:fontawesome-solid-book-open:
+
[Regular Expressions in q](../basics/regex.md)
-:fontawesome-solid-book-open:
+
[Strings](../basics/by-topic.md#strings)
-:fontawesome-solid-graduation-cap:
+
[Using regular expressions](../basics/regex.md)
diff --git a/docs/ref/string.md b/docs/ref/string.md
index 948dc2f7..2ce03a09 100644
--- a/docs/ref/string.md
+++ b/docs/ref/string.md
@@ -1,15 +1,12 @@
---
title: string casts its argument to a string | Reference | kdb+ and q documentation
description: string is a q keyword that casts its argument to a string.
-author: Stephen Taylor
+author: KX Systems, Inc., a subsidiary of KX Software Limited
---
# `string`
_Cast to string_
-
-
-
```syntax
string x string[x]
```
@@ -27,8 +24,7 @@ q)string (+/)
"+/"
```
-
-## :fontawesome-solid-sitemap: Implicit iteration
+## Implicit iteration
`string` is an [atomic function](../basics/atomic.md) and iterates through dictionaries and tables.
@@ -55,7 +51,6 @@ a b
,"3" "aapl"
```
-
## Domain and range
```txt
@@ -66,17 +61,14 @@ range c c c c c c c c c c c c c c c c c c
Range: `c`
----
-:fontawesome-solid-book:
+
[`.h` namespace](doth.md)
-:fontawesome-solid-book:
+
[`.Q.addr`](dotq.md#addr-iphost-as-int) (IP/host as int),
[`.Q.f`](dotq.md#f-precision-format) (precision format),
[`.Q.fmt`](dotq.md#fmt-precision-format) (precision format with length)
-:fontawesome-solid-street-view:
+
_Q for Mortals_
[§7.3.1 Data to Strings](/q4m3/7_Transforming_Data/#731-data-to-strings)
-
-
-
diff --git a/docs/ref/sublist.md b/docs/ref/sublist.md
index a25e9c4a..40d7c5d4 100644
--- a/docs/ref/sublist.md
+++ b/docs/ref/sublist.md
@@ -1,7 +1,7 @@
---
title: Sublist of a list | Reference | kdb+ and q documentation
description: sublist is a q keyword that returns a sublist of a list.
-author: Stephen Taylor
+author: KX Systems, Inc., a subsidiary of KX Software Limited
---
# `sublist`
@@ -72,9 +72,9 @@ q)1 2 sublist p / 2 items starting from position 1
----
-:fontawesome-solid-book:
+
[Take](take.md)
-:fontawesome-solid-book-open:
+
[Selection](../basics/by-topic.md#selection)
diff --git a/docs/ref/subtract.md b/docs/ref/subtract.md
index 7bb9e297..becc7b3f 100644
--- a/docs/ref/subtract.md
+++ b/docs/ref/subtract.md
@@ -1,7 +1,7 @@
---
title: Subtract | Reference | kdb+ and q documentation
description: Subtract is a q operator that returns the difference of its arguments for a wide range of datatypes.
-author: Stephen Taylor
+author: KX Systems, Inc., a subsidiary of KX Software Limited
---
# `-` Subtract
@@ -108,20 +108,20 @@ q)type 55-1i
```
----
-:fontawesome-solid-book:
+
[Add](add.md),
-[`deltas`](deltas.md),
+[`deltas`](deltas.md),q4m
[`differ`](differ.md),
[`.Q.addmonths`](dotq.md#addmonths)
-:fontawesome-solid-book-open:
+
[Datatypes](../basics/datatypes.md),
[Mathematics](../basics/math.md)
-:fontawesome-solid-graduation-cap:
+
[How to handle temporal data in q](../kb/temporal-data.md)
-:fontawesome-solid-street-view:
+
_Q for Mortals_
[§4.9.2 Temporal Arithmetic](/q4m3/4_Operators/#492-temporal-arithmetic)
diff --git a/docs/ref/sum.md b/docs/ref/sum.md
index 541b7946..ca20a8bc 100644
--- a/docs/ref/sum.md
+++ b/docs/ref/sum.md
@@ -1,15 +1,12 @@
---
title: sum, sums, msum, wsum – sum, cumulative sums, moving sums, and weighted sum of a list | Reference | kdb+ and q documentation
description: sum, sums, msum, and wsum are q keywords athat return (respectively) the sum, cumulative sums, moving sums, and weighted sum of their argument.
-author: Stephen Taylor
+author: KX Systems, Inc., a subsidiary of KX Software Limited
---
# `sum`, `sums`, `msum`, `wsum`
_Totals – simple, running, moving, and weighted_
-
-
-
## `sum`
_Total_
@@ -20,10 +17,10 @@ sum x sum[x]
Where `x` is
-- a simple numeric list, returns the sums of its items
-- an atom, returns `x`
-- a list of numeric lists, returns their sums
-- a dictionary with numeric values
+- a simple numeric list, returns the sums of its items
+- an atom, returns `x`
+- a list of numeric lists, returns their sums
+- a dictionary with numeric values
Nulls are treated as zeros.
@@ -63,8 +60,8 @@ q)sum each flip(0n 8;8 0n) /do this to fall back to vector case
Different results may be obtained by changing the order of the summation.
❯ q -s 4
- KDB+ 4.0 2021.01.20 Copyright (C) 1993-2021 Kx Systems
- m64/ 12()core 65536MB sjt mackenzie.local 127.0.0.1 ..
+ kdb+ 5.0.20251113 2025.11.13 Copyright (C) 1993-2025 Kx Systems
+ ...
q)\s 0
q)a:100000000?1.
@@ -118,7 +115,6 @@ q)sums "abc" / type error if list is not numeric
`sums` is a uniform function, equivalent to `+\`.
-
## `msum`
_Moving sums_
@@ -129,8 +125,8 @@ x msum y msum[x;y]
Where
-- `x` is a positive int atom
-- `y` is a numeric list
+- `x` is a positive int atom
+- `y` is a numeric list
returns the `x`-item moving sums of `y`, with nulls replaced by zero. The first `x` items of the result are the sums of the terms so far, and thereafter the result is the moving sum.
@@ -143,7 +139,6 @@ q)3 msum 0N 2 3 5 0N 11 / nulls treated as zero
`msum` is a uniform function.
-
## `wsum`
_Weighted sum_
@@ -152,7 +147,7 @@ _Weighted sum_
x wsum y wsum[x;y]
```
-Where `x` and `y` are numeric lists, returns the weighted sum of the products of `x` and `y`. When both `x` and `y` are integer lists, they are first converted to floats.
+Where `x` and `y` are numeric lists, returns the weighted sum of the products of `x` and `y`. When both `x` and `y` are integer lists, they are first converted to floats.
```q
q)2 3 4 wsum 1 2 4 / equivalent to sum 2 3 4 * 1 2 4f
@@ -167,14 +162,12 @@ q)(1 2;3 4) wsum (500 400;300 200)
`wsum` is an aggregate function, equivalent to `{sum x*y}`.
-:fontawesome-solid-graduation-cap:
[Sliding windows](../kb/programming-idioms.md#how-do-i-apply-a-function-to-a-sequence-sliding-window)
-:fontawesome-brands-wikipedia-w:
-[Weighted sum](https://en.wikipedia.org/wiki/Weight_function "Wikipedia")
+[Weighted sum](https://en.wikipedia.org/wiki/Weight_function "Wikipedia")
-## :fontawesome-solid-sitemap: Implicit iteration
+## Implicit iteration
`sum`, `sums`, and `msum` apply to [dictionaries and tables](../basics/math.md#dictionaries-and-tables).
`wsum` applies to dictionaries.
@@ -206,7 +199,6 @@ q)1 2 wsum d
18 31 15
```
-
## Aggregating nulls
`avg`, `min`, `max` and `sum` are special: they ignore nulls, in order to be similar to SQL92.
@@ -217,16 +209,17 @@ q)sum (1 2;0N 4)
0N 6
```
-
## Domains and ranges
`sum` and `sums`
+
```txt
domain: b g x h i j e f c s p m d z n u v t
range: i . i i i j e f i . p m d z n u v t
```
`msum`
+
```txt
b g x h i j e f c s p m d z n u v t
----------------------------------------
@@ -253,6 +246,7 @@ t | . . . . . . . . . . . . . . . . . .
Range: `efijntuv`
`wsum`
+
```txt
b g x h i j e f c s p m d z n u v t
----------------------------------------
@@ -278,9 +272,6 @@ t | t . t t t t t f t . . . . . . . . .
Range: `defijmnptuvz`
-
-
-
----
-:fontawesome-solid-book-open:
+
[Mathematics](../basics/math.md)
diff --git a/docs/ref/sv.md b/docs/ref/sv.md
index 2ce3df3a..d66374e6 100644
--- a/docs/ref/sv.md
+++ b/docs/ref/sv.md
@@ -1,7 +1,7 @@
---
title: sv – scalar from vector | Reference | kdb+ and q documentation
description: sv is a q keyword that performs a variety of functions under the general scheme of scalar (atom) from vector – join strings or filepath elements; decode a vector to an atom.
-author: Stephen Taylor
+author: KX Systems, Inc., a subsidiary of KX Software Limited
---
# `sv`
@@ -98,7 +98,7 @@ q)` sv `mywork`dat
```
-:fontawesome-solid-book:
+
[`vs`](vs.md#partition) partition
@@ -188,14 +188,14 @@ q)0b sv 100011000110101110001011011001000110100000010101011000001000010000001010
8c6b8b64-6815-6084-0a3e-178401251b68
```
-:fontawesome-solid-book:
+
[`vs`](vs.md#encode) encode
-:fontawesome-solid-book:
+
[`.Q.j10`](dotq.md#j10-encode-binhex) (encode binhex),
[`.Q.x10`](dotq.md#x10-decode-binhex) (decode binhex)
-:fontawesome-solid-book:
+
[`.Q.j12`](dotq.md#j12-encode-base-36) (encode base36),
[`.Q.x12`](dotq.md#x12-decode-base-36) (decode base36)
diff --git a/docs/ref/system.md b/docs/ref/system.md
index 49b00dcb..d06a3db6 100644
--- a/docs/ref/system.md
+++ b/docs/ref/system.md
@@ -2,10 +2,10 @@
title: system keyword executes a system command | Reference | kdb+ and q documentation
description: system is a q keyword that executes a system command.
keywords: command, system, shell, os, kdb+, q
-author: Stephen Taylor
+author: KX Systems, Inc., a subsidiary of KX Software Limited
---
-# :fontawesome-solid-bullhorn: `system`
+# `system`
_Execute a system command_
@@ -13,7 +13,7 @@ _Execute a system command_
system x system[x]
```
-Where `x` is a string representing a [kdb+ system command](../basics/syscmds.md) or operating system shell command, and any parameters to it. Executes the command and returns the result as a list of character vectors.
+Where `x` is a string representing a [kdb+ system command](../basics/syscmds.md) or operating system shell command, and any parameters to it. Executes the command and returns the result as a list of character vectors.
## kdb+ system commands
@@ -34,7 +34,7 @@ q)count system "a" / this returns a result
3
```
-### :fontawesome-brands-windows: Changing working directory
+### Changing working directory
In the event of an unexpected change to the working directory, Windows users please note
@@ -49,16 +49,15 @@ q)system "pwd"
!!! warning "Binary output"
- The result is expected to be text, and is captured into a list of character vectors.
- As part of this capture, line feeds and associated carriage returns are removed.
-
- This transformation makes it impractical to capture binary data from the result of the system call.
- Redirecting the output to a
- [file](https://code.kx.com/q/ref/read1/) or
- [fifo](https://code.kx.com/q/kb/named-pipes/) for explicit ingestion may be appropriate in such cases.
+ The result is expected to be text, and is captured into a list of character vectors.
+ As part of this capture, line feeds and associated carriage returns are removed.
+
+ This transformation makes it impractical to capture binary data from the result of the system call.
+ Redirecting the output to a
+ [file](read1.md) or
+ [fifo](../kb/named-pipes.md) for explicit ingestion may be appropriate in such cases.
-
-### :fontawesome-solid-database: Directing output to a file
+### Directing output to a file
When redirecting output to a file, for efficiency purposes, avoiding using `>tmpout` needlessly; append a semi-colon to the command.
@@ -97,7 +96,7 @@ the shell interpreter considers it as two statements
cat x > y; > tmpout
```
-### :fontawesome-solid-triangle-exclamation: Capture stderr output
+### Capture stderr output
You cannot capture the stderr output from the system call directly, but a workaround is
@@ -110,6 +109,3 @@ q)@[system;"ls egg";{0N!"error - ",x;}]
ls: egg: No such file or directory
"error - os"
```
-
-
-
diff --git a/docs/ref/tables.md b/docs/ref/tables.md
index 9ee12123..0c3f1547 100644
--- a/docs/ref/tables.md
+++ b/docs/ref/tables.md
@@ -1,7 +1,7 @@
---
title: tables – Reference – kdb+ and q documentation
description: tables is a q keyword that returns a list of tables in a namespace.
-author: Stephen Taylor
+author: KX Systems, Inc., a subsidiary of KX Software Limited
keywords: kdb+, metadata, q, table
---
# `tables`
@@ -29,5 +29,5 @@ q)tables `.work / tables in work
```
---
-:fontawesome-solid-book-open:
+
[Metadata](../basics/metadata.md)
\ No newline at end of file
diff --git a/docs/ref/take.md b/docs/ref/take.md
index 5ac4659b..8c73fdca 100644
--- a/docs/ref/take.md
+++ b/docs/ref/take.md
@@ -1,7 +1,7 @@
---
title: Take selects leading or trailing items | Reference | kdb+ and q documentation
description: Take is a q operator that selects leading or trailing items from a list or dictionary, named entries from a dictionary, or named columns from a table.
-author: Stephen Taylor
+author: KX Systems, Inc., a subsidiary of KX Software Limited
---
# `#` Take
@@ -278,7 +278,7 @@ s2| jones 10 paris
----
-:fontawesome-solid-street-view:
+
_Q for Mortals_
[§8.4.5 Retrieving Multiple Records](/q4m3/8_Tables/#845-retrieving-multiple-records)
diff --git a/docs/ref/tan.md b/docs/ref/tan.md
index a23a5054..679f1e8e 100644
--- a/docs/ref/tan.md
+++ b/docs/ref/tan.md
@@ -1,21 +1,18 @@
---
title: tan, atan – tangent and arctangent | Reference | kdb+ and q documentation
description: tan and atan are q keywords that return the tangent or arctangent of their argument.
-author: Stephen Taylor
+author: KX Systems, Inc., a subsidiary of KX Software Limited
---
# `tan`, `atan`
-
-
_Tangent and arctangent_
-
```syntax
tan x tan[x]
atan x atan[x]
```
-Where `x` is a numeric, returns
+Where `x` is a numeric, returns
`tan`
: the [tangent](https://en.wikipedia.org/wiki/Tangent) of `x`, taken to be in radians. Integer arguments are promoted to floating point. Null is returned if the argument is null or infinity.
@@ -23,7 +20,7 @@ Where `x` is a numeric, returns
: The function is equivalent to `{(sin x)%cos x}`.
`atan`
-: the [arctangent](https://en.wikipedia.org/wiki/Inverse_trigonometric_functions#Basic_properties) of `x`; that is, the value whose tangent is `x`.
+: the [arctangent](https://en.wikipedia.org/wiki/Inverse_trigonometric_functions#Basic_properties) of `x`; that is, the value whose tangent is `x`.
: The result is in radians and lies between $-\frac{\pi}{2}$ and $\frac{\pi}{2}$. The range is approximate due to rounding errors.
@@ -39,8 +36,7 @@ q)atan 42
`tan` and `atan` are [multithreaded primitives](../kb/mt-primitives.md).
-
-## :fontawesome-solid-sitemap: Implicit iteration
+## Implicit iteration
`tan` and `atan` are [atomic functions](../basics/atomic.md).
@@ -59,7 +55,6 @@ y| 0.4227932 0.5463025 0.6841368 0.8422884
z| 1.029639 1.260158 1.557408 1.96476
```
-
## Domain and range
```txt
@@ -67,13 +62,10 @@ domain: b g x h i j e f c s p m d z n u v t
range: f . f f f f f f f . f f f z f f f f
```
-
----
-:fontawesome-solid-book:
[`cos` and `acos`](cos.md),
[`sin` and `asin`](sin.md)
-:fontawesome-solid-book-open:
-[Mathematics](../basics/math.md)
+[Mathematics](../basics/math.md)
diff --git a/docs/ref/til.md b/docs/ref/til.md
index 464e09c9..7889f845 100644
--- a/docs/ref/til.md
+++ b/docs/ref/til.md
@@ -1,7 +1,7 @@
---
title: til returns the first natural numbers | Reference | kdb+ and q documentation
description: til is a q keyword that returns the natural numbers up to its argument.
-author: Stephen Taylor
+author: KX Systems, Inc., a subsidiary of KX Software Limited
---
# `til`
@@ -34,5 +34,5 @@ q)til 5f
`til` is a [multithreaded primitive](../kb/mt-primitives.md).
----
-:fontawesome-solid-book-open:
+
[Mathematics](../basics/math.md)
diff --git a/docs/ref/tok.md b/docs/ref/tok.md
index 3fd48edf..75b416bc 100644
--- a/docs/ref/tok.md
+++ b/docs/ref/tok.md
@@ -1,7 +1,7 @@
---
title: Tok interprets string data to another datatype | Reference | kdb+ and q documentation
description: Tok is a q operator that interprets string data to another datatype.
-author: Stephen Taylor
+author: KX Systems, Inc., a subsidiary of KX Software Limited
---
# `$` Tok
@@ -155,7 +155,7 @@ q)"I"$"192.168.1.34" /an IP address as an int
-1062731486i
```
-:fontawesome-solid-book:
+
[`.Q.addr`](dotq.md#addr-iphost-as-int) (IP/host as int),
[`.Q.host`](dotq.md#host-ip-to-hostname) (IP to hostname)
@@ -194,7 +194,6 @@ q)"PZ"$\:"20191122-11:11:11.123"
2019.11.22T11:11:11.123
```
-
## Date formats
`"D"$` will Tok dates with varied formats:
@@ -207,26 +206,26 @@ yyyy/[mm|MMM]/dd
dd/[mm|MMM]/[yy]yy / when \z is set to 1
```
-:fontawesome-solid-book-open:
+
[Command-line option `-z` (date format)](../basics/cmdline.md#-z-date-format)
-:fontawesome-solid-book-open:
+
[System command `\z` (date format)](../basics/syscmds.md#z-date-parsing)
----
-:fontawesome-solid-book:
+
[Cast](cast.md)
-:fontawesome-solid-book:
+
[Overloads of `$`](overloads.md#dollar)
-:fontawesome-solid-book:
+
[`.h.iso8601`](doth.md#hiso8601-iso-timestamp) ISO 8601 timestamp
-:fontawesome-solid-book-open:
+
[Casting](../basics/by-topic.md#casting-and-encoding)
-:fontawesome-solid-street-view:
+
_Q for Mortals_
[§7.3.3 Parsing Data from Strings](/q4m3/7_Transforming_Data/#733-parsing-data-from-strings)
diff --git a/docs/ref/trim.md b/docs/ref/trim.md
index ed6a265d..c68b99c6 100644
--- a/docs/ref/trim.md
+++ b/docs/ref/trim.md
@@ -1,13 +1,12 @@
---
title: trim, ltrim, rtrim – trim nulls from a list | Reference | kdb+ and q documentation
description: trim, ltrim, and rtrim are q keywords that remove leading or trailing spaces from a string.
-author: Stephen Taylor
+author: KX Systems, Inc., a subsidiary of KX Software Limited
---
# `trim`, `ltrim`, `rtrim`
_Remove leading or trailing nulls from a list_
-
```syntax
trim x trim[x]
ltrim x ltrim[x]
@@ -34,8 +33,7 @@ q)trim 42
42
```
-
-## :fontawesome-solid-sitemap: Implicit iteration
+## Implicit iteration
`trim`, `ltrim`, and `rtrim` are [string-atomic](../basics/atomic.md#string-atomic) and apply to dictionaries and tables.
@@ -55,7 +53,6 @@ a b
("jumps";"over") "dog"
```
-
## Domain and range
```txt
@@ -64,9 +61,8 @@ range: b g x h i j e f c s p m d z n u v t
```
----
-:fontawesome-solid-book:
+
[Drop](drop.md)
-:fontawesome-solid-book-open:
-[Strings](../basics/by-topic.md#strings)
+[Strings](../basics/by-topic.md#strings)
diff --git a/docs/ref/type.md b/docs/ref/type.md
index 7de2b05d..089148d8 100644
--- a/docs/ref/type.md
+++ b/docs/ref/type.md
@@ -1,7 +1,7 @@
---
title: type – datatype of an object | Reference | kdb+ and q documentation
description: type is a q keyword that returns as a short int the datatype of an object
-author: Stephen Taylor
+author: KX Systems, Inc., a subsidiary of KX Software Limited
---
# `type`
@@ -42,11 +42,11 @@ q)type (0|+) / composition
----
-:fontawesome-solid-book:
+
[`key`](key.md#type-of-a-vector),
[.Q.ty](dotq.md#ty-type)
-:fontawesome-solid-book-open:
+
[Casting and encoding](../basics/by-topic.md#casting-and-encoding),
[Datatypes](../basics/datatypes.md)
diff --git a/docs/ref/uj.md b/docs/ref/uj.md
index 5b4df10a..bbe25bbf 100644
--- a/docs/ref/uj.md
+++ b/docs/ref/uj.md
@@ -3,7 +3,7 @@ title: uj – union join | Reference | kdb+ and q documentation
description: uj and ujf are q keywords that perform a union join on two tables.
keywords: join, kdb+, q, uj, ujf, union join
---
-
+
{: style="float:right; margin-left: 3em; max-width: 250px;"}
# `uj`, `ujf`
@@ -80,12 +80,12 @@ a b| c d
-| ---
1| 1
2| z
- q)x uj y / kdb+ 3.0
+ q)x uj y / q 3.0
a| b c
-| ---
1| 1
2| z
- q)x uj y / kdb+ 2.8
+ q)x uj y / q 2.8
a| b c
-| ----
1| x 1
@@ -96,10 +96,10 @@ a b| c d
---
-:fontawesome-solid-book-open:
+
[Joins](../basics/joins.md)
-:fontawesome-solid-street-view:
+
_Q for Mortals_
[§9.9.7 Union Join](/q4m3/9_Queries_q-sql/#997-union-join)
diff --git a/docs/ref/ungroup.md b/docs/ref/ungroup.md
index cd042a0f..97a3ad33 100644
--- a/docs/ref/ungroup.md
+++ b/docs/ref/ungroup.md
@@ -1,7 +1,7 @@
---
title: ungroup normalizes a table | Reference | kdb+ and q documentation
description: ungroup is a q keyword that, where x is a table, in which some cells are lists, but for any row, all lists are of the same length, returns the normalized table, with one row for each item of a lists.
-author: Stephen Taylor
+author: KX Systems, Inc., a subsidiary of KX Software Limited
---
# `ungroup`
@@ -62,11 +62,11 @@ s4 p4 300
Grouping sorts on the keys, so a subsequent `ungroup` returns the original records sorted by the grouped column/s.
----
-:fontawesome-solid-book:
+
[`group`](group.md),
[`select`](select.md),
[`xgroup`](xgroup.md)
-:fontawesome-solid-street-view:
+
_Q for Mortals_
[§9.3.4.2 Grouping without Aggregation](/q4m3/9_Queries_q-sql/#9342-grouping-without-aggregation)
diff --git a/docs/ref/union.md b/docs/ref/union.md
index 628f6944..6b9f08c4 100644
--- a/docs/ref/union.md
+++ b/docs/ref/union.md
@@ -1,7 +1,7 @@
---
title: union join of two tables | Reference | kdb+ and q documentation
description: union is a q keyword that returns the union of two lists.
-author: Stephen Taylor
+author: KX Systems, Inc., a subsidiary of KX Software Limited
---
# `union`
@@ -38,10 +38,10 @@ q)(distinct t0,t1)~t0 union t1
----
-:fontawesome-solid-book:
+
[`in`](in.md), [`inter`](inter.md), [`within`](within.md)
-:fontawesome-solid-book:
+
[Select](../basics/by-topic.md#selection)
diff --git a/docs/ref/update.md b/docs/ref/update.md
index c93a9a89..7ef3fc84 100644
--- a/docs/ref/update.md
+++ b/docs/ref/update.md
@@ -1,7 +1,7 @@
---
title: update keyword | Reference | kdb+ and q documentation
description: update is a qSQL query template that adds rows or columns to a table.
-author: Stephen Taylor
+author: KX Systems, Inc., a subsidiary of KX Software Limited
keywords: columns, kdb+, q, query, qsql, rows, sql, update
---
# `update`
@@ -14,7 +14,7 @@ _Add or amend rows or columns of a table or entries in a dictionary_
!!! info "`update` is a qSQL query template and varies from regular q syntax."
For the Update operator `!`, see
-:fontawesome-solid-book-open:
+
[Functional SQL](../basics/funsql.md)
Since 4.1t 2021.06.04 updates from splayed table and path@tablename now leverage [peach](each.md) to load columns (when running with [secondary threads](../basics/syscmds.md#s-number-of-secondary-threads)).
@@ -29,7 +29,7 @@ q)update x:0 from get`:mysplay
update _p~s~_ [by _p~b~_] from _t~exp~_ [where _p~w~_]
-:fontawesome-solid-book-open:
+
[qSQL query templates](../basics/qsql.md)
@@ -130,15 +130,15 @@ see [qSQL](../basics/qsql.md#cond).
----
-:fontawesome-solid-book:
+
[`delete`](delete.md),
[`exec`](exec.md),
[`select`](select.md)
-:fontawesome-solid-book-open:
+
[qSQL](../basics/qsql.md),
[Functional SQL](../basics/funsql.md)
-:fontawesome-solid-street-view:
+
_Q for Mortals_
[§9.5 The `update` template](/q4m3/9_Queries_q-sql/#95-the-update-template)
diff --git a/docs/ref/upsert.md b/docs/ref/upsert.md
index 59d6002b..83fb78cb 100644
--- a/docs/ref/upsert.md
+++ b/docs/ref/upsert.md
@@ -1,7 +1,7 @@
---
title: upsert | Reference | kdb+ and q documentation
description: upsert is a q keyword that adds new records to a table.
-author: Stephen Taylor
+author: KX Systems, Inc., a subsidiary of KX Software Limited
---
# `upsert`
@@ -158,15 +158,15 @@ Upserting to a splayed table appends new values to the column files.
Enclose in a lambda or use [Vector Conditional](vector-conditional.md) instead.
-:fontawesome-solid-book:
+
[`insert`](insert.md),
[Join](join.md)
-:fontawesome-solid-book-open:
+
[Joins](../basics/joins.md),
[qSQL](../basics/qsql.md),
[Tables](../kb/faq.md)
-:fontawesome-solid-street-view:
+
_Q for Mortals_
[§9.2 Upsert](/q4m3/9_Queries_q-sql/#92-upsert)
\ No newline at end of file
diff --git a/docs/ref/value.md b/docs/ref/value.md
index a12c5ab0..e4a9fcf6 100644
--- a/docs/ref/value.md
+++ b/docs/ref/value.md
@@ -1,7 +1,7 @@
---
title: value | Reference | kdb+ and q documentation
description: value is a q keyword that returns the value of a named variable, or metadata.
-author: Stephen Taylor
+author: KX Systems, Inc., a subsidiary of KX Software Limited
---
# `value`
@@ -184,7 +184,7 @@ q.test)value f
## Local values in suspended functions
-See changes since V3.5 that support [debugging](../basics/debug.md#debugger).
+See changes since V3.5 that support [debugging](../basics/debug.md).
## `get`
@@ -202,7 +202,7 @@ q)value each (get;value) / same internal code
----
-:fontawesome-solid-book:
+
[`eval`](eval.md),
[`get`](get.md),
[`parse`](parse.md),
diff --git a/docs/ref/var.md b/docs/ref/var.md
index 0571b8f0..7aa548fd 100644
--- a/docs/ref/var.md
+++ b/docs/ref/var.md
@@ -1,7 +1,7 @@
---
title: var, svar – variance and sample variance | Reference | kdb+ and q documentation
description: var and svar are q keywords that return (respectively) the variance and sample variance of their argument.
-author: Stephen Taylor
+author: KX Systems, Inc., a subsidiary of KX Software Limited
---
# `var`, `svar`
@@ -103,16 +103,16 @@ range: f . f f f f f f f . f f f f f f f f
----
-:fontawesome-solid-book:
+
[`cov, scov`](cov.md)
-:fontawesome-solid-book-open:
+
[Mathematics](../basics/math.md)
-:fontawesome-brands-wikipedia-w:
+
[Covariance](https://en.wikipedia.org/wiki/Covariance "Wikipedia"),
[Variance](https://en.wikipedia.org/wiki/Variance "Wikipedia")
-:fontawesome-solid-globe:
+
[Variance](http://financereference.com/learn/variance "financereference.com")
diff --git a/docs/ref/vector-conditional.md b/docs/ref/vector-conditional.md
index 62edd06f..763f681a 100644
--- a/docs/ref/vector-conditional.md
+++ b/docs/ref/vector-conditional.md
@@ -1,7 +1,7 @@
---
title: Vector Conditional operator | Reference | kdb+ and q documentation
description: Vector Conditional is a q operator that replaces selected items of one list with corresponding items of another.
-author: Stephen Taylor
+author: KX Systems, Inc., a subsidiary of KX Software Limited
keywords: condition, item, kdb+, q, vector
---
# `?` Vector Conditional
@@ -48,14 +48,14 @@ Vector Conditional can be used in [qSQL queries](../basics/qsql.md), which do no
!!! tip "For multiple cases – more than just true/false – see [Controlling evaluation](../basics/control.md#case)."
----
-:fontawesome-solid-book:
+
[`?` Query](overloads.md#query),
[Cond](cond.md),
[`if`](if.md)
-:fontawesome-solid-book-open:
+
[Controlling evaluation](../basics/control.md)
-:fontawesome-solid-street-view:
+
_Q for Mortals_
[§10.1.3 Vector Conditional Evaluation](/q4m3/10_Execution_Control/#1013-vector-conditional-evaluation)
diff --git a/docs/ref/view.md b/docs/ref/view.md
index e4924a7a..d3e4252c 100644
--- a/docs/ref/view.md
+++ b/docs/ref/view.md
@@ -1,7 +1,7 @@
---
title: view, views | Reference | kdb+ and q documentation
description: view and views are q keywords. view returns the expression defining a view. views lists views defined in the default namespace.
-author: Stephen Taylor
+author: KX Systems, Inc., a subsidiary of KX Software Limited
---
# `view`, `views`
@@ -48,12 +48,9 @@ q)views[]
```
---
-:fontawesome-solid-book-open:
+
[Metadata](../basics/metadata.md)
-:fontawesome-solid-graduation-cap:
-[Views](../learn/views.md)
-
-:fontawesome-solid-street-view:
+
_Q for Mortals_
-[§4.11 Alias](/q4m3/4_Operators/#411-alias)
+[4.11 Views](/q4m3/4_Operators/#4114-views)
diff --git a/docs/ref/vs.md b/docs/ref/vs.md
index bddd5c39..c0af890d 100644
--- a/docs/ref/vs.md
+++ b/docs/ref/vs.md
@@ -1,7 +1,7 @@
---
title: vs – Reference – kdb+ and q documentation
description: vs is a q keyword that performs various functions under the scheme vector-from-scalar (atom).
-author: Stephen Taylor
+author: KX Systems, Inc., a subsidiary of KX Software Limited
keywords: atom, decode, kdb+, keyword, q, scalar, vector, vs
---
@@ -96,7 +96,7 @@ q)` vs `:/home/kdb/data/mywork.dat
`:/home/kdb/data`mywork.dat
```
-:fontawesome-solid-book:
+
[sv](sv.md#join) join
@@ -202,14 +202,14 @@ q)10 vs(1995;1996 1997)
```
---
-:fontawesome-solid-book:
+
[`sv`](sv.md#decode) decode
-:fontawesome-solid-book:
+
[`.Q.j10`](dotq.md#j10-encode-binhex) encode binhex,
[`.Q.j12`](dotq.md#j12-encode-base-36) encode base36
-:fontawesome-solid-book:
+
[`.Q.x10`](dotq.md#x10-decode-binhex) decode binhex,
[`.Q.x12`](dotq.md#x12-decode-base-36) decode base36
diff --git a/docs/ref/where.md b/docs/ref/where.md
index 303344b3..640bf675 100644
--- a/docs/ref/where.md
+++ b/docs/ref/where.md
@@ -1,7 +1,7 @@
---
title: where | Reference | kdb+ and q documentation
description: where is a q keyword that returns copies of indexes of a list or keys of a dictionary.
-author: Stephen Taylor
+author: KX Systems, Inc., a subsidiary of KX Software Limited
keywords: kdb+, q, selection, where
---
# `where`
@@ -64,7 +64,7 @@ q)where 0 1 2 3 ! 2 3 0 1 / same on dictionary with indices as keys
----
-:fontawesome-solid-book-open:
+
[`where` in q-SQL](../basics/qsql.md),
[Selection](../basics/by-topic.md#selection)
diff --git a/docs/ref/while.md b/docs/ref/while.md
index d7c49b1d..10712ebc 100644
--- a/docs/ref/while.md
+++ b/docs/ref/while.md
@@ -1,7 +1,7 @@
---
title: while control word | Reference | kdb+ and q documentation
description: while is a q control word that governs iteration.
-author: Stephen Taylor
+author: KX Systems, Inc., a subsidiary of KX Software Limited
keywords: condition, control, iteration, kdb+, q, while
---
# `while`
@@ -42,14 +42,14 @@ The brackets of the expression list do not create lexical scope.
Name scope within the brackets is the same as outside them.
----
-:fontawesome-solid-book:
+
[Accumulators – While](accumulators.md#while),
[`do`](do.md),
[`if`](if.md)
-:fontawesome-solid-book-open:
+
[Controlling evaluation](../basics/control.md)
-:fontawesome-solid-street-view:
+
_Q for Mortals_
-[§10.1.6 `while`](/q4m3/10_Execution_Control/#1016-while)
+[10.1.7 `while`](/q4m3/10_Execution_Control/#1016-while)
\ No newline at end of file
diff --git a/docs/ref/within.md b/docs/ref/within.md
index 6a1073f0..cbd61c97 100644
--- a/docs/ref/within.md
+++ b/docs/ref/within.md
@@ -1,7 +1,7 @@
---
title: within tests whether one argument is within the bounds defined by the other | Reference | kdb+ and q documentation
description: within is a q keyword that tests whether one argument is within the bounds defined by the other.
-author: Stephen Taylor
+author: KX Systems, Inc., a subsidiary of KX Software Limited
---
# `within`
@@ -51,13 +51,13 @@ q)(1 3 10 6 4;"acyxmpu") within ((2;"b");(6;"r"))
----
-:fontawesome-solid-book:
+
[`except`](except.md),
[`in`](in.md),
[`inter`](inter.md),
[`union`](union.md)
-:fontawesome-solid-book-open:
+
[Search](../basics/by-topic.md#search)
diff --git a/docs/ref/wj.md b/docs/ref/wj.md
index 081788b2..ac6bcc9f 100644
--- a/docs/ref/wj.md
+++ b/docs/ref/wj.md
@@ -1,7 +1,7 @@
---
title: Window join | Reference | kdb+ and q documentation
description: wj and wj1 are q keywords that perform window joins.
-author: Stephen Taylor
+author: KX Systems, Inc., a subsidiary of KX Software Limited
---
# `wj`, `wj1`
@@ -64,7 +64,7 @@ For `wj`, the prevailing quote on entry to the window is considered valid as quo
| 3.0+ | `[]` | prevailing + `[]` |
| 2.7/2.8 | `[)` | prevailing + `[]` |
-:fontawesome-brands-wikipedia-w:
+
[Notation for intervals](https://en.wikipedia.org/wiki/Interval_(mathematics)#Notations_for_intervals "Wikipedia")
@@ -127,14 +127,14 @@ ibm 10:01:08 105 107 108 107 108 104 106 106 107
----
-:fontawesome-solid-book:
+
[`aj`](aj.md),
[`asof`](asof.md)
-:fontawesome-solid-book-open:
+
[Joins](../basics/joins.md)
-:fontawesome-solid-street-view:
+
_Q for Mortals_
-[§9.9.9 Window Joins](/q4m3/9_Queries_q-sql/#999-window-join)
+[9.9.9 Window Joins](/q4m3/9_Queries_q-sql/#999-window-join)
diff --git a/docs/ref/xbar.md b/docs/ref/xbar.md
index 38319c2b..ea3f63c6 100644
--- a/docs/ref/xbar.md
+++ b/docs/ref/xbar.md
@@ -1,12 +1,10 @@
---
title: xbar | Reference | kdb+ and q documentation
description: xbar is a q keyword that returns one argument rounded down to the nearest multiple of the other.
-author: Stephen Taylor
+author: KX Systems, Inc., a subsidiary of KX Software Limited
---
# `xbar`
-
-
_Round down_
```syntax
@@ -15,8 +13,8 @@ x xbar y xbar[x;y]
Where
-- `x` is a non-negative numeric atom
-- `y` is numeric or temporal
+- `x` is a non-negative numeric atom
+- `y` is numeric or temporal
returns `y` rounded down to the nearest multiple of `x`. `xbar` is a [multithreaded primitive](../kb/mt-primitives.md).
@@ -82,13 +80,11 @@ q)-1+`date$3+3 xbar `month$2019.11.19 / end of that quarter
2019.12.31
```
-
!!! warning "Duplicate keys or column names"
Duplicate keys in a dictionary or duplicate column names in a table will cause sorts and grades to return unpredictable results.
-
-## :fontawesome-solid-sitemap: Implicit iteration
+## Implicit iteration
`xbar` is an [atomic function](../basics/atomic.md).
It applies to [dictionaries and keyed tables](../basics/math.md#dictionaries-and-tables)
@@ -112,10 +108,9 @@ def| -21 3
ghi| 3 -6
```
-
## Domain and range
-The following shows the resulting output type given the input type of `x` and `y`.
+The following shows the resulting output type given the input type of `x` and `y`.
The character representation of the datatypes referenced can be found [`here`](../basics/datatypes.md).
```txt
@@ -142,6 +137,7 @@ t | t . t t t t f f t . . . . . . . . .
```
For example, rounding down timespans to the nearest multiple of a long will produce a timespan.
+
```q
q)2 xbar 00:00:00.000000001 00:00:00.000000002 00:00:00.000000013
0D00:00:00.000000000 0D00:00:00.000000002 0D00:00:00.000000012
@@ -152,9 +148,8 @@ q)type 2 xbar 00:00:00.000000001 00:00:00.000000002 00:00:00.000000013
The possible range of output types are `ijfpmdznuvte`.
----
-:fontawesome-solid-book:
+
[`bin`](bin.md), [`floor`](floor.md)
-:fontawesome-solid-book-open:
-[Mathematics](../basics/math.md)
+[Mathematics](../basics/math.md)
diff --git a/docs/ref/xgroup.md b/docs/ref/xgroup.md
index 253f0ebf..1553fc9c 100644
--- a/docs/ref/xgroup.md
+++ b/docs/ref/xgroup.md
@@ -1,7 +1,7 @@
---
title: xgroup – Reference – kdb+ and q documentation
description: xgroup is a q keyword that groups a table by values in selected columns.
-author: Stephen Taylor
+author: KX Systems, Inc., a subsidiary of KX Software Limited
keywords: column, group, kdb+, q, xgroup
---
# `xgroup`
@@ -79,8 +79,8 @@ p3 s1 400
Duplicate keys in a dictionary or duplicate column names in a table will cause sorts and grades to return unpredictable results.
-:fontawesome-solid-book:
+
[`group`](group.md)
-:fontawesome-solid-book-open:
+
[Dictionaries & tables](../basics/dictsandtables.md)
diff --git a/docs/ref/xrank.md b/docs/ref/xrank.md
index b7c7a347..d088ff7f 100644
--- a/docs/ref/xrank.md
+++ b/docs/ref/xrank.md
@@ -1,7 +1,7 @@
---
title: xrank – group by value | Reference | kdb+ and q documentation
description: xrank is a q keyword that groups its argument by value.
-author: Stephen Taylor
+author: KX Systems, Inc., a subsidiary of KX Software Limited
---
# `xrank`
@@ -67,5 +67,5 @@ bucket| Min Max Count
----
-:fontawesome-solid-book-open:
+
[Sorting](../basics/by-topic.md#sort)