Skip to content

Instantly share code, notes, and snippets.

View krismp's full-sized avatar
Working from home

Kris Mulyandani P. krismp

Working from home
View GitHub Profile
krismp / quicksort.c
Created March 13, 2019 05:44
Non randomized quicksort
View quicksort.c
/* C implementation QuickSort */
// A utility function to swap two elements
void swap(int* a, int* b)
int t = *a;
*a = *b;
*b = t;
krismp / randomize_quicksort.cpp
Created March 13, 2019 05:42
Randomize Quicksort Algorithm
View randomize_quicksort.cpp
/* C++ implementation QuickSort using Lomuto's partition
#include <cstdlib>
#include <iostream>
using namespace std;
/* This function takes last element as pivot, places
the pivot element at its correct position in sorted
array, and places all smaller (smaller than pivot)
to left of pivot and all greater elements to right
krismp / gather-to-all.c
Created March 12, 2019 04:25
Gather to all
View gather-to-all.c
#include <mpi.h>
#include <stdio.h>
#include <stdlib.h>
int numnodes;
int main(int argc, char* argv[])
int rank;
int *back_array;
int i,data;
View collective_scatter_and_gather.c
#include <mpi.h>
#include <stdio.h>
#include <stdlib.h>
int numnodes;
int main(int argc, char* argv[])
int rank;
int *myray,*send_array,*back_array;
int count;
krismp /
Created January 11, 2017 07:33 — forked from staltz/
The introduction to Reactive Programming you've been missing
krismp / gulpfile.js
Created September 10, 2016 00:24 — forked from danharper/gulpfile.js
New ES6 project with Babel, Browserify & Gulp
View gulpfile.js
var gulp = require('gulp');
var sourcemaps = require('gulp-sourcemaps');
var source = require('vinyl-source-stream');
var buffer = require('vinyl-buffer');
var browserify = require('browserify');
var watchify = require('watchify');
var babel = require('babelify');
function compile(watch) {
var bundler = watchify(browserify('./src/index.js', { debug: true }).transform(babel));
krismp / Install Composer using MAMP's
Created August 27, 2016 01:27 — forked from irazasyed/Install Composer using MAMP's
Instructions on how to change preinstalled Mac OS X PHP to MAMP's PHP Installation and then install Composer Package Management
View Install Composer using MAMP's
krismp / gist:43fa6b50448b54b06cf1
Created September 17, 2015 01:16
install pg gem on Mac OSX
View gist:43fa6b50448b54b06cf1
gem install pg -- --with-pg-config=/Applications/
Note: in newer versions (in 9.4 at least) the path is actually: /Applications/
View gist:57edef1cd11a0642dbb7
look process:
`lsof -i :<PORT NUMBER>
kill process
`kill -9 <PID>`