Re: Midday Commander [retrofuturistic file manager]

2020-04-20 Thread JohnS
Can't help with all of that, but available disk drives is present on Linux/Windows and I _think_ OS X in psutil. import psutil echo disk_partitions() Run yields - @[(device: "C:\\", mountpoint: "C:\\", fstype: "NTFS", opts: "rw,fixed"), (d

Re: how to deal with C string with \0?

2020-03-02 Thread JohnS
[psutil](https://github.com/juancarlospaco/psutil-nim) has this function in case you'd rather use that (or see how we did it). import psutil echo disk_partitions() Run produces: @[(device: "C:\\", mountpoint: "C:\\", fstype: "NTFS", opts: "rw,fixed")

Re: port psutil on mac host_statistics get nil result

2019-12-12 Thread JohnS
Seems like a pretty straightforward port, nothing looks wrong. What's the error value that you're seeing from the host_statistics function? Can you echo error Run and see/show us what's printed?

Re: Screenshot / Screencapture

2019-11-07 Thread JohnS
I submitted a PR: [https://github.com/Senketsu/nsu/pull/3](https://github.com/Senketsu/nsu/pull/3) * Updates nsu to work with Nim 1.0 * Migrates from oldwinapi to winim * Removes the dependency on the broken png library and libpng.dll (replacing it with Flippy, thanks @treeform !) * Fixe

Re: Screenshot / Screencapture

2019-11-01 Thread JohnS
Oh that's really straightforward, nice! I'll try to get a minute this weekend to send a PR over to nsu.

Re: Screenshot / Screencapture

2019-10-31 Thread JohnS
I did exactly that, replace oldwinapi with winim and change some definitions around to make it work. I got it to compile after modifying the png package (replacing TFile with File), but I don't have a working png.dll to verify it works. I also don't know enough about the PNG format/processing t

Re: Screenshot / Screencapture

2019-10-30 Thread JohnS
What's the build error you see?

Re: Extract sprite data from old DOS game resource file?

2019-10-27 Thread JohnS
You'd probably get some high-quality responses from [https://www.reddit.com/r/ReverseEngineering](https://www.reddit.com/r/ReverseEngineering)

Re: List of processes and get information on process

2019-10-24 Thread JohnS
[psutil-nim](https://github.com/juancarlospaco/psutil-nim/) might help you get started, specifically the [pids function.](https://github.com/juancarlospaco/psutil-nim/blob/master/src/psutil/psutil_windows.nim#L55) It gets a list of process IDs on Linux and, within the last few weeks Windows, as

Re: query pc specification?

2019-10-15 Thread JohnS
I'm right in the middle of adding Windows support to psutil for Hacktoberfest, but I don't have any exemplar code for things like identifying the graphics card or CPU type (the python version psutil doesn't do either of those). If you have exemplar Win32 C code or can figure out what to pass to

Nim/Nimble/Git on Windows Issues

2019-10-04 Thread JohnS
I'm surprised I haven't seen anyone else run into this yet so I'm posting it here. I was trying to get a fresh install of Nim 1.0 running on my Windows 10 laptop. It's not my normal development box, but I was hoping to get a few PRs to psutil-nim in for Hacktoberfest to add some basic Windows s

Re: How to get mac address of the local host?

2019-09-19 Thread JohnS
Take a look at the ifconfig script in psutil-nim: [https://github.com/juancarlospaco/psutil-nim/blob/master/scripts/ifconfig.nim](https://github.com/juancarlospaco/psutil-nim/blob/master/scripts/ifconfig.nim)

Re: Compiling fails with --gc:refc and --opt:speed

2019-09-09 Thread JohnS
Did you try watching memory via top/htop while compiling? I wonder if you're getting killed by the Out of Memory killer?

Re: Nim program executes painfully slow

2019-07-02 Thread JohnS
Maybe DNS resolution is really slow on your Fedora server? Try changing the URL string ("[http://ident.me";](http://ident.me";)) to an IP address ("[http://176.58.123.25";](http://176.58.123.25";)) to see if that speeds things up.

Re: Winim - Nim's Windows API and COM Library

2018-07-27 Thread JohnS
Agreed, this is great! Nice work :D

Re: Nim T-shirts and mugs now available

2018-03-12 Thread JohnS
Very cool, ordered.

Re: The Nim way to do this

2018-03-09 Thread JohnS
let primes = [7, 11, 13, 17, 19, 23, 29, 31] #1 if 7 in primes: echo("Found it!") #2 echo primes.find(13) I don't think count does what you think it does. According to [the docs](https://nim-lang.org/docs/sequtils.html#count,openArray%5BT%5D,T) it "Returns the

Re: How do you get thread count in Nim

2017-11-04 Thread JohnS
For Linux systems, this is how I do it in the [psutil library](https://github.com/johnscillieri/psutil-nim): proc cpu_count_logical*(): int = ## Return the number of logical CPUs in the system. try: return sysconf( SC_NPROCESSORS_ONLN ) except Valu

Re: Has anyone considered if Nim would be a good fit for a

2017-11-02 Thread JohnS
Apparently it's their suggested approach: [https://aws.amazon.com/blogs/compute/running-executables-in-aws-lambda](https://aws.amazon.com/blogs/compute/running-executables-in-aws-lambda)/

Re: Introducing Reel Valley

2017-09-20 Thread JohnS
[https://onsetgame.com](https://onsetgame.com) for anyone not on Facebook. Looks great, congrats! I'd love to read about how it was built with Nim.

Re: Launching the 2017 Nim community survey

2017-06-26 Thread JohnS
> The reason I love Nim: It feels like I'm writing Python, but it runs like I'm > writing C. This. Excited to see the survey results, thanks @dom96!

Re: choosenim - the Nim toolchain installer/multiplexer

2017-05-07 Thread JohnS
@dom96 I got the same error as @hcorion originally. Linux Mint 18, Bash. It prompts you to remove it but you never get the option to hit y/N. Tries to read from a non-available stdin maybe? Great work! Any interest in changing the syntax to "choosenim head" instead of "choosenim #head". I end u

Re: Python3.5 extension help needed

2017-04-29 Thread JohnS
Any way you can run it through [Valgrind](http://valgrind.org/) to see where the invalid free is coming from?

Re: Inject the whole tuple into expression

2017-03-29 Thread JohnS
I know it doesn't exactly meet your desired syntax but mimicking the standard library reads well and is consistent: template maskIt(dt : DataTable, expr : untyped) : seq[bool] = var result = newSeq[bool](dt.len) for i in 0 ..< dt.len: let it {.inject.} = (id:dt.id

Re: Nim GC Performance

2017-01-15 Thread JohnS
Thanks @dom96! It kept sliding down my todo list unfortunately.

Re: Nim GC Performance

2016-12-03 Thread JohnS
Follow on comments: > Removed extraneous spaces after ( and before ). You'll take the spaces from my cold, dead fingers. ;) > Rewrote code to make it more idiomatic. > > Using seq[byte] instead of ref array[1024, byte] (this is not idiomatic at > all) Tracking. I used the array/ref array beca

Nim GC Performance

2016-12-02 Thread JohnS
I was reading this: [Golang's Real-time GC in Theory and Practice](https://blog.pusher.com/golangs-real-time-gc-in-theory-and-practice/) and thought I'd try the same code in Nim. Here's my initial cut, anyone see anything that should be changed/improved to make the benchmark more comparable/mea

Re: netwatch 1.0.0 - network monitor written in nim

2016-11-11 Thread JohnS
Removed the temp variable declarations in the latest check in. I'm sure there's a better way to do the repetitive parseInts. Looks like this now: proc net_io_counters*(): TableRef[string, NetIO] = ## Return network I/O statistics for every network interface ## instal

Re: netwatch 1.0.0 - network monitor written in nim

2016-11-08 Thread JohnS
@federico3: Trying to! :) I'm doing Linux first and unfortunately it's only when I get some free time. Help & PRs are welcome! The idea (from @endragor) is to rip out most of the low-level interface/network stuff that's in netwatch and use a psutil library instead. As an aside, Nim makes it _re

Re: netwatch 1.0.0 - network monitor written in nim

2016-10-12 Thread JohnS
Good thinking on the int->string table and thanks for the suggestion! I'll implement that for 1.1. Regarding your Zyxel mapping, it looks like the folks at [http://linuxnet.ca/ieee/oui/nmap-mac-prefixes](http://forum.nim-lang.org///linuxnet.ca/ieee/oui/nmap-mac-prefixes) updated their table and

Re: netwatch 1.0.0 - network monitor written in nim

2016-10-10 Thread JohnS
@endragor that's a great idea, I'd love a [psutil](https://github.com/giampaolo/psutil)-style library. I'll try to look into what it would take to clone that in Nim.

Re: netwatch 1.0.0 - network monitor written in nim

2016-10-08 Thread JohnS
@OderWat thanks for the input and offer! Your network sounds like the perfect test bed. Once I support MacOS I'll post an update.

netwatch 1.0.0 - network monitor written in nim

2016-10-07 Thread JohnS
I finally got around to releasing a small network utility called netwatch: [https://github.com/johnscillieri/netwatch](https://github.com/johnscillieri/netwatch) netwatch scans your network for hosts, lets you label them, and shows you the last time they were seen: Scanning 192.168

Re: Wannabe-Official Nim Images for Docker

2016-08-02 Thread JohnS
@guitmz I liked that your images were based off Alpine/musl, I'd be very glad to see those make it in as an option. Alpine & musl make it _very_ easy to compile stand-alone static binaries for POSIX apps with lots of external dependencies.

Re: StackOverflow Nim Documentation Proposal

2016-07-21 Thread JohnS
I like the idea of external but integrated example files. Dropping a 50+ line block right into the code base never seemed like the right idea.

StackOverflow Nim Documentation Proposal

2016-07-21 Thread JohnS
Based on some of the previous comments/concerns over Nim documentation, this seems like it might address some of the issues: [http://stackoverflow.com/documentation/nim/commit](http://forum.nim-lang.org///stackoverflow.com/documentation/nim/commit) Upvote if you're interested.