OK, maybe lets start with the proc vs iterator issue: We have
[https://github.com/StefanSalewski/RTree/blob/master/src/rtree.nim#L894](https://github.com/StefanSalewski/RTree/blob/master/src/rtree.nim#L894)
proc findNearestBox*[M, D: Dim; RT, LT](t: RTree[M, D, RT, LT];
queryObject:
Bonjour,
je suis à la retraite , j'ai bien compris le problème , j'arrive de la grosse
informatique de gestion , et j'ai aussi travailler sur des pc en c/c++ mon
problème est de trouvé un exemple concret qui montre comment fonctionne au
trvers d'une application simple mais dont les principe ce
Yes, that looks good, but when I visited that page yesterday I was not sure if
it is a pure Nim solution or it depends on C libs. I found that flippy depends
on some other libs, but than again I was not sure if that where native Nim libs
or C wrappers. C wrappers is not too bad when done well of
just gotta say, "cool!" and Thanks, all! 3 hours from "... noticed that..." to
"PR up:"!
and love that compile time lookup table goodness!
I use nim heavily on my projects. I hope to get some bits polished enough to
give back at some point.
> benchmarks are a game.
I agree, but in a very positive interpretation of that phrase.
Competitive games are essential, both to individual human development as well
as software projects. They are a feedback mechanism that challenges potential
complacency, and helps bring out the best that is w
I am based toward
[https://github.com/treeform/flippy](https://github.com/treeform/flippy)
because I made it.
PR up:
[https://github.com/nim-lang/Nim/pull/12436](https://github.com/nim-lang/Nim/pull/12436)
What traffic capturing speed do you want to achieve? DPDK is a monster, perhaps
[https://kukuruku.co/post/capturing-packets-in-linux-at-a-speed-of-millions-of-packets-per-second-without-using-third-party-libraries](https://kukuruku.co/post/capturing-packets-in-linux-at-a-speed-of-millions-of-packe
Hello, version v1.2 is released with a breaking change! Element wise operators
starting with a dot (`.*`, `./`, `.\`) are renamed to `*.`, `/.` and similar.
These had incorrect
[precedence](https://nim-lang.org/docs/manual.html#syntax-precedence), writing
`1.0 - A .* A` is actually `(1.0 - A) .
I am working on a PR.
The gist is just a proof of concept.
You are right. I need to check for "" otherwise my code breaks. I just added
that in. Thanks!
Hi everyone! I am wanting to create an application firewall (opensnitch like)
with Nim lang and add more features. I also want to monitor packets and block
packets by signatures (snort / suricata like). So i searched for packet
sniffing lib for nim lang and the only thing i found was libpcap fro
Wheres the PR ?. :P
if unlikely(str.len == 0): return "" # For eg. encode("")
Run
Special case return fast for empty string ?.
Sounds good.
The links in the docs are broken, e.g.,
[https://github.com/b3liever/manu//tree/devel/manu/qr.nim#L51](https://github.com/b3liever/manu//tree/devel/manu/qr.nim#L51)
Note that there is a `devel` in the path, whereas your repo has no `devel`
branch. Perhaps it should be `master` instead.
I am happy to take over the stdlib base64 API and make it stable if you guys
agree with my proposals bellow:
This is the place where stdlib does not handle errors:
[https://github.com/nim-lang/Nim/blob/master/lib/pure/base64.nim#L123](https://github.com/nim-lang/Nim/blob/master/lib/pure/base64.n
I was looking at Nim benchmarks here:
[https://github.com/kostya/benchmarks#base64](https://github.com/kostya/benchmarks#base64)
, and noticed that Nim's base64 is so far behind the simple C implementation.
I took the plain C algorithm and ported it to Nim without using any crazy C's
pointers e
> it has more features but does not handle errors?
Since base64.nim says "unstable API" we could take your code... :-)
Also, I have the same issue with dicts. It seems dynamic memory allocating is
broken.
Here is the code
import macros
import random
macro EMSCRIPTEN_KEEPALIVE*(someProc: untyped): typed =
result = someProc
result.addPragma(newIdentNode("exportc"))
when defined(cpp):
result.addPragma(newNimNode(nnkExprColonExpr).add(
newId
[assercho](https://github.com/juancarlospaco/nim-contra/blob/master/README.rst#assercho)
is like `assert(conditionBool, errorString)` \+ `echo(Nim_Code)` \+
`printf(C_Code)`.
It only works `when not defined(release) and not defined(danger)`. 🙂
Compile with `-d:release --assertions:off`. Maybe we should turn them off in
version 1.1...
In the past we had doAssert() for checks always enabled, and assert() which was
disabled in release built.
But with Nim 1.0 we generally avoid -d:danger, so assert() is generally enabled.
For example in
[https://github.com/StefanSalewski/RTree/blob/master/src/rtree.nim](https://github.com/Stefa
Thanks for example. I have never found time to learn about gtk-pixbuf myself.
Of course gintro can work on Windows as well, some Nim users have managed to
install it. But of course most Windows users just don't want to use GTK.
[https://github.com/SolitudeSF/imageman](https://github.com/SolitudeSF/imageman)
its heavily wip but it works. if something doesnt work or functionality is
missing, issue on github would be much appreciated.
You'll have to deal with them for now, as the Nim ecosystem is not that big
yet. It's not too hard to provide abstractions for cstrings, as Nim's string
can be converted implicitly to them.
If you're on Linux, `gdk-pixbuf` is a viable choice (bindings provided by
gintro package). Here's a CLI t
Tried [https://github.com/treeform/flippy](https://github.com/treeform/flippy) ?
You might also wants to do this the [Nim
way](https://nim-lang.org/docs/manual.html#procedures-properties)
proc age(a: Human): int = a.age
proc `age=`(a: var Human, age: int) =
a.age = age
Frank.age = 99 # or `age=`(Frank, 99)
echo Frank.age # or age(Frank
What is the most simple way to read image, flip or rotate (for example) and
write back?
tried many ways from here
[https://forum.nim-lang.org/t/3056](https://forum.nim-lang.org/t/3056)
half of libs are not working/legacy, the rest methods aren't pretty (operating
with C pointers/strings etc.)
Should probably also be mentioned/of interest to @torarinvik that Nim has
fancier support for setters as well. See
[https://nim-lang.org/docs/tut2.html#object-oriented-programming-properties](https://nim-lang.org/docs/tut2.html#object-oriented-programming-properties)
Thank you!!! Perfect!!
> On the contrary of what araq says, I never had problems of writing efficient
> two line programs for such a task in a straightforward way.
No, what I say is true, here is what Python does:
"a b ".split(" ")
['a', '', '', 'b', '']
Run
proc getAge(a: Human): int =
return a.age
echo Frank.getAge() # or: getAge(Frank)
Run
.
Hi I have tried several times to create Getter and Setter methods in my project
but failed.
The code is this:
type
Human = ref object of RootObj
age: int job: string height: int weight: int
var Frank : Human
proc getAge(a: Human, age: int): int =
return a.age
Frank = Human(age:
I am pretty sure you are right on all these things. It is a no-brainer for me,
Nim is the obvious choice for me. Since Nim can compile to C, C++, js and
Obj-c, the sky is the limit. But we need that Qt Studio integration, or at
least more helpful manual/tutorials to get the Nim beginners like me
34 matches
Mail list logo