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/python | |
# --*-- coding: utf-8 --*-- | |
import os | |
import time | |
from datetime import date, timedelta | |
FILE_NAME = '1.txt' | |
DAYS_AGO = { |
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
def connect(*args, **kwargs) | |
pass | |
class Storage(object): | |
def precheck(my, *args, **kwargs): | |
pass | |
def connect(my, *args, **kwargs): | |
my.precheck(*args, **kwargs) |
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
def patch_class(clobj): | |
for method in ['get', 'put', 'post', 'delete', 'patch']: | |
if (hasattr(clobj, method)): | |
setattr(clobj, method, tresponse(getattr(clobj, method))) | |
return clobj | |
def tresponse(function): | |
''' | |
Adds `rest_framework.response.Response` with two parametrs | |
to initial function. |
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
-module(simple_ebmt_decoder). | |
-export([decode/1]). | |
%% Простой фразовый декодировщик для СМП основанной на примерах | |
decode(Input_string) -> | |
Word_list = words:list(Input_string), %% Разбиваем входную строку на слова. | |
Decoded_word_list = decode_word_list(Word_list, 6), %% Переводим список слов. | |
make_sentence(Decoded_word_list). %% Формируем из него предложение. | |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
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
User = db:list(user, #req{ | |
fields=[id, name, {as, passhash, password}], | |
limit=10, | |
offset=10 | |
}), | |
db:update(user, #req{ | |
filter = [ | |
{id, 42} | |
{name, <<"100500">>} |
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
/** | |
* ---------------------------------------------------------------------------- | |
* @TODO: token_type.h | |
* вынести в отдельные файлы | |
* ---------------------------------------------------------------------------- | |
**/ | |
#include<stdio.h> | |
#include<stdlib.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
┏━━━━━━━━━┓ ┏━━━━━━━━┓ | |
┃ ▼ ┃ ▼ | |
▓▒░▒░▒░▒ Tree* ▒░▒ Tree ▒░▒ Node ▒░▒░▒░▒▓ // в программе | |
▓▒░▒░▒░▒ Node** ▒░▒ Node* ▒░▒ Node ▒░▒░▒░▒▓ // как это понятнее изобразить | |
▓▒░▒░▒░▒ long ▒░▒ long ▒░▒ struct ▒░▒░▒░▒▓ // что это на самом деле |
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
/** | |
* @file | |
* Changed API example for decoding and filtering | |
* @example doc/examples/filtering_video.c | |
*/ | |
#include <unistd.h> | |
#include <libavcodec/avcodec.h> | |
#include <libavformat/avformat.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 <stdio.h> | |
#include <stdlib.h> | |
/** | |
* Создадим параметрические макросы с переменным числом аргументов. | |
* Они понадобятся для удобства отладки. | |
* | |
* @HINT_1: Что это такое (только для C99): | |
* http://en.wikipedia.org/wiki/Variadic_macro |
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<stdio.h> | |
#include<stdlib.h> | |
#define LOG_HELPER(fmt, ...) \ | |
fprintf( \ | |
stderr, \ | |
"\033[32mLOG:\033[0m " \ | |
"\033[33m%s\033[0m " \ | |
"\033[36m%s\033[0m " \ | |
"[\033[1m%d\033[0m] : " fmt "%s", \ |
OlderNewer