Another instance of DQWEB is already open. Please close this tab/window!
Help
The basics
All your code and your layout are persisted in the browser's local storage.
You can always close DQWEB, re-open and continue where you left off.
Drag & Drop
You can re-arrange your panels by drag & drop.
You can also drag and drop items from the menu bar no the top to create new panels.
NEW: create new kdb+/q code editor.
TRASH: restore (up to 10) closed code editors. Double-click to empty trash.
SHARE: open shared code.
DEMO: open demo code.
HELP: open help page.
Code editor
In DQWEB some comments do something. There are executable commands (TITLE, URL), directives that are effective below the comment (SERVER, OUTPUT, PROXY) and one-shot directives that only take effect right below the comment (ONCE, WARN, FILE, TRAP) and there is one that defines global macros (MAC).
//@SERVER [user@]host:port [comments]
Add this comment to set the target server of execution.
Everything after the address string is ignored, so you can add any comments there.
The setting only takes effect below the comment.
You can work with multiple servers in the same document by adding multiple //@SERVER comments.
The default server is ....
Press Ctrl+Enter after "//@SERVER " to get hints collected from all the open editors with the longest comment.
//@ONCE [user@]host:port [comments]
Similar to //@SERVER, but only specifies the target server for the query right below the comment.
Ctrl+Enter
Press Ctrl+Enter to execute current line or selected code and show results in Output. Works with multiple lines too.
//@TITLE title
Add this comment and execute (Ctrl+Enter) to set the title of your code editor.
//@WARN message
Add this comment right above your query to show a warning message before execution.
//@FILE filename [comments]
Add this comment right above your query to download the results into a file (like .csv,.xls etc...).
//@TRAP [comments]
Add this comment right above your query to execute with exteded trap, i.e. you will get the stack trace of errors.
//@OUTPUT [name]
Add this comment to set the target output window for queries or urls below the comment. The defult is empty sting.
//@URL url [comments]
Add this comment and execute (Ctrl+Enter) to open url in the target output window.
//@MAC name definition
Macros provide a non-intrusive way of defining q values (function or data) on the clint side. If the "name" macro is defined in any of the q editors the "!!name" string is replaced with its definition before execution. Macros can be nested. Warnings are shown for duplicate definitions on execution.
Ctrl+Space
Code completion for standard q keywords longer than 3 characters and the .Q namespace.
Ctrl+s
Copies a link to the clipboard that encodes the code editor's title and code and can be sent to others. The DQWEB share ULR is ....
Export
Export all your code and layout to JSON. Simply click "EXPORT" + "Ok" for quick timestamped export.
Import
Click "IMPORT" to import (i.e. replace) your code and layout from JSON or keep everything and only import code (it will show up in SHARED).
Advanced
Hosting DQWEB from Q
Use start.q to host DQWEB from Q and start the DQWEB Proxy.
//@PROXY
When you host DQWEB from Q, you can specify the same host:port as a proxy for other Q processes. DQWEB will call ".dqweb.h[server] message" to execute your command, where server is the string you specified at @SERVER or @ONCE and .dqweb.h returns an integer connection handle. The default impl caches connection handles and returns an error if can't connect for one second.
Alt+Enter
If you host DQWEB from Q and PROXY or SERVER is pointing to this server, you can press Alt+Enter to execute queries and the results will be inlined below the executed code. This is somewhat similar to executing code in Jupyter notebooks, except that repeated execution will not remove previous results.
dqweb.settings.js
You can change some settings here, like default server, trash size, q keywords for code completion, the default code for new code editors and the demo code.
Credits
You downloaded this from GitHub for free, or you use it from github.io. Use it at your own risk, I provide no support.
Internet people: You can do amazing things with modern browsers in 300 lines of code. Thanks for that!