Thank you for the detailed explanation.
The Title is the Question :D.
I know that there is mod and %%. %% is only for unsigned integers, so i thought
mod would also work with signed ones. What is the operator or function i need
to get the correct modulus?
When trying different proxies i get different errors, sometimes it's unable to
CONNECT or the connection is refused or i get a ProtocolError. I don't know if
it's a configuration thing on the proxy side or if i have to use different
methods.
If someone has an idea on how to investigate that
Hi,
i'm trying the following code:
import
httpclient
let myProxy = newProxy("http://ip:port;)
let proxyClient = newHttpClient(proxy = myProxy)
let response = proxyClient.request("https://www.google.de/;)
echo response.body
Run
i
Hm yes that makes sense.
The input fie contains a URL per line which has to be checked and the result
should be written into a file. Because this depends on Network latency i
thought it would speed up the program if i spawn many connections ~300-400
concurrently. But maybe i'm mistaken.
Thank you for your time and the detailed explanation , now i understand and it
works across many physical cores.
Because i have to write data into a single file the lines are now mixed up, i
think i need channels (?) to solve this, i will read how that works try it out
and ask again if i have
I read your answer in the other Thread and i don't understand how your example
code should be translated into a "parallel_for" loop. I don't know what to look
for. Do you have any keywords i should search for ? :(
Thank you for the link. I will try that out.
Hi,
i currently use this code to divide work between worker threads:
var linePtr: seq[pointer]
for line in memSlices(memfiles.open($args["--inputFile"], mode = fmRead)):
linePtr.add(line.data)
let batchSize = (linePtr.len /
Thank you, this works.
That makes sense. Thank you!
Hi, i'm using
let m = memfiles.open("text.txt", mode = fmRead)
Run
and try to call
let f open("another.txt")
Run
results in
Error: ambiguous call; both io.open(filename: string, mode: FileMode,
bufSize: int) [declared in
Hm, so you mean something along this?
var linePtr: seq[pointer]
var input = memfiles.open("file.txt", mode = fmRead)
for line in memSlices(input):
linePtr.add(line.data)
Run
and then i divide the length of linePtr by my core count. This gives me the
I want to split a file into multiple pieces and give one piece to one thread. I
figured memfiles should be the best option, but I'm struggling as to how I
should use them to divide my file into multiple slices.
The file itself contains in each line a single datum.
Does anyone have any hints on
14 matches
Mail list logo