Advanced Capstone 3.6

Hello! I have this piece of code for the exercise 3.6: 

hdbH“.z.pg:{[query] api:.perm.users[.z.u][`api]; $[api~`all;value query;api~(.perm.parseQuery[query]);value query;`notAuthorized]}” ?Scratchpad

However, when I test it, I only fail one test - I am not sure if it is because of the .z.pg definition, or due to any previous mistake (Although I checked that my tables should be properly keyed with the required meta and so on). I am attaching a screenshot as well.

Hi  !

I’ve ran your code and your definition seems to work fine so I’m thinking there might be an issue elsewhere in the notebook. Can you download your project.md file and send it to me at mmcparland@kx.com so I can have a closer look?

Thanks,

Megan

Dear Megan,

 

Thank you! I just sent the code. If I need to provide anything else, please let me know!

Hi ,

I believe the error lies in question 2.1 when you are asked to load in the race day data.

If you take a look at the raceDay.csv file (screenshot below) you will see the entries are separated by commas. To load this in as a table this indicates that our delimiter needs to be ’ , ’ 

Handling CSVs in kdb+ | A tour of the q programming language | Documentation for kdb+ and the q programming language - Kdb+ and q documentation (kx.com)

For the file path then we use _hsym - _creates a file path out of a symbol

and then the file path as used before:

$getenv[AX_WORKSPACE],“/AdvancedCapstone.Data/raceDay.csv”

Let me know if this works!

Megan

 

Dear Megan,

Thank you for your help. I tried implementing your suggestions (below is the command line I used for loading the csv file for 2.1). However, I still get the following test error for 3.6 (although this time, it is only one error out of 4. Moreover, I still get errors for 2.5, even though the execution time is reduced by more than half):

show raceDay:(“STJSFS”; enlist “,”) 0: hsym </span><span class='"cm-keyword"'>$</span><span class='"cm-keyword"'>getenv</span>[<span class='"cm-symbol"'>AX_WORKSPACE],“/AdvancedCapstone.Data/raceDay.csv”
exercise3.6 Fail “fiauser can run one function” “sensor”