Skip to content

Instantly share code, notes, and snippets.

@skharel
skharel / SparkConfig.js
Last active June 24, 2020 15:45
Spark executor calculation
'use strict';
function getExecutorPerEC2(cpuPerEc2, executorCore) {
return Math.floor((cpuPerEc2 - 1) / executorCore);
}
function getMemoryCfg(memoryPerEc2, executorPerEc2) {
var totalMemory = Math.floor(memoryPerEc2 / executorPerEc2);
var executorMemory = Math.floor(totalMemory * 0.86);
return {
@skharel
skharel / SelectionSort.java
Created April 23, 2014 23:59
Selection sort using java
/*
*
* This code is written for Selection sort tutorial
* The comment won't make sense unless you read the slide that goes with it
*
* Go to Vumari.com to find the slides
*
*/
public class SelectionSort {
/*
*
* This code is written for Stacks tutorial
* The comment won't make sense unless you read the slide that goes with it
*
* Go to Vumari.com to find the slide
*
*/
public class LinkedListStacks {
/*
*
* This code is written for Queue tutorial
* The comment won't make sense unless you read the slide that goes with it
*
* Go to Vumari.com to find slides
*
*/
public class LinkedListQueue {
/*
*
* This code is written for Stacks tutorial
* The comment won't make sense unless you read the slide that goes with it
*
* Go to Vumari.com to find the slide
*
*/
import java.util.Arrays;