Skip to content

Instantly share code, notes, and snippets.

View ivlevdenis's full-sized avatar
🏠
Working from home

Ivlev Denis ivlevdenis

🏠
Working from home
View GitHub Profile
n = int(input('Введите колчество студентов: '))
quantity = 0
score_sum = 0
lines = []
with open('students.txt','w+') as file:
for _ in range(n):
first_name = input('Введите имя: ')
second_name = input('Введите фамилию: ')
mark_math = int(input('Оценка по математике: '))
mark_fiz = int(input('Оценка по физике: '))
#include <iostream>
#include <fstream>
using namespace std;
int main()
{
setlocale(LC_ALL, "Russian");
int n, mark_math, mark_progr, mark_phys;
char fam[50], name[50];
cout << ":::::::::::::::::";
from rest_framework import viewsets
from rest_framework.response import Response
# https://gist.github.com/ivlevdenis/a0c8f5b472b6b8550bbb016c6a30e0be
class ExtendViewSet(object):
"""
This viewset mixin class with extended options list.
"""
from lib import fib
print(fib(1000))
(venv) di-erz@worklap:~$ ipython
Python 3.6.1 (default, Apr 22 2017, 20:17:23)
Type 'copyright', 'credits' or 'license' for more information
IPython 6.0.0 -- An enhanced Interactive Python. Type '?' for help.
In [1]: import re
In [2]: lsblk = list(re.finditer(
...: r'NAME=\"(?P<name>[\w|\d]+?)\" SIZE=\"(?P<size>[\w|\d]+?)\" TYPE=\"(?P<type>[\w|\d]+?)\"',
...: 'NAME="sda" SIZE="20G" TYPE="disk"\nNAME="sda1" SIZE="19G" TYPE="part"\nNAME="sda2" SIZE="1K" TYPE="part"\nNAME="sda5" SIZE="1022M" TYPE="part"\nNAME="sr0"
@ivlevdenis
ivlevdenis / gist:e8cdbe748b1cc752964dc293e279df41
Last active July 10, 2017 09:21
django-mailbox test errors
(venv) di-erz@worklap:~/projects/opensource/django-mailbox$ tox
GLOB sdist-make: /home/di-erz/projects/opensource/django-mailbox/setup.py
py27 create: /home/di-erz/projects/opensource/django-mailbox/.tox/py27
py27 installdeps: django, -r/home/di-erz/projects/opensource/django-mailbox/test_requirements.txt
py27 inst: /home/di-erz/projects/opensource/django-mailbox/.tox/dist/django-mailbox-4.5.4.zip
py27 installed: Django==1.11.3,django-mailbox==4.5.4,funcsigs==1.0.2,mock==2.0.0,pbr==3.1.1,pkg-resources==0.0.0,py==1.4.34,pytest==2.9.1,pytest-django==2.9.1,pytz==2017.2,six==1.10.0
py27 runtests: PYTHONHASHSEED='1535436567'
py27 runtests: commands[0] | python manage.py test
Traceback (most recent call last):
File "manage.py", line 10, in <module>
(venv) di-erz@worklap:~/projects/opensource/django-mailbox$ tox
GLOB sdist-make: /home/di-erz/projects/opensource/django-mailbox/setup.py
ERROR: invocation failed (exit code 1), logfile: /home/di-erz/projects/opensource/django-mailbox/.tox/log/tox-0.log
ERROR: actionid: tox
msg: packaging
cmdargs: ['/usr/bin/python3', local('/home/di-erz/projects/opensource/django-mailbox/setup.py'), 'sdist', '--formats=zip', '--dist-dir', local('/home/di-erz/projects/opensource/django-mailbox/.tox/dist')]
env: None
Traceback (most recent call last):
File "setup.py", line 9, in <module>
(venv) di-erz@worklap:~/projects/opensource/django-mailbox$ tox
GLOB sdist-make: /home/di-erz/projects/opensource/django-mailbox/setup.py
py27 create: /home/di-erz/projects/opensource/django-mailbox/.tox/py27
py27 installdeps: django, -r/home/di-erz/projects/opensource/django-mailbox/test_requirements.txt
py27 inst: /home/di-erz/projects/opensource/django-mailbox/.tox/dist/django-mailbox-4.5.4.zip
py27 installed: Django==1.11.3,django-mailbox==4.5.4,funcsigs==1.0.2,mock==2.0.0,pbr==3.1.1,pkg-resources==0.0.0,py==1.4.34,pytest==2.9.1,pytest-django==2.9.1,pytz==2017.2,six==1.10.0
py27 runtests: PYTHONHASHSEED='1643451349'
py27 runtests: commands[0] | py.test
======================================================================= test session starts ========================================================================
platform linux2 -- Python 2.7.12, pytest-2.9.1, py-1.4.34, pluggy-0.3.1
{
"name": "PROJ",
"version": "0.0.1",
"main": "webpack.config.js",
"license": "MIT",
"scripts": {
"build": "cross-env NODE_ENV=production webpack --progress --hide-modules"
},
"dependencies": {
"vue": "^2.1.4",
@ivlevdenis
ivlevdenis / django_graphene_orderBy.py
Last active September 14, 2023 17:58
Django graphene orderBy
from graphene import relay, String, List
from graphene_django.filter import DjangoFilterConnectionField
from graphene_django.fields import DjangoConnectionField
from app.models import Model
class Object(DjangoObjectType):
class Meta:
model = Model