|
|
@ -60,7 +60,7 @@ Input download(const string& address)
|
|
|
|
if(curl)
|
|
|
|
if(curl)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
CURLcode res;
|
|
|
|
CURLcode res;
|
|
|
|
double start;
|
|
|
|
double time;
|
|
|
|
|
|
|
|
|
|
|
|
curl_easy_setopt(curl, CURLOPT_URL, address.c_str());
|
|
|
|
curl_easy_setopt(curl, CURLOPT_URL, address.c_str());
|
|
|
|
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_data);
|
|
|
|
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_data);
|
|
|
@ -69,10 +69,10 @@ Input download(const string& address)
|
|
|
|
curl_easy_cleanup(curl);
|
|
|
|
curl_easy_cleanup(curl);
|
|
|
|
if (res == CURLE_OK)
|
|
|
|
if (res == CURLE_OK)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
res = curl_easy_getinfo(curl, CURLINFO_STARTTRANSFER_TIME, &start);
|
|
|
|
res = curl_easy_getinfo(curl, CURLINFO_STARTTRANSFER_TIME, &time);
|
|
|
|
if (CURLE_OK == res)
|
|
|
|
if (CURLE_OK == res)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
cerr<<"Time: " << start;
|
|
|
|
cerr<<"Time to connect: " << time;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -82,40 +82,6 @@ Input download(const string& address)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*int main(int argc, char* argv[])
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
curl_global_init(CURL_GLOBAL_ALL);
|
|
|
|
|
|
|
|
Input input;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (argc > 1)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
CURL* curl = curl_easy_init();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(curl)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
CURLcode res;
|
|
|
|
|
|
|
|
curl_easy_setopt(curl, CURLOPT_URL, argv[1]);
|
|
|
|
|
|
|
|
res = curl_easy_perform(curl);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (res != CURLE_OK)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
cerr << curl_easy_strerror(res);
|
|
|
|
|
|
|
|
exit(1);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
curl_easy_cleanup(curl);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
auto in = input_data(cin, true);
|
|
|
|
|
|
|
|
auto bins = make_histogram(in.numbers, in.bin_count);
|
|
|
|
|
|
|
|
show_histogram_svg(bins);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
} */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int main(int argc, char* argv[])
|
|
|
|
int main(int argc, char* argv[])
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Input input;
|
|
|
|
Input input;
|
|
|
|