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
package leetcode.medium.heap; | |
import java.util.ArrayList; | |
import java.util.Arrays; | |
import java.util.Comparator; | |
import java.util.HashMap; | |
import java.util.PriorityQueue; | |
public class TopKFrequentElems_347_records { |
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 reactor.netty.DisposableServer; | |
import reactor.netty.tcp.TcpServer; | |
public class Application { | |
public static void main(String[] args) { | |
DisposableServer server = | |
TcpServer.create() | |
//inbound.connection.addHandlerLast() Is there a combiner I can use here? | |
.handle((inbound, outbound) -> { |
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
package advent; | |
import java.io.IOException; | |
import java.nio.file.Files; | |
import java.nio.file.Paths; | |
import java.util.List; | |
/** | |
* Created by Steven Curran on 08/12/2015. | |
*/ |
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 random | |
import sys | |
def rand_char(): | |
return unichr(random.randint(ord('A'),ord('z'))) | |
def gen_pattern(len): | |
pattern = "" | |
for i in range(len): | |
pattern += rand_char() |
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
int i,j,k,lastI; | |
i=startPoint*blockSize; | |
j=0; | |
k=startPoint*blockSize; //may be -1... | |
int end; | |
end = ((startPoint+1) * blockSize) - patternLength; //may be -1 | |
//*testchar = dev_textData[((startPoint+1) * blockSize) -1]; |
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 <stdlib.h> | |
#include <stdio.h> | |
#include <string.h> | |
#include <math.h> | |
#include <time.h> | |
#include "mpi.h" | |
//////////////////////////////////////////////////////////////////////////////// | |
// Program main | |
//////////////////////////////////////////////////////////////////////////////// | |
char *textData; |
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
MPI_Init(&argc,&argv); | |
MPI_Comm_size(MPI_COMM_WORLD, &numtasks); | |
MPI_Comm_rank(MPI_COMM_WORLD, &rank); | |
int i; | |
for(i = rank; i< 8; i+=numtasks) | |
{ | |
printf("Num Tasks: %d, num rank: %d , i: %d \n", numtasks, rank, i); | |
readPattern(i); |
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
/cm/shared/apps/git-1.7.3 | |
/cm/shared/apps/MATLAB/R2010b | |
/cm/shared/apps/MATLAB/R2010b/bin ./matlab -nojvm -nodisplay -nosplash -r |
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
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
% main script %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
% delete stuff from any previous runs | |
clear all; % clear all variables etc. from memory | |
clf; % clear any figures | |
clc; % clear command window | |
%access file and open for reading 'r' | |
file = importdata('20Cmin trimmed.txt'); | |
data = file.data; |
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
movie = VideoReader('TownCentreXVID.avi') | |
nFrames = movie.NumberOfFrames; | |
vidHeight = movie.Height; | |
vidWidth = movie.Width; | |
mov(1:nFrames) = ... | |
struct('cdata', zeros(vidHeight, vidWidth, 3, 'uint8'),... | |
'colormap', []); | |
NewerOlder