# Advanced Capstone section 3.1 and 3.3

**URL:** <https://forum.kx.com/t/advanced-capstone-section-3-1-and-3-3/12248>\
**Category:** Community Support\
**Created:** [November 1, 2021, 11:36pm UTC](https://forum.kx.com/t/advanced-capstone-section-3-1-and-3-3/12248 "2021-11-01T23:36:00Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![User7](https://avatars.discourse-cdn.com/v4/letter/u/7ea924/32.png) [@User7](https://forum.kx.com/u/User7)\
**Post date:** [November 1, 2021, 11:36pm UTC](https://forum.kx.com/t/advanced-capstone-section-3-1-and-3-3/12248/1 "2021-11-01T23:36:00Z")

</div>

Section 3.1 requires us to&nbsp;“Load f1 database to remote process (port=5099), save handle to variable called `hdbH`”. I know that the proper command to save the connection handle to port 5099 is:&nbsp;

hdbH:hopen `::5099

but the verbiage “Load f1 database” seems to be throwing me off. I’ve tried hdbH"\l ." but this attempt was futile. Any hint or resource would be greatly appreciated.&nbsp;

&nbsp;

For section 3.3, if anyone could point me to a place where I could find the syntax necessary to pass a table to a handle, it would also be greatly appreciated. I’ve been looking through the advdev1 modules.&nbsp;

&nbsp;

Thanks!

Andrew

---

<div class="post-metadata">

**Author:** ![davidcrossey1](https://avatars.discourse-cdn.com/v4/letter/d/e68b1a/32.png) [@davidcrossey1](https://forum.kx.com/u/davidcrossey1)\
**Post date:** [November 2, 2021, 5:35am UTC](https://forum.kx.com/t/advanced-capstone-section-3-1-and-3-3/12248/2 "2021-11-02T05:35:00Z")

</div>

Hi Andrew,

For 3.1, you could do this in a few ways.

- Use the Remote Scratchpad to connect to the remote process and load the HDB as you have been doing for other sections;
- Send a system command to the remote process&nbsp;using sync/async to load the HDB (similar to above)

&nbsp;Note, the “remote” process is on the same system as your primary workspace process. Using system “l .” might not work as this is a relative path - you need to use the full path.

For section 3.3,&nbsp; you need to&nbsp; **set** the table. Pseudo logic would be neg[hdbH] ({function};data), where you need to set the data in the function executed on the remote process.

Hope this helps!

Kind regards,

David

---

<div class="post-metadata">

**Author:** ![User7](https://avatars.discourse-cdn.com/v4/letter/u/7ea924/32.png) [@User7](https://forum.kx.com/u/User7)\
**Post date:** [November 4, 2021, 10:32pm UTC](https://forum.kx.com/t/advanced-capstone-section-3-1-and-3-3/12248/3 "2021-11-04T22:32:00Z")

</div>

Hi David (and anyone else who might be reading this)

David- Thank you for this. It was very helpful and thoroughly appreciated. I actually have all quizzes working except for 3.3 now. I’ve clearly loaded the .perm.users table to my remote process on port 5099, and I know this because the functionality for some of the other quizzes requires .perm.users to exist on this process, and those quizzes are all passing. However, when I go to my remote scratchpad (port 5099), and run “tables”, .perm.users does not show up, hence why I am failing quiz 3.3. When I define a simple table (t:( a: 1 2 3; b: 4 56) on my remote scratchpad, it appears when I run tables. My best guess is that .perm.users is a namespace variable, and that there must be a special method used to load it into the remote scratchpad working directory. I’ve toyed around with “set” to no avail. I hope this was all clear. Please let me know what you think, and if I need to clarify anything.&nbsp;

---

<div class="post-metadata">

**Author:** ![davidcrossey1](https://avatars.discourse-cdn.com/v4/letter/d/e68b1a/32.png) [@davidcrossey1](https://forum.kx.com/u/davidcrossey1)\
**Post date:** [November 4, 2021, 11:44pm UTC](https://forum.kx.com/t/advanced-capstone-section-3-1-and-3-3/12248/4 "2021-11-04T23:44:00Z")

</div>

Hi Andrew,

As&nbsp; **users** is in the&nbsp; **.perm** namespace you need to call tables as such:&nbsp; **tables `.perm**

See here for more:&nbsp;tables  Reference  kdb+ and q documentation - Kdb+ and q documentation (kx.com)

3.3 only requires you to define .perm.users on the remote as per the pseudo-logic provided above. What are you seeing that is failing?

Kind regards,

David

---

<div class="post-metadata">

**Author:** ![User7](https://avatars.discourse-cdn.com/v4/letter/u/7ea924/32.png) [@User7](https://forum.kx.com/u/User7)\
**Post date:** [November 5, 2021, 9:02pm UTC](https://forum.kx.com/t/advanced-capstone-section-3-1-and-3-3/12248/5 "2021-11-05T21:02:00Z")

</div>

Hi David. Thanks for replying. I really appreciate your patience with this. I’ve used that pseudo logic (modified to be working kdb logic) to pass functions and data across to my remote process.

The logic I used to pass the data for the .perm.users table across to the remote process is:

neg[hdbH]“.perm.users:([username:`$()] password:(); api:`$())”  
neg[hdbH]“.perm.users”  
neg[hdbH]".perm.addUser:{[usr;pwd;api] `.perm.users upsert (usr; pwd; api);}" neg[hdbH](`.perm.addUser;`jmurphy;"bahrain22";`all)  
neghdbH  
neghdbH  
neghdbH  
neghdbH

I am passing all quizzes except for 3.3 and I am seeing the following error:

exercise3.3 Fail “.perm.users should exist on HDB process” “”

&nbsp;

Just touching on the points from my last post, this is odd because when I go to my remote scratchpad and run&nbsp;

.perm.users

the output is the correct table. Similarly, on my remote scratchpad, when I run

tables`.perm

`users is show in the output, so the table definitely exists.&nbsp;

---

<div class="post-metadata">

**Author:** ![davidcrossey1](https://avatars.discourse-cdn.com/v4/letter/d/e68b1a/32.png) [@davidcrossey1](https://forum.kx.com/u/davidcrossey1)\
**Post date:** [November 7, 2021, 7:08am UTC](https://forum.kx.com/t/advanced-capstone-section-3-1-and-3-3/12248/6 "2021-11-07T07:08:00Z")

</div>

Hi Andrew,

In the line just before 3.3 you will define .perm.users on your local HDB process. In 3.3 you should send this entire table across the handle to the remote process, instead of defining and adding each user to it.

I’m not sure of the test case implementation but I think it’s comparing the local and remote .perm.user tables.

Tip - you can complete 3.3 in a single async call; i.e. send the entire .perm.users table from local to remote and set.

Hope this helps

David

---

<div class="post-metadata">

**Author:** ![Robert4](https://avatars.discourse-cdn.com/v4/letter/r/46a35a/32.png) [@Robert4](https://forum.kx.com/u/Robert4)\
**Post date:** [November 25, 2021, 11:13am UTC](https://forum.kx.com/t/advanced-capstone-section-3-1-and-3-3/12248/7 "2021-11-25T11:13:00Z")

</div>

Hi,

I am just wondering if you resolved your issue for 3.3, as I am failing it for the same reason. When I set the table on the remote process and run “tables” or “tables`.perm” the table does not seem to exist, however when I manually create the table on the remote process the table exists but the test for 3.3 still fails.

Thanks,

Robert

---

<div class="post-metadata">

**Author:** ![Michaela](https://avatars.discourse-cdn.com/v4/letter/m/f4b2a3/32.png) [@Michaela](https://forum.kx.com/u/Michaela)\
**Post date:** [November 25, 2021, 11:21am UTC](https://forum.kx.com/t/advanced-capstone-section-3-1-and-3-3/12248/8 "2021-11-25T11:21:00Z")

</div>

Adding the test case to help here:

```
feature exercise3.3 before .test.randomHandle:hopen `::5099:twilson:letmewinonce; should .perm.users should exist on HDB process expect .perm.users~.test.randomHandle".perm.users"
```

---

<div class="post-metadata">

**Author:** ![User7](https://avatars.discourse-cdn.com/v4/letter/u/7ea924/32.png) [@User7](https://forum.kx.com/u/User7)\
**Post date:** [November 30, 2021, 9:02pm UTC](https://forum.kx.com/t/advanced-capstone-section-3-1-and-3-3/12248/9 "2021-11-30T21:02:00Z")

</div>

Hey Robert.&nbsp;

I haven’t figured it out yet. Had the same issue you were speaking of.

Were you able to resolve it?

---

<div class="post-metadata">

**Author:** ![Robert4](https://avatars.discourse-cdn.com/v4/letter/r/46a35a/32.png) [@Robert4](https://forum.kx.com/u/Robert4)\
**Post date:** [December 1, 2021, 2:05pm UTC](https://forum.kx.com/t/advanced-capstone-section-3-1-and-3-3/12248/10 "2021-12-01T14:05:00Z")

</div>

Hi Andrew,

I defined the table on the remote process in a similar way to what you had done above when manually creating the table. Then instead of adding each user, I passed the table created on the local process to the remote process and assigned the values to the table created on the remote process in a single async call. That way the table seems to be populated correctly and recognised in the test for 3.3.
