wbt_nim: A Nim API for the WhiteboxTools geospatial data analysis library

2020-06-24 Thread jlindsay
I just finished writing and publishing [wbt_nim]([https://github.com/jblindsay/wbt_nim](https://github.com/jblindsay/wbt_nim)) a Nim-based API for the [WhiteboxTools]([https://jblindsay.github.io/wbt_book/preface.html](https://jblindsay.github.io/wbt_book/preface.html)) geospatial data

Re: A pure Nim k-d tree

2020-05-01 Thread jlindsay
Thanks, I'll look into it.

Re: A pure Nim k-d tree

2020-05-01 Thread jlindsay
No, you're right, it allows for it to be adjusted at compile time. I don't think that I've ever seen a k-d tree library that allows for K to be set at runtime. I can't think of a use-case for this. For one, I would think it would come at a large performance hit.

Re: A pure Nim k-d tree

2020-05-01 Thread jlindsay
There is a genericK branch on the GitHub page. It's fully operational, but I am experiencing challenges with the code. For one, it seems to kill VS Code's ability (nimsuggest, actually, I suspect) to work with the code. And it is significantly slower, which I can't quite understand. I had

Re: A pure Nim k-d tree

2020-05-01 Thread jlindsay
I can't say that I'm familiar with an UncheckedArray. Is there any documentation for it? I can't seem to find any after a quick search.

Re: A pure Nim k-d tree

2020-04-11 Thread jlindsay
Well that was embarrassing. I've fixed the 'I' 'e' spelling throughout and committed the changes. Thank you for noticing that. As a Canadian, I can't approve the 'or' over 'our' spelling however! All the English speakers in the UK, Canada, Australia, New Zealand, South Africa, etc. wouldn't be

Re: A pure Nim k-d tree

2020-04-11 Thread jlindsay
@b3liever Thanks for the catches. I've just pushed the changes now.

Re: A pure Nim k-d tree

2020-04-11 Thread jlindsay
It seems to work within VS Code for me, with autocomplete working as expected. That said, I'm not sure if it would work with others. The only generic parameter in it is with the data associated with points.

Re: A pure Nim k-d tree

2020-04-11 Thread jlindsay
I'm not sure if it works with nimsuggest. I'm still just experimenting with Nim and am not all that knowledgable of it's larger ecosystem. Is there a way that I can check if it works with nimsuggest? I've seen your RTree implementation and it's quite impressive!

A pure Nim k-d tree

2020-04-11 Thread jlindsay
I have created a pure Nim k-d tree implementation ([https://github.com/jblindsay/kdtree)](https://github.com/jblindsay/kdtree\)). It's rather flexible compared with many existing k-d tree libraries, allowing for single and multiple nearest neighbour searches, within-radius (circular search

Re: Nim Syntax ''Skins''

2018-01-30 Thread jlindsay
@dom96 Thank you very much for your reply. Having an open and transparent pathway to 1.0 is going to be so important for the community and for fostering adoption. Thank you for all of your efforts. I just had my new Nim book arrive in the mail this week. Can't wait to read it!

Re: Nim Syntax ''Skins''

2018-01-23 Thread jlindsay
@dom96, Very interesting! Any hints that you may provide on the timeline for the 1.0 release? I know that there are a lot of people who are waiting until 1.0 hits before seriously looking at Nim and so this is quite a big deal. If it is coming very soon then that could be quite interesting. Is

Re: Nim in Action is going into production!

2016-11-21 Thread jlindsay
Congratulations Dom! It's quite an achievement both personally and for the Nim community, which will undoubtedly benefit greatly from having a current book focussed on the language. I'm very much looking forward to receiving my copy in the mail this winter and thanks for putting the effort into

Re: Best way to convert sequence of bytes to uint32

2016-11-20 Thread jlindsay
@Araq, wow, moving the code to a 'main' proc rather than 'when isMainModule' made the compiler optimize away the for loop entirely. I wasn't expecting that to happen :) .

Re: Best way to convert sequence of bytes to uint32

2016-11-20 Thread jlindsay
Stefan, you're absolutely right to mention this. In fact, my original testing was simply running the program from Atom using the Script add-on...so who knows how it is configured to run in this case. So I ran it from the command line using nim c --run -d:release --verbosity:0

Re: Best way to convert sequence of bytes to uint32

2016-11-20 Thread jlindsay
@Krux02, yes, the data that I will be reading will vary in endianness, which adds an extra complication for this. In the case where the file's endianness does not match the machine's, I intended to perform byte swapping. @Araq, I'm a little surprised by this. I had done a quick performance

Re: Best way to convert sequence of bytes to uint32

2016-11-19 Thread jlindsay
Ar, I believe that I do need the seq since I am reading the bytes in from a file. lucian, your solution looks quite interesting. I'll have to explore this option further. Thanks.

Re: Best way to convert sequence of bytes to uint32

2016-11-18 Thread jlindsay
Yep, that's it. You did it! It seems really strange to me that that empty [] needs to be placed after the cast to dereference it. Shouldn't s be dereferenced by the [p] within the cast? Anyhow, I'm very thankful to have a solution and am grateful for all your time spent finding it.

Re: Best way to convert sequence of bytes to uint32

2016-11-18 Thread jlindsay
Ha! Looks like we're both experimenting with the same solutions unsuccessfully. I'm sure someone out there knows what we're doing wrong :). Anyhow, thank you very much for giving it a go.

Re: Best way to convert sequence of bytes to uint32

2016-11-18 Thread jlindsay
Thanks for your reply Stefan. Yes, my code works fine. It's just that I have to run it many millions of times and so I was concerned that it may not be the most efficient means of accomplishing the conversion. If there is a standard one-operation method that I'm not aware of, then I thought it

Best way to convert sequence of bytes to uint32

2016-11-18 Thread jlindsay
Just as the title suggests, what is the recommended way of converting a sequence of four uint8's into a uint32? Or even more specifically, how would you convert four consecutive bytes within a larger sequence into a uint32? At the moment, I'm doing this: var offset = 0 var x =

Re: Nim in Action is now available!

2016-08-01 Thread jlindsay
have had to purchase it through Manning to do that instead. January seems like a long time to wait for the hard copy to be shipped! Thanks. jlindsay

Re: Nim in Action is now available!

2016-08-01 Thread jlindsay
I think I've answered my own question. I saw on the Manning webpage: > Q: Can I buy a MEAP anywhere else? > > No. Currently, MEAPs are available exclusively at manning.com. So looks like I'll have to wait until January. Oh well, it'll be a nice New Year surprise.