What kind of verb or, for want of a better word,“facility” is h?? Let us suppose I have two kdbsessions listening at ports 7777 and 8888 resp.and I have assigned a to 1 in the root ws of thefirst and 2 in the other. Now,h: (hopen`$“:localhost:”,) each (“7777”;“8888”)q)h[0] "a"1q)h[1] "a"2q)h each "aa"0N 0Nq)h @ each “aa”'q)What weirdness is this and how can I useeach and h together?Thanks.
depends what you want to do.
e.g.
h@:“a”
Hi Charlie,Yes I already knew @: works but this example is bogus,sorry. Let us say instead that I defined a in one ws and bin the other. Then I want (intuitively) something like h each"ab", which again gives 0N 0N-- O.L.
given 2 kdb+ processes
-
listening on port 5000, with a:1
-
listening on port 5001, with b:2
q)h:hopen each 5001 5002
q)h@'“ab”
1 2
q)@'[h;“ab”]
1 2
Ah, ok. I had not tried ’ because this is the dyadic eachand I though h was some kind of (obviously monadic) verb.So, what *is* h? It’s not a verb since it would be monadicif it were a verb and then ’ wouldn’t work.-- O.L.
I think I get it (today). “handle at cmd” is another form of access,like “list at index” or “dict at key” and at itself is the verb here;execution of the command is implicit. Correct?-- O.L.
Yet another way of doing it (using a simple apply):@[;“1+1”] each h
More or less. “int atom@x”, where x is any atom or list and the int isa file descriptor referring to a socket, sends x to that socket. Theresult is dependent on the definition of .z.pg (or .z.ps, if the filedescriptor given is negative) in the remote q process. (@ is of courseoften implicit, generally being inferred in any whitespace that can’tbe interpreted as being part of a vector literal.)On Thursday, February 18, 2010, olivier wrote:> I think I get it (today). “handle at cmd” is another form of access,> like “list at index” or “dict at key” and at itself is the verb here;> execution of the command is implicit. Correct?-- Aaron Daviesaaron.davies@gmail.com