> I am brand new to Nim, and was inspired by the Advent of Nim post
Glad to have you with us :)
> In my testing, `initIntSet()` turned out to be a lot faster than initializing
> with `initSet[int]()`
You're not using high enough number ;) Try it with something like `2^17`. There
should be a di
> The documentation for CountTable is autogenerated and lacking (no
> "description" explaining how to use CountTable).
This was improved during Hacktoberfest, but it has not yet hit the stable
version. For the devel docs of tables module (including a short example how to
use `CountTable`), see
> Something in the end I was not able to understand how to do is how to print
> the type of a variable.
There is a pending PR waiting to be merged which will allow this by default.
Until that is here, you need to `import typetraits`.
> my input file contained integer that did not fit in 16 bits
I'm learning Nim (previously used Python and C++/etc.) and trying to attempt
[https://adventofcode.com/2018/day/2](https://adventofcode.com/2018/day/2).
I'm using a CountTable to count how many times each character appears:
for line in f.lines:
if line.len == 0: break
va
I'm a n00b, and I've spent some time trying to research this without finding a
good answer. I'm posting my notes in case they are helpful for someone...
In C one would use
[getaddrinfo](https://archive.fo/eFztO#selection-589.810-589.883). This is much
easier in Python, which has a high-level [g
Thanks for the reply.
I don't know if that code makes any difference or not. But it is correct and I
made the change. And whether or not that change did anything when I ran the
code again I did get an error right up front. And then I noticed an error in
the code I posted. I have the "while" loo
Joining in. I dabble in nim. Haven't touched it for a couple of months so I am
rusty. Need to keep practicing so I joined this
[https://github.com/floydnunez/Advent_of_code_2018](https://github.com/floydnunez/Advent_of_code_2018)
Oh man, my second solution is bruteforce as all fuck. I just rerea
> We had a long discussion on #nim IRC channel about this today, and there are
> two possible solutions
yes, thank you! I saw the discussion earlier this morning and I was able to fix
that (I did initialize the HashSet with the defaults...). I pushed the changes
and also activated the issues. :
> I would always have to look up the forum syntax how to do that.
the markdown code block is used literally on every forum, IM or any place where
you can leave a comment.
1. I _did_ describe my solution
2. I don't react as desired to paternalizing and trying to paint me as a bad
guy without a social conscience. Quite the contrary.
3. I try to avoid putting code here because I would always have to look up
the forum syntax how to do that.
Hi everyone! I am brand new to Nim, and was inspired by the Advent of Nim post
I saw on Hackernews the other day to give it a shot. Like others here, I will
be posting my solutions to Github:
[https://github.com/hermanschaaf/advent-of-code-2018](https://github.com/hermanschaaf/advent-of-code-201
My repo:
[https://github.com/ericsolomon/aoc2018](https://github.com/ericsolomon/aoc2018)
Still fairly new to nim and there will be solutions in other languages in this
repo, but there is where all of the aoc code will be housed.
> Anyway, I have found a working solution now after a lot of research
_...and as a good citizen, I will post it here so when somebody after me
struggles with the same issue, can see how I managed to solve it._
> Inspired by @miran's repo
_blushing_ :)
> Nim (python-naive) implementation unexpectedly much slower! Why?
I know the answer, but you disabled issues in your repo so I cannot comment
there.
We had a long discussion on #nim IRC channel about this today, and there are
two possible solutions
Joined the leaderboard and here is my repo:
[https://github.com/Thor77/AdventOfCode2018](https://github.com/Thor77/AdventOfCode2018)
Hey everyone, new Nim hobbyist programmer here!
It's my first time doing AOC this year, I though it would be a new opportunity
to learn what seems to be one of the most promising new languages out there.
So, I'll try to do most days in Nim, but can't promise I won't fall back to
python if I get
yep.. old stuff but still newsworthy:
[https://ponyfoo.com/articles/stop-breaking-the-web](https://ponyfoo.com/articles/stop-breaking-the-web)
and [https://youtu.be/GMWAHzXQnNM](https://youtu.be/GMWAHzXQnNM)
Yes that's one way but not what I want. I mean, come on, it's not something
exotic to binary read/write from/to disk.
Anyway, I have found a working solution now after a lot of research. Thank you
all for sharing your thoughts.
You have both sum types and inheritance so you have both side of the coin, then
you have metaprogramming to tie them together anyway you want it.
For example you can use macros to create your case statement like we do in
Nimbus VM here:
> *
> [https://github.com/status-im/nimbus/blob/2521ff1
Hi all, ran into Nim in Hacker News a couple months ago, and this year's Advent
of Code seems an excellent way to finally learn by doing.
Inspired by @miran's repo I will be posting my solutions here:
[https://github.com/pietroppeter/AdventOfCode2018](https://github.com/pietroppeter/AdventOfCode
change your 10th line
var
client = newHttpClient()
lastConnection = getTime().utc
Run
change to
var
client = newHttpClient(timeout=500)
lastConnection = getTime().utc
Run
this should be possible with osproc.Process and its output stream
i would just safe the string representation of the ip addr. And would call
"parseIpAddress" when i want to read it in again.
I'm wondering how does Nim provide language facilities to solve the expression
problem:
[https://en.wikipedia.org/wiki/Expression_problem#cite_note-Scala-10](https://en.wikipedia.org/wiki/Expression_problem#cite_note-Scala-10)
Here are also discussions in hack news:
[https://news.ycombinator.co
24 matches
Mail list logo