The terminal module and reading the non-alphanumeric key presses

2018-04-07 Thread bronikowski
Hello, another weekend with a free time, so I'm playing around with Nim. I decided I'll try to write a little terminal plaything but after having a good luck with the fact that _terminal_ implements almost everything I wanted I got stuck on getch() — as I guessed it only picks up the

Re: Twinprimes generator that showcases Nim

2018-04-07 Thread miran
> I was hoping a few people would be curious enough to run the code and post > (or send me via email) their results on their systems Is there a way to easily automate this? I have tried to call it with `./twinprimes_ssoz 100`, but I still have to enter manually the wanted number in the

Re: Twinprimes generator that showcases Nim

2018-04-07 Thread jzakiya
`UPDATE`, caught, and corrected, a subtle coding error that affected the total twinprimes count being possibly off by 1 (and wrong last twinprime value) when the Kmax residues groups for an input is (very rarely) an exact multiple of the segment size. If anybody is running code please use

Re: Help with Matrix concept

2018-04-07 Thread planhths
Udiknedormin: Actually this code is the fastest (when [used](https://gist.github.com/notTito/aaeb00ef41c3c56c0e3bf2e3c2a7bc29) with right data structure of course) You think the Jama creators didn't think about allocations , that's why it creates a temporary sequence only once instead of a

Nim linter: what checks would be most useful?

2018-04-07 Thread alehander42
Hey, one of my side projects is to slowly make a Nim linter I already have one prototype at nim-linter<[https://github.com/alehander42/nim-linter](https://github.com/alehander42/nim-linter)> and some DSL-s for loading tokens and AST and walking AST. I might need to work a bit on the compiler

Re: Memory usage skyrocketed with nim 0.18.0 (in my async tcp service test)

2018-04-07 Thread dom96
Nice find I think dynamically increasing FDs might be less efficient than allocating them all up front. Perhaps we could offer this as an option?

Re: Memory usage skyrocketed with nim 0.18.0 (in my async tcp service test)

2018-04-07 Thread aguspiza2
Ok, i have found why: In that commit there is a new templated implementation for newSelector() (0.17.2) to newSelector[T]() (0.17.3+) in linux specifically it is using epoll. proc newSelector*[T](): Selector[T] = # Retrieve the maximum fd count (for current OS) via

Re: Help with Matrix concept

2018-04-07 Thread mratsim
You shouldn't compare on Matrix Multiplication with triple for-loops, that's the slowest way to do matrix multiplication. In short, yes the best memory representation for 2D-only matrices is `seq[float]` like what Neo and you are doing. If it's just to solve linear equations Neo has a [solve

Re: TechEmpower Web Framework Benchmarks: Round 10

2018-04-07 Thread Libman
[httpBEAST](https://github.com/dom96/httpbeast), _yaay!_

Re: NimShooter

2018-04-07 Thread erasmo85
Thanks for your comment, sure thing, have a look! Honestly, looking at it, I'm thinking that maybe some parts could have been programmed in another ways. For example, I add the gems straight to the Entity sequence (in the Game object) right from the Bullet object, instead of passing the new

Re: Memory usage skyrocketed with nim 0.18.0 (in my async tcp service test)

2018-04-07 Thread aguspiza2
Found, big commit, but i will check it d3394be5559c324da1c6b576d0ae9bfa966698d9 is the first bad commit commit d3394be5559c324da1c6b576d0ae9bfa966698d9 Author: Dominik Picheta Date: Wed Nov 22 14:43:10 2017 + Async upcoming (#6585)

Re: Help with Matrix concept

2018-04-07 Thread Udiknedormin
You allocated a wholly new seq in optMatrixProduct, no wonder why it's slower than unoptimized version. By the way: have you tried changing the representation of the matrix before multiplication (so that for k in 0 ..< a.n: a.data[i,k] and b.data[k,j] are both linear in memory)? As far as I