Friday, May 20, 2016

Riddle 4: What’s Going On Here?

What’s happening in this snippet, and why is it interesting?
% q
KDB+ 3.3 2016.03.14 Copyright (C) 1993-2016 Kx Systems
m32/ 2()core 2048MB adavies air.local 10.37.129.2 NONEXPIRE

q)f:{x+1}
q)\d .foo
q.foo)g:{select f a from x}
q.foo)\d .
q).foo.g([]a:1 2 3)
a
-
2
3
4
q)

Labels: ,

Monday, June 8, 2015

Riddle 3: not x~string`$x

Here’s an easy one:

When will {(10h=type x)&not x~string`$x} return true (1b)?

Slightly harder:

In cases where this is problematic, what can be done about it?

Labels: ,

Monday, January 19, 2015

Riddle 2: “:: is not a special case”

(I suppose it’s a good thing I only said I’d be posting riddles “occasionally”, as it’s now almost two years since I last posted one.)

Referring specifically to the “global amend” sense, I make the claim that :: is not a special case.

What do I mean by this?

Labels: ,

Monday, March 11, 2013

Riddle 1: (all x)and not any x

When will {(all x)and not any x} return true (1b)?

Labels: ,

Sunday, November 4, 2012

Riddle 0: not x~flip flip x

I’m going to start occasionally posting q riddles; this is the first.

When will {x~flip flip x} return false (0b)?

Labels: ,