udacity / cppnd-system-monitor-project-updated Goto Github PK
View Code? Open in Web Editor NEWSystem Monitor Project from the Object Oriented Programming Course of the Udacity C++ Nanodegree Program
License: MIT License
System Monitor Project from the Object Oriented Programming Course of the Udacity C++ Nanodegree Program
License: MIT License
Hello I am working on the project right now and I think the calculation of the RAM is not quite correct. Also on the example screenshot the Firefox process has 34390 MB = 34 GB alone.
This will facilitate testing, and also allow us to implement the class on different operating systems.
We should give students scaffolding that compiles without error.
With non-static
functions, we can use the same interface to support multiple implementations for different operating systems.
Ref
If the size of the processes
list is less than n
, the loop goes out of range and picks up some random gibberish.
I propose that the line be changed to check the list's size:
for (int i = 0; i < n && i < (int)processes.size(); ++i)
Similarly when the processes
list shrinks the number of rows do not shrink accordingly. I propose something like that at the end of the function:
// filling rows with white space after deleted processes
for (int i = (int)processes.size(); i < n; ++i) {
mvwprintw(window, ++row, pid_column,
" ");
}
Function needs to be updated so that it returns the proper value of the linux kernel defined in /proc/version. As it stands, right now the function returns the string "version" instead of string directly after version. All images used in the C++ course showing the htop display have the kernel field showing "version" instead of the proper value.
I'm more than happy to fix this, just give me a shout.
On some Linux systems an additional option must be set to get the given Code to link correctly.
Default repository clone ran me into the following error:
[100%] Linking CXX executable monitor
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: CMakeFiles/monitor.dir/src/ncurses_display.cpp.o: undefined reference to symbol 'cbreak'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /lib64/libtinfo.so.6: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
Checking the CMake documentation https://cmake.org/cmake/help/v3.13/module/FindCurses.html states: Set CURSES_NEED_NCURSES to TRUE before the find_package(Curses) call if NCurses functionality is required.
If i follow that, everything works as expected.
I'll provide a PR for that minor patch
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.