This file contains hidden or 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
using namespace std; | |
const int BUFF = 256; | |
std::string reads(const std::string& message, istream &in) | |
{ | |
char s[BUFF]; | |
cout << message; | |
in.getline(s, BUFF); | |
return s; | |
} |
This file contains hidden or 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
__author__ = 'Разумов А.А.' | |
# Реализация алгоритма Прима на python 3 | |
import random | |
from string import ascii_uppercase | |
def prima(W, city_labels = None): | |
""" | |
Алгоритм Прима для нахождения сети дорог минимальной длины |
This file contains hidden or 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 string | |
def baseEncode(number, base=0): | |
if isinstance(number, str): | |
number = long(number) | |
if not isinstance(number, (int, long)): | |
raise TypeError('number must be an integer') | |
if number < 0: | |
raise ValueError('number must be positive') |
This file contains hidden or 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> /* prsize_tf, scanf, NULL */ | |
#include <stdlib.h> /* malloc, free, rand */ | |
#include <limits.h> /* INT_MAX */ | |
#include <time.h> /* time */ | |
#define ERROR -1 | |
#define MAX_AL 8 | |
#define MIN_AL 4 | |
#define MAX_VL 20 | |
#define MIN_VL 3 |
This file contains hidden or 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 One 1 | |
#define N 10 //number of elem in array "in" | |
#define Error_Of_Input -1 //if puted simbol wasn't NULL or 1 | |
#define Error_in_ToInteger -2 //if puted simbol wasn't NULL or 1 | |
size_t Pow10(size_t a, size_t n) | |
{ |
This file contains hidden or 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
func GetCurrentTimeForGroup(a *app.App, group string) (t time.Time, weekday int, week string, today bool, err error) { | |
// получаем текущее время | |
t = time.Now() | |
today = true | |
// определим, нужно ли нам показывать сегодняшнее расписание | |
// или завтрашнее | |
// TODO: сделать это зависимым от расписания, а не хардкодом | |
if t.Hour() > 18 { |
This file contains hidden or 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
class Student(AbstractBaseUser): | |
email = models.EmailField( | |
verbose_name='email address', | |
max_length=255 | |
) | |
phone = models.CharField(max_length=11) | |
phone_confirmed = models.BooleanField(default=False) | |
name = models.CharField(max_length=20) |
This file contains hidden or 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 files(request): | |
data = {} | |
data.update({'gang': u'ИУ5-32'}) | |
folders = models.Folder.objects.all() | |
data.update({'folders': folders}) | |
return render(request, 'files.html', data) |
This file contains hidden or 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
{% extends "base.html" %} | |
{% block container %} | |
{% for folder in folders %} | |
<div class="panel panel-table panel-info"> | |
<div class="panel-heading"><h3 class="panel-title">{{ folder }}</h3></div> | |
<table class="table table-striped"> | |
<thead> | |
<tr> | |
<th>Имя файла</th> | |
<th>Размер</th> |
This file contains hidden or 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
/* _l1, _l2 - длины строк | |
_s1, _s2 - строки | |
решение было оформлено как объект с функцией | |
*/ | |
public int Solution() | |
{ | |
// equal(i, j) то же самое, что m(S1[i],S2[j]) | |
// и равна нулю, если символы равны и единице, если иначе | |
var equal = new Func<int, int, int>((x, y) => (_s1.Substring(x-1, 1) == _s2.Substring(y-1, 1)) ? 0 : 1); |