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
# Верно ли что если Н' нормальна в 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); |
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 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 |
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
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') |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
{-# LANGUAGE OverloadedStrings #-} | |
module Main where | |
import Lib | |
import GHC.List (take) | |
import Data.Text as T | |
import System.Console.ANSI | |
import System.Exit (exitFailure) |
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 re | |
import sys | |
import sqlite3 | |
import sqlparse | |
from PyQt5.QtWidgets import * | |
from PyQt5.QtCore import QAbstractTableModel, Qt | |
class SQLite3TableModel(QAbstractTableModel): | |
def __init__(self, db, queriesText, *argv, **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
{-# LANGUAGE OverloadedStrings, ExistentialQuantification, ExtendedDefaultRules, FlexibleContexts, Rank2Types, TemplateHaskell #-} | |
module Demo where | |
import Data.Monoid ((<>)) | |
import Lens.Micro.Platform | |
data ExampleParams = ExampleParams | |
{ _foo :: Int | |
, _bar :: [Int] | |
} deriving (Show) |
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
{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies, FlexibleInstances, FlexibleContexts #-} | |
import Geom2D | |
left :: (Num a) => Point a -> a -> Point a | |
left (Point x y) n = Point (x - n) y | |
right :: (Num a) => Point a -> a -> Point a | |
right (Point x y) n = Point (x + n) y | |
up :: (Num a) => Point a -> a -> Point a |
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
fibonacci :: Integer -> Integer | |
fibonacci 0 = 0 | |
fibonacci 1 = 1 | |
fibonacci n = fibohelper n 1 0 | |
fibohelper 1 acc1 acc2 = acc1 | |
fibohelper c acc1 acc2 = fibohelper (c - 1) (acc1 + acc2) acc1 |
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
create_big_data_from_csv_dir <- function(directory, ids) { | |
# locate the files | |
files <- list.files(directory, full.names=T)[ids] | |
# read the files into a list of data.frames | |
data.list <- lapply(files, read.csv) | |
# concatenate into one big data.frame | |
data.cat <- do.call(rbind, data.list) | |
NewerOlder