Tickerplants for Real-time access
https://code.kx.com/trac/wiki/DotQ
1. (Middle) Design a server that takes data that comes
in as pairs from many clients
and simply logs data as it arrives in an append only logfile.
The server also holds the data and can be searched.
	rm tmpout
	q server.q -p 1235
	q client.q
2. (Middle) This server should route data whose first element is addressed
to arthur to a secondary server that logs all messages to arthur.
All other data should be logged by the primary server.
	rm tmpsecondary
	rm tmpprimary
	q secondaryserver.q -p 1236
	q primaryserver.q -p 1235
	q client.q
3. (Easy) Put an sql implementation into your q directory,
by copying s.k into that directory.
You can get that from www.kx.com/q/s.k.
Then generate random data and try the query
s) select stock, avg(price) from rantrade where price > 200 group by stock
4. (Middle) Write a translator from aquery on a single table to kdb.
It should allow aquery statements to be prefaced by "a)".
They will then be translated into kdb statements, e.g.
	q aquery.q hasaquery.q
will produce hasaquery_ready.q.
The aquery statements in question must each appear on one line
and may include assuming statements and group by, but no having.
So, q tmp.q won't work by itself, but q tmp_ready.q will.
5. (Middle) Enhance the translator to suggest what to do if a table
is very wide and there is an assuming clause.
	q aquery2.q hasaquery.q
will produce hasaquery_ready.q.
6. (Hard) Enhance the translator further to allow multiple table
foreign key joins. To do this, the user must give us information
in the form of statements such as
ac) foreignkey[rantrade.stock; stock.mystock]
This means that the foreign key of rantrade.stock is stock.mystock.
Note that in the table design, if there is 
foreignkey[R.X; S.Y], then Y must be the key of S, 
X and R must be the same name, and the query to follow must have
a clause R.X = S.Y.
	q aquery3.q foreignkeyaquery.q

Translator from aquery to q, but it is in a preprocessing way.
Now for multi-table, I want to figure out which table has a foreign
key relationship to which other, so I can use dot,
then I want to use lj if not a foreign key but the right table has a key.
Then aj etc.
?[table;indices;parsetree]
Need a file like a.k
Should be a function p
s.k

