cancel
Showing results for 
Search instead for 
Did you mean: 

Advanced Capstone 3.6

anduhau
New Contributor II

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

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

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.

4 REPLIES 4

megan_mcp
Community Manager Community Manager
Community Manager

Hi @anduhau !

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 🙂

anduhau
New Contributor II

Dear Megan,

 

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

megan_mcp
Community Manager Community Manager
Community Manager

Hi @anduhau,

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 prog...

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

 

anduhau
New Contributor II

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):

Spoiler
show raceDay:("STJSFS"; enlist ",") 0: hsym `$getenv[`AX_WORKSPACE],"/AdvancedCapstone.Data/raceDay.csv"
Spoiler
exercise3.6 Fail "fiauser can run one function" "sensor"