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
| -- 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 |
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
| 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) { |
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
| #!/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 |
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
| ;; 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) |
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
| 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) |
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
| 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; |
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 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) |
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 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 | |
| ''' |
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 <iostream> | |
| #include <time.h> | |
| #include <vector> | |
| #include <mpi.h> | |
| using namespace std; | |
| double random(const int min, const int max) | |
| { | |
| if (min == max) |
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 <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 } }; |
NewerOlder