We have a github repo that is dedicated for tracking these things:
[https://github.com/nim-lang/needed-libraries/issues?q=is%3Aissue+is%3Aclosed](https://github.com/nim-lang/needed-libraries/issues?q=is%3Aissue+is%3Aclosed)
Well, basically we can use Vte. Have just hacked together a minimal test:
# https://vincent.bernat.im/en/blog/2017-write-own-terminal
import gintro/[gtk, glib, gobject, gio, vte]
var cmd: array[2, cstring] = ["/bin/bash".cstring, cast[cstring](0)]
proc
Hi folks!
I've been more or less active on forum for quite a long time but to tell you
the truth, I haven't really used Nim for any "serious" stuff. Now when I
started Physical Processes Modeling course as a part of my studies, a friend of
my asked me: "Will you use Matlab or Python?". It was
If you include the header in the top of the generated file, wouldn't you have
two structs, causing a "redefinition of 'struct Foo'" error?
\--- begin of file --- #foo.h code struct foo... # original from header
#generated code struct foo... # generated from type statement
I think you could find inspiration in the implementation of BitSets and IntSets
since they both do low-level bit manipulation and operate on arrays of bytes.
BitSets have a fixed memory size while IntSets are dynamically
allocated/resized and use refs (GC'ed memory).
I solved this by adding the "stb_image.nimble" file in my project folder (I had
just the "stb_image" folder). I haven't the motivation to investigate what
happened exactly, but anyway, that works.
You should probably also use the `packed` pragma on your type since depending
on platform and compiler there could be some padding between the fields of your
struct. (ex: between signature and size )
Thank you, I did different approach. I followed from this stackoverflow thread
about cross compiling
Certainly, but you need to assign to `result`:
proc loadBitmapFileHeader*(bitmap: Bitmap, file: FileStream):
BitmapFileHeader =
static:
doAssert(cpuEndian == littleEndian)
discard file.readData(result.addr, 14)
bitmap.fileHeader = result
The use of `ptr` in Nim is always not safe.
For pointer math operation, check this post:
[https://forum.nim-lang.org/t/1188#7366](https://forum.nim-lang.org/t/1188#7366)
If it's sequence of bytes, you can use `seq[Byte]` or simply use `cstring`
together with `cast`
Thanks! Where in the docs are these methods?
let primes = [7, 11, 13, 17, 19, 23, 29, 31]
#1
if 7 in primes: echo("Found it!")
#2
echo primes.find(13)
I don't think count does what you think it does. According to [the
docs](https://nim-lang.org/docs/sequtils.html#count,openArray%5BT%5D,T) it
"Returns
I've looked through the docs but haven't found the answer to this.
I have an array of integers (prime numbers) and I want to: 1) determine if some
number is included in the array and 2) return the index value of the number in
the array.
In Ruby/Crystal I can do the following. What are the
13 matches
Mail list logo