Skip to content

Instantly share code, notes, and snippets.

@schdub
schdub / logs.cpp
Created July 30, 2018 11:38
Only 10 recent logs
#include <iostream>
#include <dirent.h>
#include <sys/stat.h>
#include <string>
#include <cstring>
#include <map>
template<typename Key, typename T>
void flipMap(const std::map<Key, T> & source,
std::multimap<T, Key, std::greater<T>> & result) {
@schdub
schdub / freq.cpp
Last active March 5, 2017 07:55
Генератор частотного словаря - решение тестового задания
/*
На входе и выходе текстовые файлы, указанные параметрами командной строки.
Во входном файле произвольные данные, обычно текст.
На выход нужно записать отдельные слова из входа и их частоты.
Например:
$ cat in.txt
The time has come, the walrus said, to talk of many things.