Yes true, please try this:
pkg update
pkg install libandroid-glob-dev libandroid-glob git clang nodejs pcre
pcre-dev libsqlite
git clone https://github.com/nim-lang/Nim
cd Nim
git clone --depth 1 https://github.com/nim-lang/csources
cd csources
find ./ -
Thanks, weird that I missed recvFrom when looking through the library.
Araq helped me with this, turns out you need static[int] to get around "Error:
cannot instantiate"
This works:
type PackedString[N: static[int]] = array[N, char]
proc pack[N](str: string): PackedString[N] =
if str.len > result.len:
raise newException(Va
I am trying to get some thing like this to work, but I am having issues with
arrays and the type system:
Working code, but I have to write array[16, char] which is awkward:
proc pack[A](str: string): A =
if str.len > result.len:
raise newException(ValueError, "Can't p
@Araq - fabulous. I think a B-Tree in the stdlib would be great.
@mratsim - I think you meant `collections.intsets` with a 't' which does _not_
yield items() in key order.
The built-in `set[up to int16]` type _does_ (implicitly) order its keys,
though. @cdome also did not mention how large the
Hello all, I wrote a document to quickly introduce nim to developers from
mainstream languages like c# or java. (basically it sums what I understood
about the language.) For an experienced programmer, this is faster than reading
a technical manual.
A quick-glance skeleton with bullet points to
I totally missed that. I thought you could only inherite when you want "dynamic
dispatch"(ref object of RootObj)!
Yep, see the following example:
import net
let listener = newSocket(sockType=SOCK_DGRAM, protocol=IPPROTO_UDP)
# listen on port
listener.bindAddr(Port())
var
data = newString(1024) # receive buffer of 1024 bytes
senderAddress: string
@Udiknedormin: Actually `map` is the easiest, you can just do:
for i in 0||(container.len - 1):
result[i] = mapped_op(container[i])
OpenMP will divide work statically in `(container.len - 1) / threads_count`
chunks.
Right now Arraymancer offers 2 choices, value and ref s
`insets` dedups for sure and seems extremely fast. I don't know if it's items
is sorted though.
I have a B-Tree implementation. Remind me to release it.
`CountTable` is just a histogram and the sorting is by the bin counts not by
the keys. Keys are visited in "hash order". `hashes` does use an identity hash
for integers which could create some confusion from a simple test program if
the modulo the table size post hash transform doesn't change th
`CountTable` from the `tables` library can also do this. I don't know how it
compares speed-wise with the previous solution
The `keys()` iterator will retrieve the sorted numbers (it sorts on insert??),
and the value is the number of occurrences.
If you already have a sequence of data, you can
Is it possible to get the source address of a received UDP packet using the net
library?
Ok, thanks.
@monster Why not use inheritance?
type
ThreadID* = distinct uint8
AnyMsg = object {.inheritable.}
sender*: ThreadID
receiver*: ThreadID
previous: ptr[AnyMsg]
Msg*[T] = object of AnyMsg
content*: T
let space = all
16 matches
Mail list logo