Skip to content

Instantly share code, notes, and snippets.

View wouzar's full-sized avatar
😱
Focusing

Viktor Moskvych wouzar

😱
Focusing
View GitHub Profile
-- TODO: make number of disks generic
import qualified Data.Map.Strict as Map
type State = ([Int], [Int], [Int], [Int])
type PatternDb = Map.Map State Int
type Depth = Int
isAllowed :: [Int] -> [Int] -> Bool
isAllowed [] [] = False
@wouzar
wouzar / Main.java
Created March 27, 2018 05:43
Runge-Kutta solution of second order differential equation
public class Main {
public static int m = 1;
public static int k = 100;
public static double xo2 = 0.5;
public static int f = 10;
public static double x1o = 0.1;
public static double omega = Math.sqrt(k / m);
public static double f1(double q2, double h) {
@wouzar
wouzar / conv
Created April 27, 2017 05:22
Example of paralyzing of convolutional layer using mpi
#!/usr/bin/env python
from __future__ import print_function
from mpi4py import MPI
import time
import numpy as np
rand = np.random.rand
IMG_H, IMG_W = 400, 400
@wouzar
wouzar / .emacs.el
Last active January 23, 2017 05:54
My emacs config file
;; PACKAGES
(require 'package)
(add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/") t)
(add-to-list 'package-archives '("marmalade" . "http://marmalade.ferrier.me.uk/packages/"))
(add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/"))
(package-initialize)
;; WINDOW
(desktop-save-mode 1)
matrix = [[1,2,3],[4,6,6],[7,8,10]]
for i in range(len(matrix)):
if matrix[i][i] % 2 == 0:
for j in range(len(matrix)):
matrix[i][j] = 0
print(matrix)
@wouzar
wouzar / crypto.cs
Last active December 19, 2016 00:54
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Security.Cryptography;
using System.IO;
import numpy as np
from mpi4py import MPI
from functools import reduce
comm = MPI.COMM_WORLD
rank = comm.Get_rank()
size = comm.Get_size()
LENGTH = 3
if rank == 0:
matrix = np.random.rand(LENGTH, LENGTH)
from pyspark import SparkContext
import numpy as np
'''
This program calculates sums of values
of rows and columns that corresponds to
diagonal elements and puts these values
onto diagonal
'''
#include <iostream>
#include <time.h>
#include <vector>
#include <mpi.h>
using namespace std;
double random(const int min, const int max)
{
if (min == max)
@wouzar
wouzar / gist:72e6fccfed6000dd7494d14359cd7c55
Last active November 24, 2016 14:39
Solver for system of linear equations implemented with OpenMP
#include "stdafx.h"
#include <iostream>
using namespace std;
int main()
{
int rows = 3;
int columns = 4;
double array[3][4] = { { 5, 2, 3, 3 },{ 1, 6, 1, 5 },{ 3, -4, -2, 8 } };