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 string | |
class Node: | |
def __init__(self): | |
self._links = {} | |
self._is_finite = False | |
def set_link(self, letter, node): | |
if letter == '.': |
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 multiprocessing import Pool, Pipe, Process | |
def work(process_name, pipe): | |
while True: | |
print("%s Start w8!" % process_name) | |
data = pipe.recv() | |
print("%s You sent %s" % (process_name, data)) | |
if __name__ == "__main__": |
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 multiprocessing import Process, Manager, Event | |
from random import randint | |
children_count = 5 | |
block_size = 10000 | |
def find(my_id, found): | |
print("Process with id %s has been started" % my_id) | |
left = block_size * my_id | |
right = left + block_size |
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 multiprocessing import Process, Queue | |
from time import sleep | |
def func(q, cnt, log): | |
for i in range(0, cnt): | |
item = q.get() | |
message = "Got an item %s\n" % item | |
log.put(message) | |
if __name__ == '__main__': |
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
angular.module("test-app", []) | |
.controller("PDFDownloadController", ["$scope", "$http", function($scope, $http) { | |
function handleResponse(response){ | |
var pdfFile = new Blob([response.data], { type : 'application/pdf' }) | |
var downloadURL = URL.createObjectURL(pdfFile); | |
var link = document.createElement('a'); | |
link.href = downloadURL; | |
link.download = "preview.pdf" | |
document.body.appendChild(link); | |
link.click(); |
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) a, b- min(x) a^x <= b | |
# 2) list - a, b; (a - b ) union (b - a) | |
# 3) a - find last atom | |
# 4) depth - the deepest sublist with sublists | |
# 5) sublists count | |
# 6) лінеаризація | |
# 7) min-max tree optonal | |
*/ |
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
angular.module('geomApp') | |
.controller('MainCtrl', function ($scope) { | |
$scope.testesTriangles = []; | |
//$scope.points = [{x: 40, y: 400}, | |
// {x: 16, y: 300}, | |
// {x: 230, y: 200}, | |
// {x: 430, y: 100}, | |
// {x: 330, y: 400}, | |
// {x: 130, y: 270}]; | |
$scope.points = [{x: 116, y: 300}]; |
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 os import urandom | |
from random import randint | |
from time import * | |
__author__ = 'mlavrynenko' | |
smal_rsa_primes = [ | |
2 , 3 , 5 , 7 , 11 , 13 , 17 , 19, | |
23 , 29 , 31 , 37 , 41 , 43 , 47 , 53, | |
59 , 61 , 67 , 71 , 73 , 79 , 83 , 89, | |
] |
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
<html> | |
<head> | |
<title>English learner</title> | |
<link rel="stylesheet" type="text/css" href="bower_components/bootstrap/dist/css/bootstrap.css"> | |
<link rel="stylesheet" type="text/css" href="1.css"> | |
</head> | |
<body ng-app="LearnerApp" ng-controller="WordCtr"> | |
<div class="navbar navbar-static"> | |
<div class="container"> | |
<div class="navbar-header"> |
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
;Macro study | |
(defun range-helper(x) | |
(if (= x 0) | |
(list x) | |
(cons x (range-helper (- x 1))) | |
) | |
) | |
(defun range (x) | |
(reverse (range-helper (- x 1))) |
NewerOlder