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.
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#.>> 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>>> 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,>> –>
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>> 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>> q)<br>> <br>> <br>> <br>> On Thu, Aug 1, 2013 at 4:16 PM, Charles Skelton <charlie> =<br>wrote:<br>>> btw, that timestored page erroneously states that there is no space =<br>overhead<br>>> 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>>> <br>>> http://code.kx.com/wiki/Cookbook/TemporalData<br>>> <br>>> <br>>> On Thu, Aug 1, 2013 at 4:58 PM, Ryan Hamilton <ryan> =<br>wrote:<br>>>> <br>>>> http://www.timestored.com/kdb-guides/table-attributes<br>>>> <br>>>> <br>>>> On Thu, Aug 1, 2013 at 3:43 PM, Tahsin Alam <alam.tahsin> =<br>wrote:<br>>>>> <br>>>>> (newbie alert!)<br>>>>> <br>>>>> I am trying to understand the # symbol.<br>>>>> <br>>>>> At the end of this page =<br>http://code.kx.com/wiki/Reference/NumberSign<br>>>>> there is a section talking about how to "get/set attributes" =<br>followed by two<br>>>>> examples but no explanation of what it means to "get/set =<br>attributes" using<br>>>>> #.<br>>>>> <br>>>>> Some code am looking at does this:<br>>>>> <br>>>>> 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. > >
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:> i think it should be understood as> 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> q)attr key a> 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>> q-internal stuff?>>>> q)d:s#1 12 30 44 100!acekt>> q)0N!d;>> 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#.>>>>>> 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>>>>>>>>> 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,>>>>>> –>>>
Submitted via Google Groups</alam.tahsin></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>> and<br>> (s#1 12 30 44 100)!acekt<br>> ?<br>> and what's the benefit of the first over the second?<br>> <br>> On Sat, Aug 3, 2013 at 11:40 AM, Attila Vrabecz<br>> <attila.vrabecz> wrote:<br>>> i think it should be understood as<br>>> 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>>> q)attr key a<br>>> 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>>>> q-internal stuff?<br>>>> <br>>>> q)d:s#1 12 30 44 100!acekt<br>>>> q)0N!d;<br>>>> 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>>>>> <br>>>>> Might also like to view<br>>>>> <br>>>>> http://kx.com/q/d/q.htm<br>>>>> http://code.kx.com/wiki/JB:QforMortals2/tables#Attributes<br>>>>> 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. > >
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> " aaabbbcc"> 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>> and>> (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:>>> i think it should be understood as>>> 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>>> q)attr key a>>> 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>>>> q-internal stuff?>>>>>>>> q)d:s#1 12 30 44 100!acekt>>>> q)0N!d;>>>> 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#.>>>>>>>>>> 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>>>>>>>>>>>>>>> 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,>>>>>>>>>> –>>>>>
Submitted via Google Groups</alam.tahsin></attila.vrabecz></attila.vrabecz>