Compare commits

..

No commits in common. "9b63bbef61230b80bcf53add6ffe2234cfc7b398" and "22e024ab90fc8636b463c62888f65e707d60c177" have entirely different histories.

5 changed files with 1 additions and 58 deletions

View File

@ -3,7 +3,7 @@
## Other
- [seconds_to_minutes_and_hours.c](seconds_to_minutes_and_hours.c) - Преобразование секунд в минуты и часы
- [get_ram_usage.c](get_ram_usage.c) - Получение используемой приложением RAM
## SQLite 3
- [CREATE TABLE](sqlite/sqlite3_create.c)

View File

@ -1,23 +0,0 @@
#include <stdio.h>
#include <sys/statvfs.h>
#define PATH "/media/user/Samsung USB"
int main(int argc, const char *argv[]) {
const unsigned int GB = (1024 * 1024) * 1024;
struct statvfs buffer;
int ret = statvfs(PATH, &buffer);
if (!ret) {
const double total = (double)(buffer.f_blocks * buffer.f_frsize) / GB;
const double available = (double)(buffer.f_bfree * buffer.f_frsize) / GB;
const double used = total - available;
const double usedPercentage = (double)(used / total) * (double)100;
printf("Total: %f --> %.0f\n", total, total);
printf("Available: %f --> %.0f\n", available, available);
printf("Used: %f --> %.1f\n", used, used);
printf("Used Percentage: %f --> %.0f\n", usedPercentage, usedPercentage);
}
return ret;
}

View File

@ -1,11 +0,0 @@
#include <sys/resource.h>
#include <stdio.h>
int main() {
struct rusage r_usage;
getrusage(RUSAGE_SELF, &r_usage);
printf("Memory usage: %ld kilobytes\n", r_usage.ru_maxrss);
return 0;
}

View File

@ -1,9 +0,0 @@
// ...
auto image = sf::Image{};
if (!image.loadFromFile("cat.png"))
{
// Error handling...
}
window.setIcon(image.getSize().x, image.getSize().y, image.getPixelsPtr());
// ...

View File

@ -1,14 +0,0 @@
#include <SFML/Graphics.hpp>
#include <opencv2/opencv.hpp>
sf::Texture getTextureFromCvFrame(cv::Mat frame) {
cv::Mat frameRGBA;
sf::Image image;
sf::Texture texture;
cv::cvtColor(frame, frameRGBA, cv::COLOR_BGR2RGBA);
image.create(frameRGBA.cols, frameRGBA.rows, frameRGBA.ptr());
texture.loadFromImage(image);
return texture;
}