How to get just the first N bytes with httpclient ?

2022-08-06 Thread jrfondren
> Not sure which one is better. My solution's overly general (do you want to do anything other than check progress is onRecv?) and relatedly is not as nice for the caller (the desire to limit the content received has to be expressed twice, in `onRecv` and in the `substr`). The other solution,

How to get just the first N bytes with httpclient ?

2022-08-06 Thread jrfondren
> "contentProgress" is ... this is all correct. > The await in there is somehow receiving the output of "onRecv" and once > "onRecv"evaluates to true, the await stops waiting and the code continues, > granting you now have access to the body of the request. This is incorrect. The diff doesn't

Math library for renderers and GUIs

2022-08-06 Thread icedquinn
I've just finished putting together what should be a relatively complete but untested set of math code for game engines and GUIs: Proper testing will come somewhen. I'm sure there are some wrinkles.

Nim spotted in the wild on new Hacker News code education startup

2022-08-06 Thread icedquinn
we were also mentioned in one of the posts about Our Machinery dying; someone was asking about a nim port of the engine.

Where to start with creating direct Qt bindings?

2022-08-06 Thread elcritch
There’s It’s focused on QML objects but uses a direct C++ wrapper. See for example I’d start from there. If you had the basic suite of Qt types that go a long ways. Though it’d be cool if

string of compressed source code

2022-08-06 Thread shirleyquirk
The compiler doesn't like something, maybe it's the null bytes? I had to echo "echo \"Hello, World\"" | gzip | base64 Run #H4sIAAACA0tNzshXUPJIzcnJ11EIzy/KSVHiAgBv5X7/FA== import macros macro exec(s:static string):untyped = s.parseStmt

Threads dying, memory issues?

2022-08-06 Thread sekao
That must be a bug... [the docs](https://nim-lang.org/docs/tables.html#initTable) say that tables are initialized by default.

Threads dying, memory issues?

2022-08-06 Thread jasonfi
I've just fixed a memory issue caused by not initializing a table in an object with InitTable[. Isn't there a way for the Nim compiler to check for such cases?

Where to start with creating direct Qt bindings?

2022-08-06 Thread planetis
I would start by reading the bindings from other languages. Use any existing tool that provides API information in a simple format or if it doesn't exist resort to c2nim and manually edit the output.

string of compressed source code

2022-08-06 Thread chaemon
I tried your code. Actually string with F... was not failed. But unfortunetely, the other case of general string output by zip was failed. Your method of comment out by #[ ]# also failed... Moreover, I noticed these code with invalid char cannot paste to this thread.

How to get just the first N bytes with httpclient ?

2022-08-06 Thread void09
I also got this solution from someone in the community: Not sure which one is "better"

How to get just the first N bytes with httpclient ?

2022-08-06 Thread Isofruit
Not having fully understood the code, quick question about the code. I'm interpreting it like this so far: "contentProgress" is a field that represents a number of so-far received characters that gets incremented as the reply is being received. The events that update contentProgress trigger a c

Where to start with creating direct Qt bindings?

2022-08-06 Thread Clonk
You can try to use Otherwise you can take a look at as an example of a C++ wrapped library. Also you can look at which wrap some C++ STL utilities

string of compressed source code

2022-08-06 Thread exelotl
well, I thought it was a neat concept but I actually don't think it's necessary. It seems like you can just straight up put invalid unicode in a string literal. const s = """ ��� """ echo s Run works for me. I filled out the string with F.

Where to start with creating direct Qt bindings?

2022-08-06 Thread matkuki
True, but those are not direct, that's QML. I was thinking more in the line of something like: * NimForUE * cinterop * or something similar

Where to start with creating direct Qt bindings?

2022-08-06 Thread Clonk
There is (or for the non forked version) that already exists as a starting point.

string of compressed source code

2022-08-06 Thread chaemon
Wow! This method is fantustic! Thank you very much!

string of compressed source code

2022-08-06 Thread exelotl
If you need it to be in 1 file, maybe you could try something like this? #[ testing, put your dirty unprintable string here ]# const s = staticRead("main.nim")[3..49] echo s Run Output: testing, put your dirty unprintable string h

Threads dying, memory issues?

2022-08-06 Thread jasonfi
I've updated my code to make sure globals aren't used. I now get an exceptions. I've actually seen similar exceptions before, except when I was preparing to write the initial post in this thread. I didn't yet have stacktrace on for this one: double free or corruption (fasttop)

string of compressed source code

2022-08-06 Thread chaemon
Here is my code. It can be compiled. I want to compile with commented out part which is same operation in compile time. But I couldn't do it even though I put {.compiletime.} pragma... const libz = "libz.so.1" type Uint* = cuint Ulong* = culong Ulongf* = culong

Where to start with creating direct Qt bindings?

2022-08-06 Thread matkuki
Hi guys, Can anyone recommend what are the possibilities of creating direct `Qt C++` bindings with `Nim`? I would just like to know the principles of all the options (simple examples are of course very welcome) that are available. I would like to give it a go at creating something, but would l

string of compressed source code

2022-08-06 Thread jrfondren
Indeed, even when Nim compiles through C, Nim's compiletime happens before C's compiletime, so you have use `let` instead of `const`, etc., for imported values.

string of compressed source code

2022-08-06 Thread chaemon
Thanks! I implemented by 3. . But I noticed that importc seems not to be able to use in copile time with the error "cannot 'importc' variable at compile time; inflateEnd"