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 <time.h> | |
#include <stdio.h> | |
#include <string.h> | |
#include <stdlib.h> | |
#include <iostream> | |
#include <string> | |
std::string tzs[] = { | |
"Africa/Accra", "Africa/Addis_Ababa", "Africa/Algiers", "Africa/Asmera", "Africa/Bamako", "Africa/Bangui", "Africa/Banjul", "Africa/Bissau", "Africa/Brazzaville", "Africa/Bujumbura", "Africa/Cairo", "Africa/Casablanca", "Africa/Conakry", "Africa/Dakar", "Africa/Dar_es_Salaam", "Africa/Djibouti", "Africa/Douala", "Africa/El_Aaiun", "Africa/Freetown", "Africa/Gaborone", "Africa/Harare", "Africa/Johannesburg", "Africa/Kampala", "Africa/Khartoum", "Africa/Kigali", "Africa/Kinshasa", "Africa/Lagos", "Africa/Libreville", "Africa/Lome", "Africa/Lusaka", "Africa/Malabo", "Africa/Maputo", "Africa/Maseru", "Africa/Mbabane", "Africa/Mogadishu", "Africa/Monrovia", "Africa/Nairobi", "Africa/Ndjamena", "Africa/Niamey", "Africa/Nouakchott", "Africa/Porto-Novo", "Africa/Sao_Tome", "Africa/Tripoli", "Africa/Tunis", "Africa/Windhoek", "America/Anchorage", "America/Anguilla", "America/An |
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
#!/usr/bin/env bash | |
set -eu | |
if [ "." == "$2" ]; then | |
CMD="tar -xvzf -"; | |
else | |
case "$2" in | |
"dev") H="kotic.dev.zla.net" ;; | |
"gen") H="kotic-gen.proto.zla.net" ;; | |
*) H="$2" ;; |
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
#!/usr/bin/env python | |
USAGE = ''' | |
Incremental backup program | |
Usage: python "prog_name" destination_dir path1/source1 ... pathN/sourceN' | |
Copied result will be in the destination_dir/DATE_TIME/source1 ... destination_dir/DATE_TIME/sourceN' | |
Also there will be created files pathN/sourceN/hash_dir_info.txt (write access to source is needed now)' | |
When backup is complete, destination_dir/DATE_TIME/backup.complete is created, with timestamp info. |
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
докажите что в последовательности [2/sqrt(2)], [2^2/sqrt(2)], ... [2^n/sqrt(2)] .... , где [] - операция взятия целой части бесконечно много нечетных чисел | |
--------------------------------------------------- | |
Для определёности, две последовательности (вторая - целые части первой): | |
An = (2^n)/sqrt(2) | |
Bn = [An] = [ (2^n)/sqrt(2) ] | |
Метод решения: посмотрел на картинке, что происходит с числами последовательности An "по модулю 2" в промежутке [0..2), там сразу видно: если число нечётное, то каждый раз удваивается расстояние от правой границы отрезка [0..2) | |
--------------------------------------------------- | |
Формальные логические шаги: | |
Если четных Bn - конечное число, то бесконечно много нечетных Bn. |
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
import sys, re | |
# convert lispy-like language to 'lambda-man' ICFP2014 assembler. | |
# output is JavaScript, loaded in browser | |
def parse(s, i): | |
node = [] | |
while 1: | |
while i < len(s) and (s[i] == ' ' or s[i] == '\n' or s[i] == '\r' or s[i] == '\t'): | |
i = i+1 |
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
LD 0 0 ; 00 | |
LD 0 1 ; 01 | |
LDF 5 ; 02 | |
LDC 0 ; 03 | |
TSEL 1824 1824 ; 04 | |
LDC 1 ; 05 | |
LDC 2 ; 06 | |
LDC 3 ; 07 | |
LDC 0 ; 08 | |
CONS ; 09 |
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
//compile with g++ -std=c++11 select_print.cpp | |
#include <vector> | |
#include <iostream> | |
#include <string> | |
namespace detail { | |
struct FromAny { | |
template <class T> FromAny(const T&) {} |
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
( | |
find . -name '*.cpp' -or -name '*.h' | xargs grep -E '^ *[a-zA-Z0-9< >,:_]+ +[a-zA-Z0-9_]+;$' -o -h | grep '<' | grep '>' ; | |
find . -name '*.cpp' -or -name '*.h' | xargs grep -E '^ *[a-zA-Z0-9_]+ +[a-zA-Z0-9_]+;$' -o -h | |
) | awk '{print $2}' | sort -u | tr -d ';' > ../names.txt | |
find . -name '*.cpp' -or -name '*.h' | xargs fgrep --word-regexp -f ../names.txt -oh | sort | uniq -c | awk '$1 <= 2' |
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
mkdir src_dir | |
mkdir exec_dir | |
python generate_variants.py | |
ls src_dir | xargs -P 100 -IF gcc src_dir/F -o exec_dir/F.x 2>/dev/null | |
find exec_dir/ | xargs -n 1 -P 1000 ./check_prog.sh |
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 "uatraits/details/branch.hpp" | |
#include "uatraits/details/definition.hpp" | |
-#include "uatraits/details/hash_utils.hpp" | |
#include "uatraits/details/regex_definition.hpp" | |
#include "uatraits/details/static_definition.hpp" | |
#include "uatraits/details/string_definition.hpp" | |
@@ -181,7 +180,7 @@ | |
header = header.substr(0, header.length() - sizeof (to_strip) + 1); | |
} |
OlderNewer