Skip to content

Instantly share code, notes, and snippets.

View nskeip's full-sized avatar
🕶️

Nikita Hismatov nskeip

🕶️
View GitHub Profile
@nskeip
nskeip / colorfulAsserts.hs
Created April 21, 2018 05:10
Green OKs and red FAILs test helper :)
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Lib
import GHC.List (take)
import Data.Text as T
import System.Console.ANSI
import System.Exit (exitFailure)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@nskeip
nskeip / check_smtp.py
Last active July 3, 2020 10:19
Django command to test sending a simple email
from django.core.mail import send_mail
from django.core.management.base import BaseCommand
class Command(BaseCommand):
help = 'Tests sending a simple email.'
def add_arguments(self, parser):
parser.add_argument('subject')
parser.add_argument('message')
def proper_plural_form(r, nom_singular, gen, nom_plural):
"""
Если число оканчивается на 1, но не оканчивается на 11, то вариант 1 (Именительный падеж)
Если число оканчивается на 2, 3, 4, и не оканчивается на 12, 13, 14, то вариант 2 (Родительный падеж)
Всё остальное — вариант 3 (Множественный родительный падеж)
"""
if r % 10 == 1 and r % 100 != 11:
return nom_singular
elif r % 10 in (2, 3, 4) and r % 100 not in (12, 13, 14):
return gen
@nskeip
nskeip / dh_and_h_normality.g
Last active November 11, 2020 07:29
Верно ли что если Н' нормальна в G, то H нормальна в G?
# Верно ли что если Н' нормальна в G, то H нормальна в G?
# Нет. Приведем пример, когда H' нормальна в G, но H не нормальна в G
# полезное: IsNormal, DerivedSubgroup
# https://alex-konovalov.github.io/ukrgap/gapbook/chapC.html#X87D263A4841FD6A1
for n in [3..10] do
G := SymmetricGroup(n);
Print("Checking ", n, "\n");
for ccs in ConjugacyClassesSubgroups(G) do
H := Representative(ccs);