KX Community

Find answers, ask questions, and connect with our KX Community around the world.

Home Forums KX Academy Advanced Capstone 3.1 and 3.2

  • Advanced Capstone 3.1 and 3.2

    Posted by anduhau on October 30, 2023 at 12:00 am

    Hello! I wanted to ask, firstly, if this is the correct solution for loading the f1 database into the remote server for question 3.1… I am asking because there is no test to check at the end of the 3rd task.

     

    hdbH : h : hopen 5099 
    f1data : get `:../f1 
    hdbH (set; `f1data; f1data) 
    hdbH `f1data

     

    In parallel, I have more questions about 3.2. Firstly, the .Q.sha1 function does not work on my column string (I have checked that I work with string columns, and not with symbol columns). Even if I write .Q.sha1 “Hello world!” I get an error, therefore I use the .Q.fc function and retrieve the following table (screenshot attached – the api column is also in the table, even though not seen from the picture). Moreover, why were we advised to check the Advanced IPC Module before attempting this exercise, I do not believe this has anything to do with IPC (we are even told to save the variable locally – only for 3.3 we need to load the table into the remote server). In the other case, I am wrong in my thinking, but I have no idea where. The code for 3.2 is shown below

     

    show table : read0`:../AdvancedCapstone.Data/users.txt 
    show myTable : ([user : ()]; password : (); api : ())  
    
    addToUsers : {[newStr] words : "t" vs newStr;     
          if[[words[0] like "user"] = 0b; `myTable insert (`$words[0]; `$words[1]; `$words[2])];     
          } 
    addToUsers each table 
    myTable : update string user, string password, string api from myTable 
    .perm.users : update .Q.fc password from myTable 
    show .perm.users

     

    anduhau replied 2 months ago 2 Members · 2 Replies
  • 2 Replies
  • laura

    Administrator
    October 30, 2023 at 12:00 am

    Hi,

    Can you send me a screenshot of what you mean? There is no combination required.

    You can either use the word

    each

    or the single quotation mark

    '

    between .Q.sha1 and password. The backtick is not correct here.

    No extra libraries are required, these are in built functions within q.

    Hope this helps,

    Laura

     

  • anduhau

    Member
    October 30, 2023 at 12:00 am

    Dear Laura,

     

    Thank you for your help! It works now… I commented out the first two lines at some point through all the checks – this is my mistake.

    Thank you for all the help!

Log in to reply.