Сравнить коммиты

..

Ничего общего в коммитах. '9dbd42977fba2e37e369d5b58ef11dcc76b47cd5' и '908957c2c9679db2d2def265ae43cd7f0979878a' имеют совершенно разные истории.

@ -5,8 +5,7 @@
#include "histogram_internal.h" #include "histogram_internal.h"
#include "svg.h" #include "svg.h"
#include <curl/curl.h> #include <curl/curl.h>
#include <sstream>
#include <string>
using namespace std; using namespace std;
@ -43,52 +42,30 @@ input_data(istream& inp,bool promt) {
return in; return in;
} }
size_t int main(int argc, char* argv[]) {
write_data(void* items, size_t item_size, size_t item_count, void* ctx) {
stringstream* buffer = reinterpret_cast<stringstream*>(ctx);
size_t data_size = item_size * item_count;
(*buffer).write(reinterpret_cast<const char*>(items), data_size);
return data_size;
}
Input
download(const string& address) {
stringstream buffer;
// TODO: çàïîëíèòü áóôåð. curl_global_init(CURL_GLOBAL_ALL);
CURL *curl = curl_easy_init(); setlocale(LC_ALL, "Russian");
if(argc > 1){
CURL *curl = curl_easy_init();
if(curl) { if(curl) {
CURLcode res; CURLcode res;
curl_easy_setopt(curl, CURLOPT_URL, address.c_str()); curl_easy_setopt(curl, CURLOPT_URL, argv[1]);
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_data);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &buffer);
res = curl_easy_perform(curl); res = curl_easy_perform(curl);
curl_easy_cleanup(curl); curl_easy_cleanup(curl);
if(res != 0){
cerr << curl_easy_strerror(res);
exit(1);
}
} }
return 0;
}
return input_data(buffer, false); auto in = input_data(cin,true);
}
int main(int argc, char* argv[]) { auto bins = make_histogram(in.numbers, in.bin_count);
curl_global_init(CURL_GLOBAL_ALL); double min, max;
setlocale(LC_ALL, "Russian");
Input input;
if(argc > 1){
input = download(argv[1]);
}
else{
input = input_data(cin, true);
}
double bin_size = (max - min) / in.bin_count;
const auto bins = make_histogram(input.numbers, input.bin_count); //show_histogram_text(bins, bin_size); çàìåíèëè íà:
show_histogram_svg(bins); show_histogram_svg(bins);
return 0; return 0;

Загрузка…
Отмена
Сохранить