You can write:
const data = [0xFD.byte, 0x10, 0x20, 0x30]
or
const data = [0xFD.uint32, 0x10, 0x20, 0x30]
It will inherit size and type automatically.
Initial problem is:
# Error: type mismatch: got (Array constructor[0..3, int]) but expected
'array[0..3, byte]'
const data: array[4,byte] = [0xFD, 0x10, 0x20, 0x30]
Because typing _'u8_ or _'u32_ or similar is no fun for large const arrays, I
thought let's use some sort
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
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
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
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 in
Maybe using
[memfiles](http://forum.nim-lang.org///nim-lang.org/docs/memfiles.html) is a
solution for your problem.
Maybe godot should use nim intead gdscript, Like nim!
Godot is a good game engine.
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
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?
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.
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 3
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.
On
> 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 Fast
> 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
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)
ee.emit("Tes
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 ...
Hi,
just recently i wanted to use the [events
module](http://forum.nim-lang.org///nim-lang.org/docs/events.html) to play
around with, but since I'm a newbie to nim I ran into difficulties. Considering
the following code:
import events
type
StringArgsRef = ref objec
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 compile,
> 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 the
> 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) tem
@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 others
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 pr
@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 {
constr
@OderWat
Don't mind.
As the saying goes, Gehangrugeshan, as a layman decoration, decoration option
is to see nothing more than the standard wooden floor color,The benefits of
outdoor wall panel material too specialized terminology than we could not
understand. Finally get the satisfaction of a solid wood floor, but
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.
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
lang
[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 the
29 matches
Mail list logo