Thanks! I'll look into it!
i usualy got for
* nginx as reverse proxy
* "nim-templates" whith plain asynchttpserver with a small "path matching"
library, since i find it easier to incoperate asynchttpserver into bigger
applications than jester (for example in the past it was not possible to use
websocket with jester s
For frontend, Karax is the way to go.
For backend, there are at least Jester and Rosencrantz.
There's no Nim-sponsored hosting solution, you can pick anyone you like. I used
to use Zeit when they offered Docker deployments. People say Heroku is nice.s
When you use if as an expression like
var res = if cond: x else: y
Run
the x and y have to have the same type. Seems to be obvious in a statically
type language, but I think I will add a note in my book.
I've got a few ideas for some web applications that I want to deploy in Nim.
How are Nim developers doing it now? Jester? Karax? What about hosting?
type Cell = object
x,y:int
let Size = 2345
#...
for i in countup(1,Map.high,2):
for j in countup(1, Map[i].high,2):
var direction = random.sample( [if j+1 > 0 and j+1 < Size:
Cell(x:j+1, y:i) else: NaN, if i+1 > 0 and i+1 < Size: Cell(x:j,
@glukhov:
Thanks for the advice on compiling as a static library; looks like I should
give it a try for these repos.
Also, thanks for the pointer on using ANDROID_HOME to find the location of the
Android NDK. However, it isn't automatically set on my Windows machines with
Android Studio instal
cool script. Thanks for sharing.
> I would love to have a nim switch that will generate platform specific linker
> options to load dynlibs from binary's location, like on Windows. This could
> be considered as default behavior for nim programs.
This is a bad ida IMO. The behavior is different o
#enthus1ast You are free to use it, your idea is not bad I just finished
(finished) on the Linux side ;)
thank you.
Indeed I do the network stuff (parsing, filtering downloads etc) in a separate
program, using async/await, and after the processing I send the gui relevant
info to the GUI app via another socket.
I'd prefer to listen also this "GUI" socket in a thread, that's what I do in
Python, bu
yeah the UTF-8 input fix is still only in my head ...
We also should implement some programming learning games like "Turtle".
you must poll with a very small timeout (eg. 20-50 miliseconds), while it works
i still recommend to do the network stuff in another thread and keep the gui
thread for gui stuff. The gui will feel much more responsive then.
all right! thanks a lot for the tips. I'll give a look at Araq's code and play
around with poll()
> I would love to have a nim switch that will generate platform specific linker
> options to load dynlibs from binary's location, like on Windows. This could
> be considered as default behavior for nim programs.
Depends on who you ask, using this as the default behavior have possible
security i
A benefit of shared/dynamic libraries is that they can receive security updates
from the OS without having to rebuild and deploy all impacted applications.
It's crucial in many scenarios.
Thanks, Araq! That's exactly what I needed.
For an example how I did see
[https://github.com/nim-lang/Nim/blob/devel/tools/downloader.nim](https://github.com/nim-lang/Nim/blob/devel/tools/downloader.nim)
Esp this section:
pollingMainLoop((proc (timeout: int) =
if hasPendingOperations(): asyncdispatch.poll(timeout)), 1
`import os, strtabs proc envTable: StringTableRef = result =
newStringTable(modeCaseSensitive) for key, value in envPairs(): result[key] =
value let envs = envTable() path = paramStr(1) echo(`%`(path, envs,
{useEmpty})) # or simply echo(`%`(path, newStringTable(modeCaseSensitive),
{useEnvironme
> receiving input from a socket requires a runForever()
`runForever()` is just an infinite while loop running `poll()`. Just make sure
to run `poll()` along your GUI event loop and you should be fine :)
Hi, semi-beginner with NIM, like it a lot but still need to get used to rather
new way, for me, to structure the programs. I'm attempting to port to NIM an
application written in Python. The application receives inputs both from a GUI
and from a socket whose messages are used to update the GUI s
> also couldn't one use a dynamic library as easily as a static one?
By building static lib we offload the final linking to gradle. This gives an
advantage to use non-nim dependencies more freely. E.g. you can pull in
third-party native android libs in whatever gradle-compatible form they are
d
q is cool but I like
[https://github.com/GULPF/nimquery](https://github.com/GULPF/nimquery) more :)
Thanks Vindaar.
I saw `countup` and `countdown` in the Nim documents, but (wrongly) thought
using `high` and `low` would provide the same. Especially as the `low..high`
works fine without the use of the extra `countup`.
Thanks for the help and the example correct code usage.
The reason it doesn't work is that N .. M in the context of a for loop
implicitly calls countup.
You need to explicitly call countdown:
for i in countdown(high(seqStr), low(seqStr)):
echo seqStr[i]
Run
Hi
I was trying to reverse a string using a sequence and _high_ to _low_
iteration, but it does not output anything for some reason. When using the same
iteration going from _low_ to _high_ it works as expect.
Not sure what I am doing wrong - is this not supposed to work, or am I doing
somethi
J'aime beaucoup
Some days ago i tried to scrape data from a game trading site and build a small
cookie handling "nim browser" (unfortunately the site was behind cloudflares
anti crawling engine und behaved funny).
import httpClient, asyncdispatch, httpclient, strtabs, uri, strformat,
strutils, os
Hello, all!
I created a command line tool that uses dynamic libraries to do different kinds
of text processing so you can create a processor in your own tree.
Getting nimble to package it was workable but kind of nontrivial so I thought
I'd share. I've got a plugin folder with .nimf files that
I have a small repo here,
[https://github.com/ThomasTJdev/nim_nordnet_api](https://github.com/ThomasTJdev/nim_nordnet_api),
where I scrape stock information, convert it to JSON and send it with MQTT. It
uses the nimble package [q](https://github.com/OpenSystemsLab/q.nim) for HTML
querying. With
30 matches
Mail list logo