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
# this code can be run on cloud.sagemath.org | |
per_day = 1000000 | |
per_sec = per_day/(24 * 3600) | |
cache = {} | |
def poisson(mean_per_second, x): | |
return e ** (-mean_per_second) * mean_per_second ** x / factorial(x) | |
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 argparse | |
import re | |
import random | |
import datetime | |
import os | |
import sys | |
import time | |
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 random | |
import time | |
def make_check_login_regexes(): | |
line_start= r"""^([a-zA-Z])""" | |
long_line_expr = re.compile(line_start + r""" | |
([A-Za-z0-9\.-]{0,18}) # латинские буквы, цифры, точки и минус | |
([a-zA-Z0-9]) # alphanumeric |
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 argparse | |
import re | |
import random | |
import datetime | |
import os | |
import sys | |
import time | |
from random import randrange |
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 sys | |
def next_word(start, current, end, diff_index): | |
for i in range(len(current) - 1, diff_index - 1, -1): | |
if current[i] != end[i]: | |
if i < len(start) - 1: | |
return current[:i] + chr(ord(current[i]) + 1) + start[i] | |
else: | |
return current[:i] + chr(ord(current[i]) + 1) + current[i+1:] |
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 numpy | |
import theano | |
import theano.tensor as T | |
theano.config.compute_test_value = 'raise' | |
theano.config.optimizer='None' | |
ar = numpy.random.random((2,3, 2)) | |
ar += 1 | |
x = T.dtensor3('x') |
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
1) Создаёшь проект на https://github.com/new, к примеру с названием test | |
В интерфейсе выбираешь добавить подходящий .gitignore и лицензию по желанию. | |
2) Создаёшь директорию для проекта | |
В ней выполняешь: | |
git init | |
3) Копируешь с страницы проекта ссылку HTTPS clone URL | |
В директории выполняешь команду: |
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 <iostream> | |
#include <memory> | |
template<class T> | |
struct Node | |
{ | |
Node(T v, std::shared_ptr<const Node> tail): value(v), next(tail) { | |
// std::cout << "Node " << value << tail << std::endl; | |
}; | |
const T value; |
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
(define (problem start-vms) | |
(:domain cluster) | |
(:objects | |
vm1 - virtualdomain | |
vm2 - virtualdomain | |
libvirt - daemon | |
node1 - node | |
node2 - node |
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
(define (domain cluster) | |
(:requirements :typing :action-costs ) | |
(:types | |
resource - object | |
node - object | |
daemon - resource | |
virtualdomain - resource | |
softgoalorder | |
softgoal-mode | |
defstatus - object |
OlderNewer