Re: Help with asynchronously downloading file

2016-08-15 Thread dom96
Hello! You won't be able to get the progress of the download easily (unless you hack on the stdlib a bit). But as for downloading without blocking your GUI you've got two options I think: * Run `httpclient.downloadFile` (or `get`) in a different thread. * Use the `AsyncHttpServer` and poll

Re: Reading large files using Nim

2016-08-15 Thread Smaehtin
There's [FileStream](http://forum.nim-lang.org///nim-lang.org/docs/streams.html#newFileStream,string,FileMode) that can be used to read chunks of a file using [readData](http://forum.nim-lang.org///nim-lang.org/docs/streams.html#readData,Stream,Stream,pointer,int), for example

Re: Data structures in Nim equivalent to dataframe in R

2016-08-15 Thread darshanmeel
Thanks for reply. I want to use bit complicated stats. I want to include all types of columns not just floats. Anyway, I have further question. I was thinking that I will create a type and then I will use the Seq[type] to store the data. It is working fine. But I have another question. How can

Reading large files using Nim

2016-08-15 Thread darshanmeel
HI, I have ram around 8Gb and I want to read a file which is 16gb what is best way. I know I cant keep whole data in seq[] is there any alternate? Or it is better to read the data from file directly rather than reading it in seq and process. Also, is there a way such that I can keep 10% data

Re: Reading large files using Nim

2016-08-15 Thread OderWat
Maybe using [memfiles](http://forum.nim-lang.org///nim-lang.org/docs/memfiles.html) is a solution for your problem.

Re: thounghs about Nim language in godot

2016-08-15 Thread Angluca
Maybe godot should use nim intead gdscript, Like nim! Godot is a good game engine.

Re: db_odbc.nim some iterator has bug.

2016-08-15 Thread Angluca
Use odbc bind mssql database, Run db_odbc.nim's example. var theDb = open("localhost", "nim", "nim", "test") for x in theDb.fastRows(sql"select * from qqq"): echo x #qqq table name | id | 你好 xxx

Re: db_odbc.nim some iterator has bug.

2016-08-15 Thread jlp765
IIRC, fastRows should not be interupted (no good if you want to break the loop). The snippet you show doesn't give the full picture of how you are using the iterator. Can you show more example code?

Re: FastStack - dynamically resizable data structure optimized for fast iteration

2016-08-15 Thread mora
Gc is giving back memory to the OS if there is 1 MB unused. When I increased that to 8 MB (I don't remember the exact location, maybe allocate.nim, or something like that), it helped a lot in these kind of benchmarks.

Re: FastStack - dynamically resizable data structure optimized for fast iteration

2016-08-15 Thread mbaulch
My apologies. I only looked at seq and (mistakenly) assumed all were faster. On my (rather slow) laptop, the results of the ptr benchmark are refc: Sequence 2.70ms/iter List 2.99ms/iter FastStack 2.23ms/iter Boehm: Sequence 2.43ms/iter List

NBFVB

2016-08-15 Thread fifa17sara
Seeing that cost range varies routinely, you can opt for fifa globe cup lowest cost myfifa17coins fifa coins range within fifa globe cup dependable web-sites.You will be in search of dependable web-sites where by you may sincerely attain affordable seriously gold strongly moreover to easily.

Re: FastStack - dynamically resizable data structure optimized for fast iteration

2016-08-15 Thread Vladar
> With the Boehm GC, seq is faster With the Boehm GC **all three** are **slower** than with the default GC. Don't see a point of Boehm in such case. > Also, it's probably better to initialise FastStack to the same capacity as > the seq I'd better initialize the seq to the same capacity as

Re: Going to Haxe. Nim In Action book available.

2016-08-15 Thread flyx
> I have yet to seen a single example of anybody using namespacing in > functional programming. Then again, its relative "new" in PHP. rofl PHP is all but a functional programming language. I think you are confusing terms here, _functional_ programming languages are things like Haskell, Scheme

Re: Inheritance concerning events module

2016-08-15 Thread Arrrrrrrrr
The problem is that EventArgs is not defined as a ref object, it expects the struct itself not a pointer, so you have to [dereference](https://stackoverflow.com/questions/4955198/what-does-dereferencing-a-pointer-mean) it with `[]`: #ee.emit("TestEvent", sArgsRef)

Re: how to use Natural type?

2016-08-15 Thread _tulayang
I think this will be useful when you try to write an api about database. Natural (it mean >= 0) can represents primary key of mysql, and so on ...

Re: how to use Natural type?

2016-08-15 Thread Arrrrrrrrr
This is how natural is defined [http://nim-lang.org/docs/system.html#Natural](http://forum.nim-lang.org///nim-lang.org/docs/system.html#Natural) it is only a range. Ranges are typed checked both on runtime and compile time. It means that, if you try to use a non-natural number, it won't

Re: Going to Haxe. Nim In Action book available.

2016-08-15 Thread wulfklaue
> Oh! ECMAScript2015, ECMAScript7 and Node.js are very popular now. I think you > just not understand JavaScript. Took me 10 second to read and understand your code. I just never liked JS design for front end programming. Too much overuse of closures, bad error responses, inconsistencies in

db_odbc.nim some iterator has bug.

2016-08-15 Thread Angluca
> win10, nim 0.14.2 Will crash when I use fastRows and instantRows iterator. echo buf, rowRes,":",cCnt, ";" rowRes[colId-1] = $buf.cstring # line:341 db_odbc.nim result: 你好nil:19; Traceback (most recent call last) db_odbc.nim(342)

Re: Can't build asyncnet example on macosx

2016-08-15 Thread qqtop
@dom96 I would vote against sub-forums for different languages and rather suggest to anyone to use one of the translator plugins in modern browsers like: [https://addons.mozilla.org/id/firefox/addon/s3google-translator](https://addons.mozilla.org/id/firefox/addon/s3google-translator)/ or

how to use Natural type?

2016-08-15 Thread Kerp
I checked the documentation, i understand i think, that a natural is a range of a type specifically int in the example. But other than that i have no idea how to use it. I'm trying to use readbytes proc in system module but having a little difficulty understanding what i need to do to use the

Re: Going to Haxe. Nim In Action book available.

2016-08-15 Thread _tulayang
@wulfklaue Oh! ECMAScript2015, ECMAScript7 and nodejs are very popular now. I think you just not understand JavaScript. You should have a look at: import fs from "fs"; const stateNone = 0; const stateRead = 1; const stateWrite = 2; class IO {

Re: Can't build asyncnet example on macosx

2016-08-15 Thread _tulayang
@OderWat Don't mind.

Re: FastStack - dynamically resizable data structure optimized for fast iteration

2016-08-15 Thread mbaulch
With the Boehm GC, seq is faster in both of your benchmarks. The default ref-counting GC definitely has limitations. Also, it's probably better to initialise FastStack to the same capacity as the seq. 1000 vs 0 isn't really fair.

Re: thounghs about Nim language in godot

2016-08-15 Thread hcorion
Hey, that's cool! Has anybody started a binding for godot yet? Does someone want to start a git repo, maybe an official one? This guy: [https://github.com/ggVGc/nim-godot](https://github.com/ggVGc/nim-godot) seems to have started, but it was a year ago, before this whole push for these new

FastStack - dynamically resizable data structure optimized for fast iteration

2016-08-15 Thread Vladar
[https://github.com/Vladar4/FastStack](https://github.com/Vladar4/FastStack) FastStack is dynamically resizable data structure optimized for fast iteration over the large arrays of similar elements avoiding memory fragmentation (e.g., update and rendering cycles of a game scene). Judging by

Re: thounghs about Nim language in godot

2016-08-15 Thread Libman
This just in -- "[MORE PROGRAMMING LANGUAGES IN GODOT, WANT TO HELP?](https://godotengine.org/article/godot-getting-more-languages)" \-- > There currently is a lot of demand for additional languages, such as Java, > Haxe, Swift, Object Pascal, etc. **As Godot 2.2 will focus on new languages, >

Re: Best 2D game engine for nim?

2016-08-15 Thread Libman
([See also this thread about Nim and Godot.](http://forum.nim-lang.org///forum.nim-lang.org/t/2342/1#15292))