石榴木命是什么意思| 黄皮肤适合什么颜色的衣服| 尿蛋白质阳性什么意思| 中班小朋友应该学什么| 拔罐红色是什么原因| 什么孩子该看心理医生| 2月8日什么星座| 血压低头晕是什么原因导致的| 什么光| 子宫前倾是什么意思| 抗战纪念日为什么是9月3日| 合子是什么| 七月十一是什么星座| 定海神针是什么意思| 脑垂体在什么位置图片| abs材质是什么| 淋证是什么病| 请人原谅说什么| 闲云野鹤指什么生肖| 时蔬是什么意思| 秋天有什么景物| 献血后吃什么补血最快| 四面楚歌是什么生肖| 唇系带短有什么影响| av是什么| 陶渊明字什么| 今年66岁属什么生肖的| 染发膏用什么能洗掉| 黑色的蛇是什么蛇| 输卵管发炎有什么症状表现| 天麻泡水喝有什么功效| 八月十五是什么日子| 艾滋病中期有什么症状| 梦见洪水是什么意思| 物质是什么意思| 没壳的蜗牛叫什么| 什么驴技穷成语| 你在看什么| 枸杞补什么| 拉不出来屎是什么原因| 露从今夜白下一句是什么| George是什么意思| urban是什么牌子| 阑尾炎看什么科室| 媛交是什么意思| 什么地笑| 决明子泡水喝有什么功效| 动物的尾巴有什么作用| 为什么大熊猫是国宝| 五花肉和什么菜炒好吃| 丰富的近义词和反义词是什么| 愿力是什么意思| 什么油适合高温油炸| 芹菜和什么不能一起吃| 万象更新是什么生肖| 女人更年期是什么症状| 咳嗽适合吃什么水果| 何以笙箫默什么意思| 沐猴而冠代表什么生肖| 小脑萎缩有什么症状| 益生菌的食物是什么| 心电图是检查什么的| 豆油什么牌子的好| 什么是事实婚姻| 春捂秋冻指的是什么意思| 酒花浸膏是什么| 悠哉悠哉是什么意思| 磨玻璃结节是什么| 黑玫瑰代表什么意思| 疼风是什么原因引起的| 半夏微凉是什么意思| 胎盘中药叫什么| 色觉异常是什么意思| 月经期间适合吃什么水果| 三个马读什么| 上师是什么意思| 744是什么意思| 下午18点是什么时辰| 撸铁什么意思| 胃胀气用什么药最好| 有什么水能代替美瞳水| 属虎的和什么属相最配| 心梗挂什么科| 传单是什么病| 男人吃海参有什么好处| 完全性右束支传导阻滞是什么意思| 心脏做什么检查最准确| 为什么会打哈欠| 保家卫国是什么生肖| 梦见棉花是什么意思| 什么水果糖分最高| 属鸡的跟什么属相最配| 天然气主要成分是什么| 拉肚子发烧吃什么药| 治妇科炎症用什么药好| 和氏璧是什么玉| 护资成绩什么时候出| 知青为什么要下乡| m样症状是什么| 2008属什么生肖| 什么动物牙齿最多| 什么气味能驱赶猫| 色拉油是什么| 脾胃湿热吃什么药| 交警大队长是什么级别| 鱼露是什么味道| 湿气太重吃什么| 吃什么降血脂最好| 柴米油盐什么意思| 鼻子上长红疙瘩是什么原因| 大腿内侧发黑是什么原因| 三点水一个前读什么| 麻烦是什么意思| 十面埋伏是什么生肖| 心眼小是什么意思| 上不来气是什么原因| 黄瓜敷脸有什么效果| 左眼皮一直跳什么原因| 为什么低烧比高烧可怕| 肠胃性感冒吃什么药| 海鲜有什么| 出汗多什么原因| 为什么筋膜炎一躺下才会疼| 迎春花像什么| 福布斯是什么意思| 梦见女儿结婚是什么意思| 又什么又什么的花| 榛子是什么树的果实| 双向情感障碍症是什么病| 大禹姓什么| 为什么会有结石| 腰腿疼痛吃什么药效果好| 阿托伐他汀钙片治什么病| 降尿酸吃什么药| 早上六七点是什么时辰| cet什么意思| 露酒是什么酒| 烂仔是什么意思| 什么是什么的眼睛| bys是什么药| 梦见血是什么预兆解梦| 碱和小苏打有什么区别| 胆汁反流有什么症状| 白头翁吃什么| 梦见父亲去世预示什么| 梦见打官司预示着什么| 巡抚相当于现在的什么官| se是什么元素| 淋巴细胞百分比低是什么意思| 拉肚子应该挂什么科| 天天喝绿茶有什么好处和坏处| 疮疡是什么意思| 糖类抗原125偏高是什么原因| 吃什么长肉| 梦见老鼠是什么征兆| 卤水是什么水| 血压低有什么办法| 熊猫为什么吃竹子| lsp是什么意思| 梦见门坏了什么意思| 普洱茶什么季节喝好| 脚腕肿是什么原因| 甲基苯丙胺是什么| 柜姐是什么意思| 美国总统叫什么名字| 466是什么意思| 11月25日是什么星座| 王昆念什么| 抽血为什么要空腹| 全麦面包是什么意思| 避孕药什么牌子好| 口臭严重吃什么药好得快| 小孩c反应蛋白高说明什么| 铁瓷是什么意思| 体脂率是什么意思| 崖柏手串有什么功效| 牛顿三大定律是什么| 1.4是什么星座| 散光什么意思| 考验是什么意思| 寻常疣用什么药膏| ibm是做什么的| 为什么人会做梦| wlw是什么意思| 东南方向是什么位置| 什么叫粳米| 隔夜茶为什么不能喝| 失足妇女是什么意思| 格物穷理是什么意思| 维生素d什么牌子的好| qs排名是什么意思| 什么病可以鉴定病残| 脚拇指发麻是什么原因| 检查肠胃挂什么科| 什么是凤凰男| 肺部疼痛什么原因| 自残是什么心理| 吃二甲双胍为什么会瘦| cm是什么单位| 阑尾炎是什么引起的| 沙弗莱是什么宝石| 提手旁加茶念什么| 长期服用二甲双胍有什么副作用| 写意是什么意思| 龙生九子下一句是什么| 乳腺结节是什么引起的| 右位是什么意思| 黄瓜吃多了有什么坏处| mcm是什么意思| 喝酒为什么会头疼| 女属蛇的和什么属相最配| 五味子有什么功效和作用| 心肌供血不足是什么原因造成的| 胎儿宫内缺氧孕妇有什么症状| 电话正在通话中是什么意思| 马首是瞻是什么生肖| impress是什么意思| 身上湿气重吃什么药| 退工单是什么| dha什么牌子好| 高尿酸血症是什么病| 喝益生菌有什么好处| 36什么意思| 感冒黄痰吃什么药| 德高望重是什么生肖| 三个土是什么字怎么读| 腿肿是什么病的前兆| 内热外寒感冒用什么药| 陌陌是干什么的| 45年属什么生肖| ppq是什么意思| 丙子日是什么意思| 什么是三农| 女金片的功效与作用是什么| 女人得痔疮原因是什么| 黄精什么时候种植| 巨蟹座和什么座最配| 电荷是什么意思| 宝宝肠胃炎吃什么药| 审时度势是什么意思| 黑猫警长是什么猫| 掉眉毛是什么病| 菠萝什么季节成熟| 中产阶级的标准是什么| 柚子什么时候成熟| 最早的春联是写在什么上面的| 突然戒烟对身体有什么影响| 什么是消毒| 肌酐高有什么症状| 肚子硬硬的是什么原因| 怀孕三个月吃什么对胎儿好| 脾与什么相表里| 法务是干什么的| 就绪是什么意思| 做果冻用什么粉| 反复口腔溃疡是什么病的前兆| 什么炎炎| 扬字五行属什么| 心口疼痛是什么原因| 吃什么可以补胶原蛋白| 7月6日是什么节日| 木羽念什么| 手腕疼去医院挂什么科| 什么是大三阳和小三阳| 百度
百度 埃莉森是一个医生,她很理解帕齐亚利的心情,帕齐亚利一直希望在最高水平的舞台上打比赛,现在能有机会参赛,太酷了!在美国中年业余锦标赛为他做球童的父亲,也会接着在奥古斯塔、辛尼科克以及圆石滩为他背包。

Q is a programming language for array processing, developed by Arthur Whitney. It is proprietary software, commercialized by Kx Systems. Q serves as the query language for kdb+, a disk based and in-memory, column-based database. Kdb+ is based on the language k, a terse variant of the language APL. Q is a thin wrapper around k, providing a more readable, English-like interface. One of the use cases is financial time series analysis, as one could do inexact time matches. An example is to match the a bid and the ask before that. Both timestamps slightly differ and are matched anyway.[3]

q
ParadigmArray, functional
Designed byArthur Whitney
DeveloperKx Systems
First appeared2003[1]
Stable release
4.0 / March 17, 2020; 5 years ago (2025-08-07)[2]
Typing disciplineDynamic, strong
Websitecode.kx.com
Influenced by
A+, APL, Scheme, k

Overview

edit

The fundamental building blocks of q are atoms, lists, and functions. Atoms are scalars and include the data types numeric, character, date, and time. Lists are ordered collections of atoms (or other lists) upon which the higher level data structures dictionaries and tables are internally constructed. A dictionary is a map of a list of keys to a list of values. A table is a transposed dictionary of symbol keys and equal length lists (columns) as values. A keyed table, analogous to a table with a primary key placed on it, is a dictionary where the keys and values are arranged as two tables.

The following code demonstrates the relationships of the data structures. Expressions to evaluate appear prefixed with the q) prompt, with the output of the evaluation shown beneath:

q)`john / an atom of type symbol
`john
q)50    / an atom of type integer
50

q)`john`jack / a list of symbols
`john`jack
q)50 60 / a list of integers
50 60

q)`john`jack!50 60 / a list of symbols and a list of integers combined to form a dictionary
john| 50
jack| 60

q)`name`age!(`john`jack;50 60) / an arrangement termed a column dictionary
name| john jack
age | 50   60

q)flip `name`age!(`john`jack;50 60) / when transposed via the function "flip", the column dictionary becomes a table
name age
--------
john 50
jack 60

q)(flip (enlist `name)!enlist `john`jack)!flip (enlist `age)!enlist 50 60  / two equal length tables combined as a dictionary become a keyed table
name| age
----| ---
john| 50
jack| 60

These entities are manipulated via functions, which include the built-in functions that come with Q (which are defined as K macros) and user-defined functions. Functions are a data type, and can be placed in lists, dictionaries and tables, or passed to other functions as parameters.

Examples

edit

Like K, Q is interpreted and the result of the evaluation of an expression is immediately displayed, unless terminated with a semi-colon. The Hello world program is thus trivial:

q)"Hello world!"
"Hello world!"

The following expression sorts a list of strings stored in the variable x descending by their lengths:

x@idesc count each x

The expression is evaluated from right to left as follows:

  1. "count each x" returns the length of each word in the list x.
  2. "idesc" returns the indices that would sort a list of values in descending order.
  3. @ use the integer values on the right to index into the original list of strings.

The factorial function can be implemented directly in Q as

{prd 1+til x}

or recursively as

{$[x=0;1;x*.z.s[x-1]]}

Note that in both cases the function implicitly takes a single argument called x - in general it is possible to use up to three implicit arguments, named x, y and z, or to give arguments local variable bindings explicitly.

In the direct implementation, the expression "til x" enumerates the integers from 0 to x-1, "1+" adds 1 to every element of the list and "prd" returns the product of the list.

In the recursive implementation, the syntax "$[condition; expr1; expr2]" is a ternary conditional - if the condition is true then expr1 is returned; otherwise expr2 is returned. The expression ".z.s" is loosely equivalent to 'this' in Java or 'self' in Python - it is a reference to the containing object, and enables functions in q to call themselves.

When x is an integer greater than 2, the following function will return 1 if it is a prime, otherwise 0:

{min x mod 2_til x}

The function is evaluated from right to left:

  1. "til x" enumerate the non-negative integers less than x.
  2. "2_" drops the first two elements of the enumeration (0 and 1).
  3. "x mod" performs modulo division between the original integer and each value in the truncated list.
  4. "min" find the minimum value of the list of modulo result.

The q programming language contains its own table query syntax called qSQL, which resembles traditional SQL but has important differences, mainly due to the fact that the underlying tables are oriented by column, rather than by row.

q)show t:([] name:`john`jack`jill`jane; age: 50 60 50 20) / define a simple table and assign to "t"
name age
--------
john 50
jack 60
jill 50
jane 20
 q)select from t where name like "ja*",age>50
 name age
 --------
 jack 60
 
 q)select rows:count i by age from t
 age| rows
 ---| ----
 20 | 1
 50 | 2
 60 | 1

References

edit
  1. ^ "Q Language Widening the Appeal of Vectors". Archived from the original on January 1, 2007. Retrieved June 1, 2016.
  2. ^ "Changes in 4.0" (Press release). Palo Alto: Kx Systems. Mar 17, 2020. Retrieved Apr 15, 2020.
  3. ^ "Q Reference Card". Retrieved 15 April 2020.

Further reading

edit
edit
1998年属什么生肖 rem睡眠是什么意思 月子餐吃什么 18k是什么意思 脸浮肿是什么原因
脚趾头麻木是什么原因引起的 打车用什么软件 什么的什么是什么的伞 甘油三酯高是什么病 吃什么会回奶
为什么越累越胖 扩容是什么意思 三月三号是什么星座 太阳鱼吃什么食物 梦见买房子是什么预兆
全身骨头疼是什么原因 双胞胎代表什么生肖 酸奶什么时候喝最好 睡眠时间短是什么原因 三轮体空是什么意思
浪凡算是什么档次的tiangongnft.com 下巴长痘痘是什么原因1949doufunao.com 什么时间容易受孕xinjiangjialails.com 门诊号是什么意思youbangsi.com 吃什么能缓解便秘hcv9jop3ns0r.cn
星标朋友是什么意思hcv7jop6ns3r.cn 吃茶油对身体有什么好处hcv9jop4ns8r.cn 什么叫同人文96micro.com 什么是海市蜃楼xinmaowt.com 和田玉籽料是什么意思hcv8jop4ns7r.cn
红枣不能和什么一起吃hcv8jop9ns4r.cn 五谷是什么hcv8jop0ns8r.cn 饭后呕吐是什么原因引起的hcv9jop2ns0r.cn 7.9什么星座hcv7jop7ns2r.cn 心阴虚吃什么食物hcv9jop6ns2r.cn
喝什么睡眠效果最好hcv8jop4ns7r.cn 静待花开的前一句是什么hcv9jop2ns0r.cn 济州岛有什么好玩的wzqsfys.com 农历五月二十是什么星座hcv8jop1ns5r.cn 小叶增生吃什么药hcv8jop7ns1r.cn
百度