This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //run this on q session in a new server | |
| h: hopen`$":192.241.231.75:5012::"; | |
| h ({tables `.}; ()); | |
| sel: {[t; d] select from t where date=d}; | |
| getdata: {[src; dst; query; transform; d] dst set transform delete date from h (query; src; d)}; | |
| write: {[dst; d] .Q.dpft[`:/apps/bnb/data; d; `id; dst]}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| chrome: "/Applications/Google\\ Chrome.app/Contents/MacOS/Google\\ Chrome " | |
| .nv.t1: {.j.j {{`key`values!(y;`x`y xcol (x,'y)#z)}[;;x]/:[c[0];1_c:cols x]} x} | |
| .chart.libpath: "/" sv (getenv `QHOME;"ext";"chart") | |
| .chart.template: {hsym `$"/" sv (.chart.libpath;"template";string ` sv (x;`html))} | |
| .chart.tempfile: {hsym `$"/" sv (.chart.libpath;"tmp";string ` sv (`$-3_(string .z.Z) except ".:";`html))} | |
| plot:{[template; data] | |
| lines: read0 .chart.template template; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(devtools) | |
| install_local('/workspace/github/rzmq') | |
| install_github('IRkernel/repr') | |
| install_github("IRkernel/IRdisplay") | |
| install_github("IRkernel/IRkernel") | |
| IRkernel::installspec() | |
| system.file("kernelspec", package="IRkernel") | |
| > system.file("kernelspec", package="IRkernel") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from IPython.core.magic import (register_cell_magic) | |
| from qpython import qconnection | |
| @register_cell_magic | |
| def q(con, cell=None): | |
| """ | |
| execute q statements in jupyter cell. Required qpython https://github.com/exxeleron/qPython | |
| :param con: connection string (default 'localhost:5555') | |
| :type con: str |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
| { | |
| "cmd": ["/usr/local/bin/q32", "test/$file_name"], | |
| "file_regex": "^(...*?):([0-9]*):?([0-9]*)", | |
| "working_dir": "${file_path}/..", | |
| "selector": "source.q", | |
| "env": | |
| { | |
| "QPREFIX":"/usr/local", | |
| "QHOME":"/usr/local/lib/q", | |
| "QLIB":"/Users/komsit/lib/q", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //log alias for .qunit namespace | |
| INFO: (value`.)[`INFO]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var express = require('express'); | |
| var app = express(); | |
| app.use(express.static('public')); | |
| var server = app.listen(3000, function () { | |
| var host = server.address().address; | |
| var port = server.address().port; | |
| console.log('Example app listening at http://%s:%s', host, port); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| case class DbOrg(id: Int, name: String, a: String, b: Int, c: Long) | |
| val q = quote { | |
| (id: Int, orgName: String) => | |
| query[DbOrg].filter(_.id == id).filter(_.name == orgName).update | |
| } | |
| val d = DbOrg(1, "n", "a", 1, 2L) | |
| mirrorSource.run(q(lift(d.id), lift(d.name)))(d) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #put this file in ~/ | |
| unbind C-b | |
| set -g prefix C-a | |
| bind C-a send-prefix | |
| set -sg escape-time 1 # quicker responses | |
| set -g base-index 1 # Numbering of windows | |
| setw -g pane-base-index 1 # Numbering of Panes | |
| bind \ split-window -h # Split panes horizontal |
OlderNewer