Forum Replies Created

Page 1 of 8
  • davidcrossey

    Member
    March 19, 2024 at 11:01 am in reply to: DS_EXEC_ANALYTIC Template

    Thanks for sharing Leah!

  • davidcrossey

    Member
    March 19, 2024 at 11:01 am in reply to: Code Formatting

    Thanks for sharing @dhodgins.

    Whilst I don’t necessarily agreed with all of the points based on personal preference, I do agree with the overall theme of keep it simple and consistent – both for readability and performance.

    I find it’s a balancing act, for example on the projection performance, one may prefer a more tacit style approach as it can be cleaner/easier to read right-to-left the following expression:

    aggFunc projFunc[var1;] calcFunc

    vs

    aggFunc projFunc[var1;calcFunc]

    Especially if calcFunc has a longer definition and if the small performance overhead justifies it.

    Your blog post and notes on style can be eye-opening and help to develop good code hygiene over the long term.

  • davidcrossey

    Member
    November 1, 2023 at 12:00 am in reply to: Kdb+ Community Edition

    Hi ,

    Check out the downloads page here for more information: Download kdb+ Free Personal Edition | KX

  • davidcrossey

    Member
    September 20, 2023 at 12:00 am in reply to: Conda package update?

    I can’t comment in an official capacity, but I’m sure there will continue to be conda package releases into the future.

  • davidcrossey

    Member
    September 15, 2023 at 12:00 am in reply to: Conda package update?

    Hi Dan,

    There was a recent release, if you try updating now you should see the following version:

     

    Regards,

    David

  • davidcrossey

    Member
    September 13, 2023 at 12:00 am in reply to: Web interface, JSON

    Try enlisting

     

     

     

  • davidcrossey

    Member
    September 12, 2023 at 12:00 am in reply to: Web interface, JSON

    A quick solution could be utilise something like wget to download the json data instead.

    Server

    $ q -p 5000 -q 
    q)show data:([]a:1+til 10;b:10?`4) 
    a b 
    ------- 
    1 milg 
    2 igfb 
    3 kaod 
    4 bafc 
    5 kfho 
    6 jecp 
    7 kfmo 
    8 lkkl 
    9 kfif 
    10 fglg q
    )`:html/test.json 0: enlist .j.j data

    Client

    $ wget http://localhost:5000/test.json 
    --2023-09-12 10:46:40-- 
    http://localhost:5000/test.json Resolving localhost (localhost)... 
    127.0.0.1 Connecting to localhost (localhost)|127.0.0.1|:5000... connected. 
    HTTP request sent, awaiting response... 200 OK 
    Length: 193 [application/json] 
    Saving to: test.json test.json 100%[====================================================>] 193 --.-KB/s in 0s 2023-09-12 10:46:40 (61.1 MB/s)- test.json saved [193/193] 
    $ q -q 
    q)first .j.k each read0 `:test.json 
    a b 
    --------- 
    1 "milg" 
    2 "igfb" 
    3 "kaod" 
    4 "bafc" 
    5 "kfho" 
    6 "jecp" 
    7 "kfmo" 
    8 "lkkl" 
    9 "kfif" 
    10 "fglg"

     

  • davidcrossey

    Member
    September 12, 2023 at 12:00 am in reply to: Web interface, JSON

    You can do this in one call without saving the table to the filesystem from the client machine, and without needing to tweak the .z.ph (or .h.val) handlers

     

    Note, if you run the same URL via the brower you’ll see the JSON there, it won’t automatically download like CSV files though.

     

    Hope this helps, in lieu of more community suggestions

  • davidcrossey

    Member
    September 12, 2023 at 12:00 am in reply to: What’s new in KX Dashboards 2.1.0

    Thanks for sharing the latest from KX Dashboards Kieran!

  • davidcrossey

    Member
    July 31, 2023 at 12:00 am in reply to: Send a mail in kdb

    This is a duplicate / cross-post which has already been answered on StackOverflow

  • davidcrossey

    Member
    July 24, 2023 at 12:00 am in reply to: Exporting CSV file

    Note, this was just a quick attempt:

    q)testfile:flip {(1#x),"t",'/:1_x} csv vs' csv 0: t save `:testfile.csv

     

  • davidcrossey

    Member
    July 24, 2023 at 12:00 am in reply to: Exporting CSV file

    Hi ,

    Your question isn’t very clear. Do you want to export a table to a csv, or a table with column headers that include tabs?

    Have a look at 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)

  • davidcrossey

    Member
    July 24, 2023 at 12:00 am in reply to: Exporting CSV file

    I’m not following your request. I read it as follows, which I don’t think is what you mean?

     

    q)t:([]c1:`a`b`c;c2:1 2 3) 
    q){cc:count cols t;x:csv 0: x;(1#x),enlist[(csv sv cc# enlist enlist "t")],1_x} 
    t "c1,c2" "t,t" "a,1" "b,2" "c,3" 
    
    q)(count[cols t]#"*";enlist csv) 0: {cc:count cols t;x:csv 0: x;(1#x),enlist[(csv sv cc# enlist enlist "t")],1_x} 
    t c1 c2 
    ----------- 
    ,"t" ,"t" ,"a" ,"1" ,"b" ,"2" ,"c" ,"3"

     

    If you prepare you csv data and read from disk, you’ll recreate a table without needing to add tabs:

     

    q)csv 0: t “c1,c2” “a,1” “b,2” “c,3″ q)(count[cols t]#”*”;enlist csv) 0: csv 0: t c1 c2 ——— ,”a” ,”1″ ,”b” ,”2″ ,”c” ,”3″

     

    Can you provide a before and after example of what you mean?

  • davidcrossey

    Member
    July 24, 2023 at 12:00 am in reply to: Information needed for Kdb Insights Personal Edition License

    Hi Cristian,

    A bunch of questions that might help us guide you;

    • What version of JuypterQ do you have?
    • What format is your licence? i.e. k[x,4,c].lic?
    • What flags have you got in your Insights lic? (Can you share your banner information here?)
    • What are your QLIC and QHOME env var pointing to?
    q).z.l "" "2024.01.13" "2024.01.13" ,"1" "insights.lib.embedq insights.lib.pykx insights.lib.sql insights.lib.qlog ins.. ,"0" ,"0" "dcrossey..." ,"0" 
    q)" " vs .z.l 4 "insights.lib.embedq" "insights.lib.pykx" "insights.lib.sql" "insights.lib.qlog" "insights.lib.kurl" "insights.lib.objstore" "insights.lib.bigquery" "insights.lib.restserver"

    Have you installed your licence as per: Install kdb Insights Core – kdb products (kx.com) ?

  • davidcrossey

    Member
    July 19, 2023 at 12:00 am in reply to: Can’t recognise khpun, khp functions…

    Yes it can be used on w64, however there are differences in terms of the libraries needed for linking: kdb/w64 at master KxSystems/kdb (github.com)

    This repo: kxcontrib/capi (github.com) only supports Linux based environments. You could fork it and add Windows support yourself, or a more straight forward solution would be to setup WSL2 with a *nix distribution (such as Ubuntu), and use that environment for your local development – works with VS Code.

Page 1 of 8