

rocuinneagain
Forum Replies Created
-
Linux is best to make use of all features.
If you plan on using Platform/Developer I’d recommend Ubuntu 20.04 for best compatibility.
https://code.kx.com/developer/getting-started/#prerequisites
-
Dictionaries require lists to be passed to either side of !. You can use enlist to make lists from atoms:
q)d:.Q.def[enlist[`num1]!enlist 5].Q.opt .z.x
q)d
num1| 5If you are using kdb 4.1 you can use the new dictionary syntax which does not need enlist
q)d:.Q.def[([num1:5])].Q.opt .z.x
q)d
num1| 5 -
rocuinneagain
MemberApril 29, 2024 at 8:36 am in reply to: kx developer – from installation to the endYou need to install q to use developer. q cannot be installed by pip.
Instructions are here: https://code.kx.com/q/learn/install/
code.kx.com
Installing kdb+ | Learn | kdb+ and q documentation - Kdb+ and q documentation
How to install kdb+ on Linux, macOS, or Windows
-
rocuinneagain
MemberApril 23, 2024 at 11:50 am in reply to: Failed to Load KX Insights Core Library error when using pykx in qDid you download q from this link?
https://kx.com/kdb-personal-edition-download/
It does not include the cloud libraries.
Instead the insights edition is needed to have those libraries:
https://kx.com/kdb-insights-personal-edition-license-download/
-
rocuinneagain
MemberApril 22, 2024 at 7:29 pm in reply to: message after print to stderror not shownIf statements in q do not return data.
“The result of if is always the generic null.”
q)result:if[1b;1]
q)result
q).Q.s1 result //The generic null is returned
"::"
//You can include the date in the printed output:
q){if[x>1;-2"Warn ",string[x]," above threshold 1 ",string .z.D]} 2
Warn 2 above threshold 1 2024.04.22
code.kx.com
if control word | Reference | kdb+ and q documentation - Kdb+ and q documentation
if is a q control construct for conditional evaluation of one or more expressions.
-
We added some functionality in version 2.3.0
https://code.kx.com/pykx/2.4/release-notes/changelog.html#pykx-230
If you enable beta features as well as pykx threading all calls into q from any python thread will be run as if they were calling from the main thread which allows python multithreaded programs to use IPC connections in licensed mode.
You can enable this functionality like this:
import os
os.environ['PYKX_THREADING'] = '1'
os.environ['PYKX_BETA_FEATURES'] = '1'
import pykx as kxYou will also want to ensure that kx.shutdown_thread() is called when the script finishes. The safest way to do this is within a try – finally block like this.
if __name__ == '__main__':
try:
main()
finally:
kx.shutdown_thread()More information about this functionality and an example can be found within our documentation:
https://code.kx.com/pykx/2.4/examples/threaded_execution/threading.html
-
We added some functionality in version 2.3.0
https://code.kx.com/pykx/2.4/release-notes/changelog.html#pykx-230
If you enable beta features as well as pykx threading all calls into q from any python thread will be run as if they were calling from the main thread which allows python multithreaded programs to use IPC connections in licensed mode.
You can enable this functionality like this:
import os
os.environ['PYKX_THREADING'] = '1'
os.environ['PYKX_BETA_FEATURES'] = '1'
import pykx as kxYou will also want to ensure that kx.shutdown_thread() is called when the script finishes. The safest way to do this is within a try – finally block like this.
if __name__ == '__main__':
try:
main()
finally:
kx.shutdown_thread()More information about this functionality and an example can be found within our documentation:
https://code.kx.com/pykx/2.4/examples/threaded_execution/threading.html
-
rocuinneagain
MemberApril 19, 2024 at 12:10 pm in reply to: PyKX could not establish an IPC connection in the Flask appWe added some functionality in version 2.3.0
https://code.kx.com/pykx/2.4/release-notes/changelog.html#pykx-230
If you enable beta features as well as pykx threading all calls into q from any python thread will be run as if they were calling from the main thread which allows python multithreaded programs to use IPC connections in licensed mode.
You can enable this functionality like this:
import os
os.environ['PYKX_THREADING'] = '1'
os.environ['PYKX_BETA_FEATURES'] = '1'
import pykx as kxYou will also want to ensure that kx.shutdown_thread() is called when the script finishes. The safest way to do this is within a try – finally block like this.
if __name__ == '__main__':
try:
main()
finally:
kx.shutdown_thread()More information about this functionality and an example can be found within our documentation:
https://code.kx.com/pykx/2.4/examples/threaded_execution/threading.html
-
rocuinneagain
MemberApril 16, 2024 at 9:21 am in reply to: Natural Query Interface API fails to aggregate rdb + hdb resultsWhat is Holistic API? You may be using an internal tool which we can not answer questions on.
Standard kdb will not behave as you have outlined:
q)`:testHDB/2024.04.16/tableName/ set ([] publishTime:asc 100?.z.t;otherCol:100?100.0)
`:testHDB/2024.04.16/tableName/
q)`:testHDB/2024.04.15/tableName/ set ([] publishTime:asc 100?.z.t;otherCol:100?100.0)
`:testHDB/2024.04.15/tableName/
q)\l testHDB
q)select last publishTime from tableName where date within(.z.D-5;.z.D)
publishTime
------------
09:12:36.839 -
rocuinneagain
MemberApril 11, 2024 at 9:31 am in reply to: Could Someone Give Me Guidance on Integrating KDB+/q with Machine Learning?There are a lot of resources here: https://code.kx.com/q/ml/
Note: These show use of embedPy which is still usable but is not being actively updated. These can be however be migrated to use the current Python interface PyKX which includes notes on upgrading from embedPy.
Related to the question to you linked to you may be interested in this Websocket example interfacing with coinapi.io:
code.kx.com
Machine learning | kdb+ and q documentation - Kdb+ and q documentation
Machine-learning capabilities are at the heart of future technology development at KX. Libraries are added here as they are released. Libraries are released under the Apache 2 license, and are free for all use cases, including 64-bit and commercial use.
-
Yes you can renew it again.
-
The first error is saying you do not have node.js installed to be able to run that command
https://nodejs.org/en/download
The second error is saying that a different process is using the port 10001 blocking your new process from starting. You need to kill that other process or change your configuration to use a different port instead.
nodejs.org
Node.js® is a JavaScript runtime built on Chrome's V8 JavaScript engine.
-
rocuinneagain
MemberApril 29, 2024 at 8:20 pm in reply to: kx developer – from installation to the endYou have not exported PATH so q is available on it.
See: https://code.kx.com/q/learn/install/#step-5-edit-your-profile
setx PATH "%PATH%;C:\q\w64"
Or instead to make a permanent change to the existing PATH environment variable on windows you can follow this guide https://chlee.co/how-to-setup-environment-variables-for-windows-mac-and-linux/
code.kx.com
Installing kdb+ | Learn | kdb+ and q documentation - Kdb+ and q documentation
How to install kdb+ on Linux, macOS, or Windows
-
rocuinneagain
MemberApril 23, 2024 at 1:06 pm in reply to: Failed to Load KX Insights Core Library error when using pykx in qRun ‘ls’ on ‘/q’ in the container to see what files are there. The load error output suggests the cloud libraries are not there.
-
rocuinneagain
MemberApril 23, 2024 at 11:05 am in reply to: Failed to Load KX Insights Core Library error when using pykx in q.