Recursive functions returns different values

2024-02-10 Thread seekworser
Thanks a lot, I'll report.

Nish, a command line shell

2024-02-10 Thread thindil
[Nish](https://github.com/thindil/nish) is a non-POSIX, multiplatform (tested on Linux and FreeBSD but should work on Windows too. With a lot of unixisms inside) command-line shell (similar to zsh, bash or fish), currently in the beta stage. It offers some features common for commands' shells, l

Recursive functions returns different values

2024-02-10 Thread janAkali
That's definitely seems like a bug and a wild one at that. Please report it on github. Here are my findings: import tables var t = initTable[int, int](0) proc foo(x: int): int = if x < 2: return 0 t[x] = x t[x] = t[x] + foo(x-1) if x == 2: echo t.

Recursive functions returns different values

2024-02-10 Thread seekworser
After digging around a bit more, I found even weirder results. when I fix initial size of hash table, it returns different value. When I modify line 3 of my original code to var dp = initTable[int, int](4) Run so that resize should not be occur, and it also returns 5,

How do I get the process ID of the current program?

2024-02-10 Thread dilair910
Thank you for share with us.https://9apps.ltd/dl/";>9apps](https://9apps.ltd/dl/";>9apps) apk

Recursive functions returns different values

2024-02-10 Thread janAkali
* line 10: evaluates to `y = 2` * line 11: evaluates to `dp[3] += 2` you're adding 2 to 3 which results in 5 * line 12: you return dp[3] that is now 5 You know that you can use gdb debugger or just print-debugging to inspect the state while program is running?

Recursive functions returns different values

2024-02-10 Thread seekworser
Hi, I found following two codes output different values. import tables var n = 3 var dp = initTable[int, int](0) proc dfs(x: int): int = if x < 2: return 0 if x in dp: return dp[x] dp[x] = x dp[x] += dfs(x div 2) dp[x] += dfs((x+1) d

Error while trying to do a https request

2024-02-10 Thread palaso
Thanks for your reply, puppy worked perfectly fine, and it fits my inmediate wish of learning nim by doing small examples. But still if someone knows how to do it with with the stdlib i'll be grateful. I also tried downloading the cacert.pem used by curl but it did not work and neither disablin

Error while trying to do a https request

2024-02-10 Thread enthus1ast
for http(s) requests i would use puppy ( ) , since puppy use the apis provided by the system (winapi or curl). Btw. i could not do a any request to the url you provided (from germany). The server does not answer to me.