Re: Library isolation (diamond dependencies)

2019-02-24 Thread CavariuX
Hi, NimGL developer here. @chr This is an interesting issue but you should have no problems if you are not import stb/image from nimgl modules since that way it would not be compiling the stb_image twice. If you need to have both for whatever reason I could add a definition to toggle the compil

Re: How to speed up the upload of a big file with asynchttpserver!

2019-02-24 Thread mrhdias
Hi @dom96, I did an experiment (see [https://github.com/mrhdias/EnigmaHTTPServer](https://github.com/mrhdias/EnigmaHTTPServer)) to decode the multipart/data request body by doing the cache of the body. I do not know if it's the best approach, but it works and it's fast for large files. But for

Re: Noob question: proper way to read binary files byte by byte

2019-02-24 Thread cblake
You can also use `memfiles`. There writing/reading is the same as accessing memory. Besides being possibly simpler presenting an "as if you already read the whole file into a buffer" view, it may also be much more efficient, especially for byte-at-a-time operation where other APIs might do a lot

Problem with templates in multiple files

2019-02-24 Thread cdunn2001
My code used to work. **msgpack4nim** was updated for nim-0.19.4, and now my code fails. But I don't think it's a bug in **msgpack4nim** , and I don't think I'm doing anything unexpected. I think there might be a fundamental problem with how Nim handles templates across multiple files now. [htt

Re: [Review request] for rosetta code challenge "Lexical Analyzer"

2019-02-24 Thread greenfork
`lexbase` is totally the case! In the challenge it is also suggested to use one variant as a "raw" version and one with a lexing support from the language. I also wrote a version which reads one character at a time and it became very dirty very fast as well as it was hard to debug it, so the 2nd

Re: Noob question: proper way to read binary files byte by byte

2019-02-24 Thread r3c
[check this out](https://bitbucket.org/DraganJanushevski/q3bsp/src/cee3bf04b30414672939c0ffde25011ec026a822/src/coreBSP/bspfile.nim#lines-18)

Re: Noob question: proper way to read binary files byte by byte

2019-02-24 Thread mashingan
use [atEnd](https://nim-lang.org/docs/streams.html#atEnd%2CStream) to check whether it's ended or not and use [getPosition](https://nim-lang.org/docs/streams.html#getPosition%2CStream) for its current position. import os, streams var fs = newFileStream(paramStr(1), fmRead)

Re: [Review request] for rosetta code challenge "Lexical Analyzer"

2019-02-24 Thread leorize
Great work! Personally I think you should build one using `lexbase` instead of `re` as `re` seems to be too big just for this (the C version is written in plain C without `re`). Actually if I could find sometime I'd try to build a `lexbase` version as it seemed fun :)

Noob question: proper way to read binary files byte by byte

2019-02-24 Thread vimal73700
Hi all, What is the best way to read a binary file byte by byte? import os, streams var fs_pos = 0 var fs = newFileStream(paramStr(1), fmRead) while true: var one_char = fs.readChar() echo one_char if (one_char == '\0'): echo "breaking

Online Nim Compiler

2019-02-24 Thread aditya12
https://www.welookups.com/php/php_exception.html

Qt Creator 4.9 Beta has Nim support (code completion)

2019-02-24 Thread zarican
Change log in Qt Creator 4.9 Beta has an item Nim Support *Added code completion based on `NimSuggest` Run Although it seems limited to code completion, it is still good news for Nim's popularity. Change log [here](https://code.qt.io/cgit/qt-creator/qt-crea

Re: Library isolation (diamond dependencies)

2019-02-24 Thread Araq
Having thought about this more, I think we can simply use the checksum of the C file in order to detect duplicates and then link only one version in the end...

defining `==` breaks Option

2019-02-24 Thread drewp
import options type Base = ref object of RootObj A = ref object of Base B = ref object of Base opt: Option[A] proc `==`(x: A, y: B): bool = false proc initA(): A = new result proc initB(): B = new result result.opt