I have successfully played with the demo smart meter script on a Mac, but trying to run the buildsmartmeterdb.q script from http://code.kx.com/wsvn/code/cookbook_code/tutorial/ on a Windows 10 machine is throwing the following error:
k){ON!X Y}
'{
@
“q”
“genprofile:{[id]”
the genprofile function appears fine to me in the script, not sure what’s going on. Any help would be appreciated.
Can you attach the script?Looks like a syntax error when loading it in…On Wed, Nov 23, 2016 at 5:47 pm, stevekdbq@gmail.com wrote:Hello,I have successfully played with the demo smart meter script on a Mac, but trying to run the buildsmartmeterdb.q script from http://code.kx.com/wsvn/code/cookbook_code/tutorial/ on a Windows 10 machine is throwing the following error:k){ON!X Y}'{@“q”"genprofile:{[id]"the genprofile function appears fine to me in the script, not sure what’s going on. Any help would be appreciated.Stece–
Something strange… 1.q is the genprofile func taken from the svn repo, 2.q is the same func from your script;In your case space seems to be “\302\240” - $ unicode U+00A0http://unix.stackexchange.com/questions/272161/octals-302-240-together-seem-to-correspond-to-non-breaking-spaceWhat text editor are you using?q)read0:1.q"genprofile:{[id]"," "" /- get the profile for the id, given the starting point "" p:currentusage[id]+profile[baseusage[id;0];gradients[baseusage[id;1]]];"," "" /- store the usage"" currentusage[id]:last p;"," "" /- return the profile, drop the last value"" -1 _ p}"q)read0:2.q"genprofile:{[id]“”\302\240"“\302\240/- get the profile for the id, given the starting point”“\302\240p:currentusage[id]+profile[baseusage[id;0];gradients[baseusage[id;1]..”\302\240"“\302\240/- store the usage”“\302\240currentusage[id]:last p;”“\302\240"”\302\240/- return the profile, drop the last value""\302\240-1 _ p}"q)________________________________________From: personal-kdbplus@googlegroups.com [personal-kdbplus@googlegroups.com] on behalf of stevekdbq@gmail.com [stevekdbq@gmail.com]Sent: 23 November 2016 23:27To: Kdb+ Personal DevelopersSubject: Re: [personal kdb+] buildsmartmeterdb.q script error on WindowsCopied from the cookbook, but attached here.On Wednesday, November 23, 2016 at 6:12:29 PM UTC-5, Michael Keenan wrote:Can you attach the script?Looks like a syntax error when loading it in…On Wed, Nov 23, 2016 at 5:47 pm, stev...@gmail.com <stev…> wrote:Hello,I have successfully played with the demo smart meter script on a Mac, but trying to run the buildsmartmeterdb.q script from http://code.kx.com/wsvn/code/cookbook_code/tutorial/ on a Windows 10 machine is throwing the following error:k){ON!X Y}'{@“q”"genprofile:{[id]"the genprofile function appears fine to me in the script, not sure what’s going on. Any help would be appreciated.Stece–