Comments (4)
The memory leak could be fixed with
std::map<std::string, std::string&> DataFrame::operator[](size_t index) {
std::map<std::string, std::string&> series;
for (auto& col : this->data) {
series[col.first] = col.second.at(index);
}
return series;
}
from gradebook-management-system.
Hey!
Are you sure it is a memory leak? As far as I remember, when I designed the DataFrame, I did not allocate any memory (and when I do, it is via smart pointers). I have tried returning a reference instead of a pointer, but it returned some error I don't remember (I have gone through this though: https://stackoverflow.com/questions/1543193/why-cant-i-store-references-in-a-stdmap-in-c). Also, it is a non-owning pointer, meant to be used as a reference.
Did you try running it with Valgrind and see if it reports anything?
I will address some of these issues and fix them when I get some time!
from gradebook-management-system.
std::endl probably should be \n
The reason I used std::endl
instead of \n
was because it flushes the output buffer, while \n
does not. (https://www.geeksforgeeks.org/endl-vs-n-in-cpp/).
from gradebook-management-system.
I really need to get into Valgrind testing this and I haven't so far yet. Fair enough for using endl for that. Just some thoughts I had. Just did some objective debugging on this looking for small things that could cause issues. My big problem is with the operator[].. just needs more debugging and testing.
Do the sizeRows and sizeCols seem inconsistent?
I think the code overall is pretty good.
from gradebook-management-system.
Related Issues (11)
- [Feature] Features HOT 2
- [Feat] Implement logging with Google log aka glog HOT 1
- [ToDo] Improve CMakeLists.txt
- Consider adding compiler detection in CMakeLists.txt
- VSCode settings.json needs QoL improvements
- [ToDo] Improve project README.md
- [ToDo] Testing & CI/CD & Workflows HOT 1
- [ToDo] Implement CRUD Operations for Gradebook Management System
- [ToDo] Improve Menu and User Interface HOT 1
- [ToDo] CMake CrossPlatform builds: Apple/Darwin, BSD/UNIX, Windows, etc. [Future]
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gradebook-management-system.