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
[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")
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?
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
Oh that's really straightforward, nice!
I'll try to get a minute this weekend to send a PR over to nsu.
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
What's the build error you see?
You'd probably get some high-quality responses from
[https://www.reddit.com/r/ReverseEngineering](https://www.reddit.com/r/ReverseEngineering)
[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
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
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
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)
Did you try watching memory via top/htop while compiling? I wonder if you're
getting killed by the Out of Memory killer?
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.
Agreed, this is great! Nice work :D
Very cool, ordered.
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
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
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)/
[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.
> 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!
@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
Any way you can run it through [Valgrind](http://valgrind.org/) to see where
the invalid free is coming from?
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
Thanks @dom96!
It kept sliding down my todo list unfortunately.
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
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
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
@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
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
@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.
@OderWat thanks for the input and offer! Your network sounds like the perfect
test bed. Once I support MacOS I'll post an update.
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
@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.
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.
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.
36 matches
Mail list logo