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
program mpidiffusioneq1d | |
implicit none | |
include 'mpif.h' | |
integer :: nprocs | |
integer :: myrank | |
integer :: ierr | |
integer :: tag |
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
program ompdiffusioneq1d | |
!$ use omp_lib | |
implicit none | |
!$ integer :: nthreads | |
!$ integer :: mythreadno | |
integer, allocatable :: bc(:) | |
integer :: division_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
library(glmmML) | |
d = read.csv("data.csv") | |
summary(d) | |
glmmML(cbind(y, N - y) ~ x, | |
data = d, | |
family = binomial, | |
cluster = id) |
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 java.util.Scanner; | |
class ColorfulTransceivers { | |
public static void main(String[] args) { | |
Scanner scanner = new Scanner(System.in); | |
int a = scanner.nextInt(); | |
int b = scanner.nextInt(); | |
int c = scanner.nextInt(); | |
int d = scanner.nextInt(); |
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
def setup(): | |
np.random.seed(100) | |
x = np.zeros(1000) | |
u = np.random.rand(1000) | |
flag = (u >= 0) & (u < 1/8) | |
x[flag] = np.sqrt(8 * u[flag]) | |
flag = (u >= 1/8) & (u < 1/4) | |
x[flag] = 2 - np.sqrt(2 - 8 * u[flag]) | |
flag = (u >= 1/4) & (u < 1/2) |
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 java.io.BufferedReader; | |
import java.io.InputStreamReader; | |
import java.util.ArrayList; | |
import java.util.Collections; | |
import java.util.List; | |
import java.util.Scanner; | |
class TroubleSort { | |
public static void main(String[] args) { | |
Scanner scanner = new Scanner(new BufferedReader(new InputStreamReader(System.in))); |
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
array = np.array([1, 2, 3, 4, 5]) | |
index = np.ones(5, dtype=bool) | |
index[3, 4] = False | |
array[index] |
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 IPython.core.display import display, HTML | |
display(HTML("<style>.container { width:100% !important; }</style>")) |
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 <cstdio> | |
#include <algorithm> | |
#include <iostream> | |
#include <vector> | |
#include <map> | |
#include <unordered_map> | |
#include <cmath> | |
#include <numeric> | |
using namespace std; |
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
unordered_map<int, int> mp_even; | |
vector<pair<int, int> > elem_even(mp_even.begin(), mp_even.end()); | |
sort(elem_even.begin(), elem_even.end(), | |
[](pair<int, int> a, pair<int, int> b) { return a.second > b.second; }); |
OlderNewer