Сравнить коммиты
3 Коммитов
| Автор | SHA1 | Дата |
|---|---|---|
|
|
fea444c84f | 1 месяц назад |
|
|
6b52ebfe5e | 1 месяц назад |
|
|
228292835f | 1 месяц назад |
@ -1 +0,0 @@
|
||||
curl/
|
||||
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Двоичный файл не отображается.
Двоичный файл не отображается.
Двоичный файл не отображается.
Двоичный файл не отображается.
Двоичный файл не отображается.
@ -0,0 +1,36 @@
|
||||
#include <iostream>
|
||||
#include <vector>
|
||||
#include "histogram.h"
|
||||
#include "svg.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
struct Input
|
||||
{
|
||||
vector<double> numbers;
|
||||
size_t bin_count{};
|
||||
};
|
||||
|
||||
Input input_data()
|
||||
{
|
||||
size_t number_count;
|
||||
cerr << "Number count: ";
|
||||
cin >> number_count;
|
||||
Input in;
|
||||
in.numbers.resize(number_count);
|
||||
|
||||
cerr << "Numbers: ";
|
||||
for (size_t i = 0; i < number_count; i++) {
|
||||
cin >> in.numbers[i];
|
||||
}
|
||||
cerr << "Enter bin count:";
|
||||
cin >> in.bin_count;
|
||||
return in;
|
||||
}
|
||||
|
||||
int main() {
|
||||
auto in = input_data();
|
||||
auto bins = make_histogram(in.numbers, in.bin_count);
|
||||
show_histogram_svg(bins);
|
||||
return 0;
|
||||
}
|
||||
Двоичный файл не отображается.
Двоичный файл не отображается.
Двоичный файл не отображается.
@ -1,52 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
||||
<CodeBlocks_project_file>
|
||||
<FileVersion major="1" minor="6" />
|
||||
<Project>
|
||||
<Option title="lab04" />
|
||||
<Option pch_mode="2" />
|
||||
<Option compiler="gcc" />
|
||||
<Build>
|
||||
<Target title="Debug">
|
||||
<Option output="bin/Debug/lab04" prefix_auto="1" extension_auto="1" />
|
||||
<Option object_output="obj/Debug/" />
|
||||
<Option type="1" />
|
||||
<Option compiler="gcc" />
|
||||
<Compiler>
|
||||
<Add option="-g" />
|
||||
</Compiler>
|
||||
</Target>
|
||||
<Target title="Release">
|
||||
<Option output="bin/Release/lab04" prefix_auto="1" extension_auto="1" />
|
||||
<Option object_output="obj/Release/" />
|
||||
<Option type="1" />
|
||||
<Option compiler="gcc" />
|
||||
<Compiler>
|
||||
<Add option="-O2" />
|
||||
</Compiler>
|
||||
<Linker>
|
||||
<Add option="-s" />
|
||||
</Linker>
|
||||
</Target>
|
||||
</Build>
|
||||
<Compiler>
|
||||
<Add option="-Wall" />
|
||||
<Add directory="curl/include" />
|
||||
</Compiler>
|
||||
<Linker>
|
||||
<Add library="libcurl.dll.a" />
|
||||
<Add directory="curl/lib" />
|
||||
<Add directory="libcurl.dll.a" />
|
||||
</Linker>
|
||||
<Unit filename="../histogram.cpp" />
|
||||
<Unit filename="../histogram.h" />
|
||||
<Unit filename="../histogram_internal.h" />
|
||||
<Unit filename="../main.cpp" />
|
||||
<Unit filename="../svg.cpp" />
|
||||
<Unit filename="../svg.h" />
|
||||
<Unit filename="../text.cpp" />
|
||||
<Unit filename="../text.h" />
|
||||
<Extensions>
|
||||
<lib_finder disable_auto="1" />
|
||||
</Extensions>
|
||||
</Project>
|
||||
</CodeBlocks_project_file>
|
||||
@ -1,94 +0,0 @@
|
||||
# depslib dependency file v1.0
|
||||
1759176921 source:c:\users\irina\desktop\lab34\lab04\histogram.cpp
|
||||
"histogram.h"
|
||||
"histogram_internal.h"
|
||||
<vector>
|
||||
<cstddef>
|
||||
|
||||
1759176921 c:\users\irina\desktop\lab34\lab04\histogram.h
|
||||
<vector>
|
||||
<cstddef>
|
||||
|
||||
1759176921 c:\users\irina\desktop\lab34\lab04\histogram_internal.h
|
||||
<vector>
|
||||
|
||||
1759176921 source:c:\users\irina\desktop\lab34\lab04\svg.cpp
|
||||
"svg.h"
|
||||
<iostream>
|
||||
<vector>
|
||||
<string>
|
||||
|
||||
1759176921 c:\users\irina\desktop\lab34\lab04\svg.h
|
||||
<vector>
|
||||
<cstddef>
|
||||
|
||||
1759176921 source:c:\users\irina\desktop\lab34\lab04\text.cpp
|
||||
"text.h"
|
||||
<iostream>
|
||||
<vector>
|
||||
<cstddef>
|
||||
|
||||
1759176921 c:\users\irina\desktop\lab34\lab04\text.h
|
||||
<vector>
|
||||
<cstddef>
|
||||
|
||||
1759179723 source:c:\users\irina\desktop\lab34\lab04\main.cpp
|
||||
<iostream>
|
||||
<vector>
|
||||
<sstream>
|
||||
"histogram.h"
|
||||
"svg.h"
|
||||
|
||||
1759176935 c:\users\irina\desktop\lab34\lab04\curl\include\curl\curl.h
|
||||
"curlver.h"
|
||||
"system.h"
|
||||
<stdio.h>
|
||||
<limits.h>
|
||||
<sys/param.h>
|
||||
<sys/types.h>
|
||||
<time.h>
|
||||
<winsock2.h>
|
||||
<ws2tcpip.h>
|
||||
<sys/select.h>
|
||||
<sys/socket.h>
|
||||
<sys/time.h>
|
||||
"easy.h"
|
||||
"multi.h"
|
||||
"urlapi.h"
|
||||
"options.h"
|
||||
"header.h"
|
||||
"websockets.h"
|
||||
"mprintf.h"
|
||||
"typecheck-gcc.h"
|
||||
|
||||
1759176935 c:\users\irina\desktop\lab34\lab04\curl\include\curl\curlver.h
|
||||
|
||||
1759176935 c:\users\irina\desktop\lab34\lab04\curl\include\curl\system.h
|
||||
<ConditionalMacros.h>
|
||||
<inttypes.h>
|
||||
<inttypes.h>
|
||||
<sys/types.h>
|
||||
<sys/socket.h>
|
||||
<sys/poll.h>
|
||||
|
||||
1759176935 c:\users\irina\desktop\lab34\lab04\curl\include\curl\easy.h
|
||||
|
||||
1759176935 c:\users\irina\desktop\lab34\lab04\curl\include\curl\multi.h
|
||||
"curl.h"
|
||||
|
||||
1759176935 c:\users\irina\desktop\lab34\lab04\curl\include\curl\urlapi.h
|
||||
"curl.h"
|
||||
|
||||
1759176935 c:\users\irina\desktop\lab34\lab04\curl\include\curl\options.h
|
||||
|
||||
1759176935 c:\users\irina\desktop\lab34\lab04\curl\include\curl\header.h
|
||||
|
||||
1759176935 c:\users\irina\desktop\lab34\lab04\curl\include\curl\websockets.h
|
||||
|
||||
1759176935 c:\users\irina\desktop\lab34\lab04\curl\include\curl\mprintf.h
|
||||
<stdarg.h>
|
||||
<stdio.h>
|
||||
"curl.h"
|
||||
|
||||
1759176935 c:\users\irina\desktop\lab34\lab04\curl\include\curl\typecheck-gcc.h
|
||||
|
||||
@ -1,10 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
||||
<CodeBlocks_layout_file>
|
||||
<FileVersion major="1" minor="0" />
|
||||
<ActiveTarget name="Debug" />
|
||||
<File name="..\main.cpp" open="1" top="1" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||
<Cursor>
|
||||
<Cursor1 position="60" topLine="0" />
|
||||
</Cursor>
|
||||
</File>
|
||||
</CodeBlocks_layout_file>
|
||||
Двоичный файл не отображается.
@ -1,65 +0,0 @@
|
||||
#include <iostream>
|
||||
#include <vector>
|
||||
#include <sstream>
|
||||
#include "curl/curl.h"
|
||||
#include "histogram.h"
|
||||
#include "svg.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
struct Input
|
||||
{
|
||||
vector<double> numbers;
|
||||
size_t bin_count{};
|
||||
};
|
||||
|
||||
Input input_data(istream& in, bool prompt)
|
||||
{
|
||||
size_t number_count;
|
||||
if (prompt) {
|
||||
cerr << "Number count: ";
|
||||
}
|
||||
in >> number_count;
|
||||
|
||||
Input input;
|
||||
input.numbers.resize(number_count);
|
||||
|
||||
if (prompt) {
|
||||
cerr << "Numbers: ";
|
||||
}
|
||||
for (size_t i = 0; i < number_count; i++) {
|
||||
in >> input.numbers[i];
|
||||
}
|
||||
|
||||
if (prompt) {
|
||||
cerr << "Enter bin count: ";
|
||||
}
|
||||
in >> input.bin_count;
|
||||
|
||||
return input;
|
||||
}
|
||||
|
||||
int main(int argc, char* argv[]) {
|
||||
// ÒÅÑÒ cURL - ýòîò êîä äîëæåí âûïîëíÿòüñÿ ÏÅÐÂÛÌ
|
||||
cout << "Òåñòèðóåì cURL..." << endl;
|
||||
CURL* curl = curl_easy_init();
|
||||
if(curl) {
|
||||
cout << "cURL ðàáîòàåò!" << endl;
|
||||
curl_easy_cleanup(curl);
|
||||
} else {
|
||||
cout << "cURL íå èíèöèàëèçèðóåòñÿ!" << endl;
|
||||
}
|
||||
|
||||
Input input;
|
||||
if (argc > 1) {
|
||||
cerr << "URL ïîëó÷åí: " << argv[1] << " (cURL òåñòèðóåòñÿ)" << endl;
|
||||
return 0;
|
||||
} else {
|
||||
input = input_data(cin, true);
|
||||
}
|
||||
|
||||
auto bins = make_histogram(input.numbers, input.bin_count);
|
||||
show_histogram_svg(bins);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -1,45 +0,0 @@
|
||||
#define DOCTEST_CONFIG_NO_MULTITHREADING
|
||||
#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN
|
||||
#include "doctest.h"
|
||||
#include "histogram_internal.h"
|
||||
#include <vector>
|
||||
|
||||
TEST_CASE("distinct positive numbers") {
|
||||
double min = 0;
|
||||
double max = 0;
|
||||
find_minmax({1, 2}, min, max);
|
||||
CHECK(min == 1);
|
||||
CHECK(max == 2);
|
||||
}
|
||||
|
||||
TEST_CASE("distinct negative numbers") {
|
||||
double min = 0;
|
||||
double max = 0;
|
||||
find_minmax({-1, -2}, min, max);
|
||||
CHECK(min == -2);
|
||||
CHECK(max == -1);
|
||||
}
|
||||
|
||||
TEST_CASE("vector with one element") {
|
||||
double min = 0;
|
||||
double max = 0;
|
||||
find_minmax({1}, min, max);
|
||||
CHECK(min == 1);
|
||||
CHECK(max == 1);
|
||||
}
|
||||
|
||||
TEST_CASE("distinct equals numbers") {
|
||||
double min = 0;
|
||||
double max = 0;
|
||||
find_minmax({1, 1}, min, max);
|
||||
CHECK(min == 1);
|
||||
CHECK(max == 1);
|
||||
}
|
||||
|
||||
TEST_CASE("empty vector") {
|
||||
double min = -1;
|
||||
double max = -1;
|
||||
find_minmax({}, min, max);
|
||||
CHECK(min == -1); // Çíà÷åíèÿ íå äîëæíû èçìåíèòüñÿ
|
||||
CHECK(max == -1);
|
||||
}
|
||||
@ -1,44 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
||||
<CodeBlocks_project_file>
|
||||
<FileVersion major="1" minor="6" />
|
||||
<Project>
|
||||
<Option title="unittest" />
|
||||
<Option pch_mode="2" />
|
||||
<Option compiler="gcc" />
|
||||
<Build>
|
||||
<Target title="Debug">
|
||||
<Option output="bin/Debug/unittest" prefix_auto="1" extension_auto="1" />
|
||||
<Option object_output="obj/Debug/" />
|
||||
<Option type="1" />
|
||||
<Option compiler="gcc" />
|
||||
<Compiler>
|
||||
<Add option="-g" />
|
||||
<Add option="-DDOCTEST_CONFIG_NO_MULTITHREADING" />
|
||||
<Add option="-DDOCTEST_CONFIG_IMPLEMENT_WITH_MAIN" />
|
||||
</Compiler>
|
||||
</Target>
|
||||
<Target title="Release">
|
||||
<Option output="bin/Release/unittest" prefix_auto="1" extension_auto="1" />
|
||||
<Option object_output="obj/Release/" />
|
||||
<Option type="1" />
|
||||
<Option compiler="gcc" />
|
||||
<Compiler>
|
||||
<Add option="-O2" />
|
||||
</Compiler>
|
||||
<Linker>
|
||||
<Add option="-s" />
|
||||
</Linker>
|
||||
</Target>
|
||||
</Build>
|
||||
<Compiler>
|
||||
<Add option="-Wall" />
|
||||
</Compiler>
|
||||
<Unit filename="../doctest.h" />
|
||||
<Unit filename="../histogram.cpp" />
|
||||
<Unit filename="../histogram_internal.h" />
|
||||
<Unit filename="../unittest.cpp" />
|
||||
<Extensions>
|
||||
<lib_finder disable_auto="1" />
|
||||
</Extensions>
|
||||
</Project>
|
||||
</CodeBlocks_project_file>
|
||||
Загрузка…
Ссылка в новой задаче