This file contains hidden or 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
| size = 1000 | |
| tgen = zeros(1000, 1); | |
| tcalc = zeros(1000, 1); | |
| for i=1:1000 | |
| disp(i); | |
| tic; | |
| A = rand(size, size); | |
| B = rand(size, size); | |
| tgen(i) = toc; |
This file contains hidden or 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 timer import Timer | |
| import numpy as np | |
| #Генерация случайных массивов по 1000000 элементов | |
| A = np.random.sample((1000, 1000)) | |
| B = np.random.sample((1000, 1000)) | |
| with Timer() as t: | |
| C = A*B |
This file contains hidden or 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 time | |
| import numpy as np | |
| #Генерация случайных массивов по 1000000 элементов | |
| A = np.random.sample((1000, 1000)) | |
| B = np.random.sample((1000, 1000)) | |
| #Отсечка времени начала | |
| start = time.time() | |
| C = A*B |
This file contains hidden or 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 "stdafx.h" | |
| #include "opencv2/highgui/highgui.hpp" | |
| #include "opencv2/imgcodecs.hpp" | |
| #include "opencv2/imgproc/imgproc.hpp" | |
| #include <iostream> | |
| #include <stdio.h> | |
| using namespace cv; |
This file contains hidden or 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 "cuda_runtime.h" | |
| #include "device_launch_parameters.h" | |
| #include <stdio.h> | |
| cudaError_t addWithCuda(int *c, const int *a, const int *b, unsigned int size); | |
| __global__ void addKernel(int *c, const int *a, const int *b) | |
| { | |
| int i = threadIdx.x; |
This file contains hidden or 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 bs4 import BeautifulSoup | |
| from urllib.request import urlopen | |
| import threading | |
| eMails = [] | |
| urls = [] | |
| last_urls =[] | |
| def findEmail(url, TTL, mainUrl): | |
| eMail = '' | |
| try: | |
| #Сразу отсеим ссылки на документы pdf |
This file contains hidden or 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
| static double sqrt(double target) { | |
| double l_min = 0, l_max = 1000, cur = 100; | |
| double err = 0.000000000000001; | |
| while ((l_max - l_min) > err) { | |
| if (cur * cur > target) { | |
| l_max = cur; | |
| cur = (cur + l_min) / 2; | |
| } else { | |
| l_min = cur; | |
| cur = (l_max + cur) / 2; |
This file contains hidden or 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
| hold on | |
| for dx0=-2:1:2 % Диапазон начальных значений по скорости (первой производной) | |
| for x0=-5:1:5 % Диапазон начальных значений по углу | |
| sim('pendulum') % Имя simulink модели | |
| plot(x,dx) | |
| end | |
| end | |
| hold off |
This file contains hidden or 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 "opencv2/highgui/highgui.hpp" | |
| #include <iostream> | |
| using namespace cv; | |
| using namespace std; | |
| int main(int argc, const char** argv) | |
| { | |
| Mat img = imread("Lighthouse.jpg", CV_LOAD_IMAGE_UNCHANGED); //Незабудьте указать имя своей картинки и положить ее в папку с проектом (с файлом) | |
| if (img.empty()) |
This file contains hidden or 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 sympy import * | |
| >>> x = Symbol('x') | |
| >>> y = symbols('y') | |
| # Интегралы от простых функций | |
| >>> integrate(7*x**6, x) | |
| x**7 | |
| >>> integrate(-4*x*sin(2*x**2), x) | |
| cos(2*x**2) |
NewerOlder