`g#1 2 3 means what?

(newbie alert!)

I am trying to understand the # symbol.

At the end of this page http://code.kx.com/wiki/Reference/NumberSign there is a section talking about how to “get/set attributes” followed by two examples but no explanation of what it means to “get/set attributes” using #.

Some code am looking at does this:

update `g#sym from crossed

where sym is a column in table crossed.

But in the particular example am looking at, this seems to have no impact (i.e. returned table looks exactly the same).

So, wondering how I figure out what “#” does in this situation, and whether there are other documentation sources I should be looking at.

Thanks in advance,

http://www.timestored.com/kdb-guides/table-attributes

btw, that timestored page erroneously states that there is no space overhead for `p#.

Might also like to view

http://kx.com/q/d/q.htm

http://code.kx.com/wiki/JB:QforMortals2/tables#Attributes

which also mentions the use of `s# for step functions too.

http://code.kx.com/wiki/Cookbook/TemporalData

What’s the reason this actually keeps two s# on d? is that justq-internal stuff?q)d:s#1 12 30 44 100!acektq)0N!d;s#s#1 12 30 44 100!acektq)On Thu, Aug 1, 2013 at 4:16 PM, Charles Skelton wrote:> btw, that timestored page erroneously states that there is no space overhead> for p#.&gt;&gt; Might also like to view&gt;&gt; http://kx.com/q/d/q.htm&gt; http://code.kx.com/wiki/JB:QforMortals2/tables#Attributes&gt; which also mentions the use of s# for step functions too.>> http://code.kx.com/wiki/Cookbook/TemporalData&gt;&gt;&gt; On Thu, Aug 1, 2013 at 4:58 PM, Ryan Hamilton wrote:>>>> http://www.timestored.com/kdb-guides/table-attributes&gt;&gt;&gt;&gt;&gt;&gt; On Thu, Aug 1, 2013 at 3:43 PM, Tahsin Alam <alam.tahsin> wrote:>>>>>> (newbie alert!)>>>>>> I am trying to understand the # symbol.>>>>>> At the end of this page http://code.kx.com/wiki/Reference/NumberSign&gt;&gt;&gt; there is a section talking about how to “get/set attributes” followed by two>>> examples but no explanation of what it means to “get/set attributes” using>>> #.>>>>>> Some code am looking at does this:>>>>>> update `g#sym from crossed>>>>>> where sym is a column in table crossed.>>> But in the particular example am looking at, this seems to have no impact>>> (i.e. returned table looks exactly the same).>>>>>> So, wondering how I figure out what “#” does in this situation, and>>> whether there are other documentation sources I should be looking at.>>>>>> Thanks in advance,>> –>

Submitted via Google Groups</alam.tahsin>

To: personal-kdbplus@googlegroups.com
X-Mailer: Apple Mail (2.1508)
Return-Path: <attila.vrabecz>

i think it should be understood as
s#(s#1 12 30 44 100)!acekt<br><br>it is just the printing does not put the () there<br><br>q)a:s#1 12 30 44 100!acekt<br>q)a<br>1 | a<br>12 | c<br>30 | e<br>44 | k<br>100| t<br>q)attr a<br>s
q)attr key a
s<br><br>Cheers,<br> Attila<br>On 3 Aug 2013, at 10:31, wp <walter1003> wrote:<br><br>&gt; What's the reason this actually keeps two s# on d? is that just
> q-internal stuff?
>
> q)d:s#1 12 30 44 100!acekt
> q)0N!d;
> s#s#1 12 30 44 100!acekt<br>&gt; q)<br>&gt; <br>&gt; <br>&gt; <br>&gt; On Thu, Aug 1, 2013 at 4:16 PM, Charles Skelton <charlie> =<br>wrote:<br>&gt;&gt; btw, that timestored page erroneously states that there is no space =<br>overhead<br>&gt;&gt; for p#.
>>
>> Might also like to view
>>
>> http://kx.com/q/d/q.htm
>> http://code.kx.com/wiki/JB:QforMortals2/tables#Attributes
>> which also mentions the use of s# for step functions too.<br>&gt;&gt; <br>&gt;&gt; http://code.kx.com/wiki/Cookbook/TemporalData<br>&gt;&gt; <br>&gt;&gt; <br>&gt;&gt; On Thu, Aug 1, 2013 at 4:58 PM, Ryan Hamilton <ryan> =<br>wrote:<br>&gt;&gt;&gt; <br>&gt;&gt;&gt; http://www.timestored.com/kdb-guides/table-attributes<br>&gt;&gt;&gt; <br>&gt;&gt;&gt; <br>&gt;&gt;&gt; On Thu, Aug 1, 2013 at 3:43 PM, Tahsin Alam <alam.tahsin> =<br>wrote:<br>&gt;&gt;&gt;&gt; <br>&gt;&gt;&gt;&gt; (newbie alert!)<br>&gt;&gt;&gt;&gt; <br>&gt;&gt;&gt;&gt; I am trying to understand the # symbol.<br>&gt;&gt;&gt;&gt; <br>&gt;&gt;&gt;&gt; At the end of this page =<br>http://code.kx.com/wiki/Reference/NumberSign<br>&gt;&gt;&gt;&gt; there is a section talking about how to "get/set attributes" =<br>followed by two<br>&gt;&gt;&gt;&gt; examples but no explanation of what it means to "get/set =<br>attributes" using<br>&gt;&gt;&gt;&gt; #.<br>&gt;&gt;&gt;&gt; <br>&gt;&gt;&gt;&gt; Some code am looking at does this:<br>&gt;&gt;&gt;&gt; <br>&gt;&gt;&gt;&gt; update g#sym from crossed
>>>>
>>>> where sym is a column in table crossed.
>>>> But in the particular example am looking at, this seems to have no =
impact
>>>> (i.e. returned table looks exactly the same).
>>>>
>>>> So, wondering how I figure out what “#” does in this situation, and
>>>> whether there are other documentation sources I should be looking =
at.
>>>>
>>>> Thanks in advance,
>>
>> –
>> You received this message because you are subscribed to the Google =
Groups
>> “Kdb+ Personal Developers” group.
>> To unsubscribe from this group and stop receiving emails from it, =
send an
>> email to personal-kdbplus+unsubscribe@googlegroups.com.
>> To post to this group, send email to =
personal-kdbplus@googlegroups.com.
>> Visit this group at http://groups.google.com/group/personal-kdbplus.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>
> –
> You received this message because you are subscribed to the Google =
Groups “Kdb+ Personal Developers” group.
> To unsubscribe from this group and stop receiving emails from it, send =
an email to personal-kdbplus+unsubscribe@googlegroups.com.
> To post to this group, send email to =
personal-kdbplus@googlegroups.com.
> Visit this group at http://groups.google.com/group/personal-kdbplus.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>


</alam.tahsin></attila.vrabecz>

I am not sure I quite get it:)What’s the difference betweens#(s#1 12 30 44 100)!acektand(s#1 12 30 44 100)!acekt?and what's the benefit of the first over the second?On Sat, Aug 3, 2013 at 11:40 AM, Attila Vrabecz<attila.vrabecz> wrote:&gt; i think it should be understood as&gt; s#(s#1 12 30 44 100)!acekt>> it is just the printing does not put the () there>> q)a:s#1 12 30 44 100!acekt> q)a> 1 | a> 12 | c> 30 | e> 44 | k> 100| t> q)attr a> s&gt; q)attr key a&gt; s>> Cheers,> Attila> On 3 Aug 2013, at 10:31, wp wrote:>>> What’s the reason this actually keeps two s# on d? is that just&gt;&gt; q-internal stuff?&gt;&gt;&gt;&gt; q)d:s#1 12 30 44 100!acekt&gt;&gt; q)0N!d;&gt;&gt; s#s#1 12 30 44 100!acekt>> q)>>>>>>>> On Thu, Aug 1, 2013 at 4:16 PM, Charles Skelton wrote:>>> btw, that timestored page erroneously states that there is no space overhead>>> for p#.&gt;&gt;&gt;&gt;&gt;&gt; Might also like to view&gt;&gt;&gt;&gt;&gt;&gt; http://kx.com/q/d/q.htm&gt;&gt;&gt; http://code.kx.com/wiki/JB:QforMortals2/tables#Attributes&gt;&gt;&gt; which also mentions the use of s# for step functions too.>>>>>> http://code.kx.com/wiki/Cookbook/TemporalData&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; On Thu, Aug 1, 2013 at 4:58 PM, Ryan Hamilton wrote:>>>>>>>> http://www.timestored.com/kdb-guides/table-attributes&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; On Thu, Aug 1, 2013 at 3:43 PM, Tahsin Alam <alam.tahsin> wrote:>>>>>>>>>> (newbie alert!)>>>>>>>>>> I am trying to understand the # symbol.>>>>>>>>>> At the end of this page http://code.kx.com/wiki/Reference/NumberSign&gt;&gt;&gt;&gt;&gt; there is a section talking about how to “get/set attributes” followed by two>>>>> examples but no explanation of what it means to “get/set attributes” using>>>>> #.>>>>>>>>>> Some code am looking at does this:>>>>>>>>>> update `g#sym from crossed>>>>>>>>>> where sym is a column in table crossed.>>>>> But in the particular example am looking at, this seems to have no impact>>>>> (i.e. returned table looks exactly the same).>>>>>>>>>> So, wondering how I figure out what “#” does in this situation, and>>>>> whether there are other documentation sources I should be looking at.>>>>>>>>>> Thanks in advance,>>>>>> –>>>

Submitted via Google Groups</alam.tahsin></attila.vrabecz>

To: personal-kdbplus@googlegroups.com
X-Mailer: Apple Mail (2.1508)
Return-Path: <attila.vrabecz>

if only the key has the attribute not the dictionary
it won’t act as a step function - it just speeds up access

q)(s#(1 4 7)!"abc")til 9<br>" aaabbbcc"<br>q)((s#1 4 7)!“abc”)til 9
" a b c "

Cheers,
Attila
On 3 Aug 2013, at 22:23, wp wrote:

> I am not sure I quite get it:)
> What’s the difference between
> s#(s#1 12 30 44 100)!acekt<br>&gt; and<br>&gt; (s#1 12 30 44 100)!acekt<br>&gt; ?<br>&gt; and what's the benefit of the first over the second?<br>&gt; <br>&gt; On Sat, Aug 3, 2013 at 11:40 AM, Attila Vrabecz<br>&gt; <attila.vrabecz> wrote:<br>&gt;&gt; i think it should be understood as<br>&gt;&gt; s#(s#1 12 30 44 100)!acekt
>>
>> it is just the printing does not put the () there
>>
>> q)a:s#1 12 30 44 100!acekt
>> q)a
>> 1 | a
>> 12 | c
>> 30 | e
>> 44 | k
>> 100| t
>> q)attr a
>> s<br>&gt;&gt; q)attr key a<br>&gt;&gt; s
>>
>> Cheers,
>> Attila
>> On 3 Aug 2013, at 10:31, wp wrote:
>>
>>> What’s the reason this actually keeps two s# on d? is that just<br>&gt;&gt;&gt; q-internal stuff?<br>&gt;&gt;&gt; <br>&gt;&gt;&gt; q)d:s#1 12 30 44 100!acekt<br>&gt;&gt;&gt; q)0N!d;<br>&gt;&gt;&gt; s#s#1 12 30 44 100!acekt
>>> q)
>>>
>>>
>>>
>>> On Thu, Aug 1, 2013 at 4:16 PM, Charles Skelton =
wrote:
>>>> btw, that timestored page erroneously states that there is no space =
overhead
>>>> for p#.<br>&gt;&gt;&gt;&gt; <br>&gt;&gt;&gt;&gt; Might also like to view<br>&gt;&gt;&gt;&gt; <br>&gt;&gt;&gt;&gt; http://kx.com/q/d/q.htm<br>&gt;&gt;&gt;&gt; http://code.kx.com/wiki/JB:QforMortals2/tables#Attributes<br>&gt;&gt;&gt;&gt; which also mentions the use of s# for step functions too.
>>>>
>>>> http://code.kx.com/wiki/Cookbook/TemporalData
>>>>
>>>>
>>>> On Thu, Aug 1, 2013 at 4:58 PM, Ryan Hamilton =
wrote:
>>>>>
>>>>> http://www.timestored.com/kdb-guides/table-attributes
>>>>>
>>>>>
>>>>> On Thu, Aug 1, 2013 at 3:43 PM, Tahsin Alam =
<alam.tahsin> wrote:
>>>>>>
>>>>>> (newbie alert!)
>>>>>>
>>>>>> I am trying to understand the # symbol.
>>>>>>
>>>>>> At the end of this page =
http://code.kx.com/wiki/Reference/NumberSign
>>>>>> there is a section talking about how to “get/set attributes” =
followed by two
>>>>>> examples but no explanation of what it means to “get/set =
attributes” using
>>>>>> #.
>>>>>>
>>>>>> Some code am looking at does this:
>>>>>>
>>>>>> update `g#sym from crossed
>>>>>>
>>>>>> where sym is a column in table crossed.
>>>>>> But in the particular example am looking at, this seems to have =
no impact
>>>>>> (i.e. returned table looks exactly the same).
>>>>>>
>>>>>> So, wondering how I figure out what “#” does in this situation, =
and
>>>>>> whether there are other documentation sources I should be looking =
at.
>>>>>>
>>>>>> Thanks in advance,
>>>>
>>>> –
>>>> You received this message because you are subscribed to the Google =
Groups
>>>> “Kdb+ Personal Developers” group.
>>>> To unsubscribe from this group and stop receiving emails from it, =
send an
>>>> email to personal-kdbplus+unsubscribe@googlegroups.com.
>>>> To post to this group, send email to =
personal-kdbplus@googlegroups.com.
>>>> Visit this group at =
http://groups.google.com/group/personal-kdbplus.
>>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>>
>>>>
>>>
>>> –
>>> You received this message because you are subscribed to the Google =
Groups “Kdb+ Personal Developers” group.
>>> To unsubscribe from this group and stop receiving emails from it, =
send an email to personal-kdbplus+unsubscribe@googlegroups.com.
>>> To post to this group, send email to =
personal-kdbplus@googlegroups.com.
>>> Visit this group at http://groups.google.com/group/personal-kdbplus.
>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>
>>>
>>
>> –
>> You received this message because you are subscribed to the Google =
Groups “Kdb+ Personal Developers” group.
>> To unsubscribe from this group and stop receiving emails from it, =
send an email to personal-kdbplus+unsubscribe@googlegroups.com.
>> To post to this group, send email to =
personal-kdbplus@googlegroups.com.
>> Visit this group at http://groups.google.com/group/personal-kdbplus.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>
> –
> You received this message because you are subscribed to the Google =
Groups “Kdb+ Personal Developers” group.
> To unsubscribe from this group and stop receiving emails from it, send =
an email to personal-kdbplus+unsubscribe@googlegroups.com.
> To post to this group, send email to =
personal-kdbplus@googlegroups.com.
> Visit this group at http://groups.google.com/group/personal-kdbplus.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>


</alam.tahsin></attila.vrabecz></attila.vrabecz>

I should have figured that one out!Thanks Attila.On Sat, Aug 3, 2013 at 10:30 PM, Attila Vrabecz<attila.vrabecz> wrote:> if only the key has the attribute not the dictionary> it won’t act as a step function - it just speeds up access>> q)(s#(1 4 7)!"abc")til 9&gt; " aaabbbcc"&gt; q)((s#1 4 7)!“abc”)til 9> " a b c ">> Cheers,> Attila> On 3 Aug 2013, at 22:23, wp wrote:>>> I am not sure I quite get it:)>> What’s the difference between>> s#(s#1 12 30 44 100)!acekt&gt;&gt; and&gt;&gt; (s#1 12 30 44 100)!acekt&gt;&gt; ?&gt;&gt; and what's the benefit of the first over the second?&gt;&gt;&gt;&gt; On Sat, Aug 3, 2013 at 11:40 AM, Attila Vrabecz&gt;&gt; <attila.vrabecz> wrote:&gt;&gt;&gt; i think it should be understood as&gt;&gt;&gt; s#(s#1 12 30 44 100)!acekt>>>>>> it is just the printing does not put the () there>>>>>> q)a:s#1 12 30 44 100!acekt>>> q)a>>> 1 | a>>> 12 | c>>> 30 | e>>> 44 | k>>> 100| t>>> q)attr a>>> s&gt;&gt;&gt; q)attr key a&gt;&gt;&gt; s>>>>>> Cheers,>>> Attila>>> On 3 Aug 2013, at 10:31, wp wrote:>>>>>>> What’s the reason this actually keeps two s# on d? is that just&gt;&gt;&gt;&gt; q-internal stuff?&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; q)d:s#1 12 30 44 100!acekt&gt;&gt;&gt;&gt; q)0N!d;&gt;&gt;&gt;&gt; s#s#1 12 30 44 100!acekt>>>> q)>>>>>>>>>>>>>>>> On Thu, Aug 1, 2013 at 4:16 PM, Charles Skelton wrote:>>>>> btw, that timestored page erroneously states that there is no space overhead>>>>> for p#.&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; Might also like to view&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; http://kx.com/q/d/q.htm&gt;&gt;&gt;&gt;&gt; http://code.kx.com/wiki/JB:QforMortals2/tables#Attributes&gt;&gt;&gt;&gt;&gt; which also mentions the use of s# for step functions too.>>>>>>>>>> http://code.kx.com/wiki/Cookbook/TemporalData&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; On Thu, Aug 1, 2013 at 4:58 PM, Ryan Hamilton wrote:>>>>>>>>>>>> http://www.timestored.com/kdb-guides/table-attributes&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; On Thu, Aug 1, 2013 at 3:43 PM, Tahsin Alam <alam.tahsin> wrote:>>>>>>>>>>>>>> (newbie alert!)>>>>>>>>>>>>>> I am trying to understand the # symbol.>>>>>>>>>>>>>> At the end of this page http://code.kx.com/wiki/Reference/NumberSign&gt;&gt;&gt;&gt;&gt;&gt;&gt; there is a section talking about how to “get/set attributes” followed by two>>>>>>> examples but no explanation of what it means to “get/set attributes” using>>>>>>> #.>>>>>>>>>>>>>> Some code am looking at does this:>>>>>>>>>>>>>> update `g#sym from crossed>>>>>>>>>>>>>> where sym is a column in table crossed.>>>>>>> But in the particular example am looking at, this seems to have no impact>>>>>>> (i.e. returned table looks exactly the same).>>>>>>>>>>>>>> So, wondering how I figure out what “#” does in this situation, and>>>>>>> whether there are other documentation sources I should be looking at.>>>>>>>>>>>>>> Thanks in advance,>>>>>>>>>> –>>>>>

Submitted via Google Groups</alam.tahsin></attila.vrabecz></attila.vrabecz>

Thanks much all - have caught up on my reading to this point now so understand attributes.
Much appreciated,