Coder Social home page Coder Social logo

udacity / cppnd-system-monitor-project-updated Goto Github PK

View Code? Open in Web Editor NEW
46.0 4.0 262.0 231 KB

System Monitor Project from the Object Oriented Programming Course of the Udacity C++ Nanodegree Program

License: MIT License

C++ 94.88% CMake 3.05% Makefile 2.08%

cppnd-system-monitor-project-updated's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

cppnd-system-monitor-project-updated's Issues

RAM calculation

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.

ncurses_display processes list - out of range if process list is short

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,
              "                                                                                                 ");
  }

LinuxParser.Kernel does not return correct string

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.

Missing option within CMake for find_package(Curses REQUIRED)

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.