This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
MIPT, task #000 | |
"A + B" | |
12.09.2011 | |
*/ | |
#include <stdio.h> | |
int main () | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdlib.h> | |
#include <stdio.h> | |
#include <sys/types.h> | |
#include <sys/stat.h> | |
#include <fcntl.h> | |
#include <unistd.h> | |
#define BUF_SIZE 4096 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <pthread.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
struct thr_data{ | |
double b; | |
double e; | |
double step; | |
double count; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// You can test your server programs with 'telnet' UNIX tool. | |
// see man telnet! | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <errno.h> | |
#include <string.h> | |
#include <sys/types.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Usage: | |
// client <address> <port> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <errno.h> | |
#include <string.h> | |
#include <strings.h> | |
#include <sys/types.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <thread> | |
void hello() | |
{ | |
std::cout << "HW!" << std::endl; | |
} | |
int main() | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <string> | |
#include <vector> | |
int main() | |
{ | |
// Enter lambda functions.. | |
auto sum = [] (int x, int y) { | |
std::cout << "Hello, side-effects!" << std::endl; | |
return x + y; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <string> | |
#include <vector> | |
#include <map> | |
#include <set> | |
int main() | |
{ | |
std::vector<int> a = {1, 2, 3, 4, 5}; | |
a.push_back(42); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
memory_file = BytesIO() | |
with zipfile.ZipFile(memory_file, 'w') as zf: | |
files = result['files'] | |
for individualFile in files: | |
data = zipfile.ZipInfo(individualFile['fileName']) | |
data.date_time = time.localtime(time.time())[:6] | |
data.compress_type = zipfile.ZIP_DEFLATED | |
zf.writestr(data, individualFile['fileData']) | |
memory_file.seek(0) | |
return send_file(memory_file, attachment_filename='capsule.zip', as_attachment=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void delete_all_at_price(Dir dir, Price price) { | |
auto orders_map = trading_book_info.orders().get_orders_by_dir_to_map(dir); | |
auto it = orders_map.find(price); | |
if (it == orders_map.end()) { | |
return; | |
} | |
auto& active_orders = it->second; | |
for (auto& order : active_orders) { | |
delete_order(order); | |
} |
OlderNewer